PageSourceSearch

https://real-estate-project-nu-bice.vercel.app/_next/static/chunks…?dpl=dpl_5p8SbU5cA5yqSUG5gSdz5gh843KQ

js real-estate-project-nu-bice.vercel.app collected 2026-10-03 07:35:58 UTC 211,330 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,522318,e=>{"use strict";let t,i,s,n,a,o,r;var d,l,c,p,u,y,_,m=e.i(843476),h=e.i(500932),f=e.i(271645);let g=()=>{};class v{constructor(e){this.value=e,this.handlers=new Set,this.preprocessors=new Set,this.partialNext=e=>this.next(t=>({...t,...e})),this.subscribeWithSelector=(e,t)=>{let i;return this.subscribe(s=>{let n=e(s);if(v.doSelectionsEqual(i,n))return;let a=i;i=n,t(n,a)})}}merge(e){return new w({original:this,merged:e})}next(e){let t="function"==typeof e?e(this.value):e;if(Object.is(t,this.value))return;this.preprocessors.forEach(e=>e(t,this.value));let i=this.value;this.value=t,this.handlers.forEach(e=>e(this.value,i))}getLatestValue(){return this.value}subscribe(e){return e(this.value,void 0),this.handlers.add(e),()=>{this.handlers.delete(e)}}static doSelectionsEqual(e,t){let i;if(i=void 0!==e){for(let s in t)if(!Object.is(e[s],t[s])){i=!1;break}}return i}addPreprocessor(e){return this.preprocessors.add(e),()=>{this.preprocessors.delete(e)}}}class w extends v{constructor({original:e,merged:t}){const i=e.getLatestValue(),s=t.getLatestValue();super({...i,...s}),this.next=()=>{console.warn(`${w.name}.next is disabled, call original.next or merged.next instead`)},this.partialNext=()=>{console.warn(`${w.name}.partialNext is disabled, call original.partialNext or merged.partialNext instead`)},this.cachedOriginalValue=i,this.cachedMergedValue=s,this.original=e,this.merged=t}subscribe(e){let t=[];if(!this.handlers.size){let e=e=>{super.next(t=>({...t,...e}))};t.push(this.original.subscribe(t=>{t!==this.cachedOriginalValue&&(this.cachedOriginalValue=t,e(t))}),this.merged.subscribe(t=>{t!==this.cachedMergedValue&&(this.cachedMergedValue=t,e(t))}))}return t.push(super.subscribe(e)),()=>{t.forEach(e=>e())}}getLatestValue(){if(!this.handlers.size){let e=this.original.getLatestValue(),t=this.merged.getLatestValue();(e!==this.cachedOriginalValue||t!==this.cachedMergedValue)&&(this.value={...e,...t},this.cachedMergedValue=t,this.cachedOriginalValue=e)}return super.getLatestValue()}addPreprocessor(){return console.warn(`${w.name}.addPreprocessor is disabled, call original.addPreprocessor or merged.addPreprocessor instead`),g}}let b=()=>!("u"<typeof navigator)&&navigator.product?.toLowerCase()==="reactnative";(u=_||(_={}))[u.trace=0]="trace",u[u.debug=1]="debug",u[u.info=2]="info",u[u.warn=3]="warn",u[u.error=4]="error";let S="info",R=(e,t,...i)=>{let s;switch(e){case"error":if(b()){t=`ERROR: ${t}`,s=console.info;break}s=console.error;break;case"warn":if(b()){t=`WARN: ${t}`,s=console.info;break}s=console.warn;break;case"info":s=console.info;break;case"trace":s=console.trace;break;default:s=console.log}s(t,...i)};var k=e.i(247167);function C(e,t){return function(){return e.apply(t,arguments)}}let{toString:T}=Object.prototype,{getPrototypeOf:F}=Object,{iterator:A,toStringTag:D}=Symbol,E=(t=Object.create(null),e=>{let i=T.call(e);return t[i]||(t[i]=i.slice(8,-1).toLowerCase())}),U=e=>(e=e.toLowerCase(),t=>E(t)===e),P=e=>t=>typeof t===e,{isArray:O}=Array,x=P("undefined");function j(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&B(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let q=U("ArrayBuffer"),I=P("string"),B=P("function"),N=P("number"),M=e=>null!==e&&"object"==typeof e,L=e=>{if("object"!==E(e))return!1;let t=F(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(D in e)&&!(A in e)},G=U("Date"),V=U("File"),$=U("Blob"),Q=U("FileList"),W="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g,H=void 0!==W.FormData?W.FormData:void 0,z=U("URLSearchParams"),[J,K,X,Y]=["ReadableStream","Request","Response","Headers"].map(U);function Z(e,t,{allOwnKeys:i=!1}={}){let s,n;if(null!=e)if("object"!=typeof e&&(e=[e]),O(e))for(s=0,n=e.length;s<n;s++)t.call(null,e[s],s,e);else{let n;if(j(e))return;let a=i?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;for(s=0;s<o;s++)n=a[s],t.call(null,e[n],n,e)}}function ee(e,t){let i;if(j(e))return null;t=t.toLowerCase();let s=Object.keys(e),n=s.length;for(;n-- >0;)if(t===(i=s[n]).toLowerCase())return i;return null}let et="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g,ei=e=>!x(e)&&e!==et,es=(i="u">typeof Uint8Array&&F(Uint8Array),e=>i&&e instanceof i),en=U("HTMLFormElement"),ea=(({hasOwnProperty:e})=>(t,i)=>e.call(t,i))(Object.prototype),eo=U("RegExp"),er=(e,t)=>{let i=Object.getOwnPropertyDescriptors(e),s={};Z(i,(i,n)=>{let a;!1!==(a=t(i,n,e))&&(s[n]=a||i)}),Object.defineProperties(e,s)},ed=U("AsyncFunction"),el=(d="function"==typeof setImmediate,l=B(et.postMessage),d?setImmediate:l?(c=`axios@${Math.random()}`,p=[],et.addEventListener("message",({source:e,data:t})=>{e===et&&t===c&&p.length&&p.shift()()},!1),e=>{p.push(e),et.postMessage(c,"*")}):e=>setTimeout(e)),ec="u">typeof queueMicrotask?queueMicrotask.bind(et):void 0!==k.default&&k.default.nextTick||el,ep={isArray:O,
1isArrayBuffer:q,isBuffer:j,isFormData:e=>{let t;return e&&(H&&e instanceof H||B(e.append)&&("formdata"===(t=E(e))||"object"===t&&B(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&q(e.buffer)},isString:I,isNumber:N,isBoolean:e=>!0===e||!1===e,isObject:M,isPlainObject:L,isEmptyObject:e=>{if(!M(e)||j(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:J,isRequest:K,isResponse:X,isHeaders:Y,isUndefined:x,isDate:G,isFile:V,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:$,isRegExp:eo,isFunction:B,isStream:e=>M(e)&&B(e.pipe),isURLSearchParams:z,isTypedArray:es,isFileList:Q,forEach:Z,merge:function e(){let{caseless:t,skipUndefined:i}=ei(this)&&this||{},s={},n=(n,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let o=t&&ee(s,a)||a;L(s[o])&&L(n)?s[o]=e(s[o],n):L(n)?s[o]=e({},n):O(n)?s[o]=n.slice():i&&x(n)||(s[o]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Z(arguments[e],n);return s},extend:(e,t,i,{allOwnKeys:s}={})=>(Z(t,(t,s)=>{i&&B(t)?Object.defineProperty(e,s,{value:C(t,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,s,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,i,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),i&&Object.assign(e.prototype,i)},toFlatObject:(e,t,i,s)=>{let n,a,o,r={};if(t=t||{},null==e)return t;do{for(a=(n=Object.getOwnPropertyNames(e)).length;a-- >0;)o=n[a],(!s||s(o,e,t))&&!r[o]&&(t[o]=e[o],r[o]=!0);e=!1!==i&&F(e)}while(e&&(!i||i(e,t))&&e!==Object.prototype)return t},kindOf:E,kindOfTest:U,endsWith:(e,t,i)=>{e=String(e),(void 0===i||i>e.length)&&(i=e.length),i-=t.length;let s=e.indexOf(t,i);return -1!==s&&s===i},toArray:e=>{if(!e)return null;if(O(e))return e;let t=e.length;if(!N(t))return null;let i=Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{let i,s=(e&&e[A]).call(e);for(;(i=s.next())&&!i.done;){let s=i.value;t.call(e,s[0],s[1])}},matchAll:(e,t)=>{let i,s=[];for(;null!==(i=e.exec(t));)s.push(i);return s},isHTMLForm:en,hasOwnProperty:ea,hasOwnProp:ea,reduceDescriptors:er,freezeMethods:e=>{er(e,(t,i)=>{if(B(e)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;if(B(e[i])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(e,t)=>{let i={};return(O(e)?e:String(e).split(t)).forEach(e=>{i[e]=!0}),i},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e*=1)?e:t,findKey:ee,global:et,isContextDefined:ei,isSpecCompliantForm:function(e){return!!(e&&B(e.append)&&"FormData"===e[D]&&e[A])},toJSONObject:e=>{let t=Array(10),i=(e,s)=>{if(M(e)){if(t.indexOf(e)>=0)return;if(j(e))return e;if(!("toJSON"in e)){t[s]=e;let n=O(e)?[]:{};return Z(e,(e,t)=>{let a=i(e,s+1);x(a)||(n[t]=a)}),t[s]=void 0,n}}return e};return i(e,0)},isAsyncFn:ed,isThenable:e=>e&&(M(e)||B(e))&&B(e.then)&&B(e.catch),setImmediate:el,asap:ec,isIterable:e=>null!=e&&B(e[A])};var eu=e.i(467034);class ey extends Error{static from(e,t,i,s,n,a){let o=new ey(e.message,t||e.code,i,s,n);return o.cause=e,o.name=e.name,null!=e.status&&null==o.status&&(o.status=e.status),a&&Object.assign(o,a),o}constructor(e,t,i,s,n){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),n&&(this.response=n,this.status=n.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ep.toJSONObject(this.config),code:this.code,status:this.status}}}ey.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ey.ERR_BAD_OPTION="ERR_BAD_OPTION",ey.ECONNABORTED="ECONNABORTED",ey.ETIMEDOUT="ETIMEDOUT",ey.ERR_NETWORK="ERR_NETWORK",ey.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ey.ERR_DEPRECATED="ERR_DEPRECATED",ey.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ey.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ey.ERR_CANCELED="ERR_CANCELED",ey.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ey.ERR_INVALID_URL="ERR_INVALID_URL";let e_=ey;function em(e){return ep.isPlainObject(e)||ep.isArray(e)}function eh(e){return ep.endsWith(e,"[]")?e.slice(0,-2):e}function ef(e,t,i){return e?e.concat(t).map(function(e,t){return e=eh(e),!i&&t?"["+e+"]":e}).join(i?".":""):t}let eg=ep.toFlatObject(ep,{},null,function(e){return/^is[A-Z]/.test(e)}),ev=function(e,t,i){if(!ep.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let s=(i=ep.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ep.isUndefined(t[e])})).metaTokens,n=i.visitor||l,a=i.dots,o=i.indexes,r=(i.Blob||"u">typeof Blob&&Blob)&&ep.isSpecCompliantForm(t);if(!ep.isFunction(n))throw TypeError("visitor must be a function");function d(e){if(null===e)return"";if(ep.isDate(e))return e.toISOString();if(ep.isBoolean(e))return e.toString();if(!r&&ep.isBlob(e))throw new e_("Blob is not supported. Use a Buffer instead.");return ep.isArrayBuffer(e)||ep.isTypedArray(e)?r&&"function"==typeof Blob?new Blob([e]):eu.Buffer.from(e):e}function l(e,i,n){let r=e;if(ep.isReactNative(t)&&ep.isReactNativeBlob(e))return t.append(ef(n,i,a),d(e)),!1;if(e&&!n&&"object"==typeof e)if(ep.endsWith(i,"{}"))i=s?i:i.slice(0,-2),e=JSON.stringify(e);else{var l;if(ep.isArray(e)&&(l=e,ep.isArray(l)&&!l.some(em))||(ep.isFileList(e)||ep.endsWith(i,"[]"))&&(r=ep.toArray(e)))return i=eh(i),r.forEach(function(e,s){ep.isUndefined(e)||null===e||t.append(!0===o?ef([i],s,a):null===o?i:i+"[]",d(e))}),!1}return!!em(e)||(t.append(ef(n,i,a),d(e)),!1)}let c=[],p=Object.assign(eg,{defaultVisitor:l,convertValue:d,isVisitable:em});if(!ep.isObject(e))throw TypeError("data must be an object");
1return!function e(i,s){if(!ep.isUndefined(i)){if(-1!==c.indexOf(i))throw Error("Circular reference detected in "+s.join("."));c.push(i),ep.forEach(i,function(i,a){!0===(!(ep.isUndefined(i)||null===i)&&n.call(t,i,ep.isString(a)?a.trim():a,s,p))&&e(i,s?s.concat(a):[a])}),c.pop()}}(e),t};function ew(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function eb(e,t){this._pairs=[],e&&ev(e,this,t)}let eS=eb.prototype;function eR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ek(e,t,i){let s;if(!t)return e;let n=i&&i.encode||eR,a=ep.isFunction(i)?{serialize:i}:i,o=a&&a.serialize;if(s=o?o(t,a):ep.isURLSearchParams(t)?t.toString():new eb(t,a).toString(n)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}eS.append=function(e,t){this._pairs.push([e,t])},eS.toString=function(e){let t=e?function(t){return e.call(this,t,ew)}:ew;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let eC=class{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ep.forEach(this.handlers,function(t){null!==t&&e(t)})}},eT={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},eF="u">typeof URLSearchParams?URLSearchParams:eb,eA="u">typeof FormData?FormData:null,eD="u">typeof Blob?Blob:null,eE="u">typeof window&&"u">typeof document,eU="object"==typeof navigator&&navigator||void 0,eP=eE&&(!eU||0>["ReactNative","NativeScript","NS"].indexOf(eU.product)),eO="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ex=eE&&window.location.href||"http://localhost";e.s(["hasBrowserEnv",0,eE,"hasStandardBrowserEnv",0,eP,"hasStandardBrowserWebWorkerEnv",0,eO,"navigator",0,eU,"origin",0,ex],557536);let ej={...e.i(557536),isBrowser:!0,classes:{URLSearchParams:eF,FormData:eA,Blob:eD},protocols:["http","https","file","blob","url","data"]},eq=function(e){if(ep.isFormData(e)&&ep.isFunction(e.entries)){let t={};return ep.forEachEntry(e,(e,i)=>{!function e(t,i,s,n){let a=t[n++];if("__proto__"===a)return!0;let o=Number.isFinite(+a),r=n>=t.length;return(a=!a&&ep.isArray(s)?s.length:a,r)?ep.hasOwnProp(s,a)?s[a]=[s[a],i]:s[a]=i:(s[a]&&ep.isObject(s[a])||(s[a]=[]),e(t,i,s[a],n)&&ep.isArray(s[a])&&(s[a]=function(e){let t,i,s={},n=Object.keys(e),a=n.length;for(t=0;t<a;t++)s[i=n[t]]=e[i];return s}(s[a]))),!o}(ep.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0]),i,t,0)}),t}return null},eI={transitional:eT,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let i,s=t.getContentType()||"",n=s.indexOf("application/json")>-1,a=ep.isObject(e);if(a&&ep.isHTMLForm(e)&&(e=new FormData(e)),ep.isFormData(e))return n?JSON.stringify(eq(e)):e;if(ep.isArrayBuffer(e)||ep.isBuffer(e)||ep.isStream(e)||ep.isFile(e)||ep.isBlob(e)||ep.isReadableStream(e))return e;if(ep.isArrayBufferView(e))return e.buffer;if(ep.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(a){if(s.indexOf("application/x-www-form-urlencoded")>-1){var o,r;return(o=e,r=this.formSerializer,ev(o,new ej.classes.URLSearchParams,{visitor:function(e,t,i,s){return ej.isNode&&ep.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...r})).toString()}if((i=ep.isFileList(e))||s.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return ev(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(a||n){t.setContentType("application/json",!1);var d=e;if(ep.isString(d))try{return(0,JSON.parse)(d),ep.trim(d)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(d)}return e}],transformResponse:[function(e){let t=this.transitional||eI.transitional,i=t&&t.forcedJSONParsing,s="json"===this.responseType;if(ep.isResponse(e)||ep.isReadableStream(e))return e;if(e&&ep.isString(e)&&(i&&!this.responseType||s)){let i=t&&t.silentJSONParsing;try{return JSON.parse(e,this.parseReviver)}
1catch(e){if(!i&&s){if("SyntaxError"===e.name)throw e_.from(e,e_.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ej.classes.FormData,Blob:ej.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ep.forEach(["delete","get","head","post","put","patch"],e=>{eI.headers[e]={}});let eB=ep.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),eN=Symbol("internals");function eM(e){return e&&String(e).trim().toLowerCase()}function eL(e){return!1===e||null==e?e:ep.isArray(e)?e.map(eL):String(e)}function eG(e,t,i,s,n){if(ep.isFunction(s))return s.call(this,t,i);if(n&&(t=i),ep.isString(t)){if(ep.isString(s))return -1!==t.indexOf(s);if(ep.isRegExp(s))return s.test(t)}}class eV{constructor(e){e&&this.set(e)}set(e,t,i){let s=this;function n(e,t,i){let n=eM(t);if(!n)throw Error("header name must be a non-empty string");let a=ep.findKey(s,n);a&&void 0!==s[a]&&!0!==i&&(void 0!==i||!1===s[a])||(s[a||t]=eL(e))}let a=(e,t)=>ep.forEach(e,(e,i)=>n(e,i,t));if(ep.isPlainObject(e)||e instanceof this.constructor)a(e,t);else{let s;if(ep.isString(e)&&(e=e.trim())&&(s=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim()))){var o;let i,s,n,r;a((r={},(o=e)&&o.split("\n").forEach(function(e){n=e.indexOf(":"),i=e.substring(0,n).trim().toLowerCase(),s=e.substring(n+1).trim(),!i||r[i]&&eB[i]||("set-cookie"===i?r[i]?r[i].push(s):r[i]=[s]:r[i]=r[i]?r[i]+", "+s:s)}),r),t)}else if(ep.isObject(e)&&ep.isIterable(e)){let i={},s,n;for(let t of e){if(!ep.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[n=t[0]]=(s=i[n])?ep.isArray(s)?[...s,t[1]]:[s,t[1]]:t[1]}a(i,t)}else null!=e&&n(t,e,i)}return this}get(e,t){if(e=eM(e)){let i=ep.findKey(this,e);if(i){let e=this[i];if(!t)return e;if(!0===t){let t,i=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1for(;t=s.exec(e);)i[t[1]]=t[2];return i}if(ep.isFunction(t))return t.call(this,e,i);if(ep.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=eM(e)){let i=ep.findKey(this,e);return!!(i&&void 0!==this[i]&&(!t||eG(this,this[i],i,t)))}return!1}delete(e,t){let i=this,s=!1;function n(e){if(e=eM(e)){let n=ep.findKey(i,e);n&&(!t||eG(i,i[n],n,t))&&(delete i[n],s=!0)}}return ep.isArray(e)?e.forEach(n):n(e),s}clear(e){let t=Object.keys(this),i=t.length,s=!1;for(;i--;){let n=t[i];(!e||eG(this,this[n],n,e,!0))&&(delete this[n],s=!0)}return s}normalize(e){let t=this,i={};return ep.forEach(this,(s,n)=>{let a=ep.findKey(i,n);if(a){t[a]=eL(s),delete t[n];return}let o=e?n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i):String(n).trim();o!==n&&delete t[n],t[o]=eL(s),i[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ep.forEach(this,(i,s)=>{null!=i&&!1!==i&&(t[s]=e&&ep.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let i=new this(e);return t.forEach(e=>i.set(e)),i}static accessor(e){let t=(this[eN]=this[eN]={accessors:{}}).accessors,i=this.prototype;function s(e){let s=eM(e);if(!t[s]){let n;n=ep.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(i,t+n,{value:function(i,s,n){return this[t].call(this,e,i,s,n)},configurable:!0})}),t[s]=!0}}return ep.isArray(e)?e.forEach(s):s(e),this}}function e$(e,t){let i=this||eI,s=t||i,n=eV.from(s.headers),a=s.data;return ep.forEach(e,function(e){a=e.call(i,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function eQ(e){return!!(e&&e.__CANCEL__)}eV.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ep.reduceDescriptors(eV.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[i]=e}}}),ep.freezeMethods(eV);let eW=class extends e_{constructor(e,t,i){super(null==e?"canceled":e,e_.ERR_CANCELED,t,i),this.name="CanceledError",this.__CANCEL__=!0}};function eH(e,t,i){let s=i.config.validateStatus;!i.status||!s||s(i.status)?e(i):t(new e_("Request failed with status code "+i.status,[e_.ERR_BAD_REQUEST,e_.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}let ez=function(e,t){let i,s=Array(e=e||10),n=Array(e),a=0,o=0;return t=void 0!==t?t:1e3,function(r){let d=Date.now(),l=n[o];i||(i=d),s[a]=r,n[a]=d;let c=o,p=0;for(;c!==a;)p+=s[c++],c%=e;if((a=(a+1)%e)===o&&(o=(o+1)%e),d-i<t)return;let u=l&&d-l;return u?Math.round(1e3*p/u):void 0}},eJ=function(e,t){let i,s,n=0,a=1e3/t,o=(t,a=Date.now())=>{n=a,i=null,s&&(clearTimeout(s),s=null),e(...t)};return[(...e)=>{let t=Date.now(),r=t-n;r>=a?o(e,t):(i=e,s||(s=setTimeout(()=>{s=null,o(i)},a-r)))},()=>i&&o(i)]},eK=(e,t,i=3)=>{let s=0,n=ez(50,250);return eJ(i=>{let a=i.loaded,o=i.lengthComputable?i.total:void 0,r=a-s,d=n(r);s=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:r,rate:d||void 0,estimated:d&&o&&a<=o?(o-a)/d:void 0,event:i,lengthComputable:null!=o,[t?"download":"upload"]:!0})},i)},eX=(e,t)=>{let i=null!=e;return[s=>t[0]({lengthComputable:i,total:e,loaded:s}),t[1]]},eY=e=>(...t)=>ep.asap(()=>e(...t)),eZ=ej.hasStandardBrowserEnv?(s=new URL(ej.origin),n=ej.navigator&&/(msie|trident)/i.test(ej.navigator.userAgent),e=>(e=new URL(e,ej.origin),s.protocol===e.protocol&&s.host===e.host&&(n||s.port===e.port))):()=>!0,e0=ej.hasStandardBrowserEnv?{write(e,t,i,s,n,a,o){if("u"<typeof document)return;let r=[`${e}=${encodeURIComponent(t)}`];ep.isNumber(i)&&r.push(`expires=${new Date(i).toUTCString()}`),ep.isString(s)&&r.push(`path=${s}`),ep.isString(n)&&r.push(`domain=${n}`),!0===a&&r.push("secure"),ep.isString(o)&&r.push(`SameSite=${o}`),document.cookie=r.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.match(RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function e1(e,t,i){let s=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));return e&&(s||!1==i)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let e2=e=>e instanceof eV?{...e}:e;function e3(e,t){t=t||{};let i={};function s(e,t,i,s){return ep.isPlainObject(e)&&ep.isPlainObject(t)?ep.merge.call({caseless:s}
1,e,t):ep.isPlainObject(t)?ep.merge({},t):ep.isArray(t)?t.slice():t}function n(e,t,i,n){return ep.isUndefined(t)?ep.isUndefined(e)?void 0:s(void 0,e,i,n):s(e,t,i,n)}function a(e,t){if(!ep.isUndefined(t))return s(void 0,t)}function o(e,t){return ep.isUndefined(t)?ep.isUndefined(e)?void 0:s(void 0,e):s(void 0,t)}function r(i,n,a){return a in t?s(i,n):a in e?s(void 0,i):void 0}let d={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:r,headers:(e,t,i)=>n(e2(e),e2(t),i,!0)};return ep.forEach(Object.keys({...e,...t}),function(s){if("__proto__"===s||"constructor"===s||"prototype"===s)return;let a=ep.hasOwnProp(d,s)?d[s]:n,o=a(e[s],t[s],s);ep.isUndefined(o)&&a!==r||(i[s]=o)}),i}let e4=e=>{let t=e3({},e),{data:i,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:a,headers:o,auth:r}=t;if(t.headers=o=eV.from(o),t.url=ek(e1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),r&&o.set("Authorization","Basic "+btoa((r.username||"")+":"+(r.password?unescape(encodeURIComponent(r.password)):""))),ep.isFormData(i)){if(ej.hasStandardBrowserEnv||ej.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(ep.isFunction(i.getHeaders)){let e=i.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,i])=>{t.includes(e.toLowerCase())&&o.set(e,i)})}}if(ej.hasStandardBrowserEnv&&(s&&ep.isFunction(s)&&(s=s(t)),s||!1!==s&&eZ(t.url))){let e=n&&a&&e0.read(a);e&&o.set(n,e)}return t},e5="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,i){var s;let n,a,o,r,d,l,c=e4(e),p=c.data,u=eV.from(c.headers).normalize(),{responseType:y,onUploadProgress:_,onDownloadProgress:m}=c;function h(){r&&r(),d&&d(),c.cancelToken&&c.cancelToken.unsubscribe(n),c.signal&&c.signal.removeEventListener("abort",n)}let f=new XMLHttpRequest;function g(){if(!f)return;let s=eV.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders());eH(function(e){t(e),h()},function(e){i(e),h()},{data:y&&"text"!==y&&"json"!==y?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:s,config:e,request:f}),f=null}f.open(c.method.toUpperCase(),c.url,!0),f.timeout=c.timeout,"onloadend"in f?f.onloadend=g:f.onreadystatechange=function(){!f||4!==f.readyState||(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(g)},f.onabort=function(){f&&(i(new e_("Request aborted",e_.ECONNABORTED,e,f)),f=null)},f.onerror=function(t){let s=new e_(t&&t.message?t.message:"Network Error",e_.ERR_NETWORK,e,f);s.event=t||null,i(s),f=null},f.ontimeout=function(){let t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",s=c.transitional||eT;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),i(new e_(t,s.clarifyTimeoutError?e_.ETIMEDOUT:e_.ECONNABORTED,e,f)),f=null},void 0===p&&u.setContentType(null),"setRequestHeader"in f&&ep.forEach(u.toJSON(),function(e,t){f.setRequestHeader(t,e)}),ep.isUndefined(c.withCredentials)||(f.withCredentials=!!c.withCredentials),y&&"json"!==y&&(f.responseType=c.responseType),m&&([o,d]=eK(m,!0),f.addEventListener("progress",o)),_&&f.upload&&([a,r]=eK(_),f.upload.addEventListener("progress",a),f.upload.addEventListener("loadend",r)),(c.cancelToken||c.signal)&&(n=t=>{f&&(i(!t||t.type?new eW(null,e,f):t),f.abort(),f=null)},c.cancelToken&&c.cancelToken.subscribe(n),c.signal&&(c.signal.aborted?n():c.signal.addEventListener("abort",n)));let v=(s=c.url,(l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s))&&l[1]||"");v&&-1===ej.protocols.indexOf(v)?i(new e_("Unsupported protocol "+v+":",e_.ERR_BAD_REQUEST,e)):f.send(p||null)})},e6=function*(e,t){let i,s=e.byteLength;if(!t||s<t)return void(yield e);let n=0;for(;n<s;)i=n+t,yield e.slice(n,i),n=i},e8=async function*(e,t){for await(let i of e7(e))yield*e6(i,t)},e7=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:i}=await t.read();if(e)break;yield i}}finally{await t.cancel()}},e9=(e,t,i,s)=>{let n,a=e8(e,t),o=0,r=e=>{!n&&(n=!0,s&&s(e))};return new ReadableStream({async pull(e){try{let{done:t,value:s}=await a.next();if(t){r(),e.close();return}let n=s.byteLength;if(i){let e=o+=n;i(e)}e.enqueue(new Uint8Array(s))}catch(e){throw r(e),e}},cancel:e=>(r(e),a.return())},{highWaterMark:2})},{isFunction:te}=ep,tt=(({Request:e,Response:t})=>({Request:e,Response:t}))(ep.global),{ReadableStream:ti,TextEncoder:ts}=ep.global,tn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},ta=e=>{let t,{fetch:i,Request:s,Response:n}=e=ep.merge.call({skipUndefined:!0},tt,e),a=i?te(i):"function"==typeof fetch,o=te(s),r=te(n);if(!a)return!1;let d=a&&te(ti),l=a&&("function"==typeof ts?(t=new ts,e=>t.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer())),c=o&&d&&tn(()=>{let e=!1,t=new s(ej.origin,{body:new ti,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p=r&&d&&tn(()=>
1ep.isReadableStream(new n("").body)),u={stream:p&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{u[e]||(u[e]=(t,i)=>{let s=t&&t[e];if(s)return s.call(t);throw new e_(`Response type '${e}' is not supported`,e_.ERR_NOT_SUPPORT,i)})});let y=async e=>{if(null==e)return 0;if(ep.isBlob(e))return e.size;if(ep.isSpecCompliantForm(e)){let t=new s(ej.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ep.isArrayBufferView(e)||ep.isArrayBuffer(e)?e.byteLength:(ep.isURLSearchParams(e)&&(e+=""),ep.isString(e))?(await l(e)).byteLength:void 0},_=async(e,t)=>{let i=ep.toFiniteNumber(e.getContentLength());return null==i?y(t):i};return async e=>{let t,{url:a,method:r,data:d,signal:l,cancelToken:y,timeout:m,onDownloadProgress:h,onUploadProgress:f,responseType:g,headers:v,withCredentials:w="same-origin",fetchOptions:b}=e4(e),S=i||fetch;g=g?(g+"").toLowerCase():"text";let R=((e,t)=>{let{length:i}=e=e?e.filter(Boolean):[];if(t||i){let i,s=new AbortController,n=function(e){if(!i){i=!0,o();let t=e instanceof Error?e:this.reason;s.abort(t instanceof e_?t:new eW(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,n(new e_(`timeout of ${t}ms exceeded`,e_.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)}),e=null)};e.forEach(e=>e.addEventListener("abort",n));let{signal:r}=s;return r.unsubscribe=()=>ep.asap(o),r}})([l,y&&y.toAbortSignal()],m),k=null,C=R&&R.unsubscribe&&(()=>{R.unsubscribe()});try{if(f&&c&&"get"!==r&&"head"!==r&&0!==(t=await _(v,d))){let e,i=new s(a,{method:"POST",body:d,duplex:"half"});if(ep.isFormData(d)&&(e=i.headers.get("content-type"))&&v.setContentType(e),i.body){let[e,s]=eX(t,eK(eY(f)));d=e9(i.body,65536,e,s)}}ep.isString(w)||(w=w?"include":"omit");let i=o&&"credentials"in s.prototype,l={...b,signal:R,method:r.toUpperCase(),headers:v.normalize().toJSON(),body:d,duplex:"half",credentials:i?w:void 0};k=o&&new s(a,l);let y=await (o?S(k,b):S(a,l)),m=p&&("stream"===g||"response"===g);if(p&&(h||m&&C)){let e={};["status","statusText","headers"].forEach(t=>{e[t]=y[t]});let t=ep.toFiniteNumber(y.headers.get("content-length")),[i,s]=h&&eX(t,eK(eY(h),!0))||[];y=new n(e9(y.body,65536,i,()=>{s&&s(),C&&C()}),e)}g=g||"text";let T=await u[ep.findKey(u,g)||"text"](y,e);return!m&&C&&C(),await new Promise((t,i)=>{eH(t,i,{data:T,headers:eV.from(y.headers),status:y.status,statusText:y.statusText,config:e,request:k})})}catch(t){if(C&&C(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new e_("Network Error",e_.ERR_NETWORK,e,k,t&&t.response),{cause:t.cause||t});throw e_.from(t,t&&t.code,e,k,t&&t.response)}}},to=new Map,tr=e=>{let t=e&&e.env||{},{fetch:i,Request:s,Response:n}=t,a=[s,n,i],o=a.length,r,d,l=to;for(;o--;)r=a[o],void 0===(d=l.get(r))&&l.set(r,d=o?new Map:ta(t)),l=d;return d};tr();let td={http:null,xhr:e5,fetch:{get:tr}};ep.forEach(td,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let tl=e=>`- ${e}`,tc=e=>ep.isFunction(e)||null===e||!1===e,tp=function(e,t){let i,s,{length:n}=e=ep.isArray(e)?e:[e],a={};for(let o=0;o<n;o++){let n;if(s=i=e[o],!tc(i)&&void 0===(s=td[(n=String(i)).toLowerCase()]))throw new e_(`Unknown adapter '${n}'`);if(s&&(ep.isFunction(s)||(s=s.get(t))))break;a[n||"#"+o]=s}if(!s){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new e_("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(tl).join("\n"):" "+tl(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s};function tu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eW(null,e)}function ty(e){return tu(e),e.headers=eV.from(e.headers),e.data=e$.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tp(e.adapter||eI.adapter,e)(e).then(function(t){return tu(e),t.data=e$.call(e,e.transformResponse,t),t.headers=eV.from(t.headers),t},function(t){return!eQ(t)&&(tu(e),t&&t.response&&(t.response.data=e$.call(e,e.transformResponse,t.response),t.response.headers=eV.from(t.response.headers))),Promise.reject(t)})}let t_="1.13.6",tm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{tm[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});let th={};tm.transitional=function(e,t,i){function s(e,t){return"[Axios v"+t_+"] Transitional option '"+e+"'"+t+(i?". "+i:"")}return(i,n,a)=>
1{if(!1===e)throw new e_(s(n," has been removed"+(t?" in "+t:"")),e_.ERR_DEPRECATED);return t&&!th[n]&&(th[n]=!0,console.warn(s(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(i,n,a)}},tm.spelling=function(e){return(t,i)=>(console.warn(`${i} is likely a misspelling of ${e}`),!0)};let tf=function(e,t,i){if("object"!=typeof e)throw new e_("options must be an object",e_.ERR_BAD_OPTION_VALUE);let s=Object.keys(e),n=s.length;for(;n-- >0;){let a=s[n],o=t[a];if(o){let t=e[a],i=void 0===t||o(t,a,e);if(!0!==i)throw new e_("option "+a+" must be "+i,e_.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new e_("Unknown option "+a,e_.ERR_BAD_OPTION)}};class tg{constructor(e){this.defaults=e||{},this.interceptors={request:new eC,response:new eC}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let i=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?i&&!String(e.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+i):e.stack=i}catch(e){}}throw e}}_request(e,t){let i,s;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:n,paramsSerializer:a,headers:o}=t=e3(this.defaults,t);void 0!==n&&tf(n,{silentJSONParsing:tm.transitional(tm.boolean),forcedJSONParsing:tm.transitional(tm.boolean),clarifyTimeoutError:tm.transitional(tm.boolean),legacyInterceptorReqResOrdering:tm.transitional(tm.boolean)},!1),null!=a&&(ep.isFunction(a)?t.paramsSerializer={serialize:a}:tf(a,{encode:tm.function,serialize:tm.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),tf(t,{baseUrl:tm.spelling("baseURL"),withXsrfToken:tm.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();
1let r=o&&ep.merge(o.common,o[t.method]);o&&ep.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=eV.concat(r,o);let d=[],l=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;l=l&&e.synchronous;let i=t.transitional||eT;i&&i.legacyInterceptorReqResOrdering?d.unshift(e.fulfilled,e.rejected):d.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p=0;if(!l){let e=[ty.bind(this),void 0];for(e.unshift(...d),e.push(...c),s=e.length,i=Promise.resolve(t);p<s;)i=i.then(e[p++],e[p++]);return i}s=d.length;let u=t;for(;p<s;){let e=d[p++],t=d[p++];try{u=e(u)}catch(e){t.call(this,e);break}}try{i=ty.call(this,u)}catch(e){return Promise.reject(e)}for(p=0,s=c.length;p<s;)i=i.then(c[p++],c[p++]);return i}getUri(e){return ek(e1((e=e3(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}ep.forEach(["delete","get","head","options"],function(e){tg.prototype[e]=function(t,i){return this.request(e3(i||{},{method:e,url:t,data:(i||{}).data}))}}),ep.forEach(["post","put","patch"],function(e){function t(t){return function(i,s,n){return this.request(e3(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}tg.prototype[e]=t(),tg.prototype[e+"Form"]=t(!0)});class tv{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});const i=this;this.promise.then(e=>{if(!i._listeners)return;let t=i._listeners.length;for(;t-- >0;)i._listeners[t](e);i._listeners=null}),this.promise.then=e=>{let t,s=new Promise(e=>{i.subscribe(e),t=e}).then(e);return s.cancel=function(){i.unsubscribe(t)},s},e(function(e,s,n){i.reason||(i.reason=new eW(e,s,n),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new tv(function(t){e=t}),cancel:e}}}let tw={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
1alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(tw).forEach(([e,t])=>{tw[t]=e});let tb=function e(t){let i=new tg(t),s=C(tg.prototype.request,i);return ep.extend(s,tg.prototype,i,{allOwnKeys:!0}),ep.extend(s,i,null,{allOwnKeys:!0}),s.create=function(i){return e(e3(t,i))},s}(eI);function tS(e){return Array.isArray(e)?e:[e]}function tR(e){return e instanceof Date?e.getTime():"number"==typeof e&&Number.isFinite(e)?e:"string"==typeof e&&e.includes("T")&&!Number.isNaN(Date.parse(e))?Date.parse(e):null}function tk(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e&&""!==e.trim()){let t=Number(e);if(Number.isFinite(t))return t}return null}function tC(e,t){let i=tR(e),s=tR(t);if(null!==i&&null!==s)return{kind:"date",a:i,b:s};let n=tk(e),a=tk(t);return null!==n&&null!==a?{kind:"number",a:n,b:a}:"string"==typeof e&&"string"==typeof t?{kind:"string",a:e,b:t}:"boolean"==typeof e&&"boolean"==typeof t?{kind:"boolean",a:e,b:t}:{kind:"incomparable",a:e,b:t}}function tT(e){let t=tC(e,e);switch(t.kind){case"date":case"number":case"string":case"boolean":return`${t.kind}:${String(t.a)}`;default:return`other:${String(e)}`}}function tF(e){return e.normalize("NFKC").toLowerCase().trim().split(/\s+/).filter(Boolean)}function tA(e,t){return t.split(".").reduce((e,t)=>e?e[t]:void 0,e)}function tD(e){return null!=e&&"string"!=typeof e&&"function"==typeof e[Symbol.iterator]}function tE(e){return Array.isArray(e)?e:tD(e)?Array.from(e):[e]}function tU(e,t,i){var s,n;if(tD(e)||tD(t))return!1;let a=tC(e,t);return"incomparable"!==a.kind&&i((s=a.a)===(n=a.b)?0:s<n?-1:1)}function tP(e,t,i="exact"){let s=tD(e),n=tD(t);if(!s&&!n){let i=tC(e,t);return"incomparable"===i.kind?Object.is(e,t):i.a===i.b}if(s&&n){let s=tE(e),n=tE(t);if("contains"===i)return n.every(e=>s.some(t=>tP(t,e,"exact")));let a=new Set(s.map(tT)),o=new Set(n.map(tT));if(a.size!==o.size)return!1;for(let e of a)if(!o.has(e))return!1;return!0}return s?tE(e).some(e=>tP(e,t,i)):tE(t).some(t=>tP(e,t,i))}function tO(e,t){return t.some(t=>tP(e,t))}function tx(e){return e*Math.PI/180}function tj(e){if(null==e||"object"!=typeof e)return null;let t=e.Lat??e.lat,i=e.Lng??e.lng;return"number"==typeof t&&Number.isFinite(t)&&"number"==typeof i&&Number.isFinite(i)?{lat:t,lng:i}:null}tb.Axios=tg,tb.CanceledError=eW,tb.CancelToken=tv,tb.isCancel=eQ,tb.VERSION=t_,tb.toFormData=ev,tb.AxiosError=e_,tb.Cancel=tb.CanceledError,tb.all=function(e){return Promise.all(e)},tb.spread=function(e){return function(t){return e.apply(null,t)}},tb.isAxiosError=function(e){return ep.isObject(e)&&!0===e.isAxiosError},tb.mergeConfig=e3,tb.AxiosHeaders=eV,tb.formToJSON=e=>eq(ep.isHTMLForm(e)?new FormData(e):e),tb.getAdapter=tp,tb.HttpStatusCode=tw,tb.default=tb;var tq={};tq.DatetimeType=e=>new Date("number"==typeof e?Math.floor(e/1e6):e);var tI=(e,t)=>(t&&0!==Object.keys(e).length&&Object.keys(e).forEach(i=>{if(null!=t[i]&&e[i]){let s=tq[e[i].type];
1s&&(e[i].isSingle?t[i]=s(t[i]):Object.keys(t[i]).forEach(e=>{t[i][e]=s(t[i][e])}))}}),t);tq.AcceptFeedMemberInviteResponse=e=>tI({member:{type:"FeedMemberResponse",isSingle:!0}},e),tq.AcceptFollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.ActionLogResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},review_queue_item:{type:"ReviewQueueItemResponse",isSingle:!0},target_user:{type:"UserResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ActivityAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityFeedbackEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityMarkEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityPinResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ActivityPinnedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},pinned_activity:{type:"PinActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityReactionAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityReactionDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityReactionUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityRemovedFromFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},comments:{type:"CommentResponse",isSingle:!1},latest_reactions:{type:"FeedsReactionResponse",isSingle:!1},mentioned_users:{type:"UserResponse",isSingle:!1},own_bookmarks:{type:"BookmarkResponse",isSingle:!1},own_reactions:{type:"FeedsReactionResponse",isSingle:!1},collections:{type:"EnrichedCollectionResponse",isSingle:!1},reaction_groups:{type:"FeedsReactionGroupResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},edited_at:{type:"DatetimeType",isSingle:!0},expires_at:{type:"DatetimeType",isSingle:!0},friend_reactions:{type:"FeedsReactionResponse",isSingle:!1},current_feed:{type:"FeedResponse",isSingle:!0},parent:{type:"ActivityResponse",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0}},e),tq.ActivityRestoredEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityUnpinnedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},pinned_activity:{type:"PinActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ActivityUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.AddActivityResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}},e),tq.AddBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.AddCommentBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.AddCommentReactionResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0}},e),tq.AddCommentResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0}},e),tq.AddCommentsBatchResponse=e=>tI({comments:{type:"CommentResponse",isSingle:!1}},e),tq.AddReactionResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0}},e),tq.AddUserGroupMembersResponse=e=>tI({user_group:{type:"UserGroupResponse",isSingle:!0}},e),tq.AggregatedActivityResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},activities:{type:"ActivityResponse",isSingle:!1}},e),tq.AppUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.AppealItemResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.BanInfoResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},expires:{type:"DatetimeType",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.BlockListResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.BlockUsersResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0}},e),tq.BlockedUserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},blocked_user:{type:"UserResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.BookmarkAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},bookmark:{type:"BookmarkResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.BookmarkDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},bookmark:{type:"BookmarkResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.BookmarkFolderDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},bookmark_folder:{type:"BookmarkFolderResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.BookmarkFolderResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.BookmarkFolderUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},bookmark_folder:{type:"BookmarkFolderResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.BookmarkResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},folder:{type:"BookmarkFolderResponse",isSingle:!0}},e),tq.BookmarkUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},bookmark:{type:"BookmarkResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CallResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},ended_at:{type:"DatetimeType",isSingle:!0},starts_at:{type:"DatetimeType",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0}},e),tq.ChangeFeedVisibilityResponse=e=>tI({feed:{type:"FeedResponse",isSingle:!0}},e),tq.ChannelConfigWithInfo=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},commands:{type:"Command",isSingle:!1}},e),tq.ChannelMemberResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},archived_at:{type:"DatetimeType",isSingle:!0},ban_expires:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},invite_accepted_at:{type:"DatetimeType",isSingle:!0},invite_rejected_at:{type:"DatetimeType",isSingle:!0},pinned_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ChannelMute=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},expires:{type:"DatetimeType",isSingle:!0},channel:{type:"ChannelResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ChannelResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},hide_messages_before:{type:"DatetimeType",isSingle:!0},last_message_at:{type:"DatetimeType",isSingle:!0},mute_expires_at:{type:"DatetimeType",isSingle:!0},truncated_at:{type:"DatetimeType",isSingle:!0},members:{type:"ChannelMemberResponse",isSingle:!1},config:{type:"ChannelConfigWithInfo",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0},truncated_by:{type:"UserResponse",isSingle:!0}},e),tq.ChatDraftPayloadResponse=e=>tI({mentioned_users:{type:"UserResponse",isSingle:!1}},e),tq.ChatDraftResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},message:{type:"ChatDraftPayloadResponse",isSingle:!0},parent_message:{type:"ChatMessageResponse",isSingle:!0},quoted_message:{type:"ChatMessageResponse",isSingle:!0}},e),tq.ChatMessageResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},latest_reactions:{type:"ChatReactionResponse",isSingle:!1},mentioned_users:{type:"UserResponse",isSingle:!1},own_reactions:{type:"ChatReactionResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},message_text_updated_at:{type:"DatetimeType",isSingle:!0},pin_expires:{type:"DatetimeType",isSingle:!0},pinned_at:{type:"DatetimeType",isSingle:!0},thread_participants:{type:"UserResponse",isSingle:!1},draft:{type:"ChatDraftResponse",isSingle:!0},member:{type:"ChannelMemberResponse",isSingle:!0},pinned_by:{type:"UserResponse",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},quoted_message:{type:"ChatMessageResponse",isSingle:!0},reaction_groups:{type:"ChatReactionGroupResponse",isSingle:!1},reminder:{type:"ChatReminderResponseData",isSingle:!0},shared_location:{type:"ChatSharedLocationResponseData",isSingle:!0}},e),tq.ChatReactionGroupResponse=e=>tI({first_reaction_at:{type:"DatetimeType",isSingle:!0},last_reaction_at:{type:"DatetimeType",isSingle:!0},latest_reactions_by:{type:"ChatReactionGroupUserResponse",isSingle:!1}},e),tq.ChatReactionGroupUserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ChatReactionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ChatReminderResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},remind_at:{type:"DatetimeType",isSingle:!0},message:{type:"ChatMessageResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ChatSharedLocationResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},end_at:{type:"DatetimeType",isSingle:!0},message:{type:"ChatMessageResponse",isSingle:!0}},e),tq.CollectionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.Command=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentReactionAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentReactionDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentReactionUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},mentioned_users:{type:"UserResponse",isSingle:!1},own_reactions:{type:"FeedsReactionResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},edited_at:{type:"DatetimeType",isSingle:!0},latest_reactions:{type:"FeedsReactionResponse",isSingle:!1},reaction_groups:{type:"FeedsReactionGroupResponse",isSingle:!1}},e),tq.CommentRestoredEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.CommentUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ConfigResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.CreateBlockListResponse=e=>tI({blocklist:{type:"BlockListResponse",isSingle:!0}},e),tq.CreateCollectionsResponse=e=>tI({collections:{type:"CollectionResponse",isSingle:!1}},e),tq.CreateFeedsBatchResponse=e=>tI({feeds:{type:"FeedResponse",isSingle:!1}},e),tq.CreateGuestResponse=e=>tI({user:{type:"UserResponse",isSingle:!0}},e),tq.CreateUserGroupResponse=e=>tI({user_group:{type:"UserGroupResponse",isSingle:!0}},e),tq.DeleteActivityReactionResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0}},e),tq.DeleteBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.DeleteCommentBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.DeleteCommentReactionResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0},reaction:{type:"FeedsReactionResponse",isSingle:!0}},e),tq.DeleteCommentResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0}},e),tq.DeviceResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0}},e),tq.DraftPayloadResponse=e=>tI({mentioned_users:{type:"UserResponse",isSingle:!1}},e),tq.DraftResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},message:{type:"DraftPayloadResponse",isSingle:!0},channel:{type:"ChannelResponse",isSingle:!0},parent_message:{type:"MessageResponse",isSingle:!0},quoted_message:{type:"MessageResponse",isSingle:!0}},e),tq.EnrichedCollectionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.EntityCreatorResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},deactivated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},last_active:{type:"DatetimeType",isSingle:!0},revoke_tokens_issued_before:{type:"DatetimeType",isSingle:!0}},e),tq.FeedCreatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},members:{type:"FeedMemberResponse",isSingle:!1},feed:{type:"FeedResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedGroupChangedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedGroupDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedGroupRestoredEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedMemberAddedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},member:{type:"FeedMemberResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedMemberRemovedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedMemberResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{typ
1e:"UserResponse",isSingle:!0},invite_accepted_at:{type:"DatetimeType",isSingle:!0},invite_rejected_at:{type:"DatetimeType",isSingle:!0},membership_level:{type:"MembershipLevelResponse",isSingle:!0}},e),tq.FeedMemberUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},member:{type:"FeedMemberResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedOwnData=e=>tI({own_followings:{type:"FollowResponse",isSingle:!1},own_follows:{type:"FollowResponse",isSingle:!1},own_membership:{type:"FeedMemberResponse",isSingle:!0}},e),tq.FeedResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},own_followings:{type:"FollowResponse",isSingle:!1},own_follows:{type:"FollowResponse",isSingle:!1},own_membership:{type:"FeedMemberResponse",isSingle:!0}},e),tq.FeedSuggestionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},own_followings:{type:"FollowResponse",isSingle:!1},own_follows:{type:"FollowResponse",isSingle:!1},own_membership:{type:"FeedMemberResponse",isSingle:!0}},e),tq.FeedUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},feed:{type:"FeedResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedsBookmarkResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.FeedsEnrichedCollectionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedsFeedResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},created_by:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedsReactionGroupResponse=e=>tI({first_reaction_at:{type:"DatetimeType",isSingle:!0},last_reaction_at:{type:"DatetimeType",isSingle:!0}},e),tq.FeedsReactionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.FeedsV3ActivityResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},comments:{type:"FeedsV3CommentResponse",isSingle:!1},latest_reactions:{type:"FeedsReactionResponse",isSingle:!1},mentioned_users:{type:"UserResponse",isSingle:!1},own_bookmarks:{type:"FeedsBookmarkResponse",isSingle:!1},own_reactions:{type:"FeedsReactionResponse",isSingle:!1},collections:{type:"FeedsEnrichedCollectionResponse",isSingle:!1},reaction_groups:{type:"FeedsReactionGroupResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},edited_at:{type:"DatetimeType",isSingle:!0},expires_at:{type:"DatetimeType",isSingle:!0},friend_reactions:{type:"FeedsReactionResponse",isSingle:!1},current_feed:{type:"FeedsFeedResponse",isSingle:!0},parent:{type:"FeedsV3ActivityResponse",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0}},e),tq.FeedsV3CommentResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},mentioned_users:{type:"UserResponse",isSingle:!1},own_reactions:{type:"FeedsReactionResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},edited_at:{type:"DatetimeType",isSingle:!0},latest_reactions:{type:"FeedsReactionResponse",isSingle:!1},reaction_groups:{type:"FeedsReactionGroupResponse",isSingle:!1}},e),tq.FollowBatchResponse=e=>tI({created:{type:"FollowResponse",isSingle:!1},follows:{type:"FollowResponse",isSingle:!1}},e),tq.FollowCreatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},follow:{type:"FollowResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FollowDeletedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},follow:{type:"FollowResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FollowResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},source_feed:{type:"FeedResponse",isSingle:!0},target_feed:{type:"FeedResponse",isSingle:!0},request_accepted_at:{type:"DatetimeType",isSingle:!0},request_rejected_at:{type:"DatetimeType",isSingle:!0}},e),tq.FollowUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},follow:{type:"FollowResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.FullUserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},channel_mutes:{type:"ChannelMute",isSingle:!1},devices:{type:"DeviceResponse",isSingle:!1},mutes:{type:"UserMuteResponse",isSingle:!1},ban_expires:{type:"DatetimeType",isSingle:!0},deactivated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},last_active:{type:"DatetimeType",isSingle:!0},revoke_tokens_issued_before:{type:"DatetimeType",isSingle:!0}},e),tq.GetActivityResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}}
1,e),tq.GetAppealResponse=e=>tI({item:{type:"AppealItemResponse",isSingle:!0}},e),tq.GetBlockedUsersResponse=e=>tI({blocks:{type:"BlockedUserResponse",isSingle:!1}},e),tq.GetCommentRepliesResponse=e=>tI({comments:{type:"ThreadedCommentResponse",isSingle:!1}},e),tq.GetCommentResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0}},e),tq.GetCommentsResponse=e=>tI({comments:{type:"ThreadedCommentResponse",isSingle:!1}},e),tq.GetConfigResponse=e=>tI({config:{type:"ConfigResponse",isSingle:!0}},e),tq.GetFollowSuggestionsResponse=e=>tI({suggestions:{type:"FeedSuggestionResponse",isSingle:!1}},e),tq.GetOrCreateFeedResponse=e=>tI({activities:{type:"ActivityResponse",isSingle:!1},aggregated_activities:{type:"AggregatedActivityResponse",isSingle:!1},followers:{type:"FollowResponse",isSingle:!1},following:{type:"FollowResponse",isSingle:!1},members:{type:"FeedMemberResponse",isSingle:!1},pinned_activities:{type:"ActivityPinResponse",isSingle:!1},feed:{type:"FeedResponse",isSingle:!0},notification_status:{type:"NotificationStatusResponse",isSingle:!0}},e),tq.GetOrCreateFollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.GetOrCreateUnfollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.GetUserGroupResponse=e=>tI({user_group:{type:"UserGroupResponse",isSingle:!0}},e),tq.HealthCheckEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0},me:{type:"OwnUserResponse",isSingle:!0}},e),tq.ListBlockListResponse=e=>tI({blocklists:{type:"BlockListResponse",isSingle:!1}},e),tq.ListDevicesResponse=e=>tI({devices:{type:"DeviceResponse",isSingle:!1}},e),tq.ListUserGroupsResponse=e=>tI({user_groups:{type:"UserGroupResponse",isSingle:!1}},e),tq.MembershipLevelResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0}},e),tq.MessageResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},latest_reactions:{type:"ReactionResponse",isSingle:!1},mentioned_users:{type:"UserResponse",isSingle:!1},own_reactions:{type:"ReactionResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},message_text_updated_at:{type:"DatetimeType",isSingle:!0},pin_expires:{type:"DatetimeType",isSingle:!0},pinned_at:{type:"DatetimeType",isSingle:!0},thread_participants:{type:"UserResponse",isSingle:!1},draft:{type:"DraftResponse",isSingle:!0},member:{type:"ChannelMemberResponse",isSingle:!0},pinned_by:{type:"UserResponse",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},quoted_message:{type:"MessageResponse",isSingle:!0},reaction_groups:{type:"ReactionGroupResponse",isSingle:!1},reminder:{type:"ReminderResponseData",isSingle:!0},shared_location:{type:"SharedLocationResponseData",isSingle:!0}},e),tq.ModerationCustomActionEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},review_queue_item:{type:"ReviewQueueItemResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0},message:{type:"MessageResponse",isSingle:!0}},e),tq.ModerationFlagResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},review_queue_item:{type:"ReviewQueueItemResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ModerationFlaggedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.ModerationMarkReviewedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},item:{type:"ReviewQueueItemResponse",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0},message:{type:"MessageResponse",isSingle:!0}},e),tq.MuteResponse=e=>tI({mutes:{type:"UserMuteResponse",isSingle:!1},own_user:{type:"OwnUserResponse",isSingle:!0}},e),tq.NotificationFeedUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0},aggregated_activities:{type:"AggregatedActivityResponse",isSingle:!1},notification_status:{type:"NotificationStatusResponse",isSingle:!0}},e),tq.NotificationStatusResponse=e=>tI({last_read_at:{type:"DatetimeType",isSingle:!0},last_seen_at:{type:"DatetimeType",isSingle:!0}},e),tq.OwnBatchResponse=e=>tI({data:{type:"FeedOwnData",isSingle:!1}},e),tq.OwnUserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},channel_mutes:{type:"ChannelMute",isSingle:!1},devices:{type:"DeviceResponse",isSingle:!1},mutes:{type:"UserMuteResponse",isSingle:!1},deactivated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},last_active:{type:"DatetimeType",isSingle:!0},revoke_tokens_issued_before:{type:"DatetimeType",isSingle:!0},push_preferences:{type:"PushPreferencesResponse",isSingle:!0}},e),tq.PinActivityResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},activity:{type:"ActivityResponse",isSingle:!0}},e),tq.PollClosedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollDeletedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollResponse=e=>tI({poll:{type:"PollResponseData",isSingle:!0}},e),tq.PollResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},latest_answers:{type:"PollVoteResponseData",isSingle:!1},own_votes:{type:"PollVoteResponseData",isSingle:!1},created_by:{type:"UserResponse",isSingle:!0}},e),tq.PollUpdatedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollVoteCastedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},poll_vote:{type:"PollVoteResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollVoteChangedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},poll_vote:{type:"PollVoteResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollVoteRemovedFeedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},poll:{type:"PollResponseData",isSingle:!0},poll_vote:{type:"PollVoteResponseData",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.PollVoteResponse=e=>tI({poll:{type:"PollResponseData",isSingle:!0},vote:{type:"PollVoteResponseData",isSingle:!0}},e),tq.PollVoteResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.PollVotesResponse=e=>tI({votes:{type:"PollVoteResponseData",isSingle:!1}},e),tq.PushPreferencesResponse=e=>tI({disabled_until:{type:"DatetimeType",isSingle:!0}},e),tq.QueryActivitiesResponse=e=>tI({activities:{type:"ActivityResponse",isSingle:!1}},e),tq.QueryActivityReactionsResponse=e=>tI({reactions:{type:"FeedsReactionResponse",isSingle:!1}},e),tq.QueryAppealsResponse=e=>tI({items:{type:"AppealItemResponse",isSingle:!1}},e),tq.QueryBookmarkFoldersResponse=e=>tI({bookmark_folders:{type:"BookmarkFolderResponse",isSingle:!1}},e),tq.QueryBookmarksResponse=e=>tI({bookmarks:{type:"BookmarkResponse",isSingle:!1}},e),tq.QueryCollectionsResponse=e=>tI({collections:{type:"CollectionResponse",isSingle:!1}},e),tq.QueryCommentReactionsResponse=e=>tI({reactions:{type:"FeedsReactionResponse",isSingle:!1}},e),tq.QueryCommentsResponse=e=>tI({comments:{type:"CommentResponse",isSingle:!1}},e),tq.QueryFeedMembersResponse=e=>tI({members:{type:"FeedMemberResponse",isSingle:!1}},e),tq.QueryFeedsResponse=e=>tI({feeds:{type:"FeedResponse",isSingle:!1}},e),tq.QueryFollowsResponse=e=>tI({follows:{type:"FollowResponse",isSingle:!1}},e),tq.QueryModerationConfigsResponse=e=>tI({configs:{type:"ConfigResponse",isSingle:!1}},e),tq.QueryPinnedActivitiesResponse=e=>tI({pinned_activities:{type:"ActivityPinResponse",isSingle:!1}},e),tq.QueryPollsResponse=e=>tI({polls:{type:"PollResponseData",isSingle:!1}},e),tq.QueryReviewQueueResponse=e=>tI({items:{type:"ReviewQueueItemResponse",isSingle:!1}},e),tq.QueryUsersResponse=e=>tI({users:{type:"FullUserResponse",isSingle:!1}},e),tq.Reaction=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0}},e),tq.ReactionGroupResponse=e=>tI({first_reaction_at:{type:"DatetimeType",isSingle:!0},last_reaction_at:{type:"DatetimeType",isSingle:!0},latest_reactions_by:{type:"ReactionGroupUserResponse",isSingle:!1}},e),tq.ReactionGroupUserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ReactionResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.ReadCollectionsResponse=e=>tI({collections:{type:"CollectionResponse",isSingle:!1}},e),tq.RejectFeedMemberInviteResponse=e=>tI({member:{type:"FeedMemberResponse",isSingle:!0}},e),tq.RejectFollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.ReminderResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},remind_at:{type:"DatetimeType",isSingle:!0},channel:{type:"ChannelResponse",isSingle:!0},message:{type:"MessageResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.RemoveUserGroupMembersResponse=e=>tI({user_group:{type:"UserGroupResponse",isSingle:!0}},e),tq.RestoreActivityResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}},e),tq.RestoreCommentResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0},comment:{type:"CommentResponse",isSingle:!0}},e),tq.ReviewQueueItemResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},actions:{type:"ActionLogResponse",isSingle:!1},bans:{type:"BanInfoResponse",isSingle:!1},flags:{type:"ModerationFlagResponse",isSingle:!1},completed_at:{type:"DatetimeType",isSingle:!0},escalated_at:{type:"DatetimeType",isSingle:!0},reviewed_at:{type:"DatetimeType",isSingle:!0},appeal:{type:"AppealItemResponse",isSingle:!0},assigned_to:{type:"UserResponse",isSingle:!0},call:{type:"CallResponse",isSingle:!0},entity_creator:{type:"EntityCreatorResponse",isSingle:!0},feeds_v2_reaction:{type:"Reaction",isSingle:!0},feeds_v3_activity:{type:"FeedsV3ActivityResponse",isSingle:!0},feeds_v3_comment:{type:"FeedsV3CommentResponse",isSingle:!0},message:{type:"ChatMessageResponse",isSingle:!0},reaction:{type:"Reaction",isSingle:!0}},e),tq.SearchUserGroupsResponse=e=>tI({user_groups:{type:"UserGroupResponse",isSingle:!1}},e),tq.SharedLocationResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},end_at:{type:"DatetimeType",isSingle:!0},channel:{type:"ChannelResponse",isSingle:!0},message:{type:"MessageResponse",isSingle:!0}},e),tq.SharedLocationResponseData=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},end_at:{type:"DatetimeType",isSingle:!0},channel:{type:"ChannelResponse",isSingle:!0},message:{type:"MessageResponse",isSingle:!0}},e),tq.SharedLocationsResponse=e=>tI({active_live_locations:{type:"SharedLocationResponseData",isSingle:!1}},e),tq.SingleFollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.StoriesFeedUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0},activities:{type:"ActivityResponse",isSingle:!1},aggregated_activities:{type:"AggregatedActivityResponse",isSingle:!1}},e),tq.SubmitActionResponse=e=>tI({appeal_item:{type:"AppealItemResponse",isSingle:!0},item:{type:"ReviewQueueItemResponse",isSingle:!0}},e),tq.ThreadedCommentResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},mentioned_users:{type:"UserResponse",isSingle:!1},own_reactions:{type:"FeedsReactionResponse",isSingle:!1},user:{type:"UserResponse",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},edited_at:{type:"DatetimeType",isSingle:!0},latest_reactions:{type:"FeedsReactionResponse",isSingle:!1},replies:{type:"ThreadedCommentResponse",isSingle:!1},reaction_groups:{type:"FeedsReactionGroupResponse",isSingle:!1}},e),tq.UnfollowBatchResponse=e=>tI({follows:{type:"FollowResponse",isSingle:!1}},e),tq.UnfollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.UnpinActivityResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}},e),tq.UpdateActivityPartialResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}},e),tq.UpdateActivityResponse=e=>tI({activity:{type:"ActivityResponse",isSingle:!0}},e),tq.UpdateBlockListResponse=e=>tI({blocklist:{type:"BlockListResponse",isSingle:!0}},e),tq.UpdateBookmarkFolderResponse=e=>tI({bookmark_folder:{type:"BookmarkFolderResponse",isSingle:!0}},e),tq.UpdateBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.UpdateCollectionsResponse=e=>tI({collections:{type:"CollectionResponse",isSingle:!1}},e),tq.UpdateCommentBookmarkResponse=e=>tI({bookmark:{type:"BookmarkResponse",isSingle:!0}},e),tq.UpdateCommentPartialResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0}},e),tq.UpdateCommentResponse=e=>tI({comment:{type:"CommentResponse",isSingle:!0}},e),tq.UpdateFeedMembersResponse=e=>tI({added:{type:"FeedMemberResponse",isSingle:!1},updated:{type:"FeedMemberResponse",isSingle:!1}},e),tq.UpdateFeedResponse=e=>tI({feed:{type:"FeedResponse",isSingle:!0}},e),tq.UpdateFollowResponse=e=>tI({follow:{type:"FollowResponse",isSingle:!0}},e),tq.UpdateUserGroupResponse=e=>tI({user_group:{type:"UserGroupResponse",isSingle:!0}},e),tq.UpdateUsersResponse=e=>tI({users:{type:"FullUserResponse",isSingle:!1}},e),tq.UpsertActivitiesResponse=e=>tI({activities:{type:"ActivityResponse",isSingle:!1}},e),tq.UpsertConfigResponse=e=>tI({config:{type:"ConfigResponse",isSingle:!0}},e),tq.UpsertPushPreferencesResponse=e=>tI({user_preferences:{type:"PushPreferencesResponse",isSingle:!1}},e),tq.UserBannedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},expiration:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.UserDeactivatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.UserGroupMember=e=>tI({created_at:{type:"DatetimeType",isSingle:!0}},e),tq.UserGroupResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},members:{type:"UserGroupMember",isSingle:!1}},e),tq.UserMuteResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},expires:{type:"DatetimeType",isSingle:!0},target:{type:"UserResponse",isSingle:!0},user:{type:"UserResponse",isSingle:!0}},e),tq.UserReactivatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.UserResponse=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},updated_at:{type:"DatetimeType",isSingle:!0},deactivated_at:{type:"DatetimeType",isSingle:!0},deleted_at:{type:"DatetimeType",isSingle:!0},last_active:{type:"DatetimeType",isSingle:!0},revoke_tokens_issued_before:{type:"DatetimeType",isSingle:!0}},e),tq.UserUnbannedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e),tq.UserUpdatedEvent=e=>tI({created_at:{type:"DatetimeType",isSingle:!0},received_at:{type:"DatetimeType",isSingle:!0}},e);var tB=class{constructor(e){this.apiClient=e}async getApp(){let e=await this.apiClient.sendRequest("GET","/api/v2/app",void 0,void 0);return tq.GetApplicationResponse?.(e.body),{...e.body,metadata:e.metadata}}async listBlockLists(e){let t={team:e?.team},i=await this.apiClient.sendRequest("GET","/api/v2/blocklists",void 0,t);return tq.ListBlockListResponse?.(i.body),{...i.body,metadata:i.metadata}}async createBlockList(e){let t={name:e?.name,words:e?.words,is_leet_check_enabled:e?.is_leet_check_enabled,is_plural_check_enabled:e?.is_plural_check_enabled,team:e?.team,type:e?.type},i=await this.apiClient.sendRequest("POST","/api/v2/blocklists",void 0,void 0,t,"application/json");return tq.CreateBlockListResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteBlockList(e){let t={team:
1e?.team},i={name:e?.name},s=await this.apiClient.sendRequest("DELETE","/api/v2/blocklists/{name}",i,t);return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async updateBlockList(e){let t={name:e?.name},i={is_leet_check_enabled:e?.is_leet_check_enabled,is_plural_check_enabled:e?.is_plural_check_enabled,team:e?.team,words:e?.words},s=await this.apiClient.sendRequest("PUT","/api/v2/blocklists/{name}",t,void 0,i,"application/json");return tq.UpdateBlockListResponse?.(s.body),{...s.body,metadata:s.metadata}}async deleteDevice(e){let t={id:e?.id},i=await this.apiClient.sendRequest("DELETE","/api/v2/devices",void 0,t);return tq.Response?.(i.body),{...i.body,metadata:i.metadata}}async listDevices(){let e=await this.apiClient.sendRequest("GET","/api/v2/devices",void 0,void 0);return tq.ListDevicesResponse?.(e.body),{...e.body,metadata:e.metadata}}async createDevice(e){let t={id:e?.id,push_provider:e?.push_provider,push_provider_name:e?.push_provider_name,voip_token:e?.voip_token},i=await this.apiClient.sendRequest("POST","/api/v2/devices",void 0,void 0,t,"application/json");return tq.Response?.(i.body),{...i.body,metadata:i.metadata}}async addActivity(e){let t={type:e?.type,feeds:e?.feeds,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enrich_own_fields:e?.enrich_own_fields,expires_at:e?.expires_at,id:e?.id,parent_id:e?.parent_id,poll_id:e?.poll_id,restrict_replies:e?.restrict_replies,skip_enrich_url:e?.skip_enrich_url,skip_push:e?.skip_push,text:e?.text,visibility:e?.visibility,visibility_tag:e?.visibility_tag,attachments:e?.attachments,collection_refs:e?.collection_refs,filter_tags:e?.filter_tags,interest_tags:e?.interest_tags,mentioned_user_ids:e?.mentioned_user_ids,custom:e?.custom,location:e?.location,search_data:e?.search_data},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities",void 0,void 0,t,"application/json");return tq.AddActivityResponse?.(i.body),{...i.body,metadata:i.metadata}}async upsertActivities(e){let t={activities:e?.activities,enrich_own_fields:e?.enrich_own_fields},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/batch",void 0,void 0,t,"application/json");return tq.UpsertActivitiesResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteActivities(e){let t={ids:e?.ids,delete_notification_activity:e?.delete_notification_activity,hard_delete:e?.hard_delete},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/delete",void 0,void 0,t,"application/json");return tq.DeleteActivitiesResponse?.(i.body),{...i.body,metadata:i.metadata}}async trackActivityMetrics(e){let t={events:e?.events},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/metrics/track",void 0,void 0,t,"application/json");return tq.TrackActivityMetricsResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryActivities(e){let t={enrich_own_fields:e?.enrich_own_fields,include_soft_deleted_activities:e?.include_soft_deleted_activities,limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/query",void 0,void 0,t,"application/json");return tq.QueryActivitiesResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteBookmark(e){let t={folder_id:e?.folder_id},i={activity_id:e?.activity_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/activities/{activity_id}/bookmarks",i,t);return tq.DeleteBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateBookmark(e){let t={activity_id:e?.activity_id},i={folder_id:e?.folder_id,new_folder_id:e?.new_folder_id,custom:e?.custom,new_folder:e?.new_folder},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/activities/{activity_id}/bookmarks",t,void 0,i,"application/json");return tq.UpdateBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async addBookmark(e){let t={activity_id:e?.activity_id},i={folder_id:e?.folder_id,custom:e?.custom,new_folder:e?.new_folder},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{activity_id}/bookmarks",t,void 0,i,"application/json");return tq.AddBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async activityFeedback(e){let t={activity_id:e?.activity_id},i={hide:e?.hide,show_less:e?.show_less,show_more:e?.show_more},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{activity_id}/feedback",t,void 0,i,"application/json");return tq.ActivityFeedbackResponse?.(s.body),{...s.body,metadata:s.metadata}}async castPollVote(e){let t={activity_id:e?.activity_id,poll_id:e?.poll_id},i={vote:e?.vote},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote",t,void 0,i,"application/json");return tq.PollVoteResponse?.(s.body),{...s.body,metadata:s.metadata}}async deletePollVote(e){let t={user_id:e?.user_id},i={activity_id:e?.activity_id,poll_id:e?.poll_id,vote_id:e?.vote_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/activities/{activity_id}/polls/{poll_id}/vote/{vote_id}",i,t);return tq.PollVoteResponse?.(s.body),{...s.body,metadata:s.metadata}}async addActivityReaction(e){let t={activity_id:e?.activity_id},i={type:e?.type,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enforce_unique:e?.enforce_unique,skip_push:e?.skip_push,custom:e?.custom},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{activity_id}/reactions",t,void 0,i,"application/json");return tq.AddReactionResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryActivityReactions(e){let t={activity_id:e?.activity_id},i={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{activity_id}/reactions/query",t,void 0,i,"application/json");return tq.QueryActivityReactionsResponse?.(s.body),{...s.body,metadata:s.metadata}}async deleteActivityReaction(e){let t={delete_notification_activity:e?.delete_notification_activity},i={activity_id:e?.activity_id,type:e?.type},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/activities/{activity_id}/reactions/{type}",i,t);return tq.DeleteActivityReactionResponse?.(s.body),{...s.body,metadata:s.metadata}}async deleteActivity(e){let t={hard_delete:e?.hard_delete,delete_notification_activity:e?.delete_notification_activity},i={id:e?.id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/activities/{id}",i,t);return tq.DeleteActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async getActivity(e){let t={comment_sort:e?.comment_sort,comment_limit:e?.comment_limit},i={id:e?.id},s=await this.apiClient.sendRequest("GET","/api/v2/feeds/activities/{id}",i,t);return tq.GetActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateActivityPartial(e){let t={id:e?.id},i={copy_custom_to_notification:e?.copy_custom_to_notification,enrich_own_fields:e?.enrich_own_fields,handle_mention_notifications:e?.handle_mention_notifications,run_activity_processors:e?.run_activity_processors,unset:e?.unset,set:e?.set},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/activities/{id}",t,void 0,i,"application/json");return tq.UpdateActivityPartialResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateActivity(e){let t={id:e?.id},i={copy_custom_to_notification:e?.copy_custom_to_notification,enrich_own_fields:e?.enrich_own_fields,expires_at:e?.expires_at,handle_mention_notifications:e?.handle_mention_notifications,poll_id:e?.poll_id,restrict_replies:e?.restrict_replies,run_activity_processors:e?.run_activity_processors,skip_enrich_url:e?.skip_enrich_url,text:e?.text,visibility:e?.visibility,visibility_tag:e?.visibility_tag,attachments:e?.attachments,collection_refs:e?.collection_refs,feeds:e?.feeds,filter_tags:e?.filter_tags,interest_tags:e?.interest_tags,mentioned_user_ids:e?.mentioned_user_ids,custom:e?.custom,location:e?.location,search_data:e?.search_data},s=await this.apiClient.sendRequest("PUT","/api/v2/feeds/activities/{id}",t,void 0,i,"application/json");return tq.UpdateActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async restoreActivity(e){let t={enrich_own_fields:e?.enrich_own_fields},i={id:e?.id},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/activities/{id}/restore",i,t,{},"application/json");return tq.RestoreActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryBookmarkFolders(e){let t={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/bookmark_folders/query",void 0,void 0,t,"application/json");return tq.QueryBookmarkFoldersResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteBookmarkFolder(e){let t={folder_id:e?.folder_id},i=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/bookmark_folders/{folder_id}",t,void 0);return tq.DeleteBookmarkFolderResponse?.(i.body),{...i.body,metadata:i.metadata}}async updateBookmarkFolder(e){let t={folder_id:e?.folder_id},i={name:e?.name,custom:e?.custom},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/bookmark_folders/{folder_id}",t,void 0,i,"application/json");return tq.UpdateBookmarkFolderResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryBookmarks(e){let t={enrich_own_fields:e?.enrich_own_fields,limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/bookmarks/query",void 0,void 0,t,"application/json");return tq.QueryBookmarksResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteCollections(e){let t={collection_refs:e?.collection_refs},i=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/collections",void 0,t);return tq.DeleteCollectionsResponse?.(i.body),{...i.body,metadata:i.metadata}}async readCollections(e){let t={collection_refs:e?.collection_refs},i=await this.apiClient.sendRequest("GET","/api/v2/feeds/collections",void 0,t);return tq.ReadCollectionsResponse?.(i.body),{...i.body,metadata:i.metadata}}async updateCollections(e){let t={collections:e?.collections},i=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/collections",void 0,void 0,t,"application/json");return tq.UpdateCollectionsResponse?.(i.body),{...i.body,metadata:i.metadata}}async createCollections(e){let t={collections:e?.collections},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/collections",void 0,void 0,t,"application/json");return tq.CreateCollectionsResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryCollections(e){let t={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/collections/query",void 0,void 0,t,"application/json");return tq.QueryCollectionsResponse?.(i.body),{...i.body,metadata:i.metadata}}async getComments(e){let t={object_id:e?.object_id,object_type:e?.object_type,depth:e?.depth,sort:e?.sort,replies_limit:e?.replies_limit,id_around:e?.id_around,limit:e?.limit,prev:e?.prev,next:e?.next},i=await this.apiClient.sendRequest("GET","/api/v2/feeds/comments",void 0,t);return tq.GetCommentsResponse?.(i.body),{...i.body,metadata:i.metadata}}async addComment(e){let t={comment:e?.comment,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,id:e?.id,object_id:e?.object_id,object_type:e?.object_type,parent_id:e?.parent_id,skip_enrich_url:e?.skip_enrich_url,skip_push:e?.skip_push,attachments:e?.attachments,mentioned_user_ids:e?.mentioned_user_ids,custom:e?.custom},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments",void 0,void 0,t,"application/json");return tq.AddCommentResponse?.(i.body),{...i.body,metadata:i.metadata}}async addCommentsBatch(e){let t={comments:e?.comments},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/batch",void 0,void 0,t,"application/json");return tq.AddCommentsBatchResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryComments(e){let t={filter:e?.filter,id_around:e?.id_around,limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/query",void 0,void 0,t,"application/json");return tq.QueryCommentsResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteCommentBookmark(e){let t={folder_id:e?.folder_id},i={comment_id:e?.comment_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/comments/{comment_id}/bookmarks",i,t);return tq.DeleteCommentBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateCommentBookmark(e){let t={comment_id:e?.comment_id},i={folder_id:e?.folder_id,new_folder_id:e?.new_folder_id,custom:e?.custom,new_folder:e?.new_folder},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/comments/{comment_id}/bookmarks",t,void 0,i,"application/json");return tq.UpdateCommentBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async addCommentBookmark(e){let t={comment_id:e?.comment_id},i={folder_id:e?.folder_id,custom:e?.custom,new_folder:e?.new_folder},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/{comment_id}/bookmarks",t,void 0,i,"application/json");return tq.AddCommentBookmarkResponse?.(s.body),{...s.body,metadata:s.metadata}}async deleteComment(e){let t={hard_delete:e?.hard_delete,delete_notification_activity:e?.delete_notification_activity},i={id:e?.id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/comments/{id}",i,t);return tq.DeleteCommentResponse?.(s.body),{...s.body,metadata:s.metadata}}async getComment(e){let t={id:e?.id},i=await this.apiClient.sendRequest("GET","/api/v2/feeds/comments/{id}",t,void 0);return tq.GetCommentResponse?.(i.body),{...i.body,metadata:i.metadata}}async updateComment(e){let t={id:e?.id},i={comment:e?.comment,copy_custom_to_notification:e?.copy_custom_to_notification,handle_mention_notifications:e?.handle_mention_notifications,skip_enrich_url:e?.skip_enrich_url,skip_push:e?.skip_push,attachments:e?.attachments,mentioned_user_ids:e?.mentioned_user_ids,custom:e?.custom},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/comments/{id}",t,void 0,i,"application/json");return tq.UpdateCommentResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateCommentPartial(e){let t={id:e?.id},i={copy_custom_to_notification:e?.copy_custom_to_notification,handle_mention_notifications:e?.handle_mention_notifications,skip_enrich_url:e?.skip_enrich_url,skip_push:e?.skip_push,unset:e?.unset,set:e?.set},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/{id}/partial",t,void 0,i,"application/json");return tq.UpdateCommentPartialResponse?.(s.body),{...s.body,metadata:s.metadata}}async addCommentReaction(e){let t={id:e?.id},i={type:e?.type,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enforce_unique:e?.enforce_unique,skip_push:e?.skip_push,custom:e?.custom},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/{id}/reactions",t,void 0,i,"application/json");return tq.AddCommentReactionResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryCommentReactions(e){let t={id:e?.id},i={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/{id}/reactions/query",t,void 0,i,"application/json");return tq.QueryCommentReactionsResponse?.(s.body),{...s.body,metadata:s.metadata}}async deleteCommentReaction(e){let t={delete_notification_activity:e?.delete_notification_activity},i={id:e?.id,type:e?.type},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/comments/{id}/reactions/{type}",i,t);return tq.DeleteCommentReactionResponse?.(s.body),{...s.body,metadata:s.metadata}}async getCommentReplies(e){let t={depth:e?.depth,sort:e?.sort,replies_limit:e?.replies_limit,id_around:e?.id_around,limit:e?.limit,prev:e?.prev,next:e?.next},i={id:e?.id},s=await this.apiClient.sendRequest("GET","/api/v2/feeds/comments/{id}/replies",i,t);return tq.GetCommentRepliesResponse?.(s.body),{...s.body,metadata:s.metadata}}async restoreComment(e){let t={id:e?.id},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/comments/{id}/restore",t,void 0,{},"application/json");return tq.RestoreCommentResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteFeed(e){let t={
1hard_delete:e?.hard_delete,purge_user_activities:e?.purge_user_activities},i={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",i,t);return tq.DeleteFeedResponse?.(s.body),{...s.body,metadata:s.metadata}}async getOrCreateFeed(e){let t={connection_id:e?.connection_id},i={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},s={id_around:e?.id_around,limit:e?.limit,next:e?.next,overwrite_interest_weights:e?.overwrite_interest_weights,prev:e?.prev,view:e?.view,watch:e?.watch,data:e?.data,enrichment_options:e?.enrichment_options,external_ranking:e?.external_ranking,filter:e?.filter,followers_pagination:e?.followers_pagination,following_pagination:e?.following_pagination,friend_reactions_options:e?.friend_reactions_options,interest_weights:e?.interest_weights,member_pagination:e?.member_pagination},n=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",i,t,s,"application/json");return tq.GetOrCreateFeedResponse?.(n.body),{...n.body,metadata:n.metadata}}async updateFeed(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={clear_location:e?.clear_location,description:e?.description,enrich_own_fields:e?.enrich_own_fields,name:e?.name,filter_tags:e?.filter_tags,custom:e?.custom,location:e?.location},s=await this.apiClient.sendRequest("PUT","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}",t,void 0,i,"application/json");return tq.UpdateFeedResponse?.(s.body),{...s.body,metadata:s.metadata}}async markActivity(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={mark_all_read:e?.mark_all_read,mark_all_seen:e?.mark_all_seen,mark_read:e?.mark_read,mark_seen:e?.mark_seen,mark_watched:e?.mark_watched},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/mark/batch",t,void 0,i,"application/json");return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async unpinActivity(e){let t={enrich_own_fields:e?.enrich_own_fields},i={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id,activity_id:e?.activity_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin",i,t);return tq.UnpinActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async pinActivity(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id,activity_id:e?.activity_id},i={enrich_own_fields:e?.enrich_own_fields},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/activities/{activity_id}/pin",t,void 0,i,"application/json");return tq.PinActivityResponse?.(s.body),{...s.body,metadata:s.metadata}}async changeFeedVisibility(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={visibility:e?.visibility,pending_follows_action:e?.pending_follows_action},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/change_visibility",t,void 0,i,"application/json");return tq.ChangeFeedVisibilityResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateFeedMembers(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={operation:e?.operation,limit:e?.limit,next:e?.next,prev:e?.prev,members:e?.members},s=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members",t,void 0,i,"application/json");return tq.UpdateFeedMembersResponse?.(s.body),{...s.body,metadata:s.metadata}}async acceptFeedMemberInvite(e){let t={feed_id:e?.feed_id,feed_group_id:e?.feed_group_id},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/accept",t,void 0,{},"application/json");return tq.AcceptFeedMemberInviteResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryFeedMembers(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/query",t,void 0,i,"application/json");return tq.QueryFeedMembersResponse?.(s.body),{...s.body,metadata:s.metadata}}async rejectFeedMemberInvite(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/members/reject",t,void 0,{},"application/json");return tq.RejectFeedMemberInviteResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryPinnedActivities(e){let t={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},i={enrich_own_fields:e?.enrich_own_fields,limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/pinned_activities/query",t,void 0,i,"application/json");return tq.QueryPinnedActivitiesResponse?.(s.body),{...s.body,metadata:s.metadata}}async stopWatchingFeed(e){let t={connection_id:e?.connection_id},i={feed_group_id:e?.feed_group_id,feed_id:e?.feed_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/feed_groups/{feed_group_id}/feeds/{feed_id}/watch",i,t);return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async getFollowSuggestions(e){let t={limit:e?.limit},i={feed_group_id:e?.feed_group_id},s=await this.apiClient.sendRequest("GET","/api/v2/feeds/feed_groups/{feed_group_id}/follow_suggestions",i,t);return tq.GetFollowSuggestionsResponse?.(s.body),{...s.body,metadata:s.metadata}}async createFeedsBatch(e){let t={feeds:e?.feeds,enrich_own_fields:e?.enrich_own_fields},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/feeds/batch",void 0,void 0,t,"application/json");return tq.CreateFeedsBatchResponse?.(i.body),{...i.body,metadata:i.metadata}}async ownBatch(e){let t={connection_id:e?.connection_id},i={feeds:e?.feeds,fields:e?.fields},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feeds/own/batch",void 0,t,i,"application/json");return tq.OwnBatchResponse?.(s.body),{...s.body,metadata:s.metadata}}async _queryFeeds(e){let t={connection_id:e?.connection_id},i={enrich_own_fields:e?.enrich_own_fields,limit:e?.limit,next:e?.next,prev:e?.prev,watch:e?.wat
1ch,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/feeds/feeds/query",void 0,t,i,"application/json");return tq.QueryFeedsResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateFollow(e){let t={source:e?.source,target:e?.target,activity_copy_limit:e?.activity_copy_limit,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enrich_own_fields:e?.enrich_own_fields,follower_role:e?.follower_role,push_preference:e?.push_preference,skip_push:e?.skip_push,custom:e?.custom},i=await this.apiClient.sendRequest("PATCH","/api/v2/feeds/follows",void 0,void 0,t,"application/json");return tq.UpdateFollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async follow(e){let t={source:e?.source,target:e?.target,activity_copy_limit:e?.activity_copy_limit,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enrich_own_fields:e?.enrich_own_fields,push_preference:e?.push_preference,skip_push:e?.skip_push,custom:e?.custom},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows",void 0,void 0,t,"application/json");return tq.SingleFollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async acceptFollow(e){let t={source:e?.source,target:e?.target,follower_role:e?.follower_role},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/accept",void 0,void 0,t,"application/json");return tq.AcceptFollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async followBatch(e){let t={follows:e?.follows,enrich_own_fields:e?.enrich_own_fields},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/batch",void 0,void 0,t,"application/json");return tq.FollowBatchResponse?.(i.body),{...i.body,metadata:i.metadata}}async getOrCreateFollows(e){let t={follows:e?.follows,enrich_own_fields:e?.enrich_own_fields},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/batch/upsert",void 0,void 0,t,"application/json");return tq.FollowBatchResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryFollows(e){let t={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/query",void 0,void 0,t,"application/json");return tq.QueryFollowsResponse?.(i.body),{...i.body,metadata:i.metadata}}async rejectFollow(e){let t={source:e?.source,target:e?.target},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/reject",void 0,void 0,t,"application/json");return tq.RejectFollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async getOrCreateFollow(e){let t={source:e?.source,target:e?.target,activity_copy_limit:e?.activity_copy_limit,copy_custom_to_notification:e?.copy_custom_to_notification,create_notification_activity:e?.create_notification_activity,enrich_own_fields:e?.enrich_own_fields,push_preference:e?.push_preference,skip_push:e?.skip_push,custom:e?.custom},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/follows/upsert",void 0,void 0,t,"application/json");return tq.GetOrCreateFollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async unfollow(e){let t={delete_notification_activity:e?.delete_notification_activity,keep_history:e?.keep_history,enrich_own_fields:e?.enrich_own_fields},i={source:e?.source,target:e?.target},s=await this.apiClient.sendRequest("DELETE","/api/v2/feeds/follows/{source}/{target}",i,t);return tq.UnfollowResponse?.(s.body),{...s.body,metadata:s.metadata}}async getOrCreateUnfollows(e){let t={follows:e?.follows,delete_notification_activity:e?.delete_notification_activity,enrich_own_fields:e?.enrich_own_fields},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/unfollow/batch/upsert",void 0,void 0,t,"application/json");return tq.UnfollowBatchResponse?.(i.body),{...i.body,metadata:i.metadata}}async getOrCreateUnfollow(e){let t={source:e?.source,target:e?.target,delete_notification_activity:e?.delete_notification_activity,enrich_own_fields:e?.enrich_own_fields,keep_history:e?.keep_history},i=await this.apiClient.sendRequest("POST","/api/v2/feeds/unfollow/upsert",void 0,void 0,t,"application/json");return tq.GetOrCreateUnfollowResponse?.(i.body),{...i.body,metadata:i.metadata}}async getUserInterests(e){let t={limit:e?.limit},i={user_id:e?.user_id},s=await this.apiClient.sendRequest("GET","/api/v2/feeds/users/{user_id}/interests",i,t);return tq.GetUserInterestsResponse?.(s.body),{...s.body,metadata:s.metadata}}async createGuest(e){let t={user:e?.user},i=await this.apiClient.sendRequest("POST","/api/v2/guest",void 0,void 0,t,"application/json");return tq.CreateGuestResponse?.(i.body),{...i.body,metadata:i.metadata}}async longPoll(e){let t={connection_id:e?.connection_id,json:e?.json},i=await this.apiClient.sendRequest("GET","/api/v2/longpoll",void 0,t);return tq["{}"]?.(i.body),{...i.body,metadata:i.metadata}}async getOG(e){let t={url:e?.url},i=await this.apiClient.sendRequest("GET","/api/v2/og",void 0,t);return tq.GetOGResponse?.(i.body),{...i.body,metadata:i.metadata}}
1async createPoll(e){let t={name:e?.name,allow_answers:e?.allow_answers,allow_user_suggested_options:e?.allow_user_suggested_options,description:e?.description,enforce_unique_vote:e?.enforce_unique_vote,id:e?.id,is_closed:e?.is_closed,max_votes_allowed:e?.max_votes_allowed,voting_visibility:e?.voting_visibility,options:e?.options,custom:e?.custom},i=await this.apiClient.sendRequest("POST","/api/v2/polls",void 0,void 0,t,"application/json");return tq.PollResponse?.(i.body),{...i.body,metadata:i.metadata}}async updatePoll(e){let t={id:e?.id,name:e?.name,allow_answers:e?.allow_answers,allow_user_suggested_options:e?.allow_user_suggested_options,description:e?.description,enforce_unique_vote:e?.enforce_unique_vote,is_closed:e?.is_closed,max_votes_allowed:e?.max_votes_allowed,voting_visibility:e?.voting_visibility,options:e?.options,custom:e?.custom},i=await this.apiClient.sendRequest("PUT","/api/v2/polls",void 0,void 0,t,"application/json");return tq.PollResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryPolls(e){let t={user_id:e?.user_id},i={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},s=await this.apiClient.sendRequest("POST","/api/v2/polls/query",void 0,t,i,"application/json");return tq.QueryPollsResponse?.(s.body),{...s.body,metadata:s.metadata}}async deletePoll(e){let t={user_id:e?.user_id},i={poll_id:e?.poll_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/polls/{poll_id}",i,t);return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async getPoll(e){let t={user_id:e?.user_id},i={poll_id:e?.poll_id},s=await this.apiClient.sendRequest("GET","/api/v2/polls/{poll_id}",i,t);return tq.PollResponse?.(s.body),{...s.body,metadata:s.metadata}}async updatePollPartial(e){let t={poll_id:e?.poll_id},i={unset:e?.unset,set:e?.set},s=await this.apiClient.sendRequest("PATCH","/api/v2/polls/{poll_id}",t,void 0,i,"application/json");return tq.PollResponse?.(s.body),{...s.body,metadata:s.metadata}}async createPollOption(e){let t={poll_id:e?.poll_id},i={text:e?.text,custom:e?.custom},s=await this.apiClient.sendRequest("POST","/api/v2/polls/{poll_id}/options",t,void 0,i,"application/json");return tq.PollOptionResponse?.(s.body),{...s.body,metadata:s.metadata}}async updatePollOption(e){let t={poll_id:e?.poll_id},i={id:e?.id,text:e?.text,custom:e?.custom},s=await this.apiClient.sendRequest("PUT","/api/v2/polls/{poll_id}/options",t,void 0,i,"application/json");return tq.PollOptionResponse?.(s.body),{...s.body,metadata:s.metadata}}async deletePollOption(e){let t={user_id:e?.user_id},i={poll_id:e?.poll_id,option_id:e?.option_id},s=await this.apiClient.sendRequest("DELETE","/api/v2/polls/{poll_id}/options/{option_id}",i,t);return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async getPollOption(e){let t={user_id:e?.user_id},i={poll_id:e?.poll_id,option_id:e?.option_id},s=await this.apiClient.sendRequest("GET","/api/v2/polls/{poll_id}/options/{option_id}",i,t);return tq.PollOptionResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryPollVotes(e){let t={user_id:e?.user_id},i={poll_id:e?.poll_id},s={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},n=await this.apiClient.sendRequest("POST","/api/v2/polls/{poll_id}/votes",i,t,s,"application/json");return tq.PollVotesResponse?.(n.body),{...n.body,metadata:n.metadata}}async updatePushNotificationPreferences(e){let t={preferences:e?.preferences},i=await this.apiClient.sendRequest("POST","/api/v2/push_preferences",void 0,void 0,t,"application/json");return tq.UpsertPushPreferencesResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteFile(e){let t={url:e?.url},i=await this.apiClient.sendRequest("DELETE","/api/v2/uploads/file",void 0,t);return tq.Response?.(i.body),{...i.body,metadata:i.metadata}}async uploadFile(e){let t={file:e?.file,user:e?.user},i=await this.apiClient.sendRequest("POST","/api/v2/uploads/file",void 0,void 0,t,"multipart/form-data");return tq.FileUploadResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteImage(e){let t={url:e?.url},i=await this.apiClient.sendRequest("DELETE","/api/v2/uploads/image",void 0,t);return tq.Response?.(i.body),{...i.body,metadata:i.metadata}}async uploadImage(e){let t={file:e?.file,upload_sizes:e?.upload_sizes,user:e?.user},i=await this.apiClient.sendRequest("POST","/api/v2/uploads/image",void 0,void 0,t,"multipart/form-data");return tq.ImageUploadResponse?.(i.body),{...i.body,metadata:i.metadata}}async listUserGroups(e){let t={limit:e?.limit,id_gt:e?.id_gt,created_at_gt:e?.created_at_gt,team_id:e?.team_id},i=await this.apiClient.sendRequest("GET","/api/v2/usergroups",void 0,t);return tq.ListUserGroupsResponse?.(i.body),{...i.body,metadata:i.metadata}}async createUserGroup(e){let t={name:e?.name,description:e?.description,id:e?.id,team_id:e?.team_id,member_ids:e?.member_ids},i=await this.apiClient.sendRequest("POST","/api/v2/usergroups",void 0,void 0,t,"application/json");return tq.CreateUserGroupResponse?.(i.body),{...i.body,metadata:i.metadata}}async searchUserGroups(e){let t={query:e?.query,limit:e?.limit,name_gt:e?.name_gt,id_gt:e?.id_gt,team_id:e?.team_id},i=await this.apiClient.sendRequest("GET","/api/v2/usergroups/search",void 0,t);return tq.SearchUserGroupsResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteUserGroup(e){let t={team_id:e?.team_id},i={id:e?.id},s=await this.apiClient.sendRequest("DELETE","/api/v2/usergroups/{id}",i,t);return tq.Response?.(s.body),{...s.body,metadata:s.metadata}}async getUserGroup(e){let t={team_id:e?.team_id},i={id:e?.id},s=await this.apiClient.sendRequest("GET","/api/v2/usergroups/{id}",i,t);return tq.GetUserGroupResponse?.(s.body),{...s.body,metadata:s.metadata}}async updateUserGroup(e){let t={id:e?.id},i={description:e?.description,name:e?.name,team_id:e?.team_id},s=await this.apiClient.sendRequest("PUT","/api/v2/usergroups/{id}",t,void 0,i,"application/json");return tq.UpdateUserGroupResponse?.(s.body),{...s.body,metadata:s.metadata}}async addUserGroupMembers(e){let t={id:e?.id},i={member_ids:e?.member_ids,as_admin:e?.as_admin,team_id:e?.team_id},s=await this.apiClient.sendRequest("POST","/api/v2/usergroups/{id}/members",t,void 0,i,"application/json");return tq.AddUserGroupMembersResponse?.(s.body),{...s.body,metadata:s.metadata}}async removeUserGroupMembers(e){let t={id:e?.id},i={member_ids:e?.member_ids,team_id:e?.team_id},s=await this.apiClient.sendRequest("POST","/api/v2/usergroups/{id}/members/delete",t,void 0,i,"application/json");return tq.RemoveUserGroupMembersResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryUsers(e){let t={payload:e?.payload},i=await this.apiClient.sendRequest("GET","/api/v2/users",void 0,t);return tq.QueryUsersResponse?.(i.body),{...i.body,metadata:i.metadata}}async updateUsersPartial(e){let t={users:e?.users},i=await this.apiClient.sendRequest("PATCH","/api/v2/users",void 0,void 0,t,"application/json");return tq.UpdateUsersResponse?.(i.body),{...i.body,metadata:i.metadata}}async updateUsers(e){let t={users:e?.users},i=await this.apiClient.sendRequest("POST","/api/v2/users",void 0,void 0,t,"application/json");return tq.UpdateUsersResponse?.(i.body),{...i.body,metadata:i.metadata}}async getBlockedUsers(){let e=await this.apiClient.sendRequest("GET","/api/v2/users/block",void 0,void 0);return tq.GetBlockedUsersResponse?.(e.body),{...e.body,metadata:e.metadata}}async blockUsers(e){let t={blocked_user_id:e?.blocked_user_id},i=await this.apiClient.sendRequest("POST","/api/v2/users/block",void 0,void 0,t,"application/json");return tq.BlockUsersResponse?.(i.body),{...i.body,metadata:i.metadata}}async getUserLiveLocations(){let e=await this.apiClient.sendRequest("GET","/api/v2/users/live_locations",void 0,void 0);return tq.SharedLocationsResponse?.(e.body),{...e.body,metadata:e.metadata}}async updateLiveLocation(e){let t={message_id:e?.message_id,end_at:e?.end_at,latitude:e?.latitude,longitude:e?.longitude},i=await this.apiClient.sendRequest("PUT","/api/v2/users/live_locations",void 0,void 0,t,"application/json");return tq.SharedLocationResponse?.(i.body),{...i.body,metadata:i.metadata}}async unblockUsers(e){let t={blocked_user_id:e?.blocked_user_id},i=await this.apiClient.sendRequest("POST","/api/v2/users/unblock",void 0,void 0,t,"application/json");return tq.UnblockUsersResponse?.(i.body),{...i.body,metadata:i.metadata}}},tN=(a=new Map([["default",R]]),o=new Map([["default",S]]),{getLogger:r=(e,t={})=>
1{let i=(t.tags??[]).filter(Boolean).join(","),s=t=>(s,...n)=>{let r=o.get(e)??o.get("default");_[t]>=_[r]&&(a.get(e)??a.get("default"))(t,`[${e}]${i.length?`(${i})`:""}: ${s}`,...n)};return{withExtraTags:(...i)=>r(e,{...t,tags:t.tags?t.tags.concat(i):i}),getLogLevel:()=>o.get(e)??o.get("default"),...{error:s("error"),trace:s("trace"),debug:s("debug"),info:s("info"),warn:s("warn")}}},configureLoggers:e=>{for(let t in e){let i=e[t];i.sink?a.set(t,i.sink):null===i.sink&&"default"!==t&&a.delete(t),i.level?o.set(t,i.level):null===i.level&&"default"!==t&&o.delete(t)}},restoreDefaults:()=>{a.clear(),o.clear(),a.set("default",R),o.set("default",S)}}),tM=e=>new Promise(t=>setTimeout(t,e));function tL(e){let t=Math.min(500+2e3*e,5e3),i=Math.min(Math.max(250,(e-1)*2e3),5e3);return Math.floor(Math.random()*(t-i)+i)}function tG(){let e,t=(t$(e=new Uint8Array(16)),e);return t[6]=15&t[6]|64,t[8]=191&t[8]|128,tV(t.subarray(0,4))+"-"+tV(t.subarray(4,6))+"-"+tV(t.subarray(6,8))+"-"+tV(t.subarray(8,10))+"-"+tV(t.subarray(10,16))}function tV(e){let t="";for(let i=0;i<e.length;i++)t+=e[i].toString(16).padStart(2,"0");return t}var t$="u">typeof crypto&&void 0!==crypto?.getRandomValues?crypto.getRandomValues.bind(crypto):"u">typeof msCrypto?msCrypto.getRandomValues.bind(msCrypto):function(e){let t=Math.pow(2,8*e.byteLength/e.length);for(let i=0;i<e.length;i++)e[i]=Math.random()*t};function tQ(e){"u">typeof window&&window.addEventListener&&(window.addEventListener("offline",e),window.addEventListener("online",e))}function tW(e){"u">typeof window&&window.removeEventListener&&(window.removeEventListener("offline",e),window.removeEventListener("online",e))}var tH=class{constructor(){this._isAnonymous=!1,this.logger=tN.getLogger("token-manager"),this.setTokenOrProvider=e=>{var t;void 0===e?(this._isAnonymous=!0,e=""):this._isAnonymous=!1,(t=e)&&("[object Function]"===Object.prototype.toString.call(t)||"function"==typeof t||t instanceof Function)&&(this.tokenProvider=e,this.type="provider"),"string"==typeof e&&(this.token=e,this.type="static")},this.reset=()=>{this._isAnonymous=!1,this.token=void 0,this.tokenProvider=void 0,this.loadTokenPromise=null},this.loadToken=()=>(this.logger.info("Loading a new token"),this.loadTokenPromise||(this.loadTokenPromise=new Promise(async(e,t)=>{if("static"===this.type)return this.loadTokenPromise=null,e(this.token);if(this.tokenProvider&&"string"!=typeof this.tokenProvider){this.token=void 0;let i=this.tokenProvider,s=async(n=0)=>{try{this.token=await i()}catch(i){let e=++n;if(await tM(1e3),3===e)return this.loadTokenPromise=null,t(Error(`Stream error: tried to get token ${e} times, but it failed with ${i}. Check your token provider`,{cause:i}));return await s(e)}this.loadTokenPromise=null,e(this.token)};return await s()}})),this.loadTokenPromise),this.getToken=()=>{if(this._isAnonymous)return"";if(this.token)return this.token;if(this.tokenProvider)if(this.loadTokenPromise)return this.loadTokenPromise;else return this.loadToken();throw Error("Can't get token because token provider isn't set")},this.isStatic=()=>"static"===this.type,this.loadTokenPromise=null,this.type="static"}get isAnonymous(){return this._isAnonymous}},tz=class{constructor(){this.reset=()=>{this.loadConnectionIdPromise=void 0,this.resolve=void 0,this.reject=void 0,this.connectionId=void 0},this.resetConnectionIdPromise=()=>{this.connectionId=void 0,this.loadConnectionIdPromise=new Promise((e,t)=>{this.resolve=e,this.reject=t})},this.resolveConnectionidPromise=e=>{this.connectionId=e,this.resolve?.(e),this.loadConnectionIdPromise=void 0,this.resolve=void 0,this.reject=void 0},this.rejectConnectionIdPromise=e=>{this.connectionId=void 0,this.reject?.(e),this.loadConnectionIdPromise=void 0,this.resolve=void 0,this.reject=void 0},this.getConnectionId=()=>{if(this.connectionId)return this.connectionId;if(this.loadConnectionIdPromise)return this.loadConnectionIdPromise;throw Error('No connection id was provided when trying to query with presence/watch. You should call "connectUser" to get a WebSocket connection id')}}},tJ=class{constructor(){this.subscribers={},this.logger=tN.getLogger("event-dispatcher"),this.dispatch=e=>{for(let t of[...this.subscribers[e.type]??[],...this.subscribers.all??[]])try{t(e)}catch(e){this.logger.error("Listener failed with error",e)}},this.on=(e,t)=>{var i;return((i=this.subscribers)[e]??(i[e]=[])).push(t),()=>{this.off(e,t)}},this.off=(e,t)=>{this.subscribers[e]=(this.subscribers[e]??[]).filter(e=>e!==t)},this.offAll=e=>{e?this.subscribers[e]=[]:this.subscribers={}}}},tK=class{constructor(e,t,i,s=[]){this.config=e,this.tokenManager=t,this.connectionIdManager=i,this.decoders=s,this.dispatcher=new tJ,this.logger=tN.getLogger("stable-ws-connection"),this.on=this.dispatcher.on,this.off=this.dispatcher.off,this.offAll=this.dispatcher.offAll,this.onlineStatusChanged=e=>{let t=this.logger.withExtraTags("onlineStatusChanged");"offline"===e.type?(t.debug("Status changing to offline"),this._setHealth(!1,!0)):"online"===e.type&&(t.debug(`Status changing to online. isHealthy: ${this.isHealthy}`),this.isHealthy||this._reconnect({interval:10}))},this.onopen=async e=>{let t=this.logger.withExtraTags("onopen");if(this.wsID!==e)return;let i=this.config.user;if(!i)return void t.warn("User not set, can't connect to WS");let s=await this.tokenManager.getToken();if(!s&&!this.tokenManager.isAnonymous)return void t.warn("Token not set, can't connect authenticate");let n={token:s,user_details:{id:i.id,name:i.name,image:i.image,custom:i.custom},products:["feeds"]};this.authenticationSent=!0,this.ws?.send(JSON.stringify(n)),t.debug("onopen callback",{wsID:e})},this.onmessage=(e,t)=>
1{let i=this.logger.withExtraTags("onmessage");if(this.wsID!==e)return;i.debug("onmessage callback",{event:{...t,data:JSON.parse(t.data)},wsID:e});let s="string"==typeof t.data?JSON.parse(t.data):null;if(this.decoders.forEach(e=>{s=e(s)}),!this.isResolved&&s&&"connection.error"===s.type&&(this.isResolved=!0,s.error))return void this.rejectPromise?.(this._errorFromWSEvent(s,!1));if(this.lastEvent=new Date,s&&("health.check"===s.type||"connection.ok"===s.type)&&this.scheduleNextPing(),s&&"connection.ok"===s.type&&(this.resolvePromise?.(s),this.connectionID=s.connection_id,this._setHealth(!0)),s&&"connection.error"===s.type&&s.error){let{code:e}=s.error;this.isHealthy=!1,this.isConnecting=!1,this.consecutiveFailures+=1,40!==e||this.tokenManager.isStatic()||(clearTimeout(this.connectionCheckTimeoutRef),i.debug("WS failure due to expired token, so going to try to reload token and reconnect"),this._reconnect({refreshToken:!0}))}s&&(s.received_at=new Date,this.dispatcher.dispatch(s)),this.scheduleConnectionCheck()},this.onclose=(e,t)=>{let i=this.logger.withExtraTags("onclose");this.wsID===e&&(i.debug("onclose callback - "+t.code,{event:t,wsID:e}),1e3===t.code?(this.rejectPromise?.(this._errorFromWSEvent(t)),i.debug(`WS connection reject with error ${t.reason}`,{event:t})):(this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this.rejectPromise?.(this._errorFromWSEvent(t)),i.debug("WS connection closed. Calling reconnect ...",{event:t}),this._reconnect()))},this.onerror=(e,t)=>{this.wsID===e&&(this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this.rejectPromise?.(this._errorFromWSEvent(t)),this.logger.withExtraTags("onerror").debug("WS connection resulted into error",{event:t}),this._reconnect())},this._setHealth=(e,t=!1)=>{if(e!==this.isHealthy){if(this.isHealthy=e,this.isHealthy||t)return void this.dispatchConnectionChanged();setTimeout(()=>{this.isHealthy||this.dispatchConnectionChanged()},5e3)}},this.dispatchConnectionChanged=()=>{if(this.isHealthy)if(this.connectionID)this.connectionIdManager?.resolveConnectionidPromise(this.connectionID);else throw Error("Stream error: WebSocket connection is healthy, but connection id isn't set");else this.connectionIdManager.loadConnectionIdPromise&&this.connectionIdManager.rejectConnectionIdPromise(Error("Stream error: Failed to get WebSocket connection id because WebSocket connection failed")),this.connectionIdManager.reset();this.dispatcher.dispatch({type:"connection.changed",online:this.isHealthy})},this._errorFromWSEvent=(e,t=!0)=>{let i,s,n;void 0!==e.code&&(i=e.code,s="unknown",n=e.reason),void 0!==e.error&&(i=e.error.code,s=e.error.StatusCode,n=e.error.message),this.logger.withExtraTags("_errorFromWSEvent").debug(`WS failed with code ${i}`,{event:e});let a=Error(`WS failed with code ${i} and reason - ${n}`);return a.code=i,a.StatusCode=s,a.isWSFailure=t,a},this._setupConnectionPromise=()=>{this.isResolved=!1,this.connectionOpen=new Promise((e,t)=>{this.resolvePromise=e,this.rejectPromise=t})},this.scheduleNextPing=()=>{this.healthCheckTimeoutRef&&clearTimeout(this.healthCheckTimeoutRef),this.healthCheckTimeoutRef=setTimeout(()=>{let e=[{type:"health.check",client_id:this.clientId}];try{this.ws?.send(JSON.stringify(e))}catch(e){}},this.pingInterval)},this.scheduleConnectionCheck=()=>{this.connectionCheckTimeoutRef&&clearTimeout(this.connectionCheckTimeoutRef),this.connectionCheckTimeoutRef=setTimeout(()=>{let e=new Date;this.lastEvent&&e.getTime()-this.lastEvent.getTime()>this.connectionCheckTimeout&&(this.logger.withExtraTags("scheduleConnectionCheck").debug("going to reconnect"),this._setHealth(!1),this._reconnect())},this.connectionCheckTimeout)},this.consecutiveFailures=0,this.totalFailures=0,this.isConnecting=!1,this.authenticationSent=!1,this.isDisconnected=!1,this.isResolved=!1,this.isHealthy=!1,this.wsID=1,this.lastEvent=null,this.pingInterval=25e3,this.connectionCheckTimeout=this.pingInterval+1e4,this.clientId=`${e.user.id}-${tG()}`,tQ(this.onlineStatusChanged)}async connect(e=15e3){let t=this.logger.withExtraTags("connect");
1if(this.isConnecting)throw Error("You've called connect twice, can only attempt 1 connection at the time");this.isDisconnected=!1,this.connectionIdManager.loadConnectionIdPromise||this.connectionIdManager.resetConnectionIdPromise();try{let e=await this._connect();this.consecutiveFailures=0,t.debug("Established ws connection with healthcheck",e)}catch(e){if(this.isHealthy=!1,this.consecutiveFailures+=1,void 0!==e.isWSFailure||void 0!==e.code||void 0!==e.StatusCode)if(40!==e.code||this.tokenManager.isStatic()){if(!e.isWSFailure)throw Error(JSON.stringify({code:e.code,StatusCode:e.StatusCode,message:e.message,isWSFailure:e.isWSFailure}))}else t.debug("WS failure due to expired token, so going to try to reload token and reconnect"),this._reconnect({refreshToken:!0});else throw e}return await this._waitForHealthy(e)}async _waitForHealthy(e=15e3){return await Promise.race([(async()=>{for(let t=0;t<=e;t+=50)try{return await this.connectionOpen}catch(i){if(t===e)throw Error(JSON.stringify({code:i.code,StatusCode:i.StatusCode,message:i.message,isWSFailure:i.isWSFailure}));await tM(50)}})(),(async()=>{throw await tM(e),this.isConnecting=!1,Error(JSON.stringify({code:"",StatusCode:"",message:"initial WS connection could not be established",isWSFailure:!0}))})()])}disconnect(e){let t,i=this.logger.withExtraTags("disconnect");i.debug(`Closing the WS connection for wsID ${this.wsID}`),this.wsID+=1,this.isConnecting=!1,this.isDisconnected=!0,this.healthCheckTimeoutRef&&clearInterval(this.healthCheckTimeoutRef),this.connectionCheckTimeoutRef&&clearInterval(this.connectionCheckTimeoutRef),tW(this.onlineStatusChanged),this.isHealthy=!1,this.ws&&(this.ws.onclose=()=>{},this.ws.onerror=()=>{},this.ws.onmessage=()=>{});let{ws:s}=this;return s?.close&&s.readyState===s.OPEN?(t=new Promise(t=>{let n=e=>{i.debug(`resolving isClosedPromise ${e?"with":"without"} close frame`,{event:e}),t()};s.onclose=n,setTimeout(n,e??1e3)}),i.debug("Manually closed connection by calling client.disconnect()"),s.close(1e3,"Manually closed connection by calling client.disconnect()")):(i.debug("WS connection doesn't exist or it is already closed."),t=Promise.resolve()),delete this.ws,t}async _connect(){let e=this.logger.withExtraTags("_connect");if(this.isConnecting)return;this.isConnecting=!0,this.requestID=tG();let t=!1;try{e.debug("waiting for token"),await this.tokenManager.getToken(),t=!0}catch(e){}try{t||(e.debug("tokenProvider failed before, so going to retry"),await this.tokenManager.loadToken()),this._setupConnectionPromise();let i=this.config.baseUrl;e.debug(`Connecting to ${i}`,{wsURL:i,requestID:this.requestID}),this.ws=new WebSocket(i),this.ws.onopen=this.onopen.bind(this,this.wsID),this.ws.onclose=this.onclose.bind(this,this.wsID),this.ws.onerror=this.onerror.bind(this,this.wsID),this.ws.onmessage=this.onmessage.bind(this,this.wsID);let s=await this.connectionOpen;if(this.isConnecting=!1,s)return s}catch(e){throw this.isConnecting=!1,e}}async _reconnect(e={}){let t=this.logger.withExtraTags("_reconnect");if(t.debug("Initiating the reconnect"),this.isConnecting||this.isHealthy)return void t.debug("Abort (1) since already connecting or healthy");let i=e.interval;if(i||(i=tL(this.consecutiveFailures)),await tM(i),this.isConnecting||this.isHealthy)return void t.debug("Abort (2) since already connecting or healthy");if(this.isDisconnected)return void t.debug("Abort (3) since disconnect() is called");t.debug("Destroying current WS connection"),this._destroyCurrentWSConnection(),e.refreshToken&&await this.tokenManager.loadToken();try{await this._connect(),this.consecutiveFailures=0}catch(e){if(this.isHealthy=!1,this.consecutiveFailures+=1,40===e.code&&!this.tokenManager.isStatic())return t.debug("WS failure due to expired token, so going to try to reload token and reconnect"),await this._reconnect({refreshToken:!0});e.isWSFailure&&(t.debug("WS failure, so going to try to reconnect"),this._reconnect())}t.debug("== END ==")}_destroyCurrentWSConnection(){this.wsID+=1;try{this.ws&&(this.ws.onclose=()=>{},this.ws.onerror=()=>{},this.ws.onmessage=()=>{},this.ws.onopen=()=>{},this.ws.close())}catch(e){}}}
1,tX=class extends Error{constructor(e,t,i,s){super(e,s),this.metadata=t,this.code=i,this.name="StreamApiError"}},tY="2.4.0",tZ=tb.default??tb,t0=class{constructor(e,t,i,s){this.apiKey=e,this.tokenManager=t,this.connectionIdManager=i,this.extraHeaderInformation={},this.logger=tN.getLogger("api-client"),this.sendRequest=async(e,t,i,s,n,a)=>{if((s=s??{}).api_key=this.apiKey,s?.watch||s?.presence||s?.payload?.watch||s?.payload?.presence||n?.watch||n?.presence){this.logger.info("Getting connection_id for watch or presence request");let e=await this.connectionIdManager.getConnectionId();e&&(s.connection_id=e)}let o=t;i&&Object.keys(i).forEach(e=>{o=o.replace(`{${e}}`,encodeURIComponent(i[e]))});let r=tG(),d=await this.tokenManager.getToken(),l={...this.commonHeaders,Authorization:d,"Content-Type":a??"application/json","x-client-request-id":r},c="multipart/form-data"===a?new FormData:n;"multipart/form-data"===a&&Object.keys(n).forEach(e=>{let t=n[e];null!=t&&c.append(e,t)});try{this.logger.debug(`Sending request ${e.toUpperCase()}:${o} with:`,{queryParams:s},{body:n});let t=await this.axiosInstance.request({url:o,method:e,headers:l,params:s,paramsSerializer:e=>this.queryParamsStringify(e),data:c,timeout:"multipart/form-data"===a?0:this.timeout}),i=this.getRequestMetadata(r,t);return{body:t.data,metadata:i}}catch(l){if(this.isAxiosError(l)){if(!l.response)throw new tX(`Stream error ${l.message}`)}else throw Error("Unknown error received during an API call",{cause:l});let a=l.response.data,o=a?.code??l.response.status,d=a?.message??l.response.statusText;if(40===o&&401===l.response.status&&!this.tokenManager.isStatic())return this.logger.info("Token expired, fetching a new one and retrying request"),await this.tokenManager.loadToken(),await this.sendRequest(e,t,i,s,n);throw new tX(`Stream error code ${o}: ${d}`,this.getRequestMetadata(r,l.response),o,void 0)}},this.queryParamsStringify=e=>{let t=[];for(let i in e){let s=e[i];Array.isArray(s)?t.push(`${i}=${encodeURIComponent(s.join(","))}`):s instanceof Date?t.push(s.toISOString()):"object"==typeof s?t.push(`${i}=${encodeURIComponent(JSON.stringify(s))}`):("string"==typeof s||"number"==typeof s||"boolean"==typeof s)&&t.push(`${i}=${encodeURIComponent(s)}`)}return t.join("&")},this.getRequestMetadata=(e,t)=>{let i=t.headers;return{client_request_id:e,response_headers:i,response_code:t.status,rate_limit:{rate_limit:i["x-ratelimit-limit"]?+i["x-ratelimit-limit"]:void 0,rate_limit_remaining:i["x-ratelimit-remaining"]?+i["x-ratelimit-remaining"]:void 0,rate_limit_reset:i["x-ratelimit-reset"]?new Date(1e3*i["x-ratelimit-reset"]):void 0}}},this.baseUrl=s?.base_url??"https://feeds.stream-io-api.com",this.timeout=s?.timeout??3e3,this.axiosInstance=tZ.create({baseURL:this.baseUrl})}get webSocketBaseUrl(){let e=new URLSearchParams;return e.set("api_key",this.apiKey),Object.keys(this.commonHeaders).forEach(t=>{e.set(t,this.commonHeaders[t])}),`${this.baseUrl.replace("http","ws").replace(":3030",":8800")}/api/v2/connect?${e.toString()}`}generateStreamClientHeader(){let e="";e=this.extraHeaderInformation.sdkIdentifier?`stream-feeds-${this.extraHeaderInformation.sdkIdentifier.name}-v${this.extraHeaderInformation.sdkIdentifier.version}-llc-v${tY}`:`stream-feeds-js-v${tY}`;let{os:t,model:i}=this.extraHeaderInformation.deviceIdentifier??{};return[["os",t],["device_model",i],["client_bundle",void 0]].reduce((e,[t,i])=>i&&i.length>0?e.concat(`|${t}=${i}`):e,e)}get commonHeaders(){return{"stream-auth-type":this.tokenManager.isAnonymous?"anonymous":"jwt","X-Stream-Client":this.generateStreamClientHeader()}}isAxiosError(e){return void 0!==e.request}},t1={"app.updated":e=>tq.AppUpdatedEvent(e),"feeds.activity.added":e=>tq.ActivityAddedEvent(e),"feeds.activity.deleted":e=>tq.ActivityDeletedEvent(e),"feeds.activity.feedback":e=>tq.ActivityFeedbackEvent(e),"feeds.activity.marked":e=>tq.ActivityMarkEvent(e),"feeds.activity.pinned":e=>tq.ActivityPinnedEvent(e),"feeds.activity.reaction.added":e=>tq.ActivityReactionAddedEvent(e),"feeds.activity.reaction.deleted":e=>tq.ActivityReactionDeletedEvent(e),"feeds.activity.reaction.updated":e=>tq.ActivityReactionUpdatedEvent(e),"feeds.activity.removed_from_feed":e=>tq.ActivityRemovedFromFeedEvent(e),"feeds.activity.restored":e=>tq.ActivityRestoredEvent(e),"feeds.activity.unpinned":e=>tq.ActivityUnpinnedEvent(e),"feeds.activity.updated":e=>tq.ActivityUpdatedEvent(e),"feeds.bookmark.added":e=>tq.BookmarkAddedEvent(e),"feeds.bookmark.deleted":e=>tq.BookmarkDeletedEvent(e),"feeds.bookmark.updated":e=>tq.BookmarkUpdatedEvent(e),"feeds.bookmark_folder.deleted":e=>tq.BookmarkFolderDeletedEvent(e),"feeds.bookmark_folder.updated":e=>tq.BookmarkFolderUpdatedEvent(e),"feeds.comment.added":e=>tq.CommentAddedEvent(e),"feeds.comment.deleted":e=>tq.CommentDeletedEvent(e),"feeds.comment.reaction.added":e=>tq.CommentReactionAddedEvent(e),"feeds.comment.reaction.deleted":e=>tq.CommentReactionDeletedEvent(e),"feeds.comment.reaction.updated":e=>tq.CommentReactionUpdatedEvent(e),"feeds.comment.restored":e=>tq.CommentRestoredEvent(e),"feeds.comment.updated":e=>tq.CommentUpdatedEvent(e),"feeds.feed.created":e=>tq.FeedCreatedEvent(e),"feeds.feed.deleted":e=>tq.FeedDeletedEvent(e),"feeds.feed.updated":e=>tq.FeedUpdatedEvent(e),"feeds.feed_group.changed":e=>tq.FeedGroupChangedEvent(e),"feeds.feed_group.deleted":e=>tq.FeedGroupDeletedEvent(e),"feeds.feed_group.restored":e=>tq.FeedGroupRestoredEvent(e),"feeds.feed_member.added":e=>tq.FeedMemberAddedEvent(e),"feeds.feed_member.removed":e=>tq.FeedMemberRemovedEvent(e),"feeds.feed_member.updated":e=>tq.FeedMemberUpdatedEvent(e),"feeds.follow.created":e=>tq.FollowCreatedEvent(e),"feeds.follow.deleted":e=>tq.FollowDeletedEvent(e),"feeds.follow.updated":e=>tq.FollowUpdatedEvent(e),"feeds.notification_feed.updated":e=>tq.NotificationFeedUpdatedEvent(e),"feeds.poll.closed":e=>tq.PollClosedFeedEvent(e),"feeds.poll.deleted":e=>tq.PollDeletedFeedEvent(e),"feeds.poll.updated":e=>tq.PollUpdatedFeedEvent(e),"feeds.poll.vote_casted":e=>tq.PollVoteCastedFeedEvent(e),"feeds.poll.vote_changed":e=>tq.PollVoteChangedFeedEvent(e),"feeds.poll.vote_removed":e=>tq.PollVoteRemovedFeedEvent(e),"feeds.stories_feed.updated":e=>tq.StoriesFeedUpdatedEvent(e),"health.check":e=>tq.HealthCheckEvent(e),"moderation.custom_action":e=>tq.ModerationCustomActionEvent(e),"moderation.flagged":e=>tq.ModerationFlaggedEvent(e),"moderation.mark_reviewed":e=>tq.ModerationMarkReviewedEvent(e),"user.banned":e=>tq.UserBannedEvent(e),"user.deactivated":e=>tq.UserDeactivatedEvent(e),"user.reactivated":e=>tq.UserReactivatedEvent(e),"user.unbanned":e=>tq.UserUnbannedEvent(e),"user.updated":e=>tq.UserUpdatedEvent(e)},t2=e=>Object.hasOwn(t1,e.type)?t1[e.type](e):e,t3=class{constructor(e){this.apiClient=e}async getActionConfig(e){let t={queue_type:e?.queue_type,entity_type:e?.entity_type,exclude_defaults:e?.exclude_defaults,only_defaults:e?.only_defaults},i=await this.apiClient.sendRequest("GET","/api/v2/moderation/action_config",void 0,t);return tq.GetActionConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async upsertActionConfig(e){let t={action:e?.action,entity_type:e?.entity_type,order:e?.order,description:e?.description,icon:e?.icon,id:e?.id,queue_type:e?.queue_type,custom:e?.custom},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/action_config",void 0,void 0,t,"application/json");return tq.UpsertActionConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async bulkUpsertActionConfig(e){let t={action_configs:e?.action_configs},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/action_config/bulk",void 0,void 0,t,"application/json");return tq.BulkUpsertActionConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async bulkDeleteActionConfig(e){let t={ids:e?.ids},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/action_config/bulk_delete",void 0,void 0,t,"application/json");return tq.BulkDeleteActionConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteActionConfig(e){let t={id:e?.id},i=await this.apiClient.sendRequest("DELETE","/api/v2/moderation/action_config/{id}",t,void 0);return tq.DeleteActionConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async appeal(e){let t={appeal_reason:e?.appeal_reason,entity_id:e?.entity_id,entity_type:e?.entity_type,attachments:e?.attachments},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/appeal",void 0,void 0,t,"application/json");
1return tq.AppealResponse?.(i.body),{...i.body,metadata:i.metadata}}async getAppeal(e){let t={id:e?.id},i=await this.apiClient.sendRequest("GET","/api/v2/moderation/appeal/{id}",t,void 0);return tq.GetAppealResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryAppeals(e){let t={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/appeals",void 0,void 0,t,"application/json");return tq.QueryAppealsResponse?.(i.body),{...i.body,metadata:i.metadata}}async ban(e){let t={target_user_id:e?.target_user_id,banned_by_id:e?.banned_by_id,channel_cid:e?.channel_cid,delete_messages:e?.delete_messages,ip_ban:e?.ip_ban,reason:e?.reason,shadow:e?.shadow,timeout:e?.timeout,banned_by:e?.banned_by},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/ban",void 0,void 0,t,"application/json");return tq.BanResponse?.(i.body),{...i.body,metadata:i.metadata}}async upsertConfig(e){let t={key:e?.key,async:e?.async,team:e?.team,ai_image_config:e?.ai_image_config,ai_text_config:e?.ai_text_config,ai_video_config:e?.ai_video_config,automod_platform_circumvention_config:e?.automod_platform_circumvention_config,automod_semantic_filters_config:e?.automod_semantic_filters_config,automod_toxicity_config:e?.automod_toxicity_config,aws_rekognition_config:e?.aws_rekognition_config,block_list_config:e?.block_list_config,bodyguard_config:e?.bodyguard_config,google_vision_config:e?.google_vision_config,llm_config:e?.llm_config,rule_builder_config:e?.rule_builder_config,velocity_filter_config:e?.velocity_filter_config,video_call_rule_config:e?.video_call_rule_config},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/config",void 0,void 0,t,"application/json");return tq.UpsertConfigResponse?.(i.body),{...i.body,metadata:i.metadata}}async deleteConfig(e){let t={team:e?.team},i={key:e?.key},s=await this.apiClient.sendRequest("DELETE","/api/v2/moderation/config/{key}",i,t);return tq.DeleteModerationConfigResponse?.(s.body),{...s.body,metadata:s.metadata}}async getConfig(e){let t={team:e?.team},i={key:e?.key},s=await this.apiClient.sendRequest("GET","/api/v2/moderation/config/{key}",i,t);return tq.GetConfigResponse?.(s.body),{...s.body,metadata:s.metadata}}async queryModerationConfigs(e){let t={limit:e?.limit,next:e?.next,prev:e?.prev,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/configs",void 0,void 0,t,"application/json");return tq.QueryModerationConfigsResponse?.(i.body),{...i.body,metadata:i.metadata}}async flag(e){let t={entity_id:e?.entity_id,entity_type:e?.entity_type,entity_creator_id:e?.entity_creator_id,reason:e?.reason,custom:e?.custom,moderation_payload:e?.moderation_payload},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/flag",void 0,void 0,t,"application/json");return tq.FlagResponse?.(i.body),{...i.body,metadata:i.metadata}}async mute(e){let t={target_ids:e?.target_ids,timeout:e?.timeout},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/mute",void 0,void 0,t,"application/json");return tq.MuteResponse?.(i.body),{...i.body,metadata:i.metadata}}async queryReviewQueue(e){let t={exclude_default_action_config:e?.exclude_default_action_config,limit:e?.limit,lock_count:e?.lock_count,lock_duration:e?.lock_duration,lock_items:e?.lock_items,next:e?.next,prev:e?.prev,stats_only:e?.stats_only,sort:e?.sort,filter:e?.filter},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/review_queue",void 0,void 0,t,"application/json");return tq.QueryReviewQueueResponse?.(i.body),{...i.body,metadata:i.metadata}}async submitAction(e){let t={action_type:e?.action_type,appeal_id:e?.appeal_id,item_id:e?.item_id,ban:e?.ban,block:e?.block,bypass:e?.bypass,custom:e?.custom,delete_activity:e?.delete_activity,delete_comment:e?.delete_comment,delete_message:e?.delete_message,delete_reaction:e?.delete_reaction,delete_user:e?.delete_user,escalate:e?.escalate,flag:e?.flag,mark_reviewed:e?.mark_reviewed,reject_appeal:e?.reject_appeal,restore:e?.restore,shadow_block:e?.shadow_block,unban:e?.unban,unblock:e?.unblock},i=await this.apiClient.sendRequest("POST","/api/v2/moderation/submit_action",void 0,void 0,t,"application/json");return tq.SubmitActionResponse?.(i.body),{...i.body,metadata:i.metadata}}},t4=class extends t3{},t5=e=>!!e?.answer_text,t6=class{constructor({client:e,poll:t}){this.getInitialStateFromPollResponse=e=>{var t;let{own_votes:i,id:s,...n}=e,{ownAnswer:a,ownVotes:o}=i?.reduce((e,t)=>
1(t5(t)?e.ownAnswer=t:e.ownVotes.push(t),e),{ownVotes:[]})??{ownVotes:[]};return{...n,last_activity_at:new Date,max_voted_option_ids:t8(n.vote_counts_by_option),own_answer:a,own_votes_by_option_id:(t=o)?t.reduce((e,t)=>(t5(t)||!t.option_id||(e[t.option_id]=t),e),{}):{}}},this.reinitializeState=e=>{this.state.partialNext(this.getInitialStateFromPollResponse(e))},this.handlePollUpdated=e=>{if(e.poll?.id&&e.poll.id!==this.id)return;let t=this.data;if(t.updated_at&&e.poll.updated_at&&e.poll.updated_at<=t.updated_at)return;let{id:i,...s}=e.poll;this.state.partialNext({...s,last_activity_at:new Date(e.created_at)})},this.handlePollClosed=e=>{e.poll?.id&&e.poll.id!==this.id||this.data.is_closed||this.state.partialNext({is_closed:!0,last_activity_at:new Date(e.created_at)})},this.handleVoteCasted=e=>{if(e.poll?.id&&e.poll.id!==this.id)return;let t=this.data,i=e.poll_vote.user_id===this.client.state.getLatestValue().connected_user?.id;if(i&&(t5(e.poll_vote)?t.own_answer?.id===e.poll_vote.id:!!e.poll_vote.option_id&&t.own_votes_by_option_id[e.poll_vote.option_id]?.id===e.poll_vote.id))return;let s=[...t.latest_answers],n=t.own_answer,a=t.own_votes_by_option_id,o=t.max_voted_option_ids;i&&(t5(e.poll_vote)?n=e.poll_vote:e.poll_vote.option_id&&(a={...a,[e.poll_vote.option_id]:e.poll_vote})),t5(e.poll_vote)?s=[e.poll_vote,...s.filter(t=>t.id!==e.poll_vote.id)]:o=t8(e.poll.vote_counts_by_option);let{answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c}=e.poll;this.state.partialNext({answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c,latest_answers:s,last_activity_at:new Date(e.created_at),own_answer:n,own_votes_by_option_id:a,max_voted_option_ids:o})},this.handleVoteChanged=e=>{if(e.poll?.id&&e.poll.id!==this.id)return;let t=this.data,i=e.poll_vote.user_id===this.client.state.getLatestValue().connected_user?.id;if(i&&(t5(e.poll_vote)?t.own_answer?.id===e.poll_vote.id:!!e.poll_vote.option_id&&t.own_votes_by_option_id[e.poll_vote.option_id]?.id===e.poll_vote.id))return;let s=[...t.latest_answers],n=t.own_answer,a=t.own_votes_by_option_id,o=t.max_voted_option_ids;i?t5(e.poll_vote)?(s=[e.poll_vote,...s.filter(t=>t.id!==e.poll_vote.id)],n=e.poll_vote):e.poll_vote.option_id&&(e.poll.enforce_unique_vote?a={[e.poll_vote.option_id]:e.poll_vote}:(a=Object.entries(a).reduce((t,[i,s])=>(i!==e.poll_vote.option_id&&s.id===e.poll_vote.id||(t[i]=s),t),{}))[e.poll_vote.option_id]=e.poll_vote,n?.id===e.poll_vote.id&&(n=void 0),o=t8(e.poll.vote_counts_by_option)):t5(e.poll_vote)?s=[e.poll_vote,...s]:o=t8(e.poll.vote_counts_by_option);let{answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c}=e.poll;this.state.partialNext({answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c,latest_answers:s,last_activity_at:new Date(e.created_at),own_answer:n,own_votes_by_option_id:a,max_voted_option_ids:o})},this.handleVoteRemoved=e=>{if(e.poll?.id&&e.poll.id!==this.id)return;let t=this.data,i=e.poll_vote.user_id===this.client.state.getLatestValue().connected_user?.id;if(i&&(t5(e.poll_vote)?!t.own_answer:!!e.poll_vote.option_id&&!(e.poll_vote.option_id in t.own_votes_by_option_id)))return;let s=[...t.latest_answers],n=t.own_answer,a={...t.own_votes_by_option_id},o=t.max_voted_option_ids;t5(e.poll_vote)?(s=s.filter(t=>t.id!==e.poll_vote.id),i&&(n=void 0)):(o=t8(e.poll.vote_counts_by_option),i&&e.poll_vote.option_id&&delete a[e.poll_vote.option_id]);let{answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c}=e.poll;this.state.partialNext({answers_count:r,latest_votes_by_option:d,vote_count:l,vote_counts_by_option:c,latest_answers:s,last_activity_at:new Date(e.created_at),own_answer:n,own_votes_by_option_id:a,max_voted_option_ids:o})},this.client=e,this.id=t.id,this.state=new v(this.getInitialStateFromPollResponse(t))}get data(){return this.state.getLatestValue()}};function t8(e){let t=0,i=[];for(let[s,n]of Object.entries(e??{}))n>t?(i=[s],t=n):n===t&&i.push(s);return i}var t7=class{constructor(e,t,i){this.feedsApi=e,this.group=t,this.id=i}delete(e){return this.feedsApi.deleteFeed({feed_id:this.id,feed_group_id:this.group,...e})}getOrCreate(e){return this.feedsApi.getOrCreateFeed({feed_id:this.id,feed_group_id:this.group,...e})}update(e){return this.feedsApi.updateFeed({feed_id:this.id,feed_group_id:this.group,...e})}markActivity(e){return this.feedsApi.markActivity({feed_id:this.id,feed_group_id:this.group,...e})}unpinActivity(e){return this.feedsApi.unpinActivity({feed_id:this.id,feed_group_id:this.group,...e})}pinActivity(e){return this.feedsApi.pinActivity({feed_id:this.id,feed_group_id:this.group,...e})}changeFeedVisibility(e){return this.feedsApi.changeFeedVisibility({feed_id:this.id,feed_group_id:this.group,...e})}updateFeedMembers(e){return this.feedsApi.updateFeedMembers({feed_id:this.id,feed_group_id:this.group,...e})}acceptFeedMemberInvite(e){return this.feedsApi.acceptFeedMemberInvite({feed_id:this.id,feed_group_id:this.group,...e})}queryFeedMembers(e){return this.feedsApi.queryFeedMembers({feed_id:this.id,feed_group_id:this.group,...e})}rejectFeedMemberInvite(e){return this.feedsApi.rejectFeedMemberInvite({feed_id:this.id,feed_group_id:this.group,...e})}queryPinnedActivities(e){return this.feedsApi.queryPinnedActivities({feed_id:this.id,feed_group_id:this.group,...e})}stopWatching(e){return this.feedsApi.stopWatchingFeed({feed_id:this.id,feed_group_id:this.group,...e})}},t9=(e,t)=>
1void 0===e&&void 0===t||"string"==typeof t,ie=(e,t,i)=>{let s=new Set;e.forEach(e=>{let t=i(e);s.add(t)});let n=t.filter(e=>{let t=i(e);return!s.has(t)});return e.concat(n)},it=(e,t,i,s)=>{let n=new Map;(e??[]).forEach(e=>{n.set(i(e),e)});let a=[];t.forEach(e=>{n.set(i(e),e)}),e.forEach(e=>{let t=n.get(i(e));t&&(a.push(t),n.delete(i(e)))});let o=t.filter(e=>n.has(i(e)));return"end"===s?o.forEach(e=>a.push(e)):a.unshift(...o),a},ii="last",is=({stateUpdateQueueId:e,stateUpdateQueue:t,watch:i,fromWs:s=!0,isTriggeredByConnectedUser:n=!1})=>{if(!i||!n||!e)return!0;let a=s?`ws-${e}`:`http-${e}`,o=s?`http-${e}`:`ws-${e}`;return i&&t.has(o)?(t.delete(o),!1):(t.add(a),!0)};function ia(...e){let[t,i]=e,s=[i];switch(i){case"activity-deleted":case"activity-updated":return s.concat([t.activity.id]).join("-");case"activity-pinned":case"activity-unpinned":return s.concat([t.pinned_activity.activity.id]).join("-");case"activity-reaction-created":case"activity-reaction-deleted":case"activity-reaction-updated":return s.concat([t.activity.id,t.reaction.type]).join("-");case"comment-reaction-created":case"comment-reaction-deleted":case"comment-reaction-updated":return s.concat([t.comment.id,t.reaction.type]).join("-");case"comment-created":case"comment-deleted":case"comment-updated":return s.concat([t.comment.id]).join("-");case"follow-created":case"follow-deleted":case"follow-updated":return s.concat([t.source_feed.feed,t.target_feed.feed]).join("-");case"feed-member-added":case"feed-member-updated":return s.concat([t.member.user.id]).join("-");case"feed-member-removed":return s.concat([t.member_id]).join("-");default:tN.getLogger("helpers").warn("Encountered unknown state update queue prefix.",t)}}function io({matcher:e,updater:t,entities:i}){if(!i||!i.length)return{changed:!1,entities:i};let s=i.findIndex(e);if(-1===s)return{changed:!1,entities:i};let n=t(i[s]);if(n===i[s])return{changed:!1,entities:i};let a=[...i];return a[s]=n,{changed:!0,entities:a}}function ir(e,t,i=!1){let s=e.follow;if(!is({stateUpdateQueueId:ia(s,"follow-created"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:this.client.state.getLatestValue().connected_user?.id===s.source_feed.created_by.id}))return;let n=this.client.state.getLatestValue().connected_user,a=((e,t,i,s,n=!1)=>{if("accepted"!==e.status)return{changed:!1,data:t};let a={...t};if(e.source_feed.feed===i)a={...a,...e.source_feed,...n?{own_capabilities:e.source_feed.own_capabilities,own_follows:e.source_feed.own_follows,own_followings:e.source_feed.own_followings}:{}},void 0!==t.following&&(a.following=[e,...t.following]);else if(e.target_feed.feed===i){let i=e.source_feed;a={...a,...e.target_feed,...n?{own_capabilities:e.target_feed.own_capabilities,own_follows:e.target_feed.own_follows,own_followings:e.target_feed.own_followings}:{}},i.created_by.id!==s||n||(a.own_follows=t.own_follows?t.own_follows.concat(e):[e]),void 0!==t.followers&&(a.followers=[e,...t.followers])}return{changed:!0,data:a}})(s,this.currentState,this.feed,n?.id,i);a.changed&&this.state.next(a.data)}function id(e,t){let i=e.follow;if(!is({stateUpdateQueueId:ia(i,"follow-deleted"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:this.client.state.getLatestValue().connected_user?.id===i.source_feed.created_by.id}))return;let s=this.client.state.getLatestValue().connected_user,n=((e,t,i,s)=>{let n={...t};if(e.source_feed.feed===i)n={...n,...e.source_feed},void 0!==t.following&&(n.following=t.following.filter(t=>t.target_feed.feed!==e.target_feed.feed));else if(e.target_feed.feed===i){let i=e.source_feed;n={...n,...e.target_feed},i.created_by.id===s&&(n.own_follows=t.own_follows?t.own_follows.filter(t=>t.source_feed.feed!==e.source_feed.feed):[]),void 0!==t.followers&&(n.followers=t.followers.filter(t=>t.source_feed.feed!==e.source_feed.feed))}return{changed:!0,data:n}})(i,this.currentState,this.feed,s?.id);n.changed&&this.state.next(n.data)}function il(e,t){let i=e.follow,s=this.client.state.getLatestValue().connected_user?.id,n=this.feed;is({stateUpdateQueueId:ia(i,"follow-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:this.client.state.getLatestValue().connected_user?.id===i.source_feed.created_by.id})&&this.state.next(e=>{let t;if(i.source_feed.feed===n){t??(t={...e,...i.source_feed,...void 0!==i.source_feed.own_capabilities?{own_capabilities:i.source_feed.own_capabilities,own_follows:i.source_feed.own_follows,own_followings:i.source_feed.own_followings}:{}});let s=e.following?.findIndex(e=>e.target_feed.feed===i.target_feed.feed)??-1;s>=0&&(t.following=[...t.following],t.following[s]=i)}else if(i.target_feed.feed===n){let n=i.source_feed;if(t??(t={...e,...i.target_feed,...void 0!==i.target_feed.own_capabilities?{own_capabilities:i.target_feed.own_capabilities,own_follows:i.target_feed.own_follows,own_followings:i.target_feed.own_followings}:{}}),n.created_by.id===s&&e.own_follows){let s=e.own_follows.findIndex(e=>e.source_feed.feed===i.source_feed.feed);s>=0&&(t.own_follows=[...e.own_follows],t.own_follows[s]=i)}let a=e.followers?.findIndex(e=>e.source_feed.feed===i.source_feed.feed)??-1;a>=0&&(t.followers=[...t.followers],t.followers[a]=i)}return t??e})}function ic(e){let t=this.client.state.getLatestValue().connected_user,i=e.user??t;return void 0!==t&&t?.id===i?.id}
1function ip(e,t){let{comment:i}=e,s=i.parent_id??i.object_id;is({stateUpdateQueueId:ia(e,"comment-created"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)})&&this.state.next(t=>{let n=t.comments_by_entity_id[s];if(void 0===n?.comments)return t;let a=n?.comments?[...n.comments]:[],o=n.pagination?.sort,r=n.pagination?.next!==void 0,d=ic.call(this,e);if("last"===o)a.unshift(i);else if("first"===o)if(d)a.push(i);else{if(r)return t;a.push(i)}else a.push(i);return{...t,comments_by_entity_id:{...t.comments_by_entity_id,[s]:{...t.comments_by_entity_id[s],comments:a}}}})}function iu(e,t){let{comment:i}=e,s=i.parent_id??i.object_id;is({stateUpdateQueueId:ia(e,"comment-deleted"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)})&&this.state.next(e=>{let t,n=this.getCommentIndex(i,e);return(-1!==n&&(t??(t={...e.comments_by_entity_id,[s]:{...e.comments_by_entity_id[s]}}),t[s].comments=[...t[s].comments],t[s]?.comments?.splice(n,1)),void 0!==e.comments_by_entity_id[i.id]&&(t??(t={...e.comments_by_entity_id}),delete t[i.id]),t)?{...e,comments_by_entity_id:t}:e})}function iy(e,t){let{comment:i}=e,s=i.parent_id??i.object_id;is({stateUpdateQueueId:ia(e,"comment-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)})&&this.state.next(e=>{let t=e.comments_by_entity_id[s];if(!t?.comments?.length)return e;let n=this.getCommentIndex(i,e);if(-1===n)return e;let a=[...t.comments];return a[n]={...i,own_reactions:t.comments[n].own_reactions},{...e,comments_by_entity_id:{...e.comments_by_entity_id,[s]:{...e.comments_by_entity_id[s],comments:a}}}})}function i_(e,t){let{comment:i,reaction:s}=e,n=this.client.state.getLatestValue().connected_user,a=s.user.id===n?.id;is({stateUpdateQueueId:ia(e,"comment-reaction-created"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:a})&&this.state.next(e=>{let t=this.getCommentIndex(i,e);if(-1===t)return e;let n=i.parent_id??i.object_id,o=e.comments_by_entity_id[n],r=o?.comments?.concat([])??[],d=r[t].own_reactions;return a&&(d=d.concat(s)??[s]),r[t]={...r[t],reaction_count:i.reaction_count??0,latest_reactions:i.latest_reactions??[],reaction_groups:i.reaction_groups??{},own_reactions:d},{...e,comments_by_entity_id:{...e.comments_by_entity_id,[n]:{...o,comments:r}}}})}function im(e,t){let{comment:i,reaction:s}=e,n=this.client.state.getLatestValue().connected_user,a=s.user.id===n?.id;is({stateUpdateQueueId:ia(e,"comment-reaction-deleted"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:a})&&this.state.next(e=>{let t=this.getCommentIndex(i,e);if(-1===t)return e;let n=i.parent_id??i.object_id,o=e.comments_by_entity_id[n],r=o?.comments?.concat([])??[],d=r[t].own_reactions;return a&&(d=d.filter(e=>e.type!==s.type)),r[t]={...r[t],reaction_count:i.reaction_count??0,latest_reactions:i.latest_reactions??[],reaction_groups:i.reaction_groups??{},own_reactions:d},{...e,comments_by_entity_id:{...e.comments_by_entity_id,[n]:{...o,comments:r}}}})}function ih(e,t){let{comment:i,reaction:s}=e,n=this.client.state.getLatestValue().connected_user,a=s.user.id===n?.id;is({stateUpdateQueueId:ia(e,"comment-reaction-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:a})&&this.state.next(e=>{let t=this.getCommentIndex(i,e);if(-1===t)return e;let n=i.parent_id??i.object_id,o=e.comments_by_entity_id[n],r=o?.comments?.concat([])??[],d=r[t].own_reactions;return a&&(d=[s]),r[t]={...r[t],reaction_count:i.reaction_count??0,latest_reactions:i.latest_reactions??[],reaction_groups:i.reaction_groups??{},own_reactions:d},{...e,comments_by_entity_id:{...e.comments_by_entity_id,[n]:{...o,comments:r}}}})}function ig(e,t){if(!is({stateUpdateQueueId:ia(e,"feed-member-added"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)}))return;let{connected_user:i}=this.client.state.getLatestValue();this.state.next(t=>{let s;return void 0!==t.members&&(s??(s={...t}),s.members=[e.member,...t.members]),i?.id===e.member.user.id&&(s??(s={...t}),s.own_membership=e.member),s??t})}function iv(e,t){if(!is({stateUpdateQueueId:ia(e,"feed-member-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)}))return;let{connected_user:i}=this.client.state.getLatestValue();this.state.next(t=>{let s,n=t.members?.findIndex(t=>t.user.id===e.member.user.id)??-1;if(-1!==n){let i=[...t.members];i[n]=e.member,s??(s={...t}),s.members=i}return i?.id===e.member.user.id&&(s??(s={...t}),s.own_membership=e.member),s??t})}function iw(e,t){if(!is({stateUpdateQueueId:ia(e,"feed-member-removed"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)}))return;let{connected_user:i}=this.client.state.getLatestValue();this.state.next(t=>{let s;if(void 0!==t.members){let i=t.members.filter(t=>t.user.id!==e.member_id);i.length!==t.members.length&&(s??(s={...t}),s.members=i)}return i?.id===e.member_id&&void 0!==t.own_membership&&(s??(s={...t}),delete s.own_membership),s??t})}var ib=(e,t)=>
1e.user.id===t.user.id&&e.activity.id===t.activity.id&&e.folder?.id===t.folder?.id&&e.updated_at.getTime()===t.updated_at.getTime(),iS=({currentActivity:e,event:t,eventBelongsToCurrentUser:i})=>{let s=e.own_bookmarks;return i&&(s=e.own_bookmarks.filter(e=>!ib(e,t.bookmark))),{...e,bookmark_count:t.bookmark.activity.bookmark_count,own_bookmarks:s}};function iR(e){let{activities:t,pinned_activities:i}=this.currentState,{connected_user:s}=this.client.state.getLatestValue(),n=e.bookmark.user.id===s?.id,[a,o]=[io({entities:t,matcher:t=>t.id===e.bookmark.activity.id&&(!n||t.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>iS({currentActivity:t,event:e,eventBelongsToCurrentUser:n})}),io({entities:i,matcher:t=>t.activity.id===e.bookmark.activity.id&&(!n||t.activity.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>{let i=iS({currentActivity:t.activity,event:e,eventBelongsToCurrentUser:n});return i===t.activity?t:{...t,activity:i}}})];(a.changed||o.changed)&&this.state.partialNext({activities:a.entities,pinned_activities:o.entities})}var ik=({currentActivity:e,event:t,eventBelongsToCurrentUser:i})=>{let s=e.own_bookmarks;return i&&(s=[...s,t.bookmark]),{...e,bookmark_count:t.bookmark.activity.bookmark_count,own_bookmarks:s}};function iC(e){let{activities:t,pinned_activities:i}=this.currentState,{connected_user:s}=this.client.state.getLatestValue(),n=e.bookmark.user.id===s?.id,[a,o]=[io({entities:t,matcher:t=>t.id===e.bookmark.activity.id&&(!n||!t.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>ik({currentActivity:t,event:e,eventBelongsToCurrentUser:n})}),io({entities:i,matcher:t=>t.activity.id===e.bookmark.activity.id&&(!n||!t.activity.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>{let i=ik({currentActivity:t.activity,event:e,eventBelongsToCurrentUser:n});return i===t.activity?t:{...t,activity:i}}})];(a.changed||o.changed)&&this.state.partialNext({activities:a.entities,pinned_activities:o.entities})}var iT=({currentActivity:e,event:t,eventBelongsToCurrentUser:i})=>{let s=e.own_bookmarks;if(i){let e=s.findIndex(e=>e.user.id===t.bookmark.user.id&&e.activity.id===t.bookmark.activity.id&&e.folder?.id===t.bookmark.folder?.id);-1!==e&&((s=[...s])[e]=t.bookmark)}return{...e,bookmark_count:t.bookmark.activity.bookmark_count,own_bookmarks:s}};function iF(e){let{activities:t,pinned_activities:i}=this.currentState,{connected_user:s}=this.client.state.getLatestValue(),n=e.bookmark.user.id===s?.id,[a,o]=[io({entities:t,matcher:t=>t.id===e.bookmark.activity.id&&(!n||!t.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>iT({currentActivity:t,event:e,eventBelongsToCurrentUser:n})}),io({entities:i,matcher:t=>t.activity.id===e.bookmark.activity.id&&(!n||!t.activity.own_bookmarks.some(t=>ib(t,e.bookmark))),updater:t=>{let i=iT({currentActivity:t.activity,event:e,eventBelongsToCurrentUser:n});return i===t.activity?t:{...t,activity:i}}})];(a.changed||o.changed)&&this.state.partialNext({activities:a.entities,pinned_activities:o.entities})}function iA(e,t,i,{hasOwnFields:s,backfillOwnFields:n}={hasOwnFields:!0,backfillOwnFields:!0}){if(void 0===t)return{changed:!1,activities:[]};let a={changed:!1,activities:t},o=[];if(e.forEach(e=>{this.hasActivity(e.id)||o.push(e)}),o.length>0){let e=[..."start"===i?o:[],...t,..."end"===i?o:[]];this.activitiesAddedOrUpdated(o,{hasOwnFields:s,backfillOwnFields:n}),a={changed:!0,activities:e}}return a}function iD(e){let t=this.client.state.getLatestValue().connected_user,i=this.resolveNewActivityDecision(e.activity,t,!1);if("ignore"===i)return;let s=this.currentState.activities,n=iA.bind(this)([e.activity],s,"add-to-end"===i?"end":"start",{hasOwnFields:!1,backfillOwnFields:!0});if(n.changed){let t=e.activity;this.client.hydratePollCache([t]),this.state.partialNext({activities:n.activities})}}function iE(e,t){if(!this.hasActivity(e.id))return{changed:!1,activities:t};{let i=t?.findIndex(t=>t.id===e.id)??-1,s=[...t];return s.splice(i,1),{changed:!0,activities:s}}}function iU(e,t){if(!is({stateUpdateQueueId:ia(e,"activity-deleted"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)}))return;let{activities:i,pinned_activities:s}=this.currentState,[n,a]=[this.hasActivity(e.activity.id)?iE.bind(this)(e.activity,i):void 0,((e,t)=>{let i=t?.findIndex(t=>t.activity.id===e.id)??-1;if(-1===i)return{changed:!1,pinned_activities:t};{let e=[...t];return e.splice(i,1),{changed:!0,pinned_activities:e}}})(e.activity,s)];(n?.changed||a.changed)&&this.state.partialNext({activities:n?.changed?n.activities:i,pinned_activities:a.pinned_activities})}function iP(e){let t=this.currentState.activities;if(t){let i=iE.bind(this)(e.activity,t);i.changed&&this.state.partialNext({activities:i.activities})}}var iO=({currentActivity:e,newActivtiy:t})=>({...t,own_reactions:e.own_reactions,own_bookmarks:e.own_bookmarks,friend_reactions:e.friend_reactions,friend_reaction_count:e.friend_reaction_count});function ix(e,t){if(!is({stateUpdateQueueId:ia(e,"activity-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)}))return;let{activities:i,pinned_activities:s}=this.currentState,[n,a]=[this.hasActivity(e.activity.id)?io({entities:i,matcher:t=>t.id===e.activity.id,updater:t=>iO({currentActivity:t,newActivtiy:e.activity})}):void 0,io({entities:s,matcher:t=>t.activity.id===e.activity.id,updater:t=>{let i=iO({currentActivity:t.activity,newActivtiy:e.activity});return i===t.activity?t:{...t,activity:i}}})];(n?.changed||a.changed)&&(this.activitiesAddedOrUpdated([e.activity],{hasOwnFields:e.activity.current_feed?.own_capabilities!==void 0,backfillOwnFields:!1}),this.state.partialNext({activities:n?.changed?n.entities:i,pinned_activities:a.entities}))}var ij=({payload:e,currentActivity:t,eventBelongsToCurrentUser:i})=>{let{activity:s,reaction:n}=e,a=t.own_reactions;return i&&(a=[...t.own_reactions,n]),{...t,latest_reactions:s.latest_reactions,reaction_groups:s.reaction_groups,reaction_count:s.reaction_count,own_reactions:a}};function iq(e,t){let i=this.client.state.getLatestValue().connected_user,s=void 0!==i&&e.reaction.user.id===i.id;if(!is({stateUpdateQueueId:ia(e,"activity-reaction-created"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:s}))return;let{activities:n,pinned_activities:a}=this.currentState,[o,r]=[this.hasActivity(e.activity.id)?io({entities:n,matcher:t=>t.id===e.activity.id,updater:t=>ij({payload:e,currentActivity:t,eventBelongsToCurrentUser:s})}):void 0,io({entities:a,matcher:t=>t.activity.id===e.activity.id,updater:t=>{let i=ij({payload:e,currentActivity:t.activity,eventBelongsToCurrentUser:s});return i===t.activity?t:{...t,activity:i}}})];(o?.changed||r.changed)&&this.state.partialNext({...o?{activities:o.entities}:{},pinned_activities:r.entities})}var iI=({currentActivity:e,payload:t,eventBelongsToCurrentUser:i})=>{let{activity:s,reaction:n}=t,a=e.own_reactions;return i&&(a=e.own_reactions.filter(e=>e.type!==n.type||e.user.id!==n.user.id)),{...e,latest_reactions:s.latest_reactions,reaction_groups:s.reaction_groups,reaction_count:s.reaction_count,own_reactions:a}};function iB(e,t){let i=this.client.state.getLatestValue().connected_user,s=void 0!==i&&e.reaction.user.id===i.id;if(!is({stateUpdateQueueId:ia(e,"activity-reaction-deleted"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:s}))return;let{activities:n,pinned_activities:a}=this.currentState,[o,r]=[this.hasActivity(e.activity.id)?io({entities:n,matcher:t=>t.id===e.activity.id,updater:t=>iI({currentActivity:t,payload:e,eventBelongsToCurrentUser:s})}):void 0,io({entities:a,matcher:t=>t.activity.id===e.activity.id,updater:t=>{let i=iI({currentActivity:t.activity,payload:e,eventBelongsToCurrentUser:s});return i===t.activity?t:{...t,activity:i}}})];(o?.changed||r.changed)&&this.state.partialNext({...o?{activities:o.entities}:{},pinned_activities:r.entities})}var iN=({payload:e,currentActivity:t,eventBelongsToCurrentUser:i})=>{let{activity:s,reaction:n}=e,a=t.own_reactions;return i&&(a=[n]),{...t,latest_reactions:s.latest_reactions,reaction_groups:s.reaction_groups,reaction_count:s.reaction_count,own_reactions:a}};function iM(e,t){let i=this.client.state.getLatestValue().connected_user,s=void 0!==i&&e.reaction.user.id===i.id;if(!is({stateUpdateQueueId:ia(e,"activity-reaction-updated"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:s}))return;let{activities:n,pinned_activities:a}=this.currentState,[o,r]=[this.hasActivity(e.activity.id)?io({entities:n,matcher:t=>t.id===e.activity.id,updater:t=>iN({payload:e,currentActivity:t,eventBelongsToCurrentUser:s})}):void 0,io({entities:a,matcher:t=>t.activity.id===e.activity.id,updater:t=>{let i=iN({payload:e,currentActivity:t.activity,eventBelongsToCurrentUser:s});return i===t.activity?t:{...t,activity:i}}})];(o?.changed||r.changed)&&this.state.partialNext({...o?{activities:o.entities}:{},pinned_activities:r.entities})}function iL(e,t){is({stateUpdateQueueId:ia(e,"activity-pinned"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)})&&this.state.next(t=>{let i={...t},s={...e.pinned_activity,user:e.user,updated_at:new Date};return i.pinned_activities=t.pinned_activities?[s,...t.pinned_activities]:[s],i})}function iG(e,t){is({stateUpdateQueueId:ia(e,"activity-unpinned"),stateUpdateQueue:this.stateUpdateQueue,watch:this.currentState.watch,fromWs:t,isTriggeredByConnectedUser:ic.call(this,e)})&&this.state.next(t=>{let i,s=t.pinned_activities?.findIndex(t=>t.activity.id===e.pinned_activity.activity.id)??-1;if(s>=0){i??(i={...t});let e=[...t.pinned_activities];e.splice(s,1),i.pinned_activities=e}return i??t})}var iV=(e,t)=>t?io({entities:t,matcher:t=>{let i="true"===e.value;return"activity"in t?t.activity.id===e.activity_id&&t.activity.hidden!==i:t.id===e.activity_id&&t.hidden!==i},updater:t=>"activity"in t?{...t,activity:{...t.activity,hidden:"true"===e.value}}:{...t,hidden:"true"===e.value}}):{changed:!1,entities:[]};function i$(e){let{activities:t,pinned_activities:i}=this.currentState,{connected_user:s}=this.client.state.getLatestValue();if(e.activity_feedback.user.id!==s?.id||"hide"!==e.activity_feedback.action)return;let[n,a]=[iV(e.activity_feedback,t),iV(e.activity_feedback,i)];(n.changed||a.changed)&&this.state.partialNext({activities:n.entities,pinned_activities:a.entities})}function iQ(e){this.currentState.deleted_at||this.state.partialNext({deleted_at:e.created_at})}function iW(e){let t=this.currentState.updated_at;t&&e.feed.updated_at&&t.getTime()>=e.feed.updated_at.getTime()||this.state.partialNext({...e.feed})}var iH=[{matchesField:e=>"activity_type"===e,resolve:e=>e.type},{matchesField:e=>"within_bounds"===e,resolve:e=>e.location},{matchesField:()=>!0,resolve:(e,t)=>
1tA(e,t)}];function iz(e,t){var i;let s,n,a,o,r,d=t?.filter;return!d||"object"!=typeof d||(s=(i={resolvers:[...iH],arrayEqMode:"contains"}).resolvers??[],n=i.arrayEqMode??"exact",a=new Map,o=t=>{if(a.has(t))return a.get(t);let i=(s?.find(e=>e.matchesField(t))??{resolve:tA}).resolve(e,t);return a.set(t,i),i},(r=e=>{if(!e||"object"!=typeof e)return!0;if(e.$and)return e.$and.every(e=>r(e));if(e.$or)return e.$or.some(e=>r(e));if(e.$nor)return!e.$nor.some(e=>r(e));for(let[s,a]of Object.entries(e)){let e=o(s);if("object"!=typeof a||null===a||Array.isArray(a)){if(!tP(e,a,n))return!1;continue}for(let[s,o]of Object.entries(a))switch(s){case"$eq":var t,i;if(null!=(t=o)&&"object"==typeof t&&!Array.isArray(t)&&"lat"in t&&"lng"in t&&"distance"in t&&Number.isFinite(Number(t.lat))&&Number.isFinite(Number(t.lng))&&Number.isFinite(Number(t.distance))){if(!function(e,t){let i=tj(e);if(null===i||!t||"object"!=typeof t)return!1;let s=Number(t.lat),n=Number(t.lng),a=Number(t.distance);return!!Number.isFinite(s)&&!!Number.isFinite(n)&&!!Number.isFinite(a)&&6371*Math.acos(Math.max(-1,Math.min(1,Math.cos(tx(s))*Math.cos(tx(i.lat))*Math.cos(tx(i.lng-n))+Math.sin(tx(s))*Math.sin(tx(i.lat)))))<=a}(e,o))return!1}else{if(null!=(i=o)&&"object"==typeof i&&!Array.isArray(i)&&"ne_lat"in i&&"ne_lng"in i&&"sw_lat"in i&&"sw_lng"in i&&Number.isFinite(Number(i.ne_lat))&&Number.isFinite(Number(i.ne_lng))&&Number.isFinite(Number(i.sw_lat))&&Number.isFinite(Number(i.sw_lng))){if(!function(e,t){let i=tj(e);if(null===i||!t||"object"!=typeof t)return!1;let s=Number(t.ne_lat),n=Number(t.ne_lng),a=Number(t.sw_lat),o=Number(t.sw_lng);if(!Number.isFinite(s)||!Number.isFinite(n)||!Number.isFinite(a)||!Number.isFinite(o))return!1;let r=Math.min(a,s),d=Math.max(a,s),l=Math.min(o,n),c=Math.max(o,n);return i.lat>=r&&i.lat<=d&&i.lng>=l&&i.lng<=c}(e,o))return!1}else if(!tP(e,o,n))return!1}break;case"$ne":if(tP(e,o,n))return!1;break;case"$in":if(!tO(e,tS(o)))return!1;break;case"$nin":if(tO(e,tS(o)))return!1;break;case"$gt":if(!tU(e,o,e=>e>0))return!1;break;case"$gte":if(!tU(e,o,e=>e>=0))return!1;break;case"$lt":if(!tU(e,o,e=>e<0))return!1;break;case"$lte":if(!tU(e,o,e=>e<=0))return!1;break;case"$exists":if(!!e!=!!o)return!1;break;case"$contains":if(!function e(t,i){return null===i||"object"!=typeof i||Array.isArray(i)?Array.isArray(t)||"string"==typeof t&&"string"==typeof i?t.includes(i):t===i:null==t||"object"!=typeof t||Array.isArray(t)?!!Array.isArray(t)&&t.some(t=>e(t,i)):Object.keys(i).every(s=>e(t[s],i[s]))}(e,o))return!1;break;case"$path_exists":if(!function(e,t){if("string"!=typeof t||""===t||null==e||"object"!=typeof e)return!1;let i=t.split(".");if(0===i.length)return!1;let s=e;for(let e=0;e<i.length-1;e++){let t=i[e];if(void 0===t||null==s||"object"!=typeof s)return!1;s=s[t]}let n=i[i.length-1];return void 0!==n&&null!=s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,n)}(e,o))return!1;break;case"$autocomplete":if(!function(e,t){if(null==e||null==t)return!1;let i=Array.isArray(t)?t.map(String).flatMap(tF):tF(String(t));if(0===i.length)return!1;let s=e=>{let t=tF(e);return i.every(e=>t.some(t=>t.includes(e)))};return"string"==typeof e?s(e):!!Array.isArray(e)&&e.some(e=>"string"==typeof e&&s(e))}(e,o))return!1;break;default:return!1}}return!0})(d))}var iJ=(e,t,i)=>{let s;if(0===e.length)s={changed:!1,aggregated_activities:t??[]};else switch(s={changed:!0,aggregated_activities:[]},e.forEach(e=>{let i=t?.find(t=>t.group===e.group);if(i)for(let t=0;t<e.activities.length;t++){let s=e.activities[t],n=i.activities.find(e=>e.id===s.id);n&&(e.activities[t]=iO({currentActivity:n,newActivtiy:s}))}}),i){case"start":s.aggregated_activities=ie(e,t??[],e=>e.group);break;case"end":s.aggregated_activities=ie(t??[],e,e=>e.group);break;case"replace-then-end":s.aggregated_activities=it(t??[],e,e=>e.group,"end");break;case"replace-then-start":s.aggregated_activities=it(t??[],e,e=>e.group,"start")}return s},iK=(e,t)=>e||t?e?{changed:!0,notification_status:{...e}}:{changed:!1,notification_status:t}:{changed:!1,notification_status:void 0},iX=(e,t,i)=>e.reduce((e,s)=>s[t]===i?e+1:e,0);function iY(e){let t=((e,t,i,s,n)=>{let a={},o=e.notification_status??i,r=o?.last_read_at,d=o?.last_seen_at,l=o?.read_activities??[],c=o?.seen_activities??[];if(s?.length&&o){let e=!1,t=s.map(t=>{let i=null!=r&&t.updated_at.getTime()<r.getTime()||l.includes(t.id),s=null!=d&&t.updated_at.getTime()<d.getTime()||c.includes(t.id);return t.is_read!==i||t.is_seen!==s?(e=!0,{...t,is_read:i,is_seen:s}):t});e&&(a.activities=t)}if(t?.length&&o){let e=!1,i=t.map(t=>{let i=null!=r&&t.updated_at.getTime()<r.getTime()||l.includes(t.group),s=null!=d&&t.updated_at.getTime()<d.getTime()||c.includes(t.group);return t.is_read!==i||t.is_seen!==s?(e=!0,{...t,is_read:i,is_seen:s}):t});e&&(a.aggregated_activities=i)}if(e.aggregated_activities&&t){let i=iJ(function(e,t){let i=t?.filter;if(!i||"object"!=typeof i||0===Object.keys(i).length)return e;let s=[];for(let i of e){let e=i.activities.filter(e=>iz(e,t));if(e.length>0){let t=i.activities.length-e.length;s.push({...i,activities:e,activity_count:Math.max(0,i.activity_count-t)})}}return s}(e.aggregated_activities,n),a.aggregated_activities??t,"replace-then-start");i.changed&&(a.aggregated_activities=i.aggregated_activities)}if(e.notification_status){let s=n?.filter;if(s&&"object"==typeof s&&Object.keys(s).length>0&&void 0!==t&&i){let s=a.aggregated_activities??t??[],n=t??[],o=e.notification_status.unread,r=e.notification_status.unseen,d=0===o?0:Math.max(0,i.unread+(iX(s,"is_read",!1)-iX(n,"is_read",!1))),l=0===r?0:Math.max(0,i.unseen+(iX(s,"is_seen",!1)-iX(n,"is_seen",!1)));a.notification_status={...e.notification_status,unread:d,unseen:l}}else{let t=iK(e.notification_status,i);t.changed&&(a.notification_status=t.notification_status)}}return Object.keys(a).length>0?{changed:!0,data:a}:{changed:!1}})(e,this.currentState.aggregated_activities,this.currentState.notification_status,this.currentState.activities,this.currentState.last_get_or_create_request_config);t.changed&&this.state.partialNext({notification_status:t.data?.notification_status,aggregated_activities:t.data?.aggregated_activities??this.currentState.aggregated_activities,activities:t.data?.activities??this.currentState.activities})}function iZ(e){let t=function(e,t,i){if(!e&&i.aggregated_activities&&i.aggregated_activities?.length>0||!t&&i.activities&&i.activities?.length>0)return{changed:!1};let s={changed:!0,data:{aggregated_activities:e,activities:t}};if(i.aggregated_activities){let t=iJ(i.aggregated_activities,e,"replace-then-end");t.changed&&(s.data.aggregated_activities=t.aggregated_activities)}if(i.activities){let e=((e,t)=>{if(!e||0===e.length||!t)return{changed:!1,activities:t??[]};let i=[];for(let s=0;s<t.length;s++){let n=t[s],a=e.find(e=>e.id===n.id);a?i.push(iO({currentActivity:n,newActivtiy:a})):i.push(n)}return{changed:!0,activities:i}})(i.activities,t);e.changed&&(s.data.activities=e.activities)}return i.aggregated_activities||i.activities?s:{changed:!1}}(this.currentState.aggregated_activities,this.currentState.activities,e);t.changed&&this.state.partialNext({aggregated_activities:t.data?.aggregated_activities,activities:t.data?.activities})}function i0(){this.state.partialNext({watch:!0})}function i1(){this.state.partialNext({watch:!1})}async function i2(e,t={}){let i,{maxRetries:s=3,shouldRetry:n}=t;
1for(let t=0;t<=s;t++)try{return await e()}catch(e){if(i=e,t===s||!(n?n(e,t):function(e){if(e instanceof tX){let t=e.metadata?.response_code;if(t&&t>=400&&t<500)return!1}return!0}(e)))throw e;await tM(tL(t+1))}throw i}var i3=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||null==e||"object"!=typeof t||null==t||Object.keys(e).length!=Object.keys(t).length)return!1;for(let i in e)if(!Object.prototype.hasOwnProperty.call(t,i))return!1;else if(!i3(e[i],t[i]))return!1;return!0};function i4(...e){return this.getOrCreateActiveFeed(...e)}var i5=new Set;function i6({feeds:e}){for(let t of e)i5.add(t);i5.size>0&&this.throttledGetBatchOwnFields([...i5].slice(0,100),e=>{for(let t of e)i5.delete(t)})}var i8=class e extends t7{constructor(t,i,s,n,a=!1,o){super(t,i,s),this.onNewActivity=o,this.indexedActivityIds=new Set,this.stateUpdateQueue=new Set,this.eventHandlers={"feeds.activity.added":iD.bind(this),"feeds.activity.deleted":iU.bind(this),"feeds.activity.reaction.added":iq.bind(this),"feeds.activity.reaction.deleted":iB.bind(this),"feeds.activity.reaction.updated":iM.bind(this),"feeds.activity.removed_from_feed":iP.bind(this),"feeds.activity.updated":ix.bind(this),"feeds.bookmark.added":iC.bind(this),"feeds.bookmark.deleted":iR.bind(this),"feeds.bookmark.updated":iF.bind(this),"feeds.bookmark_folder.deleted":e.noop,"feeds.bookmark_folder.updated":e.noop,"feeds.comment.added":ip.bind(this),"feeds.comment.deleted":iu.bind(this),"feeds.comment.updated":iy.bind(this),"feeds.comment.restored":e.noop,"feeds.feed.created":e.noop,"feeds.feed.deleted":iQ.bind(this),"feeds.feed.updated":iW.bind(this),"feeds.feed_group.changed":e.noop,"feeds.feed_group.deleted":e.noop,"feeds.feed_group.restored":e.noop,"feeds.follow.created":ir.bind(this),"feeds.follow.deleted":id.bind(this),"feeds.follow.updated":il.bind(this),"feeds.comment.reaction.added":i_.bind(this),"feeds.comment.reaction.deleted":im.bind(this),"feeds.comment.reaction.updated":ih.bind(this),"feeds.feed_member.added":ig.bind(this),"feeds.feed_member.removed":iw.bind(this),"feeds.feed_member.updated":iv.bind(this),"feeds.notification_feed.updated":iY.bind(this),"feeds.stories_feed.updated":iZ.bind(this),"feeds.poll.closed":e.noop,"feeds.poll.deleted":e.noop,"feeds.poll.updated":e.noop,"feeds.poll.vote_casted":e.noop,"feeds.poll.vote_changed":e.noop,"feeds.poll.vote_removed":e.noop,"feeds.activity.pinned":iL.bind(this),"feeds.activity.unpinned":iG.bind(this),"feeds.activity.marked":e.noop,"moderation.custom_action":e.noop,"moderation.flagged":e.noop,"moderation.mark_reviewed":e.noop,"health.check":e.noop,"app.updated":e.noop,"user.banned":e.noop,"user.deactivated":e.noop,"user.reactivated":e.noop,"user.updated":e.noop,"feeds.activity.feedback":i$.bind(this),"feeds.activity.restored":e.noop,"user.unbanned":e.noop},this.eventDispatcher=new tJ,this.on=this.eventDispatcher.on,this.off=this.eventDispatcher.off,this.state=new v({feed:`${i}:${s}`,group_id:i,id:s,...n??{},is_loading:!1,is_loading_activities:!1,comments_by_entity_id:{},watch:a}),this.client=t,this.state.subscribeWithSelector(e=>({activities:e.activities}),e=>{let{activities:t=[]}=e;this.indexedActivityIds.size!==t?.length&&(this.indexedActivityIds=new Set(t.map(e=>e.id)))})}get feed(){return`${this.group}:${this.id}`}get currentState(){return this.state.getLatestValue()}hasActivity(e){return this.indexedActivityIds.has(e)}hasPinnedActivity(e){return this.currentState.pinned_activities?.some(t=>t.activity.id===e)}resolveNewActivityDecision(e,t,i){return this.onNewActivity?this.onNewActivity({activity:e,currentUser:t}):t&&e.user?.id===t.id&&iz(e,this.currentState.last_get_or_create_request_config)?"add-to-start":"ignore"}async synchronize(){let{last_get_or_create_request_config:e}=this.state.getLatestValue();e?.watch&&(this.inProgressGetOrCreate=void 0,await i2(()=>this.getOrCreate(e)))}async getOrCreate(e){if(!e?.next&&this.inProgressGetOrCreate&&i3(e,this.inProgressGetOrCreate.request))return this.inProgressGetOrCreate.promise;if(this.currentState.is_loading_activities)throw Error("Only one getOrCreate call is allowed at a time");this.state.partialNext({is_loading:!e?.next,is_loading_activities:!0});try{let t=super.getOrCreate(e);e?.next||(this.inProgressGetOrCreate={request:e,promise:t});let i=await t,s=[];for(let e of i.activities)e.current_feed&&s.push(e.current_feed);if(e?.next){let{activities:e=[]}=this.currentState,t=iA.bind(this)(i.activities,e,"end",{hasOwnFields:!0,backfillOwnFields:!1}),s=iJ(i.aggregated_activities,this.currentState.aggregated_activities,"end"),n=iK(i.notification_status,this.currentState.notification_status);(t.changed||s.changed||n.changed)&&this.state.partialNext({activities:t.activities,aggregated_activities:s.aggregated_activities,notification_status:n.notification_status,next:i.next,prev:i.prev})}else{this.stateUpdateQueue.clear();let t={...i,...i.feed};delete t.feed,delete t.metadata,delete t.duration,this.indexedActivityIds=new Set,this.state.next(s=>{let n={...s,...t};return e?.followers_pagination?.limit||delete n.followers,e?.following_pagination?.limit||delete n.following,0===i.members.length&&i.feed.member_count>0&&delete n.members,n.last_get_or_create_request_config=e,n.watch=e?.wat
1ch?e.watch:s.watch,n})}return this.activitiesAddedOrUpdated(i.activities),i}finally{this.state.partialNext({is_loading:!1,is_loading_activities:!1}),e?.next||(this.inProgressGetOrCreate=void 0)}}getCommentIndex(e,t){let{comments_by_entity_id:i={}}=t??this.currentState,s=i[e.parent_id??e.object_id]?.comments;if(!s?.length)return -1;let n=s.indexOf(e);return -1===n&&(n=s.findIndex(t=>t.id===e.id)),n}loadCommentsIntoState(e){let t=[{entityId:e.entityId,entityParentId:e.entityParentId,comments:e.comments,next:e.next}];this.state.next(i=>{let s={...i.comments_by_entity_id};for(;t.length;){let i=t.pop(),n=i.entityId;i.comments.forEach(e=>{e.replies?.length&&t.push({entityId:e.id,entityParentId:n,comments:e.replies,next:e.meta?.next_cursor})});let a=i.comments.map(({replies:e,meta:t,...i})=>i),o=s[n]?.comments,r=o?ie(o,a,e=>e.id):a;"first"===e.sort&&o&&o.length>0&&(r=[...r].sort((e,t)=>new Date(e.created_at).getTime()-new Date(t.created_at).getTime())),s[n]={...s[n],entity_parent_id:i.entityParentId,pagination:{...s[n]?.pagination,next:i.next,sort:e.sort},comments:r}}return{...i,comments_by_entity_id:s}})}async loadNextPageComments({entityId:e,base:t,sort:i,entityParentId:s}){let n;try{this.state.next(t=>({...t,comments_by_entity_id:{...t.comments_by_entity_id,[e]:{...t.comments_by_entity_id[e],pagination:{...t.comments_by_entity_id[e]?.pagination,loading_next_page:!0}}}}));let{next:n,comments:a}=await t();this.loadCommentsIntoState({entityId:e,comments:a,entityParentId:s,next:n,sort:i})}catch(e){n=e}finally{this.state.next(t=>({...t,comments_by_entity_id:{...t.comments_by_entity_id,[e]:{...t.comments_by_entity_id[e],pagination:{...t.comments_by_entity_id[e]?.pagination,loading_next_page:!1}}}}))}if(n)throw n}async loadNextPageActivityComments(e,t){let i=this.currentState.comments_by_entity_id["string"==typeof e?e:e.id],s=i?.pagination,n=s?.next,a=s?.sort,o=s?.loading_next_page,r=a??t?.sort??ii;if(o||!t9(i?.comments,n))return;let d="string"==typeof e?e:e.id;await this.loadNextPageComments({entityId:d,base:()=>this.client.getComments({...t,sort:r,object_id:d,object_type:"activity",next:n}),sort:r})}async loadNextPageCommentReplies(e,t){let i=this.currentState.comments_by_entity_id[e.id],s=i?.pagination,n=s?.next,a=s?.sort,o=s?.loading_next_page,r=a??t?.sort??ii;!o&&t9(i?.comments,n)&&await this.loadNextPageComments({entityId:e.id,base:()=>this.client.getCommentReplies({...t,id:e.id,sort:r,next:n}),entityParentId:e.parent_id??e.object_id,sort:r})}async loadNextPageFollows(e,t){let i,s=`${e}_pagination`,n=`query${e.charAt(0).toLocaleUpperCase()}${e.slice(1)}`,a=this.currentState[e],o=this.currentState[s]?.next,r=this.currentState[s]?.loading_next_page,d=this.currentState[s]?.sort??t.sort;if(!r&&t9(a,o)){try{this.state.next(e=>({...e,[s]:{...e[s],loading_next_page:!0}}));let{next:i,follows:a}=await this[n]({...t,next:o,sort:d});this.state.next(t=>({...t,[e]:void 0===t[e]?a:ie(t[e],a,e=>`${e.source_feed.feed}-${e.target_feed.feed}`),[s]:{...t[s],next:i,sort:d}}))}catch(e){i=e}finally{this.state.next(e=>({...e,[s]:{...e[s],loading_next_page:!1}}))}if(i)throw i}}async loadNextPageFollowers(e){await this.loadNextPageFollows("followers",e)}async loadNextPageFollowing(e){await this.loadNextPageFollows("following",e)}async loadNextPageMembers(e){let t,i=this.currentState.members,s=this.currentState.member_pagination?.next,n=this.currentState.member_pagination?.loading_next_page,a=this.currentState.member_pagination?.sort??e.sort;if(!n&&t9(i,s)){try{this.state.next(e=>({...e,member_pagination:{...e.member_pagination,loading_next_page:!0}}));let{next:t,members:i}=await this.client.queryFeedMembers({...e,sort:a,feed_id:this.id,feed_group_id:this.group,next:s});this.state.next(s=>({...s,members:s.members?ie(s.members,i,({user:e})=>e.id):i,member_pagination:{...s.member_pagination,next:t,sort:s.member_pagination?.sort??e.sort}}))}catch(e){t=e}finally{this.state.next(e=>({...e,member_pagination:{...e.member_pagination,loading_next_page:!1}}))}if(t)throw t}}async queryFollowers(e){let t={target_feed:this.feed};return await this.client.queryFollows({filter:t,...e})}async queryFollowing(e){let t={source_feed:this.feed};return await this.client.queryFollows({filter:t,...e})}async follow(e,t){let i="string"==typeof e?e:e.feed;return await this.client.follow({...t,source:this.feed,target:i})}async unfollow(e,t,i){let s="string"==typeof e?e:e.feed;return await this.client.unfollow({source:this.feed,target:s,enrich_own_fields:i,...t})}async getNextPage(){let e=this.currentState;if(e.next)return await this.getOrCreate({...e.last_get_or_create_request_config,member_pagination:{limit:0},followers_pagination:{limit:0},following_pagination:{limit:0},watch:void 0,next:e.next})}addActivityFromHTTPResponse(e){let t=this.client.state.getLatestValue().connected_user,i=this.resolveNewActivityDecision(e,t,!0);if("ignore"!==i){let t=this.currentState.activities,s=iA.bind(this)([e],t,"add-to-e
1nd"===i?"end":"start",{hasOwnFields:e.current_feed?.own_capabilities!==void 0,backfillOwnFields:!1});s.changed&&(this.client.hydratePollCache([e]),this.state.partialNext({activities:s.activities}))}}async addActivity(e){let t=await this.client.addActivity({...e,feeds:[this.feed]});return this.addActivityFromHTTPResponse(t.activity),t}handleWSEvent(t){let i=this.eventHandlers[t.type];if(i!==e.noop){if("activity"in t&&t.activity.feeds.length>1&&this.hasActivity(t.activity.id)){let e=this.currentState.activities?.find(e=>e.id===t.activity.id);!t.activity.current_feed&&e?.current_feed&&(t.activity.current_feed=e.current_feed)}i?.(t)}void 0===i&&tN.getLogger("event-dispatcher").warn(`Received unknown feed event, type: ${t.type}`,t),this.eventDispatcher.dispatch(t)}activitiesAddedOrUpdated(e,t={hasOwnFields:!0,backfillOwnFields:!0}){this.client.hydratePollCache(e),this.getOrCreateFeeds(e,t)}getOrCreateFeeds(e,t){let i=this.currentState.last_get_or_create_request_config?.enrichment_options;if(this.shouldAddToActiveFeeds(i)){let s=new Map;e.forEach(e=>{e.current_feed&&!s.has(e.current_feed.feed)&&s.set(e.current_feed.feed,e.current_feed)});let n=Array.from(s.values()),a=[];if(t.hasOwnFields&&(a.push("own_membership"),i?.skip_own_capabilities||a.push("own_capabilities"),i?.skip_own_follows||a.push("own_follows"),i?.enrich_own_followings&&a.push("own_followings")),n.forEach(e=>{i4.bind(this.client)({group:e.group_id,id:e.id,data:e,fieldsToUpdate:a})}),!t.hasOwnFields&&t.backfillOwnFields){let e=n.filter(e=>void 0===this.client.feed(e.group_id,e.id).currentState.own_capabilities);e.length>0&&i6.bind(this.client)({feeds:e.map(e=>e.feed)})}}}shouldAddToActiveFeeds(e){return!e||!e?.skip_activity&&!e?.skip_activity_current_feed&&!e?.skip_all}};function i7(e){return this.addActivityFromHTTPResponse(e)}function i9(e){this.state.next(t=>{let i,{connected_user:s}=t;return s&&s.id===e.user.id&&(i??(i={...t}),i.connected_user={...s,...e.user}),i??t})}i8.noop=()=>{};var se=((y={}).ReconnectionReconciliation="reconnection-reconciliation",y.FetchingOwnFieldsOnNewActivity="fetching-own-fields-on-new-activity",y);function st({activity:e,comment:t,replyCountUpdater:i}){let s=t.object_id;if(t?.parent_id){let e=this.currentState.comments_by_entity_id[t?.parent_id??""]?.entity_parent_id??s,n=this.currentState.comments_by_entity_id[e]?.comments?.find(e=>e.id===t.parent_id);n&&iy.bind(this)({comment:{...n,reply_count:i(n.reply_count)}},!1)}this.hasActivity(e.id)&&ix.bind(this)({activity:e},!1)}function si({fid:e}){let[t,i]=e.split(":"),s=this.activeFeeds[e];return new i8(this,t,i,void 0,s?.currentState.watch)}function ss(e){for(let t of e){let e=this.activeFeeds[t];if(e&&e.currentState.last_get_or_create_request_config?.watch)return!0}return!1}function sn(e){let t=this.activeActivities.indexOf(e);-1!==t&&this.activeActivities.splice(t,1)}var sa=class{constructor(e,t,{fromResponse:i}={fromResponse:void 0}){this.id=e,this.feedsClient=t,this.state=new v({activity:void 0,comments_by_entity_id:{},is_loading:!1}),i&&(this.setFeed({fid:i.feeds[0],initialState:i}),this.subscribeToFeedState())}get currentState(){return this.state.getLatestValue()}get feeds(){return this.currentState.activity?.feeds??[]}async get(e={}){if(this.inProgressGet&&i3(this.inProgressGet.request,e))return this.inProgressGet.promise;let{comments:t}=e;this.state.partialNext({is_loading:!0,last_get_request_config:e});let i=this.feedsClient.getActivity({id:this.id}).then(e=>e.activity);this.inProgressGet={request:e,promise:i};let s=await i;return this.feedsClient.hydratePollCache([s]),this.setFeed({fid:s.feeds[0],initialState:s}),this.feed&&(this.feed.onNewActivity=()=>"ignore"),t&&await this.loadNextPageActivityComments(t),this.subscribeToFeedState(),this.inProgressGet=void 0,s}loadNextPageActivityComments(e){let t=this.feed?.currentState.activities?.[0];if(!t||!this.feed)throw Error("Initialize activity first");return this.currentState.last_get_request_config?.comments||this.state.partialNext({last_get_request_config:{...this.currentState.last_get_request_config,comments:e}}),this.feed.loadNextPageActivityComments(t,e)}loadNextPageCommentReplies(...e){if(!this.feed)throw Error("Initialize activity first");return this.feed.loadNextPageCommentReplies(...e)}dispose(){this.unsubscribeFromFeedState?.(),sn.call(this.feedsClient,this)}async synchronize(){let e=this.currentState.activity?.feeds??[];
1if(ss.call(this.feedsClient,e))return this.inProgressGet=void 0,this.get(this.currentState.last_get_request_config)}setFeed({fid:e,initialState:t}){this.feed=si.call(this.feedsClient,{fid:e});let{activities:i}=iA.bind(this.feed)([t],[],"start",{hasOwnFields:t.current_feed?.own_capabilities!==void 0,backfillOwnFields:!1});this.feed?.state.partialNext({activities:i})}subscribeToFeedState(){this.unsubscribeFromFeedState?.(),this.unsubscribeFromFeedState=this.feed?.state.subscribeWithSelector(e=>({activity:e.activities?.find(e=>e.id===this.id),comments_by_entity_id:e.comments_by_entity_id}),e=>{e.activity&&this.state.partialNext({activity:e.activity,comments_by_entity_id:e.comments_by_entity_id,is_loading:!1})})}};function so(){return this.feed}var sr=(e,t)=>{let i=new Set(e?.map(e=>`${e.source_feed.feed}:${e.target_feed.feed}:${e.updated_at.getTime()}`)),s=new Set(t?.map(e=>`${e.source_feed.feed}:${e.target_feed.feed}:${e.updated_at.getTime()}`));return!!(i.size===s.size&&Array.from(i).every(e=>s.has(e)))},sd=(e,t)=>sr(e.own_follows,t.own_follows),sl=(e,t)=>(e.own_membership?.updated_at.getTime()??0)===(t.own_membership?.updated_at.getTime()??0),sc=(e,t)=>[...e.own_capabilities??[]].sort().join(",")===[...t.own_capabilities??[]].sort().join(","),sp=(e,t)=>sr(e.own_followings,t.own_followings),su=class extends tB{constructor(e,t){const i=new tH,s=new tz,n=new t0(e,i,s,t);super(n),this.eventDispatcher=new tJ,this.activeActivities=[],this.activeFeeds={},this.healthyConnectionChangedEventCount=0,this.setGetBatchOwnFieldsThrottlingInterval=e=>{let{throttledFn:t,cancelTimer:i}=((e,t=200,{leading:i=!0,trailing:s=!1}={})=>{let n,a=null,o=null,r=null,d=(t,i)=>{n=Date.now(),e.apply(i,t)},l=e=>{a||(a=setTimeout(()=>{a=null,s&&o&&(d(o,r),o=null,r=null)},e))};return{throttledFn:function(...e){let c=Date.now(),p=null!=n;p||i||(n=c);let u=t-(p?c-n:t);if(s&&(o=e,r=this),u<=0){a&&(clearTimeout(a),a=null),i?(s&&o===e&&(o=null,r=null),d(e,this)):s&&l(t);return}s&&!a&&l(u)},cancelTimer:()=>{a&&(clearTimeout(a),a=null)}}})((e,t)=>{this.ownBatch({feeds:e}).catch(e=>{this.eventDispatcher.dispatch({type:"errors.unhandled",error_type:se.FetchingOwnFieldsOnNewActivity,error:e})}),t(e)},e,{trailing:!0});this.throttledGetBatchOwnFields=t,this.cancelGetBatchOwnFieldsTimer=i},this.recoverOnReconnect=async()=>{if(this.healthyConnectionChangedEventCount++,this.healthyConnectionChangedEventCount>1){let e=Object.entries(this.activeFeeds),t=(await Promise.allSettled([...e.map(([,e])=>e.synchronize()),...this.activeActivities.map(e=>e.synchronize())])).flatMap((t,i)=>{if("fulfilled"===t.status)return[];let s=this.activeActivities[i-e.length];return[{feed:e[i]?.[0]??(s&&so.call(s)?.feed),reason:t.reason,activity_id:s?.id}]});t.length>0&&this.eventDispatcher.dispatch({type:"errors.unhandled",error_type:se.ReconnectionReconciliation,failures:t})}},this.pollFromState=e=>this.polls_by_id.get(e),this.connectAnonymous=()=>(this.checkIfUserIsConnected(),this.connectionIdManager.resolveConnectionidPromise(),this.tokenManager.setTokenOrProvider(void 0),this.setGetBatchOwnFieldsThrottlingInterval(this.query_batch_own_fields_throttling_interval),this.state.partialNext({connected_user:void 0,is_anonymous:!0,is_ws_connection_healthy:!1}),Promise.resolve()),this.connectGuest=async(...e)=>{this.checkIfUserIsConnected();let t=await this.createGuest(...e);return await this.connectUser(t.user,t.access_token),t},this.createGuest=async(...e)=>{let t,i=!1;try{this.state.getLatestValue().is_anonymous&&this.state.getLatestValue().connected_user||(i=!0,await this.connectAnonymous()),t=await super.createGuest(...e)}finally{i&&await this.disconnectUser()}return t},this.connectUser=async(e,t)=>{this.checkIfUserIsConnected(),this.tokenManager.setTokenOrProvider(t),this.setGetBatchOwnFieldsThrottlingInterval(this.query_batch_own_fields_throttling_interval);try{tQ(this.updateNetworkConnectionStatus),this.wsConnection=new tK({user:e,baseUrl:this.apiClient.webSocketBaseUrl},this.tokenManager,this.connectionIdManager,[t2]),this.wsConnection.on("all",e=>this.eventDispatcher.dispatch(e));let t=await this.wsConnection.connect();this.state.partialNext({connected_user:t?.me,is_ws_connection_healthy:!!this.wsConnection?.isHealthy})}catch(e){throw await this.disconnectUser(),e}},this.devToken=e=>["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",window.btoa(JSON.stringify({user_id:e})),"devtoken"].join("."),this.updatePoll=async e=>{let t=this.pollFromState(e.id),i=await super.updatePoll(e);return i.poll&&t&&t.handlePollUpdated({poll:i.poll,created_at:new Date}),i},this.updatePollPartial=async e=>{let t=this.pollFromState(e.poll_id),i=await super.updatePollPartial(e);return i.poll&&t&&t.handlePollUpdated({poll:i.poll,created_at:new Date}),i},this.closePoll=async e=>{let t=this.pollFromState(e.poll_id),i=await super.updatePollPartial({poll_id:e.poll_id,set:{is_closed:!0}});return i.poll&&t&&t.handlePollClosed({poll:i.poll,created_at:new Date}),i},this.castPollVote=async e=>{let t=this.pollFromState(e.poll_id),i=await super.castPollVote(e);if(i.poll&&i.vote&&t){let e={poll:i.poll,poll_vote:i.vote,created_at:new Date};t.data.enforce_unique_vote&&Object.keys(t.data.own_votes_by_option_id).length>0?t.handleVoteChanged(e):t.handleVoteCasted(e)}return i},this.deletePollVote=async e=>{let t=await super.deletePollVote(e);return t.poll&&t.vote&&this.pollFromState(e.poll_id)?.handleVoteRemoved({poll:t.poll,poll_vote:t.vote,created_at:new Date}),t},this.uploadFile=e=>super.uploadFile({file:e?.file}),this.uploadImage=e=>super.uploadImage({file:e?.file,upload_sizes:JSON.stringify(e?.upload_sizes)}),this.updateActivity=async e=>{let t=await super.updateActivity(e);for(let e of this.allActiveFeeds)ix.bind(e)(t,!1);return t},this.updateActivityPartial=async(...e)=>{let t=await super.updateActivityPartial(...e);for(let e of this.allActiveFeeds)ix.bind(e)(t,!1);return t},this.deleteActivity=async(...e)=>{let t=await super.deleteActivity(...e),i=e[0].id;for(let e of this.allActiveFeeds)iU.bind(e)({activity:{id:i}},!1);return this.activeActivities=this.activeActivities.filter(e=>e.id!==i),t},this.activityFeedback=async e=>{let t=await super.activityFeedback(e);if(void 0!==e.hide){let t={activity_id:e.activity_id,action:"hide",value:e.hide?"true":"false"};for(let e of this.allActiveFeeds){let{activities:i,pinned_activities:s}=e.currentState,[n,a]=[iV(t,i),iV(t,s)];(n.changed||a.changed)&&e.state.partialNext({activities:n.entities,pinned_activities:a.entities})}}return t},this.addComment=async e=>{let t=await super.addComment(e),{comment:i}=t;
1for(let e of this.allActiveFeeds){ip.bind(e)(t,!1);let s=i.object_id;if(e.hasActivity(s)){let t=e.currentState.activities?.find(e=>e.id===s);t&&st.bind(e)({activity:{...t,comment_count:t.comment_count+1},comment:i,replyCountUpdater:e=>e+1})}}return t},this.updateComment=async e=>{let t=await super.updateComment(e);for(let e of this.allActiveFeeds)iy.bind(e)(t,!1);return t},this.deleteComment=async(...e)=>{let t=await super.deleteComment(...e),{activity:i,comment:s}=t;for(let e of this.allActiveFeeds)iu.bind(e)({comment:s},!1),st.bind(e)({activity:i,comment:s,replyCountUpdater:e=>e-1});return t},this.addActivityReaction=async e=>{let t=e.enforce_unique,i=await super.addActivityReaction(e);for(let e of this.allActiveFeeds)t?iM.bind(e)(i,!1):iq.bind(e)(i,!1);return i},this.addReaction=e=>this.addActivityReaction(e),this.deleteActivityReaction=async(...e)=>{let t=await super.deleteActivityReaction(...e);for(let e of this.allActiveFeeds)iB.bind(e)(t,!1);return t},this.addCommentReaction=async e=>{let t=e.enforce_unique,i=await super.addCommentReaction(e);for(let e of this.allActiveFeeds)t?ih.bind(e)(i,!1):i_.bind(e)(i,!1);return i},this.deleteCommentReaction=async(...e)=>{let t=await super.deleteCommentReaction(...e);for(let e of this.allActiveFeeds)im.bind(e)(t,!1);return t},this.addBookmark=async e=>{let t=await super.addBookmark(e);for(let e of this.allActiveFeeds)iC.bind(e)(t);return t},this.updateBookmark=async e=>{let t=await super.updateBookmark(e);for(let e of this.allActiveFeeds)iF.bind(e)(t);return t},this.deleteBookmark=async e=>{let t=await super.deleteBookmark(e);for(let e of this.allActiveFeeds)iR.bind(e)(t);return t},this.pinActivity=async(...e)=>{let t=await super.pinActivity(...e);for(let e of t.activity?.feeds??(t.feed?[t.feed]:[])){let i=this.activeFeeds[e];i&&iL.bind(i)({pinned_activity:t},!1)}return t},this.unpinActivity=async(...e)=>{let t=await super.unpinActivity(...e);for(let e of t.activity?.feeds??(t.feed?[t.feed]:[])){let i=this.activeFeeds[e];i&&iG.bind(i)({pinned_activity:{...t,created_at:new Date}},!1)}return t},this.updateFeed=async(...e)=>{let t=await super.updateFeed(...e),i=`${e[0].feed_group_id}:${e[0].feed_id}`,s=this.activeFeeds[i];return s&&iW.call(s,{feed:t.feed}),this.checkIfOwnFieldsChanged(t.feed,!!e[0].enrich_own_fields),t},this.deleteFeed=async(...e)=>{let t=await super.deleteFeed(...e),i=`${e[0].feed_group_id}:${e[0].feed_id}`,s=this.activeFeeds[i];return s&&(iQ.call(s,{created_at:new Date}),s.currentState.watch||(delete this.activeFeeds[i],this.activeActivities=this.activeActivities.filter(e=>so.call(e)?.feed!==i))),t},this.updateFeedMembers=async(...e)=>{let t=await super.updateFeedMembers(...e),i=`${e[0].feed_group_id}:${e[0].feed_id}`,s=this.activeFeeds[i];if(s){for(let e of t.added)ig.call(s,{member:e},!1);for(let e of t.updated)iv.call(s,{member:e},!1);for(let e of t.removed_ids)iw.call(s,{member_id:e},!1)}return t},this.acceptFeedMemberInvite=async(...e)=>{let t=await super.acceptFeedMemberInvite(...e),i=`${e[0].feed_group_id}:${e[0].feed_id}`,s=this.activeFeeds[i];return s&&iv.call(s,{member:t.member},!1),t},this.rejectFeedMemberInvite=async(...e)=>{let t=await super.rejectFeedMemberInvite(...e),i=`${e[0].feed_group_id}:${e[0].feed_id}`,s=this.activeFeeds[i];return s&&iv.call(s,{member:t.member},!1),t},this.queryPollAnswers=async e=>{let t={...e.filter??{},is_answer:!0},i={...e,filter:t};return await this.queryPollVotes(i)},this.queryPollOptionVotes=async e=>await this.queryPollVotes(e),this.disconnectUser=async()=>{this.wsConnection&&(this.wsConnection?.offAll(),await this.wsConnection?.disconnect(),this.wsConnection=void 0),tW(this.updateNetworkConnectionStatus),this.connectionIdManager.reset(),this.tokenManager.reset(),this.polls_by_id.clear(),this.activeActivities=[],this.activeFeeds={},this.healthyConnectionChangedEventCount=0,this.state.partialNext(this.initialState),this.cancelGetBatchOwnFieldsTimer(),i5.clear()},this.on=this.eventDispatcher.on,this.off=this.eventDispatcher.off,this.feed=(e,t,i)=>this.getOrCreateActiveFeed({group:e,id:t,options:i,fieldsToUpdate:[]}),this.activityWithStateUpdates=(e,{fromResponse:t}={fromResponse:void 0})=>{let i=new sa(e,this,{fromResponse:t});return this.activeActivities.push(i),i},this.updateNetworkConnectionStatus=e=>{let t={type:"network.changed",online:"online"===e.type};this.eventDispatcher.dispatch(t)},this.getOrCreateActiveFeed=({group:e,id:t,data:i,watch:s,options:n,fieldsToUpdate:a})=>{let o=`${e}:${t}`,r=!1;this.activeFeeds[o]||(r=!0,this.activeFeeds[o]=new i8(this,e,t,i,s,n?.onNewActivity));let d=this.activeFeeds[o];r||n?.onNewActivity===void 0||(d.onNewActivity=n.onNewActivity);let l=r;if(!d.currentState.watch&&(!r&&i&&(d.currentState.updated_at?.getTime()??0)<i.updated_at.getTime()&&(iW.call(d,{feed:i}),l=!0),s&&i0.call(d)),!l&&i&&a.length>0){let e=[];
1if([["own_capabilities",sc],["own_follows",sd],["own_membership",sl],["own_followings",sp]].forEach(([t,s])=>{a.includes(t)&&!s(d.currentState,i)&&e.push(t)}),e.length>0){let t=e.reduce((e,t)=>(e[t]=i[t],e),{});d.state.partialNext(t)}}return d},this.state=new v(this.initialState),this.moderation=new t4(n),this.tokenManager=i,this.connectionIdManager=s,this.polls_by_id=new Map,this.query_batch_own_fields_throttling_interval=t?.query_batch_own_fields_throttling_interval??2e3,tN.configureLoggers(t?.configure_loggers_options),this.on("all",e=>{let t=e.fid,i=this.findAllActiveFeedsFromWSEvent(e);switch(e.type){case"connection.changed":{let{online:t}=e;if(this.state.partialNext({is_ws_connection_healthy:t}),t)this.recoverOnReconnect();else for(let e of this.allActiveFeeds)i1.bind(e)();break}case"feeds.feed.created":if(this.activeFeeds[e.feed.id])break;this.getOrCreateActiveFeed({group:e.feed.group_id,id:e.feed.id,data:e.feed,fieldsToUpdate:[]});break;case"feeds.feed.deleted":i.forEach(t=>t.handleWSEvent(e)),"string"==typeof t&&(delete this.activeFeeds[t],this.activeActivities=this.activeActivities.filter(e=>so.call(e)?.feed!==t));break;case"feeds.poll.closed":e.poll?.id&&this.pollFromState(e.poll.id)?.handlePollClosed(e),this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.poll.deleted":if(e.poll?.id)for(let t of(this.polls_by_id.delete(e.poll.id),this.allActiveFeeds)){let i=t.currentState.activities;if(i){let s=[],n=!1;for(let t of i)t.poll?.id===e.poll.id&&(delete t.poll,n=!0),s.push(t);n&&t.state.partialNext({activities:s})}}this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.poll.updated":e.poll?.id&&this.pollFromState(e.poll.id)?.handlePollUpdated(e),this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.poll.vote_casted":e.poll?.id&&this.pollFromState(e.poll.id)?.handleVoteCasted(e),this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.poll.vote_changed":e.poll?.id&&this.pollFromState(e.poll.id)?.handleVoteChanged(e),this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.poll.vote_removed":e.poll?.id&&this.pollFromState(e.poll.id)?.handleVoteRemoved(e),this.dispatchPollEventToInterestedFeeds(e);break;case"feeds.bookmark.added":case"feeds.bookmark.deleted":case"feeds.bookmark.updated":{let t=e.bookmark.activity.id;this.findAllActiveFeedsByActivityId(t).forEach(t=>t.handleWSEvent(e));break}case"feeds.activity.feedback":{let t=e.activity_feedback.activity_id;this.findAllActiveFeedsByActivityId(t).forEach(t=>t.handleWSEvent(e));break}case"user.updated":i9.call(this,e);break;default:i.forEach(t=>t.handleWSEvent(e)),"feeds.activity.deleted"===e.type&&(this.activeActivities=this.activeActivities.filter(t=>t.id!==e.activity.id))}})}get allActiveFeeds(){return[...Object.values(this.activeFeeds),...Object.values(this.activeActivities).filter(e=>!!so.call(e)).map(e=>so.call(e))]}hydratePollCache(e){for(let t of e)[t.poll,t.parent?.poll].filter(e=>!!e).forEach(e=>{let t=this.pollFromState(e.id);if(t)t.reinitializeState(e);else{let t=new t6({client:this,poll:e});this.polls_by_id.set(t.id,t)}})}async addActivity(e){let t=await super.addActivity(e);return e.feeds.forEach(e=>{let i=this.activeFeeds[e];i&&i7.call(i,t.activity)}),t}async queryFeeds(e){let t=await this._queryFeeds(e);return{feeds:t.feeds.map(t=>this.getOrCreateActiveFeed({group:t.group_id,id:t.id,data:t,watch:e?.watch,fieldsToUpdate:e?.enrich_own_fields?["own_capabilities","own_follows","own_membership","own_followings"]:[]})),next:t.next,prev:t.prev,metadata:t.metadata,duration:t.duration}}async ownBatch(e){let t=await i2(()=>super.ownBatch(e));return Object.entries(t.data).forEach(([e,t])=>{let i=this.activeFeeds[e];i&&i.state.partialNext(t)}),t}async updateFollow(e){let t=await super.updateFollow(e);return[t.follow.source_feed.feed,t.follow.target_feed.feed].forEach(e=>{this.findAllActiveFeedsByFid(e).forEach(e=>il.bind(e)(t,!1))}),this.checkIfOwnFieldsChanged(t.follow.source_feed,!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.target_feed,!!e.enrich_own_fields),t}async acceptFollow(...e){let t=await super.acceptFollow(...e);return[t.follow.source_feed.feed,t.follow.target_feed.feed].forEac
1h(e=>{this.findAllActiveFeedsByFid(e).forEach(e=>il.bind(e)(t,!1))}),t}async follow(e){let t=await super.follow(e);return this.updateStateFromFollows([t.follow],!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.source_feed,!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.target_feed,!!e.enrich_own_fields),t}async followBatch(e){let t=await super.followBatch(e);this.updateStateFromFollows(t.follows,!!e.enrich_own_fields);let i=!!e.enrich_own_fields;for(let e of t.follows)this.checkIfOwnFieldsChanged(e.source_feed,i),this.checkIfOwnFieldsChanged(e.target_feed,i);return t}async getOrCreateFollows(e){let t=await super.getOrCreateFollows(e);this.updateStateFromFollows(t.created,!!e.enrich_own_fields);let i=!!e.enrich_own_fields;for(let e of[...t.created,...t.follows])this.checkIfOwnFieldsChanged(e.source_feed,i),this.checkIfOwnFieldsChanged(e.target_feed,i);return t}async getOrCreateFollow(e){let t=await super.getOrCreateFollow(e);return this.updateStateFromFollows([t.follow],!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.source_feed,!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.target_feed,!!e.enrich_own_fields),t}async unfollow(e){let t=await super.unfollow(e);return this.updateStateFromUnfollows([t.follow]),this.checkIfOwnFieldsChanged(t.follow.source_feed,!!e.enrich_own_fields),this.checkIfOwnFieldsChanged(t.follow.target_feed,!!e.enrich_own_fields),t}async getOrCreateUnfollows(e){let t=await super.getOrCreateUnfollows(e);this.updateStateFromUnfollows(t.follows);let i=!!e.enrich_own_fields;for(let e of t.follows)this.checkIfOwnFieldsChanged(e.source_feed,i),this.checkIfOwnFieldsChanged(e.target_feed,i);return t}async stopWatchingFeed(e){let t=await this.connectionIdManager.getConnectionId(),i=await super.stopWatchingFeed({...e,connection_id:t});return this.findAllActiveFeedsByFid(`${e.feed_group_id}:${e.feed_id}`).forEach(e=>i1.bind(e)()),i}async getOrCreateFeed(e){let t=await super.getOrCreateFeed(e);return e.watch&&this.findAllActiveFeedsByFid(`${e.feed_group_id}:${e.feed_id}`).forEach(e=>i0.bind(e)()),t}async getFollowSuggestions(...e){let t=await super.getFollowSuggestions(...e),i=t.suggestions.map(e=>this.getOrCreateActiveFeed({group:e.group_id,id:e.id,data:e,fieldsToUpdate:["own_capabilities","own_follows","own_membership","own_followings"]}));return{...t,feeds:i}}checkIfOwnFieldsChanged(e,t){if(!t||!this.activeFeeds[e.feed])return!1;this.getOrCreateActiveFeed({group:e.group_id,id:e.id,data:e,fieldsToUpdate:["own_capabilities","own_follows","own_membership","own_followings"]})}findAllActiveFeedsByActivityId(e){return[...Object.values(this.activeFeeds),...Object.values(this.activeActivities).filter(e=>!!so.call(e)).map(e=>so.call(e))].filter(t=>t.hasActivity(e)||t.hasPinnedActivity(e))}findAllActiveFeedsByFid(e){if(!e)return[];let t=this.activeFeeds[e];return[...t?[t]:[],...Object.values(this.activeActivities).filter(t=>so.call(t)?.feed===e).map(e=>so.call(e))]}findAllActiveFeedsFromWSEvent(e){let t="fid"in e?e.fid:void 0;if(!t)return[];let i=t?this.activeFeeds[t]:void 0;return[...i?[i]:[],...Object.values(this.activeActivities).filter(e=>so.call(e)?.feed===t||e.currentState.activity?.feeds.some(e=>e===t)).map(e=>so.call(e))]}dispatchPollEventToInterestedFeeds(e){new Set(this.findAllActiveFeedsFromWSEvent(e)).forEac
1h(t=>t.handleWSEvent(e))}updateStateFromFollows(e,t){e.forEach(e=>{[...this.findAllActiveFeedsByFid(e.source_feed.feed),...this.findAllActiveFeedsByFid(e.target_feed.feed)].forEach(i=>ir.bind(i)({follow:e},!1,t))})}updateStateFromUnfollows(e){e.forEach(e=>{[...this.findAllActiveFeedsByFid(e.source_feed.feed),...this.findAllActiveFeedsByFid(e.target_feed.feed)].forEach(t=>id.bind(t)({follow:e},!1))})}get initialState(){return{connected_user:void 0,is_anonymous:!1,is_ws_connection_healthy:!1}}checkIfUserIsConnected(){if(void 0!==this.state.getLatestValue().connected_user||this.wsConnection||this.state.getLatestValue().is_anonymous)throw Error('Can\'t connect a new user, call "disconnectUser" first')}},sy=e.i(114134);let s_=(0,f.createContext)({client:null,userId:null});e.s(["StreamProvider",0,function(e){let t,i,s,n,a=(0,h.c)(8),{children:o}=e,[r,d]=(0,f.useState)(null),[l,c]=(0,f.useState)(null),p=(0,f.useRef)(!1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{if(p.current)return;p.current=!0;let e=null,t=(0,sy.getVisitorId)();return c(t),(async()=>{let i=await fetch("/api/stream/token",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({userId:t})});if(!i.ok)return;let{token:s,apiKey:n}=await i.json();e=new su(n),await e.connectUser({id:t},s),d(e)})(),()=>{e?.disconnectUser?.(),p.current=!1}},i=[],a[0]=t,a[1]=i):(t=a[0],i=a[1]),(0,f.useEffect)(t,i),a[2]!==r||a[3]!==l?(s={client:r,userId:l},a[2]=r,a[3]=l,a[4]=s):s=a[4],a[5]!==o||a[6]!==s?(n=(0,m.jsx)(s_.Provider,{value:s,children:o}),a[5]=o,a[6]=s,a[7]=n):n=a[7],n},"useStream",0,()=>(0,f.useContext)(s_)],522318)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.