/*! For license information please see getstream.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.stream=t():e.stream=t()}(self,(()=>(()=>{var e={9272:(e,t,n)=>{"use strict";var r=n(723),i=[],o=[],s=r.makeRequestCallFromTimer((function(){if(o.length)throw o.shift()}));function a(e){var t;(t=i.length?i.pop():new c).task=e,r(t)}function c(){this.task=null}e.exports=a,c.prototype.call=function(){try{this.task.call()}catch(e){a.onerror?a.onerror(e):(o.push(e),s())}finally{this.task=null,i[i.length]=this}}},723:(e,t,n)=>{"use strict";function r(e){o.length||i(),o[o.length]=e}e.exports=r;var i,o=[],s=0;function a(){for(;s1024){for(var t=0,n=o.length-s;t{"use strict";n.d(t,{n:()=>kt});var r={};n.r(r),n.d(r,{hasBrowserEnv:()=>de,hasStandardBrowserEnv:()=>pe,hasStandardBrowserWebWorkerEnv:()=>ye});var i=n(8152),o=n(4925),s=n(5861),a=n(5671),c=n(3144),u=n(4942),l=n(4687),h=n.n(l),f=n(8854),d=n(5697);function p(e,t){return function(){return e.apply(t,arguments)}}const{toString:v}=Object.prototype,{getPrototypeOf:y}=Object,g=(m=Object.create(null),e=>{const t=v.call(e);return m[t]||(m[t]=t.slice(8,-1).toLowerCase())});var m;const _=e=>(e=e.toLowerCase(),t=>g(t)===e),b=e=>t=>typeof t===e,{isArray:w}=Array,E=b("undefined"),k=_("ArrayBuffer"),O=b("string"),T=b("function"),S=b("number"),x=e=>null!==e&&"object"==typeof e,A=e=>{if("object"!==g(e))return!1;const t=y(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},C=_("Date"),R=_("File"),N=_("Blob"),j=_("FileList"),I=_("URLSearchParams");function P(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),w(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!E(e)&&e!==D,Z=(F="undefined"!=typeof Uint8Array&&y(Uint8Array),e=>F&&e instanceof F);var F;const M=_("HTMLFormElement"),q=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),B=_("RegExp"),z=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};P(n,((n,i)=>{let o;!1!==(o=t(n,i,e))&&(r[i]=o||n)})),Object.defineProperties(e,r)},H="abcdefghijklmnopqrstuvwxyz",V="0123456789",K={DIGIT:V,ALPHA:H,ALPHA_DIGIT:H+H.toUpperCase()+V},$=_("AsyncFunction"),G={isArray:w,isArrayBuffer:k,isBuffer:function(e){return null!==e&&!E(e)&&null!==e.constructor&&!E(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||T(e.append)&&("formdata"===(t=g(e))||"object"===t&&T(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&k(e.buffer),t},isString:O,isNumber:S,isBoolean:e=>!0===e||!1===e,isObject:x,isPlainObject:A,isUndefined:E,isDate:C,isFile:R,isBlob:N,isRegExp:B,isFunction:T,isStream:e=>x(e)&&T(e.pipe),isURLSearchParams:I,isTypedArray:Z,isFileList:j,forEach:P,merge:function e(){const{caseless:t}=L(this)&&this||{},n={},r=(r,i)=>{const o=t&&U(n,i)||i;A(n[o])&&A(r)?n[o]=e(n[o],r):A(r)?n[o]=e({},r):w(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(P(t,((t,r)=>{n&&T(t)?e[r]=p(t,n):e[r]=t}),{allOwnKeys:r}),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,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&y(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:g,kindOfTest:_,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(w(e))return e;let t=e.length;if(!S(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:M,hasOwnProperty:q,hasOwnProp:q,reduceDescriptors:z,freezeMethods:e=>{z(e,((t,n)=>{if(T(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];T(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return w(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:U,global:D,isContextDefined:L,ALPHABET:K,generateString:(e=16,t=K.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&T(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(x(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=w(e)?[]:{};return P(e,((e,t)=>{const o=n(e,r+1);!E(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:$,isThenable:e=>e&&(x(e)||T(e))&&T(e.then)&&T(e.catch)};function J(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}G.inherits(J,Error,{toJSON:function(){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:G.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Y=J.prototype,W={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{W[e]={value:e}})),Object.defineProperties(J,W),Object.defineProperty(Y,"isAxiosError",{value:!0}),J.from=(e,t,n,r,i,o)=>{const s=Object.create(Y);return G.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),J.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const X=J;function Q(e){return G.isPlainObject(e)||G.isArray(e)}function ee(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function te(e,t,n){return e?e.concat(t).map((function(e,t){return e=ee(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ne=G.toFlatObject(G,{},null,(function(e){return/^is[A-Z]/.test(e)})),re=function(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!G.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(G.isDate(e))return e.toISOString();if(!a&&G.isBlob(e))throw new X("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(e)||G.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(G.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(G.isArray(e)&&function(e){return G.isArray(e)&&!e.some(Q)}(e)||(G.isFileList(e)||G.endsWith(n,"[]"))&&(a=G.toArray(e)))return n=ee(n),a.forEach((function(e,r){!G.isUndefined(e)&&null!==e&&t.append(!0===s?te([n],r,o):null===s?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(te(i,n,o),c(e)),!1)}const l=[],h=Object.assign(ne,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!G.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!G.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),G.forEach(n,(function(n,o){!0===(!(G.isUndefined(n)||null===n)&&i.call(t,n,G.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t};function ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function oe(e,t){this._pairs=[],e&&re(e,this,t)}const se=oe.prototype;se.append=function(e,t){this._pairs.push([e,t])},se.toString=function(e){const t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const ae=oe;function ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ue(e,t,n){if(!t)return e;const r=n&&n.encode||ce,i=n&&n.serialize;let o;if(o=i?i(t,n):G.isURLSearchParams(t)?t.toString():new ae(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const le=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){G.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},he={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ae,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},de="undefined"!=typeof window&&"undefined"!=typeof document,pe=(ve="undefined"!=typeof navigator&&navigator.product,de&&["ReactNative","NativeScript","NS"].indexOf(ve)<0);var ve;const ye="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ge={...r,...fe},me=function(e){function t(e,n,r,i){let o=e[i++];const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&G.isArray(r)?r.length:o,a?(G.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):(r[o]&&G.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&G.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},_e={transitional:he,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=G.isObject(e);if(i&&G.isHTMLForm(e)&&(e=new FormData(e)),G.isFormData(e))return r&&r?JSON.stringify(me(e)):e;if(G.isArrayBuffer(e)||G.isBuffer(e)||G.isStream(e)||G.isFile(e)||G.isBlob(e))return e;if(G.isArrayBufferView(e))return e.buffer;if(G.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return re(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ge.isNode&&G.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=G.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return re(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(G.isString(e))try{return(0,JSON.parse)(e),G.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||_e.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&G.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw X.from(e,X.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:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],(e=>{_e.headers[e]={}}));const be=_e,we=G.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"]),Ee=Symbol("internals");function ke(e){return e&&String(e).trim().toLowerCase()}function Oe(e){return!1===e||null==e?e:G.isArray(e)?e.map(Oe):String(e)}function Te(e,t,n,r,i){return G.isFunction(r)?r.call(this,t,n):(i&&(t=n),G.isString(t)?G.isString(r)?-1!==t.indexOf(r):G.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=ke(t);if(!i)throw new Error("header name must be a non-empty string");const o=G.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=Oe(e))}const o=(e,t)=>G.forEach(e,((e,n)=>i(e,n,t)));return G.isPlainObject(e)||e instanceof this.constructor?o(e,t):G.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=ke(e)){const n=G.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(G.isFunction(t))return t.call(this,e,n);if(G.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ke(e)){const n=G.findKey(this,e);return!(!n||void 0===this[n]||t&&!Te(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=ke(e)){const i=G.findKey(n,e);!i||t&&!Te(0,n[i],i,t)||(delete n[i],r=!0)}}return G.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Te(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return G.forEach(this,((r,i)=>{const o=G.findKey(n,i);if(o)return t[o]=Oe(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete t[i],t[s]=Oe(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return G.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&G.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Ee]=this[Ee]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ke(e);t[r]||(function(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return G.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),G.reduceDescriptors(Se.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),G.freezeMethods(Se);const xe=Se;function Ae(e,t){const n=this||be,r=t||n,i=xe.from(r.headers);let o=r.data;return G.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function Ce(e){return!(!e||!e.__CANCEL__)}function Re(e,t,n){X.call(this,null==e?"canceled":e,X.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(Re,X,{__CANCEL__:!0});const Ne=Re,je=ge.hasStandardBrowserEnv?{write:function(e,t,n,r,i,o){const s=[];s.push(e+"="+encodeURIComponent(t)),G.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),G.isString(r)&&s.push("path="+r),G.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Ie(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Pe=ge.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=G.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ue(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];i||(i=c),n[o]=a,r[o]=c;let l=s,h=0;for(;l!==o;)h+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a);n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const De={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=xe.from(e.headers).normalize(),o=e.responseType;let s,a;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(G.isFormData(r))if(ge.hasStandardBrowserEnv||ge.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(a=i.getContentType())){const[e,...t]=a?a.split(";").map((e=>e.trim())).filter(Boolean):[];i.setContentType([e||"multipart/form-data",...t].join("; "))}let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const l=Ie(e.baseURL,e.url);function h(){if(!u)return;const r=xe.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new X("Request failed with status code "+n.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:o&&"text"!==o&&"json"!==o?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),ue(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(h)},u.onabort=function(){u&&(n(new X("Request aborted",X.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new X("Network Error",X.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||he;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new X(t,r.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,e,u)),u=null},ge.hasStandardBrowserEnv){const t=Pe(l)&&e.xsrfCookieName&&je.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in u&&G.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),G.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&"json"!==o&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Ue(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Ue(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{u&&(n(!t||t.type?new Ne(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);f&&-1===ge.protocols.indexOf(f)?n(new X("Unsupported protocol "+f+":",X.ERR_BAD_REQUEST,e)):u.send(r||null)}))}};G.forEach(De,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Le=e=>`- ${e}`,Ze=e=>G.isFunction(e)||null===e||!1===e,Fe=e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Le).join("\n"):" "+Le(e[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Me(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ne(null,e)}function qe(e){return Me(e),e.headers=xe.from(e.headers),e.data=Ae.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Fe(e.adapter||be.adapter)(e).then((function(t){return Me(e),t.data=Ae.call(e,e.transformResponse,t),t.headers=xe.from(t.headers),t}),(function(t){return Ce(t)||(Me(e),t&&t.response&&(t.response.data=Ae.call(e,e.transformResponse,t.response),t.response.headers=xe.from(t.response.headers))),Promise.reject(t)}))}const Be=e=>e instanceof xe?e.toJSON():e;function ze(e,t){t=t||{};const n={};function r(e,t,n){return G.isPlainObject(e)&&G.isPlainObject(t)?G.merge.call({caseless:n},e,t):G.isPlainObject(t)?G.merge({},t):G.isArray(t)?t.slice():t}function i(e,t,n){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!G.isUndefined(t))return r(void 0,t)}function s(e,t){return G.isUndefined(t)?G.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t)=>i(Be(e),Be(t),!0)};return G.forEach(Object.keys(Object.assign({},e,t)),(function(r){const o=c[r]||i,s=o(e[r],t[r],r);G.isUndefined(s)&&o!==a||(n[r]=s)})),n}const He={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{He[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ve={};He.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.1] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new X(r(i," has been removed"+(t?" in "+t:"")),X.ERR_DEPRECATED);return t&&!Ve[i]&&(Ve[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};const Ke={assertOptions:function(e,t,n){if("object"!=typeof e)throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new X("option "+o+" must be "+n,X.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new X("Unknown option "+o,X.ERR_BAD_OPTION)}},validators:He},$e=Ke.validators;class Ge{constructor(e){this.defaults=e,this.interceptors={request:new le,response:new le}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ze(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Ke.assertOptions(n,{silentJSONParsing:$e.transitional($e.boolean),forcedJSONParsing:$e.transitional($e.boolean),clarifyTimeoutError:$e.transitional($e.boolean)},!1),null!=r&&(G.isFunction(r)?t.paramsSerializer={serialize:r}:Ke.assertOptions(r,{encode:$e.function,serialize:$e.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&G.merge(i.common,i[t.method]);i&&G.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=xe.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!a){const e=[qe.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);h{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new Ne(e,r,i),t(n.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;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ye((function(t){e=t})),cancel:e}}}const We=Ye,Xe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent: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};Object.entries(Xe).forEach((([e,t])=>{Xe[t]=e}));const Qe=Xe,et=function e(t){const n=new Je(t),r=p(Je.prototype.request,n);return G.extend(r,Je.prototype,n,{allOwnKeys:!0}),G.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ze(t,n))},r}(be);et.Axios=Je,et.CanceledError=Ne,et.CancelToken=We,et.isCancel=Ce,et.VERSION="1.6.1",et.toFormData=re,et.AxiosError=X,et.Cancel=et.CanceledError,et.all=function(e){return Promise.all(e)},et.spread=function(e){return function(t){return e.apply(null,t)}},et.isAxiosError=function(e){return G.isObject(e)&&!0===e.isAxiosError},et.mergeConfig=ze,et.AxiosHeaders=xe,et.formToJSON=e=>me(G.isHTMLForm(e)?new FormData(e):e),et.getAdapter=Fe,et.HttpStatusCode=Qe,et.default=et;const tt=et;var nt=n(2965);class rt extends Error{}rt.prototype.name="InvalidTokenError";var it=n(8039),ot=n(3709),st=n(448),at=n(9082),ct=n(8824),ut=n(7878),lt=n(6685),ht=n(2589),ft=n(2637),dt=n(6793),pt=n.n(dt),vt=n(7496),yt=n.n(vt),gt=n(7248),mt=["method","token"],_t=["ids","foreignIDTimes"],bt=["activities"];function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Et(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};if((0,a.Z)(this,e),(0,u.Z)(this,"baseUrl",void 0),(0,u.Z)(this,"baseAnalyticsUrl",void 0),(0,u.Z)(this,"apiKey",void 0),(0,u.Z)(this,"appId",void 0),(0,u.Z)(this,"usingApiSecret",void 0),(0,u.Z)(this,"apiSecret",void 0),(0,u.Z)(this,"userToken",void 0),(0,u.Z)(this,"enrichByDefault",void 0),(0,u.Z)(this,"options",void 0),(0,u.Z)(this,"userId",void 0),(0,u.Z)(this,"authPayload",void 0),(0,u.Z)(this,"version",void 0),(0,u.Z)(this,"fayeUrl",void 0),(0,u.Z)(this,"group",void 0),(0,u.Z)(this,"expireTokens",void 0),(0,u.Z)(this,"location",void 0),(0,u.Z)(this,"fayeClient",void 0),(0,u.Z)(this,"browser",void 0),(0,u.Z)(this,"node",void 0),(0,u.Z)(this,"nodeOptions",void 0),(0,u.Z)(this,"request",void 0),(0,u.Z)(this,"subscriptions",void 0),(0,u.Z)(this,"handlers",void 0),(0,u.Z)(this,"currentUser",void 0),(0,u.Z)(this,"personalization",void 0),(0,u.Z)(this,"collections",void 0),(0,u.Z)(this,"files",void 0),(0,u.Z)(this,"images",void 0),(0,u.Z)(this,"reactions",void 0),(0,u.Z)(this,"_personalizationToken",void 0),(0,u.Z)(this,"_collectionsToken",void 0),(0,u.Z)(this,"_getOrCreateToken",void 0),(0,u.Z)(this,"addToMany",void 0),(0,u.Z)(this,"followMany",void 0),(0,u.Z)(this,"unfollowMany",void 0),(0,u.Z)(this,"createRedirectUrl",void 0),(0,u.Z)(this,"replaceReactionOptions",(function(e){null!=e&&e.reactions&&(null!=e.reactions.own&&(e.withOwnReactions=e.reactions.own),null!=e.reactions.recent&&(e.withRecentReactions=e.reactions.recent),null!=e.reactions.ranking_vars&&(e.rankingVars=e.reactions.ranking_vars),null!=e.reactions.score_vars&&(e.withScoreVars=e.reactions.score_vars),null!=e.reactions.counts&&(e.withReactionCounts=e.reactions.counts),null!=e.reactions.own_children&&(e.withOwnChildren=e.reactions.own_children),null!=e.reactions.kinds&&(e.reactionKindsFilter=e.reactions.kinds),null!=e.reactions.user_id&&(e.withUserId=e.reactions.user_id),delete e.reactions)})),(0,u.Z)(this,"handleResponse",(function(e){if(/^2/.test("".concat(e.status)))return c.send("response",null,e,e.data),e.data;throw new ht.eY("".concat(JSON.stringify(e.data)," with HTTP status code ").concat(e.status),e.data,e)})),(0,u.Z)(this,"doAxiosRequest",function(){var e=(0,s.Z)(h().mark((function e(t,n){var r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c.send("request",t,n),e.prev=1,e.next=4,c.request(c.enrichKwargs(Et({method:t},n)));case 4:return r=e.sent,e.abrupt("return",c.handleResponse(r));case 8:if(e.prev=8,e.t0=e.catch(1),!(i=e.t0).response){e.next=13;break}return e.abrupt("return",c.handleResponse(i.response));case 13:throw new ht.z4(i.message);case 14:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}()),this.baseUrl="https://api.stream-io-api.com/api/",this.baseAnalyticsUrl="https://analytics.stream-io-api.com/analytics/",this.apiKey=t,this.usingApiSecret=null!=n&&!n.includes("."),this.apiSecret=this.usingApiSecret?n:null,this.userToken=this.usingApiSecret?null:n,this.enrichByDefault=!this.usingApiSecret,null!=this.userToken){var p=function(e,t){if("string"!=typeof e)throw new rt("Invalid token specified: must be a string");t||(t={});const n=!0===t.header?0:1,r=e.split(".")[n];if("string"!=typeof r)throw new rt(`Invalid token specified: missing part #${n+1}`);let i;try{i=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return atob(t)}}(r)}catch(e){throw new rt(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new rt(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}(this.userToken);if(!p.user_id)throw new TypeError("user_id is missing in user token");this.userId=p.user_id,this.currentUser=this.user(this.userId)}if(this.appId=r,this.options=l,this.version=this.options.version||"v1.0",this.fayeUrl=this.options.fayeUrl||"https://faye-us-east.stream-io-api.com/faye",this.fayeClient=null,this.group=this.options.group||"unspecified",this.subscriptions={},this.expireTokens=!!this.options.expireTokens&&this.options.expireTokens,this.location=this.options.location,this.baseUrl=this.getBaseUrl(),"undefined"!=typeof process&&(null!==(i={PACKAGE_VERSION:"8.4.0"})&&void 0!==i&&i.LOCAL_FAYE&&(this.fayeUrl="http://localhost:9999/faye/"),null!==(o={PACKAGE_VERSION:"8.4.0"})&&void 0!==o&&o.STREAM_ANALYTICS_BASE_URL&&(this.baseAnalyticsUrl={PACKAGE_VERSION:"8.4.0"}.STREAM_ANALYTICS_BASE_URL)),this.handlers={},this.node="undefined"==typeof window,this.browser=void 0!==this.options.browser?this.options.browser:!this.node,this.node){var v=void 0===this.options.keepAlive||this.options.keepAlive;this.nodeOptions={httpAgent:new f.Agent({keepAlive:v,keepAliveMsecs:3e3}),httpsAgent:new d.Agent({keepAlive:v,keepAliveMsecs:3e3})}}if(this.request=tt.create(Et({timeout:this.options.timeout||1e4,withCredentials:!1},this.nodeOptions||{})),this.personalization=new it.S(this),this.browser&&this.usingApiSecret)throw new ht.IY('You are publicly sharing your App Secret. Do not expose the App Secret in browsers, "native" mobile apps, or other non-trusted environments.');this.collections=new ot.n(this,this.getOrCreateToken()),this.files=new st.h(this,this.getOrCreateToken()),this.images=new at.$(this,this.getOrCreateToken()),this.reactions=new ct.R(this,this.getOrCreateToken()),pt()&&yt()&&(this.addToMany=pt().addToMany,this.followMany=pt().followMany,this.unfollowMany=pt().unfollowMany,this.createRedirectUrl=yt())}var t,r;return(0,c.Z)(e,[{key:"_throwMissingApiSecret",value:function(){if(!this.usingApiSecret)throw new ht.z4("This method can only be used server-side using your API Secret, use client = stream.connect(key, secret);")}},{key:"getPersonalizationToken",value:function(){return this._personalizationToken||(this._throwMissingApiSecret(),this._personalizationToken=(0,lt.v)(this.apiSecret,"personalization","*",{userId:"*",feedId:"*",expireTokens:this.expireTokens})),this._personalizationToken}},{key:"getCollectionsToken",value:function(){return this._collectionsToken||(this._throwMissingApiSecret(),this._collectionsToken=(0,lt.v)(this.apiSecret,"collections","*",{feedId:"*",expireTokens:this.expireTokens})),this._collectionsToken}},{key:"getAnalyticsToken",value:function(){return this._throwMissingApiSecret(),(0,lt.v)(this.apiSecret,"analytics","*",{userId:"*",expireTokens:this.expireTokens})}},{key:"getBaseUrl",value:function(e){var t,n;if(e||(e="api"),this.options.urlOverride&&this.options.urlOverride[e])return this.options.urlOverride[e];var r="api"===e?"STREAM_BASE_URL":"STREAM_".concat(e.toUpperCase(),"_URL");if("undefined"!=typeof process&&null!==(t={PACKAGE_VERSION:"8.4.0"})&&void 0!==t&&t[r])return{PACKAGE_VERSION:"8.4.0"}[r];if("undefined"!=typeof process&&null!==(n={PACKAGE_VERSION:"8.4.0"})&&void 0!==n&&n.LOCAL||this.options.local)return"http://localhost:8000/".concat(e,"/");if(this.location){var i=this.options.protocol||"https";return"".concat(i,"://").concat(this.location,"-").concat(e,".stream-io-api.com/").concat(e,"/")}return"api"!==e?"https://".concat(e,".stream-io-api.com/").concat(e,"/"):this.baseUrl}},{key:"on",value:function(e,t){this.handlers[e]=t}},{key:"off",value:function(e){void 0===e?this.handlers={}:delete this.handlers[e]}},{key:"send",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{};if(void 0!==e.enrich){var t=e.enrich;return delete e.enrich,t}return this.enrichByDefault||null!=e.ownReactions||null!=e.reactionKindsFilter||null!=e.withRecentReactions||null!=e.withScoreVars||null!=e.withReactionCounts||null!=e.withOwnChildren||null!=e.withUserId}},{key:"enrichKwargs",value:function(e){var t=e.method,n=e.token,r=(0,o.Z)(e,mt);return Et({method:t,url:this.enrichUrl(r.url,r.serviceName),data:r.body,params:Et({api_key:this.apiKey,location:this.group},r.qs||{}),headers:Et({"X-Stream-Client":this.userAgent(),"stream-auth-type":"jwt",Authorization:n},r.headers||{})},r.axiosOptions||{})}},{key:"getFayeAuthorization",value:function(){var e=this;return{incoming:function(e,t){return t(e)},outgoing:function(t,n){if(t.subscription&&e.subscriptions[t.subscription]){var r=e.subscriptions[t.subscription];t.ext={user_id:r.userId,api_key:e.apiKey,signature:r.token}}n(t)}}}},{key:"getFayeClient",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;if(null===this.fayeClient){this.fayeClient=new nt.Client(this.fayeUrl,{timeout:e});var t=this.getFayeAuthorization();this.fayeClient.addExtension(t)}return this.fayeClient}},{key:"upload",value:function(e,t,n,r,i){var o=ft.Z.addFileToFormData(t,n,r);return this.doAxiosRequest("POST",{url:e,body:o,headers:o.getHeaders?o.getHeaders():{},token:this.getOrCreateToken(),axiosOptions:{timeout:0,maxContentLength:1/0,maxBodyLength:1/0,onUploadProgress:i}})}},{key:"get",value:function(e){return this.doAxiosRequest("GET",e)}},{key:"post",value:function(e){return this.doAxiosRequest("POST",e)}},{key:"delete",value:function(e){return this.doAxiosRequest("DELETE",e)}},{key:"put",value:function(e){return this.doAxiosRequest("PUT",e)}},{key:"createUserToken",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._throwMissingApiSecret(),(0,lt.c)(this.apiSecret,e,t,{noTimestamp:!this.expireTokens})}},{key:"updateActivities",value:function(e){if(this._throwMissingApiSecret(),!(e instanceof Array))throw new TypeError("The activities argument should be an Array");var t=(0,lt.v)(this.apiSecret,"activities","*",{feedId:"*",expireTokens:this.expireTokens});return this.post({url:"activities/",body:{activities:e},token:t})}},{key:"updateActivity",value:function(e){return this._throwMissingApiSecret(),this.updateActivities([e])}},{key:"getActivities",value:function(e){var t=e.ids,n=e.foreignIDTimes,r=(0,o.Z)(e,_t),i={};if(t){if(!(t instanceof Array))throw new TypeError("The ids argument should be an Array");i.ids=t.join(",")}else{if(!n)throw new TypeError("Missing ids or foreignIDTimes params");if(!(n instanceof Array))throw new TypeError("The foreignIDTimes argument should be an Array");var s=[],a=[];n.forEach((function(e){if(!(e instanceof Object))throw new TypeError("foreignIDTimes elements should be Objects");s.push(e.foreign_id||e.foreignID),a.push(e.time)})),i.foreign_ids=s.join(","),i.timestamps=a.join(",")}var c=this.userToken;this.usingApiSecret&&(c=(0,lt.v)(this.apiSecret,"activities","*",{feedId:"*",expireTokens:this.expireTokens})),this.replaceReactionOptions(r);var u=this.shouldUseEnrichEndpoint(r)?"enrich/activities/":"activities/";return this.get({url:u,qs:Et(Et({},r),i),token:c})}},{key:"getOrCreateToken",value:function(){return this._getOrCreateToken||(this._getOrCreateToken=this.usingApiSecret?(0,lt.v)(this.apiSecret,"*","*",{feedId:"*"}):this.userToken),this._getOrCreateToken}},{key:"user",value:function(e){return new ut.h(this,e,this.getOrCreateToken())}},{key:"setUser",value:(r=(0,s.Z)(h().mark((function e(t){var n,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.usingApiSecret){e.next=2;break}throw new ht.z4("This method can only be used client-side using a user token");case 2:return delete(n=Et({},t)).id,e.next=6,this.currentUser.getOrCreate(n);case 6:return r=e.sent,this.currentUser=r,e.abrupt("return",r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"og",value:function(e){return this.get({url:"og/",qs:{url:e},token:this.getOrCreateToken()})}},{key:"personalizedFeed",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.get({url:"enrich/personalization/feed/",qs:e,token:this.getOrCreateToken()})}},{key:"activityPartialUpdate",value:(t=(0,s.Z)(h().mark((function e(t){var n,r,s,a,c;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.activitiesPartialUpdate([t]);case 2:return n=e.sent,r=n.activities,s=(0,o.Z)(n,bt),a=(0,i.Z)(r,1),c=a[0],e.abrupt("return",Et(Et({},c),s));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"activitiesPartialUpdate",value:function(e){if(!(e instanceof Array))throw new TypeError("changes should be an Array");e.forEach((function(e){if(!(e instanceof Object))throw new TypeError("changeset should be and Object");if(e.foreignID&&(e.foreign_id=e.foreignID),void 0===e.id&&(void 0===e.foreign_id||void 0===e.time))throw new TypeError("missing id or foreign_id and time");if(e.set&&!(e.set instanceof Object))throw new TypeError("set field should be an Object");if(e.unset&&!(e.unset instanceof Array))throw new TypeError("unset field should be an Array")}));var t=this.userToken;return this.usingApiSecret&&(t=(0,lt.v)(this.apiSecret,"activities","*",{feedId:"*",expireTokens:this.expireTokens})),this.post({url:"activity/",body:{changes:e},token:t})}}]),e}()},3709:(e,t,n)=>{"use strict";n.d(t,{R:()=>l,n:()=>h});var r=n(5861),i=n(5671),o=n(3144),s=n(4942),a=n(4687),c=n.n(a),u=n(2589),l=function(){function e(t,n,r,o){(0,i.Z)(this,e),(0,s.Z)(this,"id",void 0),(0,s.Z)(this,"collection",void 0),(0,s.Z)(this,"store",void 0),(0,s.Z)(this,"data",void 0),(0,s.Z)(this,"full",void 0),this.collection=n,this.store=t,this.id=r,this.data=o}var t,n,a,u;return(0,o.Z)(e,[{key:"ref",value:function(){return"SO:".concat(this.collection,":").concat(this.id)}},{key:"get",value:(u=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.store.get(this.collection,this.id);case 2:return t=e.sent,this.data=t.data,this.full=t,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"add",value:(a=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.store.add(this.collection,this.id,this.data);case 2:return t=e.sent,this.data=t.data,this.full=t,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(n=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.store.update(this.collection,this.id,this.data);case 2:return t=e.sent,this.data=t.data,this.full=t,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"delete",value:(t=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.store.delete(this.collection,this.id);case 2:return t=e.sent,this.data=null,this.full=null,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),h=function(){function e(t,n){(0,i.Z)(this,e),(0,s.Z)(this,"client",void 0),(0,s.Z)(this,"token",void 0),(0,s.Z)(this,"buildURL",(function(e,t){var n="collections/".concat(e,"/");return void 0===t?n:"".concat(n).concat(t,"/")})),this.client=t,this.token=n}var t,n,a;return(0,o.Z)(e,[{key:"entry",value:function(e,t,n){return new l(this,e,t,n)}},{key:"get",value:(a=(0,r.Z)(c().mark((function e(t,n){var r,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.get({url:this.buildURL(t,n),token:this.token});case 2:return r=e.sent,(i=this.entry(r.collection,r.id,r.data)).full=r,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"add",value:(n=(0,r.Z)(c().mark((function e(t,n,r){var i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.post({url:this.buildURL(t),body:{id:null===n?void 0:n,data:r},token:this.token});case 2:return i=e.sent,(o=this.entry(i.collection,i.id,i.data)).full=i,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"update",value:(t=(0,r.Z)(c().mark((function e(t,n,r){var i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.client.put({url:this.buildURL(t,n),body:{data:r},token:this.token});case 2:return i=e.sent,(o=this.entry(i.collection,i.id,i.data)).full=i,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"delete",value:function(e,t){return this.client.delete({url:this.buildURL(e,t),token:this.token})}},{key:"upsert",value:function(e,t){if(!this.client.usingApiSecret)throw new u.z4("This method can only be used server-side using your API Secret");return Array.isArray(t)||(t=[t]),this.client.post({url:"collections/",serviceName:"api",body:{data:(0,s.Z)({},e,t)},token:this.client.getCollectionsToken()})}},{key:"upsertMany",value:function(e){if(!this.client.usingApiSecret)throw new u.z4("This method can only be used server-side using your API Secret");return this.client.post({url:"collections/",serviceName:"api",body:{data:e},token:this.client.getCollectionsToken()})}},{key:"select",value:function(e,t){if(!this.client.usingApiSecret)throw new u.z4("This method can only be used server-side using your API Secret");return Array.isArray(t)||(t=[t]),this.client.get({url:"collections/",serviceName:"api",qs:{foreign_ids:t.map((function(t){return"".concat(e,":").concat(t)})).join(",")},token:this.client.getCollectionsToken()})}},{key:"deleteMany",value:function(e,t){if(!this.client.usingApiSecret)throw new u.z4("This method can only be used server-side using your API Secret");Array.isArray(t)||(t=[t]);var n={collection_name:e,ids:t.map((function(e){return e.toString()})).join(",")};return this.client.delete({url:"collections/",serviceName:"api",qs:n,token:this.client.getCollectionsToken()})}}]),e}()},2631:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(3513);function i(e,t,n,i){var o;if("undefined"!=typeof process&&null!==(o={PACKAGE_VERSION:"8.4.0"})&&void 0!==o&&o.STREAM_URL&&!e){var s=/https:\/\/(\w+):(\w+)@([\w-]*).*\?app_id=(\d+)/.exec({PACKAGE_VERSION:"8.4.0"}.STREAM_URL)||[];e=s[1],t=s[2];var a=s[3];n=s[4],void 0===i&&(i={}),"getstream"!==a&&"stream-io-api"!==a&&(i.location=a)}return new r.n(e,t,n,i)}},2589:(e,t,n)=>{"use strict";n.d(t,{IY:()=>g,uA:()=>_,z4:()=>m,eY:()=>b});var r=n(3144),i=n(5671);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}var c=n(1002);function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t,n){return l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&s(i,n.prototype),i},l.apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,e)},h(e)}var f=n(4942);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"===(0,c.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)}(this,n)}}var p="function"==typeof Error.captureStackTrace,v=!!(new Error).stack,y=function(e){a(n,e);var t=d(n);function n(e){var r;return(0,i.Z)(this,n),r=t.call(this,e),(0,f.Z)(o(r),"message",void 0),r.message=e,p?Error.captureStackTrace(o(r),n.constructor):r.stack=v?(new Error).stack:"",r}return(0,r.Z)(n)}(h(Error)),g=function(e){a(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(y),m=function(e){a(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(y),_=function(e){a(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n)}(y),b=function(e){a(n,e);var t=d(n);function n(e,r,s){var a;return(0,i.Z)(this,n),a=t.call(this,e),(0,f.Z)(o(a),"error",void 0),(0,f.Z)(o(a),"response",void 0),a.error=r,a.response=s,a}return(0,r.Z)(n)}(y)},7248:(e,t,n)=>{"use strict";n.d(t,{r:()=>h});var r=n(5671),i=n(3144),o=n(4942),s=n(7878),a=n(2589),c=n(2637);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};t instanceof s.h&&(t=t.id),c.Z.validateFeedSlug(e),c.Z.validateUserId(t);var r={target:"".concat(e,":").concat(t)};return"number"==typeof n.limit&&(r.activity_copy_limit=n.limit),this.client.post({url:"feed/".concat(this.feedUrl,"/following/"),body:r,token:this.token})}},{key:"unfollow",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};"boolean"==typeof n.keepHistory&&n.keepHistory&&(r.keep_history="1"),c.Z.validateFeedSlug(e),c.Z.validateUserId(t);var i="".concat(e,":").concat(t);return this.client.delete({url:"feed/".concat(this.feedUrl,"/following/").concat(i,"/"),qs:r,token:this.token})}},{key:"following",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return e.filter&&(t.filter=e.filter.join(",")),this.client.get({url:"feed/".concat(this.feedUrl,"/following/"),qs:l(l({},e),t),token:this.token})}},{key:"followers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};return e.filter&&(t.filter=e.filter.join(",")),this.client.get({url:"feed/".concat(this.feedUrl,"/followers/"),qs:l(l({},e),t),token:this.token})}},{key:"followStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={followers:this.id,following:this.id};return e.followerSlugs&&e.followerSlugs.length&&(t.followers_slugs=e.followerSlugs.join(",")),e.followingSlugs&&e.followingSlugs.length&&(t.following_slugs=e.followingSlugs.join(",")),this.client.get({url:"stats/follow/",qs:t,token:this.client.getOrCreateToken()||this.token})}},{key:"get",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={};e.mark_read&&e.mark_read.join&&(t.mark_read=e.mark_read.join(",")),e.mark_seen&&e.mark_seen.join&&(t.mark_seen=e.mark_seen.join(",")),this.client.replaceReactionOptions(e);var n=this.client.shouldUseEnrichEndpoint(e)?"enrich/feed/":"feed/";return this.client.get({url:"".concat(n).concat(this.feedUrl,"/"),qs:l(l({},e),t),token:this.token})}},{key:"getActivityDetail",value:function(e,t){return this.get(l({id_lte:e,id_gte:e,limit:1},t||{}))}},{key:"getFayeClient",value:function(){return this.client.getFayeClient()}},{key:"subscribe",value:function(e){if(!this.client.appId)throw new a.z4("Missing app id, which is needed to subscribe, use var client = stream.connect(key, secret, appId);");var t=this.getFayeClient().subscribe("/".concat(this.notificationChannel),e);return this.client.subscriptions["/".concat(this.notificationChannel)]={token:this.token,userId:this.notificationChannel,fayeSubscription:t},t}},{key:"unsubscribe",value:function(){var e=this.client.subscriptions["/".concat(this.notificationChannel)];e&&(delete this.client.subscriptions["/".concat(this.notificationChannel)],e.fayeSubscription.cancel())}},{key:"_validateToTargetInput",value:function(e,t,n,r,i){if(!e)throw new Error("Missing `foreign_id` parameter!");if(!t)throw new Error("Missing `time` parameter!");if(!n&&!r&&!i)throw new Error('Requires you to provide at least one parameter for `newTargets`, `addedTargets`, or `removedTargets` - example: `updateActivityToTargets("foreignID:1234", new Date(), [newTargets...], [addedTargets...], [removedTargets...])`');if(n&&(r||i))throw new Error("Can't include add_targets or removedTargets if you're also including newTargets");r&&i&&r.forEach((function(e){if(i.includes(e))throw new Error("Can't have the same feed ID in addedTargets and removedTargets.")}))}},{key:"updateActivityToTargets",value:function(e,t,n,r,i){return this._updateActivityToTargetsMany([{foreignId:e,time:t,newTargets:n,addedTargets:r,removedTargets:i}])}},{key:"_updateActivityToTargetsMany",value:function(e){if(!e||0===e.length)throw new Error("At least one input is required");for(var t=[],n=0;n1?t:t[0]})}}]),e}()},448:(e,t,n)=>{"use strict";n.d(t,{h:()=>s});var r=n(5671),i=n(3144),o=n(4942),s=function(){function e(t,n){(0,r.Z)(this,e),(0,o.Z)(this,"client",void 0),(0,o.Z)(this,"token",void 0),this.client=t,this.token=n}return(0,i.Z)(e,[{key:"upload",value:function(e,t,n,r){return this.client.upload("files/",e,t,n,r)}},{key:"delete",value:function(e){return this.client.delete({url:"files/",qs:{url:e},token:this.token})}}]),e}()},9082:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;ta});var i=n(5671),o=n(3144),s=n(4942),a=function(){function e(t,n){(0,i.Z)(this,e),(0,s.Z)(this,"client",void 0),(0,s.Z)(this,"token",void 0),this.client=t,this.token=n}return(0,o.Z)(e,[{key:"upload",value:function(e,t,n,r){return this.client.upload("images/",e,t,n,r)}},{key:"delete",value:function(e){return this.client.delete({url:"images/",qs:{url:e},token:this.token})}},{key:"process",value:function(e,t){var n=r(t,{url:e});return Array.isArray(n.crop)&&(n.crop=n.crop.join(",")),this.client.get({url:"images/",qs:n,token:this.token})}},{key:"thumbnail",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{crop:"center",resize:"clip"},i=r.crop,o=r.resize;return this.process(e,{w:t,h:n,crop:i,resize:o})}}]),e}()},8039:(e,t,n)=>{"use strict";n.d(t,{S:()=>s});var r=n(5671),i=n(3144),o=n(4942),s=function(){function e(t){(0,r.Z)(this,e),(0,o.Z)(this,"client",void 0),this.client=t}return(0,i.Z)(e,[{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.client.get({url:"".concat(e,"/"),serviceName:"personalization",qs:t,token:t.token||this.client.getPersonalizationToken()})}},{key:"post",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.client.post({url:"".concat(e,"/"),serviceName:"personalization",qs:t,body:n,token:this.client.getPersonalizationToken()})}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.client.delete({url:"".concat(e,"/"),serviceName:"personalization",qs:t,token:this.client.getPersonalizationToken()})}}]),e}()},8824:(e,t,n)=>{"use strict";n.d(t,{R:()=>u});var r=n(4925),i=n(5671),o=n(3144),s=n(4942),a=n(2589),c=["user_id","activity_id","reaction_id"],u=function(){function e(t,n){(0,i.Z)(this,e),(0,s.Z)(this,"client",void 0),(0,s.Z)(this,"token",void 0),(0,s.Z)(this,"buildURL",(function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:[]).map((function(e){return"string"==typeof e?e:e.id}))})),this.client=t,this.token=n}return(0,o.Z)(e,[{key:"add",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.id,o=r.targetFeeds,s=void 0===o?[]:o,a=r.userId,c=r.targetFeedsExtraData,u={id:i,activity_id:t instanceof Object?t.id:t,kind:e,data:n||{},target_feeds:this._convertTargetFeeds(s),user_id:a};return null!=c&&(u.target_feeds_extra_data=c),this.client.post({url:this.buildURL(),body:u,token:this.token})}},{key:"addChild",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.targetFeeds,o=void 0===i?[]:i,s=r.userId,a=r.targetFeedsExtraData,c={parent:t instanceof Object?t.id:t,kind:e,data:n||{},target_feeds:this._convertTargetFeeds(o),user_id:s};return null!=a&&(c.target_feeds_extra_data=a),this.client.post({url:this.buildURL(),body:c,token:this.token})}},{key:"get",value:function(e){return this.client.get({url:this.buildURL(e),token:this.token})}},{key:"filter",value:function(e){var t=e.user_id,n=e.activity_id,i=e.reaction_id,o=(0,r.Z)(e,c);if(o.limit||(o.limit=10),(t?1:0)+(n?1:0)+(i?1:0)!=1)throw new a.z4("Must provide exactly one value for one of these params: user_id, activity_id, reaction_id");var s=(t?"user_id":n&&"activity_id")||i&&"reaction_id",u=t||n||i,l=e.kind?this.buildURL(s,u,e.kind):this.buildURL(s,u);return this.client.get({url:l,qs:o,token:this.token})}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.targetFeeds,i=void 0===r?[]:r,o=n.targetFeedsExtraData,s={data:t,target_feeds:this._convertTargetFeeds(i)};return null!=o&&(s.target_feeds_extra_data=o),this.client.put({url:this.buildURL(e),body:s,token:this.token})}},{key:"delete",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.client.delete({url:this.buildURL(e),token:this.token,qs:t?{soft:"true"}:void 0})}},{key:"restore",value:function(e){return this.client.put({url:this.buildURL(e,"restore"),token:this.token})}}]),e}()},6685:(e,t,n)=>{"use strict";n.d(t,{c:()=>l,v:()=>u});var r=n(4942),i=n(1726),o=n.n(i);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{},i=!r.expireTokens||!r.expireTokens,s={resource:c(t),action:c(n)};return r.feedId&&(s.feed_id=c(r.feedId)),r.userId&&(s.user_id=r.userId),o().sign(s,e,{algorithm:"HS256",noTimestamp:i})}function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t)throw new TypeError("userId should be a string");var i=a({user_id:t},n),s=a({algorithm:"HS256",noTimestamp:!0},r);return o().sign(i,e,s)}},7878:(e,t,n)=>{"use strict";n.d(t,{h:()=>h});var r=n(5861),i=n(5671),o=n(3144),s=n(4942),a=n(4687),c=n.n(a);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>d});var r=n(8152),i=n(1002),o=n(6230),s=n.n(o),a=n(2589),c=/^[\w]+$/,u=/^[\w-]+$/;function l(e){if(!c.test(e))throw new a.IY("Invalid feedSlug, please use letters, numbers or _: ".concat(e));return e}function h(e){if(!u.test(e))throw new a.IY("Invalid userId, please use letters, numbers, - or _: ".concat(e));return e}function f(e){return null!==e&&"object"===(0,i.Z)(e)&&(e.readable||"function"==typeof e._read)}const d={validateFeedId:function(e){var t=e.split(":");if(2!==t.length)throw new a.IY("Invalid feedId, expected something like user:1 got ".concat(e));var n=(0,r.Z)(t,2),i=n[0],o=n[1];return l(i),h(o),e},validateFeedSlug:l,validateUserId:h,rfc3986:function(e){return e.replace(/[!'()*]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))},isReadableStream:f,addFileToFormData:function(e,t,n){var r,i=new(s());return f(e)||null!=(r=e)&&null!=r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)||function(e){return"undefined"!=typeof window&&"File"in window&&e instanceof File}(e)?t?i.append("file",e,t):i.append("file",e):i.append("file",{uri:e,name:t||e.split("/").reverse()[0],type:n||void 0,contentType:n||void 0}),i},replaceStreamObjects:function e(t){if(Array.isArray(t))return t.map((function(t){return e(t)}));if("[object Object]"!==Object.prototype.toString.call(t))return t;if("function"==typeof t.ref)return t.ref();var n={};return Object.getOwnPropertyNames(t).forEach((function(r){n[r]=e(t[r])})),n}}},2965:(e,t,n)=>{"use strict";var r=n(8742),i=n(8782),o={VERSION:r.VERSION,Client:n(1955),Scheduler:n(6148)};i.wrapper=o,e.exports=o},5890:(e,t,n)=>{"use strict";var r=n(4857);e.exports={then:function(e,t){var n=this;return this._promise||(this._promise=new r((function(e,t){n._resolve=e,n._reject=t}))),0===arguments.length?this._promise:this._promise.then(e,t)},callback:function(e,t){return this.then((function(n){e.call(t,n)}))},errback:function(e,t){return this.then(null,(function(n){e.call(t,n)}))},timeout:function(e,t){this.then();var r=this;this._timer=n.g.setTimeout((function(){r._reject(t)}),1e3*e)},setDeferredStatus:function(e,t){this._timer&&n.g.clearTimeout(this._timer),this.then(),"succeeded"===e?this._resolve(t):"failed"===e?this._reject(t):delete this._promise}}},8782:(e,t,n)=>{"use strict";var r=n(9457),i={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(e,t){var n=i.logger||(i.wrapper||i).logger;if(n){var o=Array.prototype.slice.apply(e),s="[Faye",a=this.className,c=o.shift().replace(/\?/g,(function(){try{return r(o.shift())}catch(e){return"[Object]"}}));a&&(s+="."+a),s+="] ","function"==typeof n[t]?n[t](s+c):"function"==typeof n&&n(s+c)}}};for(var o in i.LOG_LEVELS)!function(e){i[e]=function(){this.writeLog(arguments,e)}}(o);e.exports=i},4909:(e,t,n)=>{"use strict";var r={countListeners:function(e){return this.listeners(e).length},bind:function(e,t,n){var r=Array.prototype.slice,i=function(){t.apply(n,r.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([e,t,n,i]),this.on(e,i)},unbind:function(e,t,n){this._listeners=this._listeners||[];for(var r,i=this._listeners.length;i--;)(r=this._listeners[i])[0]===e&&(!t||r[1]===t&&r[2]===n)&&(this._listeners.splice(i,1),this.removeListener(e,r[3]))}};n(7088)(r,n(2356).prototype),r.trigger=r.emit,e.exports=r},2840:(e,t,n)=>{"use strict";e.exports={addTimeout:function(e,t,r,i){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(e)){var o=this;this._timeouts[e]=n.g.setTimeout((function(){delete o._timeouts[e],r.call(i)}),1e3*t)}},removeTimeout:function(e){this._timeouts=this._timeouts||{};var t=this._timeouts[e];t&&(n.g.clearTimeout(t),delete this._timeouts[e])},removeAllTimeouts:function(){for(var e in this._timeouts=this._timeouts||{},this._timeouts)this.removeTimeout(e)}}},1762:(e,t,n)=>{"use strict";var r=n(8702),i=n(7088),o=n(4909),s=n(4710),a=r({initialize:function(e){this.id=this.name=e},push:function(e){this.trigger("message",e)},isUnused:function(){return 0===this.countListeners("message")}});i(a.prototype,o),i(a,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(e){var t=this.parse(e),n=["/**",e],r=t.slice();r[r.length-1]="*",n.push(this.unparse(r));for(var i=1,o=t.length;i{"use strict";var r=n(9272),i=n(8702),o=(n(4857),n(8722)),s=n(8375),a=n(8742),c=n(7088),u=n(3978),l=n(5890),h=n(8782),f=n(4909),d=n(1762),p=n(2630),v=n(5656),y=n(9983),g=n(4347),m=n(5740),_=i({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(e,t){this.info("New client created for ?",e),u(t=t||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.create(this,e||this.DEFAULT_ENDPOINT,t),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(t.interval||this.INTERVAL),timeout:1e3*(t.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),s.Event&&void 0!==n.g.onbeforeunload&&s.Event.on(n.g,"beforeunload",(function(){o.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()}),this)},addWebsocketExtension:function(e){return this._dispatcher.addWebsocketExtension(e)},disable:function(e){return this._dispatcher.disable(e)},setHeader:function(e,t){return this._dispatcher.setHeader(e,t)},handshake:function(e,t){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var i=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(a.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:a.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(o){o.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=o.clientId,this._dispatcher.selectTransport(o.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),e&&r((function(){e.call(t)}))):(this.info("Handshake unsuccessful"),n.g.setTimeout((function(){i.handshake(e,t)}),1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)}),this)}},connect:function(e,t){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake((function(){this.connect(e,t)}),this);this.callback(e,t),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var e=new g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(t){t.successful?(this._dispatcher.close(),e.setDeferredStatus("succeeded")):e.setDeferredStatus("failed",v.parse(t.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,e}},subscribe:function(e,t,n){if(e instanceof Array)return o.map(e,(function(e){return this.subscribe(e,t,n)}),this);var r=new m(this,e,t,n),i=!0===t;return this._channels.hasSubscription(e)&&!i?(this._channels.subscribe([e],r),r.setDeferredStatus("succeeded"),r):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,e),i||this._channels.subscribe([e],r),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:e},{},(function(t){if(!t.successful)return r.setDeferredStatus("failed",v.parse(t.error)),this._channels.unsubscribe(e,r);var n=[].concat(t.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),r.setDeferredStatus("succeeded")}),this)}),this),r)},unsubscribe:function(e,t){if(e instanceof Array)return o.map(e,(function(e){return this.unsubscribe(e,t)}),this);this._channels.unsubscribe(e,t)&&this.connect((function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,e),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:e},{},(function(e){if(e.successful){var t=[].concat(e.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,t)}}),this)}),this)},publish:function(e,t,n){u(n||{},["attempts","deadline"]);var r=new g;return this.connect((function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,e,t),this._sendMessage({channel:e,data:t,clientId:this._dispatcher.clientId},n,(function(e){e.successful?r.setDeferredStatus("succeeded"):r.setDeferredStatus("failed",v.parse(e.error))}),this)}),this),r},_sendMessage:function(e,t,n,r){e.id=this._generateMessageId();var i=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",e,null,(function(e){e&&(n&&(this._responseCallbacks[e.id]=[n,r]),this._dispatcher.sendMessage(e,i,t||{}))}),this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(e){var t,n=e.id;void 0!==e.successful&&(t=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",e,null,(function(e){e&&(e.advice&&this._handleAdvice(e.advice),this._deliverMessage(e),t&&t[0].call(t[1],e))}),this)},_handleAdvice:function(e){c(this._advice,e),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(e){e.channel&&void 0!==e.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,e.channel,e.data),this._channels.distributeMessage(e))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var e=this;n.g.setTimeout((function(){e.connect()}),this._advice.interval)}});c(_.prototype,l),c(_.prototype,f),c(_.prototype,h),c(_.prototype,y),e.exports=_},2630:(e,t,n)=>{"use strict";var r=n(8702),i=n(5655),o=n(3754),s=n(7088),a=n(8782),c=n(4909),u=n(4713),l=n(6148),h=r({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(e,t,n){this._client=e,this.endpoint=i.parse(t),this._alternates=n.endpoints||{},this.cookies=o.CookieJar&&new o.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||l,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var r=n.websocketExtensions;if(r)for(var s=0,a=(r=[].concat(r)).length;s{"use strict";var r=n(8702),i=n(4710),o=r({initialize:function(e,t,n){this.code=e,this.params=Array.prototype.slice.call(t),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});o.parse=function(e){if(e=e||"",!i.ERROR.test(e))return new o(null,[],e);var t=e.split(":"),n=parseInt(t[0]),r=t[1].split(",");return e=t[2],new o(n,r,e)};var s={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var a in s)!function(e){o[e]=function(){return new o(s[e][0],arguments,s[e][1]).toString()}}(a);e.exports=o},9983:(e,t,n)=>{"use strict";var r={addExtension:function(e){this._extensions=this._extensions||[],this._extensions.push(e),e.added&&e.added(this)},removeExtension:function(e){if(this._extensions)for(var t=this._extensions.length;t--;)this._extensions[t]===e&&(this._extensions.splice(t,1),e.removed&&e.removed(this))},pipeThroughExtensions:function(e,t,n,r,i){if(this.debug("Passing through ? extensions: ?",e,t),!this._extensions)return r.call(i,t);var o=this._extensions.slice(),s=function(t){if(!t)return r.call(i,t);var a=o.shift();if(!a)return r.call(i,t);var c=a[e];if(!c)return s(t);c.length>=3?a[e](t,n,s):a[e](t,s)};s(t)}};n(7088)(r,n(8782)),e.exports=r},4710:e=>{"use strict";e.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},4347:(e,t,n)=>{"use strict";var r=n(8702),i=n(5890);e.exports=r(i)},6148:(e,t,n)=>{"use strict";var r=function(e,t){this.message=e,this.options=t,this.attempts=0};n(7088)(r.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var e=this.options.attempts,t=this.attempts,n=this.options.deadline,r=(new Date).getTime();return!(void 0!==e&&t>=e||void 0!==n&&r>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),e.exports=r},5740:(e,t,n)=>{"use strict";var r=n(8702),i=n(7088),o=n(5890),s=r({initialize:function(e,t,n,r){this._client=e,this._channels=t,this._callback=n,this._context=r,this._cancelled=!1},withChannel:function(e,t){return this._withChannel=[e,t],this},apply:function(e,t){var n=t[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});i(s.prototype,o),e.exports=s},4713:(e,t,n)=>{"use strict";var r=n(2195);r.register("websocket",n(5182)),r.register("eventsource",n(9591)),r.register("long-polling",n(3611)),r.register("cross-origin-long-polling",n(7045)),r.register("callback-polling",n(7890)),e.exports=r},7045:(e,t,n)=>{"use strict";var r=n(8702),i=n(8172),o=n(5655),s=n(7088),a=n(9457),c=s(r(n(2195),{encode:function(e){return"message="+encodeURIComponent(a(e))},request:function(e){var t,r=n.g.XDomainRequest?XDomainRequest:XMLHttpRequest,i=new r,o=++c._id,s=this._dispatcher.headers,a=this;if(i.open("POST",this.endpoint.href,!0),i.withCredentials=!0,i.setRequestHeader)for(t in i.setRequestHeader("Pragma","no-cache"),s)s.hasOwnProperty(t)&&i.setRequestHeader(t,s[t]);var u=function(){if(!i)return!1;c._pending.remove(o),i.onload=i.onerror=i.ontimeout=i.onprogress=null,i=null};return i.onload=function(){var t;try{t=JSON.parse(i.responseText)}catch(e){}u(),t?a._receive(t):a._handleError(e)},i.onerror=i.ontimeout=function(){u(),a._handleError(e)},i.onprogress=function(){},r===n.g.XDomainRequest&&c._pending.add({id:o,xhr:i}),i.send(this.encode(e)),i}}),{_id:0,_pending:new i,isUsable:function(e,t,r,i){if(o.isSameOrigin(t))return r.call(i,!1);if(n.g.XDomainRequest)return r.call(i,t.protocol===location.protocol);if(n.g.XMLHttpRequest){var s=new XMLHttpRequest;return r.call(i,void 0!==s.withCredentials)}return r.call(i,!1)}});e.exports=c},9591:(e,t,n)=>{"use strict";var r=n(8702),i=n(5655),o=n(172),s=n(7088),a=n(5890),c=n(2195),u=n(3611),l=s(r(c,{initialize:function(e,t){if(c.prototype.initialize.call(this,e,t),!n.g.EventSource)return this.setDeferredStatus("failed");this._xhr=new u(e,t),(t=o(t)).pathname+="/"+e.clientId;var r=new n.g.EventSource(i.stringify(t)),s=this;r.onopen=function(){s._everConnected=!0,s.setDeferredStatus("succeeded")},r.onerror=function(){s._everConnected?s._handleError([]):(s.setDeferredStatus("failed"),r.close())},r.onmessage=function(e){var t;try{t=JSON.parse(e.data)}catch(e){}t?s._receive(t):s._handleError([])},this._socket=r},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(e,t){this.callback((function(){e.call(t,!0)})),this.errback((function(){e.call(t,!1)}))},encode:function(e){return this._xhr.encode(e)},request:function(e){return this._xhr.request(e)}}),{isUsable:function(e,t,n,r){if(!e.clientId)return n.call(r,!1);u.isUsable(e,t,(function(i){if(!i)return n.call(r,!1);this.create(e,t).isUsable(n,r)}),this)},create:function(e,t){var n=e.transports.eventsource=e.transports.eventsource||{},r=e.clientId,s=o(t);return s.pathname+="/"+(r||""),n[s=i.stringify(s)]=n[s]||new this(e,t),n[s]}});s(l.prototype,a),e.exports=l},7890:(e,t,n)=>{"use strict";var r=n(8702),i=n(5655),o=n(172),s=n(7088),a=n(9457),c=s(r(n(2195),{encode:function(e){var t=o(this.endpoint);return t.query.message=a(e),t.query.jsonp="__jsonp"+c._cbCount+"__",i.stringify(t)},request:function(e){var t=document.getElementsByTagName("head")[0],r=document.createElement("script"),s=c.getCallbackName(),u=o(this.endpoint),l=this;u.query.message=a(e),u.query.jsonp=s;var h=function(){if(!n.g[s])return!1;n.g[s]=void 0;try{delete n.g[s]}catch(e){}r.parentNode.removeChild(r)};return n.g[s]=function(e){h(),l._receive(e)},r.type="text/javascript",r.src=i.stringify(u),t.appendChild(r),r.onerror=function(){h(),l._handleError(e)},{abort:h}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(e,t,n,r){n.call(r,!0)}});e.exports=c},2195:(e,t,n)=>{"use strict";var r=n(8702),i=n(3754).Cookie,o=n(4857),s=n(8722),a=n(7088),c=n(8782),u=n(2840),l=n(1762),h=a(r({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},MAX_DELAY:0,batching:!0,initialize:function(e,t){this._dispatcher=e,this.endpoint=t,this._outbox=[],this._proxy=a({},this._dispatcher.proxy),this._proxy.origin||(this._proxy.origin=this._findProxy())},close:function(){},encode:function(e){return""},sendMessage:function(e){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,this.endpoint.href,e),this.batching?(this._outbox.push(e),this._flushLargeBatch(),e.channel===l.HANDSHAKE?this._publish(.01):(e.channel===l.CONNECT&&(this._connectMessage=e),this._publish(this.MAX_DELAY))):o.resolve(this.request([e]))},_makePromise:function(){var e=this;this._requestPromise=this._requestPromise||new o((function(t){e._resolvePromise=t}))},_publish:function(e){return this._makePromise(),this.addTimeout("publish",e,(function(){this._flush(),delete this._requestPromise}),this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length1&&(n=o[r]),n=n||o["CGI_"+i]):(n=o[r]||o[i])&&!o[r]&&console.warn("The environment variable "+i+" is discouraged. Use "+r+"."),n}}}}),{get:function(e,t,n,r,i){var o=e.endpoint;s.asyncEach(this._transports,(function(o,a){var c=o[0],u=o[1],l=e.endpointFor(c);return s.indexOf(n,c)>=0?a():s.indexOf(t,c)<0?(u.isUsable(e,l,(function(){})),a()):void u.isUsable(e,l,(function(t){if(!t)return a();var n=u.hasOwnProperty("create")?u.create(e,l):new u(e,l);r.call(i,n)}))}),(function(){throw new Error("Could not find a usable connection type for "+o.href)}))},register:function(e,t){this._transports.push([e,t]),t.prototype.connectionType=e},getConnectionTypes:function(){return s.map(this._transports,(function(e){return e[0]}))},disable:function(e){if("autodisconnect"===e)for(var t=0;t{"use strict";var r=n(8702),i=n(4857),o=n(8172),s=n(5655),a=n(8375),c=n(172),u=n(7088),l=n(9457),h=n(5003),f=n(5890),d=u(r(n(2195),{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(e,t){this.callback((function(){e.call(t,!0)})),this.errback((function(){e.call(t,!1)})),this.connect()},request:function(e){this._pending=this._pending||new o;for(var t=0,n=e.length;t{"use strict";var r=n(8702),i=n(5655),o=n(8375),s=n(7088),a=n(9457),c=s(r(n(2195),{encode:function(e){return a(e)},request:function(e){var t,r=this.endpoint.href,i=this;if(n.g.XMLHttpRequest)t=new XMLHttpRequest;else{if(!n.g.ActiveXObject)return this._handleError(e);t=new ActiveXObject("Microsoft.XMLHTTP")}t.open("POST",r,!0),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Pragma","no-cache"),t.setRequestHeader("X-Requested-With","XMLHttpRequest");var s=this._dispatcher.headers;for(var a in s)s.hasOwnProperty(a)&&t.setRequestHeader(a,s[a]);var c=function(){t.abort()};return void 0!==n.g.onbeforeunload&&o.Event.on(n.g,"beforeunload",c),t.onreadystatechange=function(){if(t&&4===t.readyState){var r=null,s=t.status,a=t.responseText,u=s>=200&&s<300||304===s||1223===s;if(void 0!==n.g.onbeforeunload&&o.Event.detach(n.g,"beforeunload",c),t.onreadystatechange=function(){},t=null,!u)return i._handleError(e);try{r=JSON.parse(a)}catch(e){}r?i._receive(r):i._handleError(e)}},t.send(this.encode(e)),t}}),{isUsable:function(e,t,n,r){var o="ReactNative"===navigator.product||i.isSameOrigin(t);n.call(r,o)}});e.exports=c},8722:e=>{"use strict";e.exports={commonElement:function(e,t){for(var n=0,r=e.length;n0;)c();a=!1}}()};u()}}},7088:e=>{"use strict";var t=Array.prototype.forEach,n=Object.prototype.hasOwnProperty;e.exports=function(e){return t.call(arguments,(function(t,r){if(0!==r)for(var i in t)n.call(t,i)&&(e[i]=t[i])})),e}},8375:(e,t,n)=>{"use strict";var r={_registry:[],on:function(e,t,n,r){var i=function(){n.call(r)};e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent("on"+t,i),this._registry.push({_element:e,_type:t,_callback:n,_context:r,_handler:i})},detach:function(e,t,n,r){for(var i,o=this._registry.length;o--;)i=this._registry[o],e&&e!==i._element||t&&t!==i._type||n&&n!==i._callback||r&&r!==i._context||(i._element.removeEventListener?i._element.removeEventListener(i._type,i._handler,!1):i._element.detachEvent("on"+i._type,i._handler),this._registry.splice(o,1),i=null)}};void 0!==n.g.onunload&&r.on(n.g,"unload",r.detach,r),e.exports={Event:r}},8702:(e,t,n)=>{"use strict";var r=n(7088);e.exports=function(e,t){"function"!=typeof e&&(t=e,e=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},i=function(){};return i.prototype=e.prototype,n.prototype=new i,r(n.prototype,t),n}},8742:e=>{e.exports={VERSION:"1.4.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},3754:e=>{"use strict";e.exports={}},172:e=>{"use strict";var t=function(e){var n,r,i;if(e instanceof Array){for(n=[],r=e.length;r--;)n[r]=t(e[r]);return n}if("object"==typeof e){for(i in n=null===e?null:{},e)n[i]=t(e[i]);return n}return e};e.exports=t},2356:e=>{var t="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(){}e.exports=n,n.prototype.emit=function(e){if("error"===e&&(!this._events||!this._events.error||t(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var n=this._events[e];if(!n)return!1;if("function"==typeof n){switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:var r=Array.prototype.slice.call(arguments,1);n.apply(this,r)}return!0}if(t(n)){r=Array.prototype.slice.call(arguments,1);for(var i=n.slice(),o=0,s=i.length;o{"use strict";var r=n(9272),i=function(e){this._state=-1,this._value=null,this._defer=[],o(this,e)};i.prototype.then=function(e,t){var n=new i,r={promise:n,onFulfilled:e,onRejected:t};return-1===this._state?this._defer.push(r):s(this,r),n},i.prototype.catch=function(e){return this.then(null,e)};var o=function(e,t){if("function"==typeof t){var n=0,r=function(t){0==n++&&l(e,t)};try{t((function(t){0==n++&&a(e,t)}),r)}catch(e){r(e)}}},s=function(e,t){var n=e._state,i=e._value,o=t.promise,s=[t.onFulfilled,t.onRejected][n];if("function"!=typeof s)return(0,[a,l][n])(o,i);r((function(){try{a(o,s(i))}catch(e){l(o,e)}}))},a=function(e,t){if(e===t)return l(e,new TypeError("Recursive promise chain detected"));var n;try{n=c(t)}catch(t){return l(e,t)}if(!n)return u(e,t);o(e,(function(e,r){n.call(t,e,r)}))},c=function(e){var t=typeof e,n=("object"===t||"function"===t)&&e&&e.then;return"function"==typeof n?n:null},u=function(e,t){h(e,0,t)},l=function(e,t){h(e,1,t)},h=function(e,t,n){var r=e._defer,i=0;if(e._state=t,e._value=n,e._defer=null,0!==r.length)for(;i{"use strict";var r=n(8702);e.exports=r({initialize:function(){this._index={}},add:function(e){var t=void 0!==e.id?e.id:e;return!this._index.hasOwnProperty(t)&&(this._index[t]=e,!0)},forEach:function(e,t){for(var n in this._index)this._index.hasOwnProperty(n)&&e.call(t,this._index[n])},isEmpty:function(){for(var e in this._index)if(this._index.hasOwnProperty(e))return!1;return!0},member:function(e){for(var t in this._index)if(this._index[t]===e)return!0;return!1},remove:function(e){var t=void 0!==e.id?e.id:e,n=this._index[t];return delete this._index[t],n},toArray:function(){var e=[];return this.forEach((function(t){e.push(t)})),e}})},9457:e=>{"use strict";e.exports=function(e){return JSON.stringify(e,(function(e,t){return this[e]instanceof Array?this[e]:t}))}},5655:e=>{"use strict";e.exports={isURI:function(e){return e&&e.protocol&&e.host&&e.path},isSameOrigin:function(e){return e.protocol===location.protocol&&e.hostname===location.hostname&&e.port===location.port},parse:function(e){if("string"!=typeof e)return e;var t,n,r,i,o,s,a={},c=function(t,n){e=e.replace(n,(function(e){return a[t]=e,""})),a[t]=a[t]||""};for(c("protocol",/^[a-z]+\:/i),c("host",/^\/\/[^\/\?#]+/),/^\//.test(e)||a.host||(e=location.pathname.replace(/[^\/]*$/,"")+e),c("pathname",/^[^\?#]*/),c("search",/^\?[^#]*/),c("hash",/^#.*/),a.protocol=a.protocol||location.protocol,a.host?(a.host=a.host.substr(2),/@/.test(a.host)&&(a.auth=a.host.split("@")[0],a.host=a.host.split("@")[1]),t=a.host.match(/^\[([^\]]+)\]|^[^:]+/),a.hostname=t[1]||t[0],a.port=(a.host.match(/:(\d+)$/)||[])[1]||""):(a.host=location.host,a.hostname=location.hostname,a.port=location.port),a.pathname=a.pathname||"/",a.path=a.pathname+a.search,s={},i=0,o=(r=(n=a.search.replace(/^\?/,""))?n.split("&"):[]).length;i{"use strict";var r=n(8722);e.exports=function(e,t){for(var n in e)if(r.indexOf(t,n)<0)throw new Error("Unrecognized option: "+n)}},5003:(e,t,n)=>{"use strict";var r=n.g.MozWebSocket||n.g.WebSocket;e.exports={create:function(e,t,n){return"function"!=typeof r?null:new r(e)}}},6230:e=>{e.exports="object"==typeof self?self.FormData:window.FormData},6793:()=>{},7496:()=>{},8854:()=>{},5697:()=>{},1726:()=>{},7061:(e,t,n)=>{var r=n(8698).default;function i(){"use strict";e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",h=c.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),s=new I(r||[]);return a(o,"_invoke",{value:C(e,n,s)}),o}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var v="suspendedStart",y="suspendedYield",g="executing",m="completed",_={};function b(){}function w(){}function E(){}var k={};f(k,u,(function(){return this}));var O=Object.getPrototypeOf,T=O&&O(O(P([])));T&&T!==o&&s.call(T,u)&&(k=T);var S=E.prototype=b.prototype=Object.create(k);function x(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,o,a,c){var u=p(e[i],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==r(h)&&s.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var i=v;return function(o,s){if(i===g)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw s;return{value:t,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var c=R(a,r);if(c){if(c===_)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===v)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=g;var u=p(e,n,r);if("normal"===u.type){if(i=r.done?m:y,u.arg===_)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function R(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),_;var o=p(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,_;var s=o.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,_):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,_)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function P(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=s.call(o,"catchLoc"),u=s.call(o,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),_}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;j(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),_}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,n)=>{var r=n(7061)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5861:(e,t,n)=>{"use strict";function r(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,c,"next",e)}function c(e){r(s,i,o,a,c,"throw",e)}a(void 0)}))}}n.d(t,{Z:()=>i})},5671:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{Z:()=>r})},3144:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9142);function i(e,t){for(var n=0;n{"use strict";n.d(t,{Z:()=>i});var r=n(9142);function i(e,t,n){return(t=(0,r.Z)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},4925:(e,t,n)=>{"use strict";function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{Z:()=>r})},8152:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni})},9142:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(1002);function i(e){var t=function(e,t){if("object"!==(0,r.Z)(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==(0,r.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===(0,r.Z)(t)?t:String(t)}},1002:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:()=>r})},4147:e=>{"use strict";e.exports={i8:"8.4.0"}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{CollectionEntry:()=>i.R,Collections:()=>i.n,FeedError:()=>d.IY,JWTScopeToken:()=>p.v,JWTUserSessionToken:()=>p.c,MissingSchemaError:()=>d.uA,Personalization:()=>c.S,SiteError:()=>d.z4,StreamApiError:()=>d.eY,StreamClient:()=>t.n,StreamFeed:()=>o.r,StreamFileStore:()=>s.h,StreamImageStore:()=>a.$,StreamReaction:()=>u.R,StreamUser:()=>l.h,connect:()=>e.$});var e=n(2631),t=n(3513),i=n(3709),o=n(7248),s=n(448),a=n(9082),c=n(8039),u=n(8824),l=n(7878),h=n(6793),f={};for(const e in h)["default","connect","StreamClient","CollectionEntry","Collections","StreamFeed","StreamFileStore","StreamImageStore","Personalization","StreamReaction","StreamUser"].indexOf(e)<0&&(f[e]=()=>h[e]);n.d(r,f);var d=n(2589),p=n(6685)})(),r})()));