PageSourceSearch

https://app.virtualspace.ai/_next/static/chunks/ab09c41f-fad116fafcbe8015.js

js virtualspace.ai collected 2026-10-05 13:13:31 UTC 243,961 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6274],{53235:function(e,t,n){var r=n(73656);e.exports=function(){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function a(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{};function h(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}var f={exports:{}};!function(e){!function(t,n){var r=Math.pow(2,-24),o=Math.pow(2,32),i=Math.pow(2,53),a={encode:function(e){var t,r=new ArrayBuffer(256),a=new DataView(r),s=0;function u(e){for(var n=r.byteLength,o=s+e;n<o;)n*=2;if(n!==r.byteLength){var i=a;r=new ArrayBuffer(n),a=new DataView(r);for(var u=s+3>>2,c=0;c<u;++c)a.setUint32(4*c,i.getUint32(4*c))}return t=e,a}function c(){s+=t}function l(e){c(u(1).setUint8(s,e))}function p(e){for(var t=u(e.length),n=0;n<e.length;++n)t.setUint8(s+n,e[n]);c()}function h(e,t){t<24?l(e<<5|t):t<256?(l(e<<5|24),l(t)):t<65536?(l(e<<5|25),function(e){c(u(2).setUint16(s,e))}(t)):t<4294967296?(l(e<<5|26),function(e){c(u(4).setUint32(s,e))}(t)):(l(e<<5|27),function(e){var t=e%o,n=(e-t)/o,r=u(8);r.setUint32(s,n),r.setUint32(s+4,t),c()}(t))}if(function e(t){var r;if(!1===t)return l(244);if(!0===t)return l(245);if(null===t)return l(246);if(t===n)return l(247);switch(typeof t){case"number":if(Math.floor(t)===t){if(0<=t&&t<=i)return h(0,t);if(-i<=t&&t<0)return h(1,-(t+1))}return l(251),function(e){c(u(8).setFloat64(s,e))}(t);case"string":var o=[];for(r=0;r<t.length;++r){var a=t.charCodeAt(r);a<128?o.push(a):a<2048?(o.push(192|a>>6),o.push(128|63&a)):a<55296?(o.push(224|a>>12),o.push(128|a>>6&63),o.push(128|63&a)):(a=(1023&a)<<10,a|=1023&t.charCodeAt(++r),a+=65536,o.push(240|a>>18),o.push(128|a>>12&63),o.push(128|a>>6&63),o.push(128|63&a))}return h(3,o.length),p(o);default:var f;if(Array.isArray(t))for(h(4,f=t.length),r=0;r<f;++r)e(t[r]);else if(t instanceof Uint8Array)h(2,t.length),p(t);else{var d=Object.keys(t);for(h(5,f=d.length),r=0;r<f;++r){var y=d[r];e(y),e(t[y])}}}}(e),"slice"in r)return r.slice(0,s);for(var f=new ArrayBuffer(s),d=new DataView(f),y=0;y<s;++y)d.setUint8(y,a.getUint8(y));return f},decode:function(e,t,i){var a=new DataView(e),s=0;function u(e,t){return s+=t,e}
1function c(t){return u(new Uint8Array(e,s,t),t)}function l(){return u(a.getUint8(s),1)}function p(){return u(a.getUint16(s),2)}function h(){return u(a.getUint32(s),4)}function f(){return 255===a.getUint8(s)&&(s+=1,!0)}function d(e){if(e<24)return e;if(24===e)return l();if(25===e)return p();if(26===e)return h();if(27===e)return h()*o+h();if(31===e)return-1;throw"Invalid length encoding"}function y(e){var t=l();if(255===t)return-1;var n=d(31&t);if(n<0||t>>5!==e)throw"Invalid indefinite length element";return n}function g(e,t){for(var n=0;n<t;++n){var r=l();128&r&&(r<224?(r=(31&r)<<6|63&l(),t-=1):r<240?(r=(15&r)<<12|(63&l())<<6|63&l(),t-=2):(r=(15&r)<<18|(63&l())<<12|(63&l())<<6|63&l(),t-=3)),r<65536?e.push(r):(r-=65536,e.push(55296|r>>10),e.push(56320|1023&r))}}"function"!=typeof t&&(t=function(e){return e}),"function"!=typeof i&&(i=function(){return n});var m=function e(){var o,h,m=l(),v=m>>5,b=31&m;if(7===v)switch(b){case 25:return function(){var e=new ArrayBuffer(4),t=new DataView(e),n=p(),o=32768&n,i=31744&n,a=1023&n;if(31744===i)i=261120;else if(0!==i)i+=114688;else if(0!==a)return a*r;return t.setUint32(0,o<<16|i<<13|a<<13),t.getFloat32(0)}();case 26:return u(a.getFloat32(s),4);case 27:return u(a.getFloat64(s),8)}if((h=d(b))<0&&(v<2||6<v))throw"Invalid length";switch(v){case 0:return h;case 1:return-1-h;case 2:if(h<0){for(var _=[],S=0;(h=y(v))>=0;)S+=h,_.push(c(h));var w=new Uint8Array(S),O=0;for(o=0;o<_.length;++o)w.set(_[o],O),O+=_[o].length;return w}return c(h);case 3:var P=[];if(h<0)for(;(h=y(v))>=0;)g(P,h);else g(P,h);return String.fromCharCode.apply(null,P);case 4:var E;if(h<0)for(E=[];!f();)E.push(e());else for(E=new Array(h),o=0;o<h;++o)E[o]=e();return E;case 5:var T={};for(o=0;o<h||h<0&&!f();++o)T[e()]=e();return T;case 6:return t(e(),h);case 7:switch(h){case 20:return!1;case 21:return!0;case 22:return null;case 23:return n;default:return i(h)}}}();if(s!==e.byteLength)throw"Remaining bytes";return m}};e.exports?e.exports=a:t.CBOR||(t.CBOR=a)}(p)}(f);var d=f.exports,y={exports:{}};!function(e,t){!function(e){var t="0.1.0",n={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};function r(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n}function o(e,t){var r=n[t||"all"];return r&&r.test(e)||!1}r.isUUID=o,r.VERSION=t,e.uuid=r,e.isUUID=o}(t),null!==e&&(e.exports=t.uuid)}(y,y.exports);var g=y.exports,m=function(){return g.uuid?g.uuid():g()},v=function(){function e(e){var t,n,r,o,i=e.setup;if(this._PNSDKSuffix={},this.instanceId="pn-".concat(m()),this.secretKey=i.secretKey||i.secret_key,this.subscribeKey=i.subscribeKey||i.subscribe_key,this.publishKey=i.publishKey||i.publish_key,this.sdkName=i.sdkName,this.sdkFamily=i.sdkFamily,this.partnerId=i.partnerId,this.setAuthKey(i.authKey),this.cryptoModule=i.cryptoModule,this.setFilterExpression(i.filterExpression),"string"!=typeof i.origin&&!Array.isArray(i.origin)&&void 0!==i.origin)throw new Error("Origin must be either undefined, a string or a list of strings.");if(this.origin=i.origin||Array.from({length:20},(function(e,t){return"ps".concat(t+1,".pndsn.com")})),this.secure=i.ssl||!1,this.restore=i.restore||!1,this.proxy=i.proxy,this.keepAlive=i.keepAlive,this.keepAliveSettings=i.keepAliveSettings,this.autoNetworkDetection=i.autoNetworkDetection||!1,this.dedupeOnSubscribe=i.dedupeOnSubscribe||!1,this.maximumCacheSize=i.maximumCacheSize||100,this.customEncrypt=i.customEncrypt,this.customDecrypt=i.customDecrypt,this.fileUploadPublishRetryLimit=null!==(t=i.fileUploadPublishRetryLimit)&&void 0!==t?t:5,this.useRandomIVs=null===(n=i.useRandomIVs)||void 0===n||n,this.enableEventEngine=null!==(r=i.enableEventEngine)&&void 0!==r&&r,this.maintainPresenceState=null===(o=i.maintainPresenceState)||void 0===o||o,"undefined"!=typeof location&&"https:"===location.protocol&&(this.secure=!0),this.logVerbosity=i.logVerbosity||!1,this.suppressLeaveEvents=i.suppressLeaveEvents||!1,this.announceFailedHeartbeats=i.announceFailedHeartbeats||
1!0,this.announceSuccessfulHeartbeats=i.announceSuccessfulHeartbeats||!1,this.useInstanceId=i.useInstanceId||!1,this.useRequestId=i.useRequestId||!1,this.requestMessageCountThreshold=i.requestMessageCountThreshold,i.retryConfiguration&&this._setRetryConfiguration(i.retryConfiguration),this.setTransactionTimeout(i.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(i.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(i.useSendBeacon||!0),i.presenceTimeout?this.setPresenceTimeout(i.presenceTimeout):this._presenceTimeout=300,null!=i.heartbeatInterval&&this.setHeartbeatInterval(i.heartbeatInterval),"string"==typeof i.userId){if("string"==typeof i.uuid)throw new Error("Only one of the following configuration options has to be provided: `uuid` or `userId`");this.setUserId(i.userId)}else{if("string"!=typeof i.uuid)throw new Error("One of the following configuration options has to be provided: `uuid` or `userId`");this.setUUID(i.uuid)}this.setCipherKey(i.cipherKey,i)}return e.prototype.getAuthKey=function(){return this.authKey},e.prototype.setAuthKey=function(e){return this.authKey=e,this},e.prototype.setCipherKey=function(e,t,n){var r;return this.cipherKey=e,this.cipherKey&&(this.cryptoModule=null!==(r=t.cryptoModule)&&void 0!==r?r:t.initCryptoModule({cipherKey:this.cipherKey,useRandomIVs:this.useRandomIVs}),n&&(n.cryptoModule=this.cryptoModule)),this},e.prototype.getUUID=function(){return this.UUID},e.prototype.setUUID=function(e){if(!e||"string"!=typeof e||0===e.trim().length)throw new Error("Missing uuid parameter. Provide a valid string uuid");return this.UUID=e,this},e.prototype.getUserId=function(){return this.UUID},e.prototype.setUserId=function(e){if(!e||"string"!=typeof e||0===e.trim().length)throw new Error("Missing or invalid userId parameter. Provide a valid string userId");return this.UUID=e,this},e.prototype.getFilterExpression=function(){return this.filterExpression},e.prototype.setFilterExpression=function(e){return this.filterExpression=e,this},e.prototype.getPresenceTimeout=function(){return this._presenceTimeout},e.prototype.setPresenceTimeout=function(e){return e>=20?this._presenceTimeout=e:(this._presenceTimeout=20,console.log("WARNING: Presence timeout is less than the minimum. Using minimum value: ",this._presenceTimeout)),this.setHeartbeatInterval(this._presenceTimeout/2-1),this},e.prototype.setProxy=function(e){this.proxy=e},e.prototype.getHeartbeatInterval=function(){return this._heartbeatInterval},e.prototype.setHeartbeatInterval=function(e){return this._heartbeatInterval=e,this},e.prototype.getSubscribeTimeout=function(){return this._subscribeRequestTimeout},e.prototype.setSubscribeTimeout=function(e){return this._subscribeRequestTimeout=e,this},e.prototype.getTransactionTimeout=function(){return this._transactionalRequestTimeout},e.prototype.setTransactionTimeout=function(e){return this._transactionalRequestTimeout=e,this},e.prototype.isSendBeaconEnabled=function(){return this._useSendBeacon},e.prototype.setSendBeaconConfig=function(e){return this._useSendBeacon=e,this},e.prototype.getVersion=function(){return"7.5.0"},e.prototype._setRetryConfiguration=function(e){if(e.minimumdelay<2)throw new Error("Minimum delay can not be set less than 2 seconds for retry");if(e.maximumDelay>150)throw new Error("Maximum delay can not be set more than 150 seconds for retry");if(e.maximumDelay&&maximumRetry>6)throw new Error("Maximum retry for exponential retry policy can not be more than 6");if(e.maximumRetry>10)throw new Error("Maximum retry for linear retry policy can not be more than 10");this.retryConfiguration=e},e.prototype._addPnsdkSuffix=function(e,t){this._PNSDKSuffix[e]=t},e.prototype._getPnsdkSuffix=function(e){var t=this;return Object.keys(this._PNSDKSuffix).reduce((function(n,r){return n+e+t._PNSDKSuffix[r]}),"")},e}();function b(e){var t=e.replace(/==?$/,""),n=Math.floor(t.length/4*3),r=new ArrayBuffer(n),o=new Uint8Array(r),i=0;function a(){var e=t.charAt(i++),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e);if(-1===n)throw new Error("Illegal character at ".concat(i,": ").concat(t.charAt(i-1)));return n}for(var s=0;s<n;s+=3){var u=a(),c=a(),l=a(),p=a(),h=(63&u)<<2|c>>4,f=(15&c)<<4|l>>2,d=(3&l)<<6|p>>0;o[s]=h,64!=l&&(o[s+1]=f),64!=p&&(o[s+2]=d)}return r}function _(e){for(var t,n="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 15,163 bytes, line 1
1+/",o=new Uint8Array(e),i=o.byteLength,a=i%3,s=i-a,u=0;u<s;u+=3)n+=r[(16515072&(t=o[u]<<16|o[u+1]<<8|o[u+2]))>>18]+r[(258048&t)>>12]+r[(4032&t)>>6]+r[63&t];return 1==a?n+=r[(252&(t=o[s]))>>2]+r[(3&t)<<4]+"==":2==a&&(n+=r[(64512&(t=o[s]<<8|o[s+1]))>>10]+r[(1008&t)>>4]+r[(15&t)<<2]+"="),n}var S,w,O,P,E,T=T||function(e,t){var n={},r=n.lib={},o=function(){},i=r.Base={extend:function(e){o.prototype=this;var t=new o;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=r.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes;if(e=e.sigBytes,this.clamp(),r%4)for(var o=0;o<e;o++)t[r+o>>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else if(65535<n.length)for(o=0;o<e;o+=4)t[r+o>>>2]=n[o>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],r=0;r<t;r+=4)n.push(4294967296*e.random()|0);return new a.init(n,t)}}),s=n.enc={},u=s.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var o=t[r>>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},c=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},p=r.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=o/(4*i);if(t=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,o=e.min(4*t,o),t){for(var u=0;u<t;u+=i)this._doProcessBlock(r,u);u=r.splice(0,t),n.sigBytes-=o}return new a.init(u,o)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=p.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=n.algo={};return n}(Math);!function(e){for(var t=T,n=(o=t.lib).WordArray,r=o.Hasher,o=t.algo,i=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},u=2,c=0;64>c;){var l;e:{l=u;for(var p=e.sqrt(l),h=2;h<=p;h++)if(!(l%h)){l=!1;break e}l=!0}l&&(8>c&&(i[c]=s(e.pow(u,.5))),a[c]=s(e.pow(u,1/3)),c++),u++}var f=[];o=o.SHA256=r.extend({_doReset:function(){this._hash=new n.init(i.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],u=n[4],c=n[5],l=n[6],p=n[7],h=0;64>h;h++){if(16>h)f[h]=0|e[t+h];else{var d=f[h-15],y=f[h-2];f[h]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+f[h-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+f[h-16]}d=p+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+a[h]+f[h],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&o^r&i^o&i),p=l,l=c,c=u,u=s+d|0,s=i,i=o,o=r,r=d+y|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA256=r._createHelper(o),t.HmacSHA256=r._createHmacHelper(o)}(Math),w=(S=T).enc.Utf8,S.algo.HMAC=S.lib.Base.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=w.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),i=this._iKey=t.clone(),a=o.words,s=i.words,u=0;u<n;u++)a[u]^=1549556828,s[u]^=909522486;o.sigBytes=i.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}}),P=(O=T).lib.WordArray,O.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var o=0;o<n;o+=3)for(var i=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;4>a&&o+.75*a<n;a++)e.push(r.charAt(i>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var t=e.length,n=this._map;(r=n.charAt(64))&&-1!=(r=e.indexOf(r))&&(t=r);for(var r=[],o=0,i=0;i<t;i++)if(i%4){var a=n.indexOf(e.charAt(i-1))<<i%4*2,s=n.indexOf(e.charAt(i))>>>6-i%4*2;r[o>>>2]|=(a|s)<<24-o%4*8,o++}return P.create(r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(e){function t(e,t,n,r,o,i,a){return((e=e+(t&n|~t&r)+o+a)<<i|e>>>32-i)+t}function n(e,t,n,r,o,i,a){return((e=e+(t&r|n&~r)+o+a)<<i|e>>>32-i)+t}function r(e,t,n,r,o,i,a){return((e=e+(t^n^r)+o+a)<<i|e>>>32-i)+t}function o(e,t,n,r,o,i,a){return((e=e+(n^(t|~r))+o+a)<<i|e>>>32-i)+t}for(var i=T,a=(u=i.lib).WordArray,s=u.Hasher,u=i.algo,c=[],l=0;64>l;l++)c[l]=4294967296*e.abs(e.sin(l+1))|0;u=u.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,i){for(var a=0;16>a;a++){var s=e[u=i+a];e[u]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var u=e[i+0],l=(s=e[i+1],e[i+2]),p=e[i+3],h=e[i+4],f=e[i+5],d=e[i+6],y=e[i+7],g=e[i+8],m=e[i+9],v=e[i+10],b=e[i+11],_=e[i+12],S=e[i+13],w=e[i+14],O=e[i+15],P=t(P=a[0],A=a[1],T=a[2],E=a[3],u,7,c[0]),E=t(E,P,A,T,s,12,c[1]),T=t(T,E,P,A,l,17,c[2]),A=t(A,T,E,P,p,22,c[3]);P=t(P,A,T,E,h,7,c[4]),E=t(E,P,A,T,f,12,c[5]),T=t(T,E,P,A,d,17,c[6]),A=t(A,T,E,P,y,22,c[7]),P=t(P,A,T,E,g,7,c[8]),E=t(E,P,A,T,m,12,c[9]),T=t(T,E,P,A,v,17,c[10]),A=t(A,T,E,P,b,22,c[11]),P=t(P,A,T,E,_,7,c[12]),E=t(E,P,A,T,S,12,c[13]),T=t(T,E,P,A,w,17,c[14]),P=n(P,A=t(A,T,E,P,O,22,c[15]),T,E,s,5,c[16]),E=n(E,P,A,T,d,9,c[17]),T=n(T,E,P,A,b,14,c[18]),A=n(A,T,E,P,u,20,c[19]),P=n(P,A,T,E,f,5,c[20]),E=n(E,P,A,T,v,9,c[21]),T=n(T,E,P,A,O,14,c[22]),A=n(A,T,E,P,h,20,c[23]),P=n(P,A,T,E,m,5,c[24]),E=n(E,P,A,T,w,9,c[25]),T=n(T,E,P,A,p,14,c[26]),A=n(A,T,E,P,g,20,c[27]),P=n(P,A,T,E,S,5,c[28]),E=n(E,P,A,T,l,9,c[29]),T=n(T,E,P,A,y,14,c[30]),P=r(P,A=n(A,T,E,P,_,20,c[31]),T,E,f,4,c[32]),E=r(E,P,A,T,g,11,c[33]),T=r(T,E,P,A,b,16,c[34]),A=r(A,T,E,P,w,23,c[35]),P=r(P,A,T,E,s,4,c[36]),E=r(E,P,A,T,h,11,c[37]),T=r(T,E,P,A,y,16,c[38]),A=r(A,T,E,P,v,23,c[39]),P=r(P,A,T,E,S,4,c[40]),E=r(E,P,A,T,u,11,c[41]),T=r(T,E,P,A,p,16,c[42]),A=r(A,T,E,P,d,23,c[43]),P=r(P,A,T,E,m,4,c[44]),E=r(E,P,A,T,_,11,c[45]),T=r(T,E,P,A,O,16,c[46]),P=o(P,A=r(A,T,E,P,l,23,c[47]),T,E,u,6,c[48]),E=o(E,P,A,T,y,10,c[49]),T=o(T,E,P,A,w,15,c[50]),A=o(A,T,E,P,f,21,c[51]),P=o(P,A,T,E,_,6,c[52]),E=o(E,P,A,T,p,10,c[53]),T=o(T,E,P,A,v,15,c[54]),A=o(A,T,E,P,s,21,c[55]),P=o(P,A,T,E,g,6,c[56]),E=o(E,P,A,T,O,10,c[57]),T=o(T,E,P,A,d,15,c[58]),A=o(A,T,E,P,S,21,c[59]),P=o(P,A,T,E,h,6,c[60]),E=o(E,P,A,T,b,10,c[61]),T=o(T,E,P,A,l,15,c[62]),A=o(A,T,E,P,m,21,c[63]),a[0]=a[0]+P|0,a[1]=a[1]+A|0,a[2]=a[2]+T|0,a[3]=a[3]+E|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296);for(n[15+(o+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(o+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),n=(t=this._hash).words,r=0;4>r;r++)o=n[r],n[r]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),i.MD5=s._createHelper(u),i.HmacMD5=s._createHmacHelper(u)}(Math),function(){var e,t=T,n=(e=t.lib).Base,r=e.WordArray,o=(e=t.algo).EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:e.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=(s=this.cfg).hasher.create(),o=r.create(),i=o.words,a=s.keySize,s=s.iterations;i.length<a;){u&&n.update(u);var u=n.update(e).finalize(t);n.reset();for(var c=1;c<s;c++)u=n.finalize(u),n.reset();o.concat(u)}return o.sigBytes=4*a,o}});t.EvpKDF=function(e,t,n){return o.create(n).compute(e,t)}}(),T.lib.Cipher||function(e){var t=(f=T).lib,n=t.Base,r=t.WordArray,o=t.BufferedBlockAlgorithm,i=f.enc.Base64,a=f.algo.EvpKDF,s=t.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?d:h).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?d:h).decrypt(e,t,n,r)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=f.mode={},c=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var o=0;o<n;o++)e[t+o]^=r[o]},l=(t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();l.Encryptor=l.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;c.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),l.Decryptor=l.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,o=e.slice(t,t+r);n.decryptBlock(e,t),c.call(this,e,t,r),this._prevBlock=o}}),u=u.CBC=l,l=(f.pad={}).Pkcs7={pad:function(e,t){for(var n,o=(n=(n=4*t)-e.sigBytes%n)<<24|n<<16|n<<8|n,i=[],a=0;a<n;a+=4)i.push(o);n=r.create(i,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:l}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var p=t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(u=(f.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?r.create([1398893684,1701076831]).concat(e).concat(t):t).toString(i)},parse:function(e){var t=(e=i.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var n=r.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},t.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var o=e.createEncryptor(n,r);return t=o.finalize(t),o=o.cfg,p.create({ciphertext:t,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),f=(f.kdf={}).OpenSSL={execute:function(e,t,n,o){return o||(o=r.random(8)),e=a.create({keySize:t+n}).compute(e,o),n=r.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:o})}},d=t.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:f}),encrypt:function(e,t,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,(e=h.encrypt.call(this,e,t,n.key,r)).mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=T,t=e.lib.BlockCipher,n=e.algo,r=[],o=[],i=[],a=[],s=[],u=[],c=[],l=[],p=[],h=[],f=[],d=0;256>d;d++)f[d]=128>d?d<<1:d<<1^283;var y=0,g=0;for(d=0;256>d;d++){var m=(m=g^g<<1^g<<2^g<<3^g<<4)>>>8^255&m^99;r[y]=m,o[m]=y;var v=f[y],b=f[v],_=f[b],S=257*f[m]^16843008*m;i[y]=S<<24|S>>>8,a[y]=S<<16|S>>>16,s[y]=S<<8|S>>>24,u[y]=S,S=16843009*_^65537*b^257*v^16843008*y,c[m]=S<<24|S>>>8,l[m]=S<<16|S>>>16,p[m]=S<<8|S>>>24,h[m]=S,y?(y=v^f[f[f[_^v]]],g^=f[f[g]]):y=g=1}var w=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),o=this._keySchedule=[],i=0;i<n;i++)if(i<t)o[i]=e[i];else{var a=o[i-1];i%t?6<t&&4==i%t&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=w[i/t|0]<<24),o[i]=o[i-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)i=n-t,a=t%4?o[i]:o[i-4],e[t]=4>t||4>=i?a:c[r[a>>>24]]^l[r[a>>>16&255]]^p[r[a>>>8&255]]^h[r[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,a,s,u,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,c,l,p,h,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,o,i,a,s){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],p=e[t+2]^n[2],h=e[t+3]^n[3],f=4,d=1;d<u;d++){var y=r[c>>>24]^o[l>>>16&255]^i[p>>>8&255]^a[255&h]^n[f++],g=r[l>>>24]^o[p>>>16&255]^i[h>>>8&255]^a[255&c]^n[f++],m=r[p>>>24]^o[h>>>16&255]^i[c>>>8&255]^a[255&l]^n[f++];h=r[h>>>24]^o[c>>>16&255]^i[l>>>8&255]^a[255&p]^n[f++],c=y,l=g,p=m}y=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^n[f++],g=(s[l>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^n[f++],m=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[f++],h=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[l>>>
18&255]<<8|s[255&p])^n[f++],e[t]=y,e[t+1]=g,e[t+2]=m,e[t+3]=h},keySize:8}),e.AES=t._createHelper(n)}(),T.mode.ECB=((E=T.lib.BlockCipherMode.extend()).Encryptor=E.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),E.Decryptor=E.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),E);var A=T;function k(e){var t,n=[];for(t=0;t<e.length;t+=1)n[t/4|0]|=e[t]<<24-8*t;return A.lib.WordArray.create(n,e.length)}var C=function(){function e(e){var t=e.config;this._config=t,this._iv="0123456789012345",this._allowedKeyEncodings=["hex","utf8","base64","binary"],this._allowedKeyLengths=[128,256],this._allowedModes=["ecb","cbc"],this._defaultOptions={encryptKey:!0,keyEncoding:"utf8",keyLength:256,mode:"cbc"}}return e.prototype.HMACSHA256=function(e){return A.HmacSHA256(e,this._config.secretKey).toString(A.enc.Base64)},e.prototype.SHA256=function(e){return A.SHA256(e).toString(A.enc.Hex)},e.prototype._parseOptions=function(e){var t=e||{};return t.hasOwnProperty("encryptKey")||(t.encryptKey=this._defaultOptions.encryptKey),t.hasOwnProperty("keyEncoding")||(t.keyEncoding=this._defaultOptions.keyEncoding),t.hasOwnProperty("keyLength")||(t.keyLength=this._defaultOptions.keyLength),t.hasOwnProperty("mode")||(t.mode=this._defaultOptions.mode),-1===this._allowedKeyEncodings.indexOf(t.keyEncoding.toLowerCase())&&(t.keyEncoding=this._defaultOptions.keyEncoding),-1===this._allowedKeyLengths.indexOf(parseInt(t.keyLength,10))&&(t.keyLength=this._defaultOptions.keyLength),-1===this._allowedModes.indexOf(t.mode.toLowerCase())&&(t.mode=this._defaultOptions.mode),t},e.prototype._decodeKey=function(e,t){return"base64"===t.keyEncoding?A.enc.Base64.parse(e):"hex"===t.keyEncoding?A.enc.Hex.parse(e):e},e.prototype._getPaddedKey=function(e,t){return e=this._decodeKey(e,t),t.encryptKey?A.enc.Utf8.parse(this.SHA256(e).slice(0,32)):e},e.prototype._getMode=function(e){return"ecb"===e.mode?A.mode.ECB:A.mode.CBC},e.prototype._getIV=function(e){return"cbc"===e.mode?A.enc.Utf8.parse(this._iv):null},e.prototype._getRandomIV=function(){return A.lib.WordArray.random(16)},e.prototype.encrypt=function(e,t,n){return this._config.customEncrypt?this._config.customEncrypt(e):this.pnEncrypt(e,t,n)},e.prototype.decrypt=function(e,t,n){return this._config.customDecrypt?this._config.customDecrypt(e):this.pnDecrypt(e,t,n)},e.prototype.pnEncrypt=function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getMode(n),o=this._getPaddedKey(t||this._config.cipherKey,n);if(this._config.useRandomIVs){var i=this._getRandomIV(),a=A.AES.encrypt(e,o,{iv:i,mode:r}).ciphertext;return i.clone().concat(a.clone()).toString(A.enc.Base64)}var s=this._getIV(n);return A.AES.encrypt(e,o,{iv:s,mode:r}).ciphertext.toString(A.enc.Base64)||e},e.prototype.pnDecrypt=function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getMode(n),o=this._getPaddedKey(t||this._config.cipherKey,n);if(this._config.useRandomIVs){var i=k((u=new Uint8ClampedArray(b(e))).slice(0,16)),a=k(u.slice(16));try{var s=A.AES.decrypt({ciphertext:a},o,{iv:i,mode:r}).toString(A.enc.Utf8);return JSON.parse(s)}catch(e){return null}}else{i=this._getIV(n);try{var u=A.enc.Base64.parse(e);return s=A.AES.decrypt({ciphertext:u},o,{iv:i,mode:r}).toString(A.enc.Utf8),JSON.parse(s)}catch(e){return null}}},e}(),N=function(){function e(e){var t=e.timeEndpoint;this._timeEndpoint=t}return e.prototype.onReconnection=function(e){this._reconnectionCallback=e},e.prototype.startPolling=function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)},e.prototype.stopPolling=function(){clearInterval(this._timeTimer)},e.prototype._performTimeLoop=function(){var e=this;this._timeEndpoint((function(t){t.error||(clearInterval(e._timeTimer),e._reconnectionCallback())}))},e}(),M=function(){function e(e){var t=e.config;this.hashHistory=[],this._config=t}return e.prototype.getKey=function(e){var t=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e.payload)).toString(),n=e.publishMetaData.publishTimetoken;return"".concat(n,"-").concat(t)}
1,e.prototype.isDuplicate=function(e){return this.hashHistory.includes(this.getKey(e))},e.prototype.addEntry=function(e){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(e))},e.prototype.clearHistory=function(){this.hashHistory=[]},e}();function j(e){return encodeURIComponent(e).replace(/[!~*'()]/g,(function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())}))}function R(e){return function(e){var t=[];return Object.keys(e).forEach((function(e){return t.push(e)})),t}(e).sort()}var x={signPamFromParams:function(e){return R(e).map((function(t){return"".concat(t,"=").concat(j(e[t]))})).join("&")},endsWith:function(e,t){return-1!==e.indexOf(t,this.length-t.length)},createPromise:function(){var e,t;return{promise:new Promise((function(n,r){e=n,t=r})),reject:t,fulfill:e}},encodeString:j,stringToArrayBuffer:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),r=0,o=e.length;r<o;r++)n[r]=e.charCodeAt(r);return t}},U={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory",PNDisconnectedCategory:"PNDisconnectedCategory",PNConnectionErrorCategory:"PNConnectionErrorCategory",PNDisconnectedUnexpectedlyCategory:"PNDisconnectedUnexpectedlyCategory"},I=function(){function e(e){var t=e.subscribeEndpoint,n=e.leaveEndpoint,r=e.heartbeatEndpoint,o=e.setStateEndpoint,i=e.timeEndpoint,a=e.getFileUrl,s=e.config,u=e.crypto,c=e.listenerManager,l=e.cryptoModule;this._listenerManager=c,this._config=s,this._leaveEndpoint=n,this._heartbeatEndpoint=r,this._setStateEndpoint=o,this._subscribeEndpoint=t,this._getFileUrl=a,this._crypto=u,this._cryptoModule=l,this._channels={},this._presenceChannels={},this._heartbeatChannels={},this._heartbeatChannelGroups={},this._channelGroups={},this._presenceChannelGroups={},this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[],this._currentTimetoken=0,this._lastTimetoken=0,this._storedTimetoken=null,this._subscriptionStatusAnnounced=!1,this._isOnline=!0,this._reconnectionManager=new N({timeEndpoint:i}),this._dedupingManager=new M({config:s}),this._cryptoModule&&(this._decoder=new TextDecoder)}return e.prototype.adaptStateChange=function(e,t){var n=this,r=e.state,o=e.channels,i=void 0===o?[]:o,a=e.channelGroups,s=void 0===a?[]:a,u=e.withHeartbeat,c=void 0!==u&&u;if(i.forEach((function(e){e in n._channels&&(n._channels[e].state=r)})),s.forEach((function(e){e in n._channelGroups&&(n._channelGroups[e].state=r)})),c){var l={};return i.forEach((function(e){return l[e]=r})),s.forEach((function(e){return l[e]=r})),this._heartbeatEndpoint({channels:i,channelGroups:s,state:l},t)}return this._setStateEndpoint({state:r,channels:i,channelGroups:s},t)},e.prototype.adaptPresenceChange=function(e){var t=this,n=e.connected,r=e.channels,o=void 0===r?[]:r,i=e.channelGroups,a=void 0===i?[]:i;n?(o.forEach((function(e){t._heartbeatChannels[e]={state:{}}})),a.forEach((function(e){t._heartbeatChannelGroups[e]={state:{}}}))):(o.forEach((function(e){e in t._heartbeatChannels&&delete t._heartbeatChannels[e]})),a.forEach((function(e){e in t._heartbeatChannelGroups&&delete t._heartbeatChannelGroups[e]})),!1===this._config.suppressLeaveEvents&&this._leaveEndpoint({channels:o,channelGroups:a},(function(e){t._listenerManager.announceStatus(e)}))),this.reconnect()},e.prototype.adaptSubscribeChange=function(e){var t=this,n=e.timetoken,r=e.channels,o=void 0===r?[]:r,i=e.channelGroups,a=void 0===i?[]:i,s=e.withPresence,u=void 0!==s&&s,c=e.withHeartbeats,l=void 0!==c&&c;this._config.subscribeKey&&""!==this._config.subscribeKey?(n&&(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=n),"0"!==this._currentTimetoken&&0!==this._currentTimetoken&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),o.forEach((function(e){t._channels[e]={state:{}},u&&(t._presenceChannels[e]={}),(l||t._config.getHeartbeatInterval())&&(t._heartbeatChannels[e]={}),t._pendingChannelSubscriptions.push(e)})),a.forEach((function(e){t._channelGroups[e]={state:{}},u&&(t._presenceChannelGroups[e]={}),(l||t._config.getHeartbeatInterval())&&(t._heartbeatChannelGroups[e]={}),t._pendingChannelGroupSubscriptions.push(e)})),this._subscriptionStatusAnnounced=!1,this.reconnect()):console&&console.log&&console.log("subscribe 
1key missing; aborting subscribe")},e.prototype.adaptUnsubscribeChange=function(e,t){var n=this,r=e.channels,o=void 0===r?[]:r,i=e.channelGroups,a=void 0===i?[]:i,s=[],u=[];o.forEach((function(e){e in n._channels&&(delete n._channels[e],s.push(e),e in n._heartbeatChannels&&delete n._heartbeatChannels[e]),e in n._presenceChannels&&(delete n._presenceChannels[e],s.push(e))})),a.forEach((function(e){e in n._channelGroups&&(delete n._channelGroups[e],u.push(e),e in n._heartbeatChannelGroups&&delete n._heartbeatChannelGroups[e]),e in n._presenceChannelGroups&&(delete n._presenceChannelGroups[e],u.push(e))})),0===s.length&&0===u.length||(!1!==this._config.suppressLeaveEvents||t||this._leaveEndpoint({channels:s,channelGroups:u},(function(e){e.affectedChannels=s,e.affectedChannelGroups=u,e.currentTimetoken=n._currentTimetoken,e.lastTimetoken=n._lastTimetoken,n._listenerManager.announceStatus(e)})),0===Object.keys(this._channels).length&&0===Object.keys(this._presenceChannels).length&&0===Object.keys(this._channelGroups).length&&0===Object.keys(this._presenceChannelGroups).length&&(this._lastTimetoken=0,this._currentTimetoken=0,this._storedTimetoken=null,this._region=null,this._reconnectionManager.stopPolling()),this.reconnect())},e.prototype.unsubscribeAll=function(e){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},e)},e.prototype.getHeartbeatChannels=function(){return Object.keys(this._heartbeatChannels)},e.prototype.getHeartbeatChannelGroups=function(){return Object.keys(this._heartbeatChannelGroups)},e.prototype.getSubscribedChannels=function(){return Object.keys(this._channels)},e.prototype.getSubscribedChannelGroups=function(){return Object.keys(this._channelGroups)},e.prototype.reconnect=function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()},e.prototype.disconnect=function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()},e.prototype._registerHeartbeatTimer=function(){this._stopHeartbeatTimer(),0!==this._config.getHeartbeatInterval()&&void 0!==this._config.getHeartbeatInterval()&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))},e.prototype._stopHeartbeatTimer=function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)},e.prototype._performHeartbeatLoop=function(){var e=this,t=this.getHeartbeatChannels(),n=this.getHeartbeatChannelGroups(),r={};0===t.length&&0===n.length||(this.getSubscribedChannels().forEach((function(t){var n=e._channels[t].state;Object.keys(n).length&&(r[t]=n)})),this.getSubscribedChannelGroups().forEach((function(t){var n=e._channelGroups[t].state;Object.keys(n).length&&(r[t]=n)})),this._heartbeatEndpoint({channels:t,channelGroups:n,state:r},function(t){t.error&&e._config.announceFailedHeartbeats&&e._listenerManager.announceStatus(t),t.error&&e._config.autoNetworkDetection&&e._isOnline&&(e._isOnline=!1,e.disconnect(),e._listenerManager.announceNetworkDown(),e.reconnect()),!t.error&&e._config.announceSuccessfulHeartbeats&&e._listenerManager.announceStatus(t)}.bind(this)))},e.prototype._startSubscribeLoop=function(){var e=this;this._stopSubscribeLoop();var t={},n=[],r=[];if(Object.keys(this._channels).forEach((function(r){var o=e._channels[r].state;Object.keys(o).length&&(t[r]=o),n.push(r)})),Object.keys(this._presenceChannels).forEach((function(e){n.push("".concat(e,"-pnpres"))})),Object.keys(this._channelGroups).forEach((function(n){var o=e._channelGroups[n].state;Object.keys(o).length&&(t[n]=o),r.push(n)})),Object.keys(this._presenceChannelGroups).forEach((function(e){r.push("".concat(e,"-pnpres"))})),0!==n.length||0!==r.length){var o={channels:n,channelGroups:r,state:t,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(o,this._processSubscribeResponse.bind(this))}},e.prototype._processSubscribeResponse=function(e,t){var n=this;if(e.error){if(e.errorData&&"Aborted"===e.errorData.message)return;e.category===U.PNTimeoutCategory?this._startSubscribeLoop():e.category===U.PNNetworkIssuesCategory?(this.disconnect(),e.error&&this._config.autoNetworkDetection&&this._isOnline&&(this._isOnline=!1,this._listenerManager.announceNetworkDown()),this._reconnectionManager.onReconnection((function(){n._config.autoNetworkDetection&&!n._isOnline&&(n._isOnline=!0,n._listenerManager.announceNetworkUp()),n.reconnect(),n._subscriptionStatusAnnounced=!0;var t={category:U.PNReconnectedCategory,operation:e.operation,lastTimetoken:n._lastTimetoken,currentTimetoken:n._currentTimetoken};n._listenerManager.announceStatus(t)})),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(e)):e.category===U.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(e)):this._listenerManager.announceStatus(e)}else{if(this._storedTimetoken?(this._currentTimetoken=this._storedTimetoken,this._storedTimetoken=null):(this._lastTimetoken=this._currentTimetoken,this._currentTimetoken=t.metadata.timetoken),!this._subscriptionStatusAnnounced){var r={};r.category=U.PNConnectedCategory,r.operation=e.operation,r.affectedChannels=this._pe
1ndingChannelSubscriptions,r.subscribedChannels=this.getSubscribedChannels(),r.affectedChannelGroups=this._pendingChannelGroupSubscriptions,r.lastTimetoken=this._lastTimetoken,r.currentTimetoken=this._currentTimetoken,this._subscriptionStatusAnnounced=!0,this._listenerManager.announceStatus(r),this._pendingChannelSubscriptions=[],this._pendingChannelGroupSubscriptions=[]}var a=t.messages||[],s=this._config,u=s.requestMessageCountThreshold,c=s.dedupeOnSubscribe;if(u&&a.length>=u){var l={};l.category=U.PNRequestMessageCountExceededCategory,l.operation=e.operation,this._listenerManager.announceStatus(l)}a.forEach((function(e){var t=e.channel,r=e.subscriptionMatch,a=e.publishMetaData;if(t===r&&(r=null),c){if(n._dedupingManager.isDuplicate(e))return;n._dedupingManager.addEntry(e)}if(x.endsWith(e.channel,"-pnpres"))(y={channel:null,subscription:null}).actualChannel=null!=r?t:null,y.subscribedChannel=null!=r?r:t,t&&(y.channel=t.substring(0,t.lastIndexOf("-pnpres"))),r&&(y.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),y.action=e.payload.action,y.state=e.payload.data,y.timetoken=a.publishTimetoken,y.occupancy=e.payload.occupancy,y.uuid=e.payload.uuid,y.timestamp=e.payload.timestamp,e.payload.join&&(y.join=e.payload.join),e.payload.leave&&(y.leave=e.payload.leave),e.payload.timeout&&(y.timeout=e.payload.timeout),n._listenerManager.announcePresence(y);else if(1===e.messageType)(y={channel:null,subscription:null}).channel=t,y.subscription=r,y.timetoken=a.publishTimetoken,y.publisher=e.issuingClientId,e.userMetadata&&(y.userMetadata=e.userMetadata),y.message=e.payload,n._listenerManager.announceSignal(y);else if(2===e.messageType){if((y={channel:null,subscription:null}).channel=t,y.subscription=r,y.timetoken=a.publishTimetoken,y.publisher=e.issuingClientId,e.userMetadata&&(y.userMetadata=e.userMetadata),y.message={event:e.payload.event,type:e.payload.type,data:e.payload.data},n._listenerManager.announceObjects(y),"uuid"===e.payload.type){var s=n._renameChannelField(y);n._listenerManager.announceUser(o(o({},s),{message:o(o({},s.message),{event:n._renameEvent(s.message.event),type:"user"})}))}else if("channel"===e.payload.type)s=n._renameChannelField(y),n._listenerManager.announceSpace(o(o({},s),{message:o(o({},s.message),{event:n._renameEvent(s.message.event),type:"space"})}));else if("membership"===e.payload.type){var u=(s=n._renameChannelField(y)).message.data,l=u.uuid,p=u.channel,h=i(u,["uuid","channel"]);h.user=l,h.space=p,n._listenerManager.announceMembership(o(o({},s),{message:o(o({},s.message),{event:n._renameEvent(s.message.event),data:h})}))}}else if(3===e.messageType)(y={}).channel=t,y.subscription=r,y.timetoken=a.publishTimetoken,y.publisher=e.issuingClientId,y.data={messageTimetoken:e.payload.data.messageTimetoken,actionTimetoken:e.payload.data.actionTimetoken,type:e.payload.data.type,uuid:e.issuingClientId,value:e.payload.data.value},y.event=e.payload.event,n._listenerManager.announceMessageAction(y);else if(4===e.messageType){(y={}).channel=t,y.subscription=r,y.timetoken=a.publishTimetoken,y.publisher=e.issuingClientId;var f=e.payload;if(n._cryptoModule){var d=void 0;try{d=(g=n._cryptoModule.decrypt(e.payload))instanceof ArrayBuffer?JSON.parse(n._decoder.decode(g)):g}catch(e){d=null,y.error="Error while decrypting message content: ".concat(e.message)}null!==d&&(f=d)}e.userMetadata&&(y.userMetadata=e.userMetadata),y.message=f.message,y.file={id:f.file.id,name:f.file.name,url:n._getFileUrl({id:f.file.id,name:f.file.name,channel:t})},n._listenerManager.announceFile(y)}else{var y;if((y={channel:null,subscription:null}).actualChannel=null!=r?t:null,y.subscribedChannel=null!=r?r:t,y.channel=t,y.subscription=r,y.timetoken=a.publishTimetoken,y.publisher=e.issuingClientId,e.userMetadata&&(y.userMetadata=e.userMetadata),n._cryptoModule){d=void 0;try{var g;d=(g=n._cryptoModule.decrypt(e.payload))instanceof ArrayBuffer?JSON.parse(n._decoder.decode(g)):g}catch(e){d=null,y.error="Error while decrypting message content: ".concat(e.message)}y.message=null!=d?d:e.payload}else y.message=e.payload;n._listenerManager.announceMessage(y)}})),this._region=t.metadata.region,this._startSubscribeLoop()}},e.prototype._stopSubscribeLoop=function(){this._subscribeCall&&("function"==typeof this._subscribeCall.abort&&this._subscribeCall.abort(),this._subscribeCall=null)},e.prototype._renameEvent=function(e){return"set"===e?"updated":"removed"},e.prototype._renameChannelField=function(e){var t=e.channel,n=i(e,["channel"]);return n.spaceId=t,n},e}(),D={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",PNSignalOperation:"PNSignalOperation",PNAddMessageActionOperation:"PNAddActionOperation",PNRemoveMessageActionOperation:"PNRemoveMessageActionOperation",PNGetMessageActionsOperation:"PNGetMessageActionsOperation",PNCreateUserOperation:"PNCreateUserOperation",PNUpdateUserOperation:"PNUpdateUserOperation",PNDeleteUserOperation:"PNDeleteUserOperation",PNGetUserOperation:"PNGetUsersOperation",PNGetUsersOperation:"PNGetUsersOperation",PNCreateSpaceOperation:"PNCreateSpaceOperation",PNUpdateSpaceOperation:"PNUpdateSpaceOperation",PNDeleteSpaceOperation:"PNDeleteSpaceOperation",PNGetSpaceOperation:"PNGetSpacesOperation",PNGetSpacesOperation:"PNGetSpacesOperation",PNGetMembersOperation:"PNGetMembersOperation",PNUpdateMembersOperation:"PNUpdateMembersOperation",PNGetMembershipsOperation:"PNGetMembershipsOperation",PNUpdateMembershipsOperation:"PNUpdateMembershipsOperation",PNListFilesOperation:"PNListFilesOperation",PNGenerateUploadUrlOperation:"PNGenerateUploadUrlOperation",PNPublishFileOperation:"PNPublishFileOperation",PNGetFileUrlOperation:"PNGetFileUrlOperation",PNDownloadFileOperation:"PNDownloadFileOperation",PNGetAllUUIDMetadataOperation:"PNGetAllUUIDMetadataOperation",PNGetUUIDMetadataOperation:"PNGetUUIDMetadataOperation",PNSetUUIDMetadataOperation:"PNSetUUIDMetadataOperation",PNRemoveUUIDMetadataOperation:"PNRemoveUUIDMetadataOperation",PNGetAllChannelMetadataOperation:"PNGetAllChannelMetadataOperation",PNGetChannelMetadataOperation:"PNGetChannelMetadataOperation",PNSetChannelMetadataOperation:"PNSetChannelMetadataOperation",PNRemoveChannelMetadataOperation:"PNRemoveChannelMetadataOperation",PNSetMembersOperation:"PNSetMembersOperation",PNSetMembershipsOperation:"PNSetMembershipsOperation",PNPushNotificationEnabledChannelsOperation:"PNPushNotificationEnabledChannelsOperation",PNRemoveAllPushNotificationsOperation:"PNRemoveAllPushNotificationsOperation",PNWhereNowOperation:"PNWhereNowOperation",PNSetStateOperation:"PNSetStateOperation",PNHereNowOperation:"PNHereNowOperation",PNGetStateOperation:"PNGetStateOperation",PNHeartbeatOperation:"PNHeartbeatOperation",PNChannelGroupsOperation:"PNChannelGroupsOperation",PNRemoveGroupOperation:"PNRemoveGroupOperation",PNChannelsForGroupOperation:"PNChannelsForGroupOperation",PNAddChannelsToGroupOperation:"PNAddChannelsToGroupOperation",PNRemoveChannelsFromGroupOperation:"PNRemoveChannelsFromGroupOperation",PNAccessManagerGrant:"PNAccessManagerGrant",PNAccessManagerGrantToken:"PNAccessManagerGrantToken",PNAccessManagerAudit:"PNAccessManagerAudit",PNAccessManagerRevokeToken:"PNAccessManagerRevokeToken",PNHandshakeOperation:"PNHandshakeOperation",PNReceiveMessagesOperation:"PNReceiveMessagesOperation"},F=function(){function e(e){this._maximumSamplesCount=100,this._trackedLatencies={},this._latencies={},this._maximumSamplesCount=e.maximumSamplesCount||this._maximumSamplesCount}return e.prototype.operationsLatencyForRequest=function(){var e=this,t={};
1return Object.keys(this._latencies).forEach((function(n){var r=e._latencies[n],o=e._averageLatency(r);o>0&&(t["l_".concat(n)]=o)})),t},e.prototype.startLatencyMeasure=function(e,t){e!==D.PNSubscribeOperation&&t&&(this._trackedLatencies[t]=Date.now())},e.prototype.stopLatencyMeasure=function(e,t){if(e!==D.PNSubscribeOperation&&t){var n=this._endpointName(e),r=this._latencies[n],o=this._trackedLatencies[t];r||(this._latencies[n]=[],r=this._latencies[n]),r.push(Date.now()-o),r.length>this._maximumSamplesCount&&r.splice(0,r.length-this._maximumSamplesCount),delete this._trackedLatencies[t]}},e.prototype._averageLatency=function(e){return Math.floor(e.reduce((function(e,t){return e+t}),0)/e.length)},e.prototype._endpointName=function(e){var t=null;switch(e){case D.PNPublishOperation:t="pub";break;case D.PNSignalOperation:t="sig";break;case D.PNHistoryOperation:case D.PNFetchMessagesOperation:case D.PNDeleteMessagesOperation:case D.PNMessageCounts:t="hist";break;case D.PNUnsubscribeOperation:case D.PNWhereNowOperation:case D.PNHereNowOperation:case D.PNHeartbeatOperation:case D.PNSetStateOperation:case D.PNGetStateOperation:t="pres";break;case D.PNAddChannelsToGroupOperation:case D.PNRemoveChannelsFromGroupOperation:case D.PNChannelGroupsOperation:case D.PNRemoveGroupOperation:case D.PNChannelsForGroupOperation:t="cg";break;case D.PNPushNotificationEnabledChannelsOperation:case D.PNRemoveAllPushNotificationsOperation:t="push";break;case D.PNCreateUserOperation:case D.PNUpdateUserOperation:case D.PNDeleteUserOperation:case D.PNGetUserOperation:case D.PNGetUsersOperation:case D.PNCreateSpaceOperation:case D.PNUpdateSpaceOperation:case D.PNDeleteSpaceOperation:case D.PNGetSpaceOperation:case D.PNGetSpacesOperation:case D.PNGetMembersOperation:case D.PNUpdateMembersOperation:case D.PNGetMembershipsOperation:case D.PNUpdateMembershipsOperation:t="obj";break;case D.PNAddMessageActionOperation:case D.PNRemoveMessageActionOperation:case D.PNGetMessageActionsOperation:t="msga";break;case D.PNAccessManagerGrant:case D.PNAccessManagerAudit:t="pam";break;case D.PNAccessManagerGrantToken:case D.PNAccessManagerRevokeToken:t="pamv3";break;default:t="time"}return t},e}(),G=function(){function e(e,t,n){this._payload=e,this._setDefaultPayloadStructure(),this.title=t,this.body=n}return Object.defineProperty(e.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{set:function(e){this._title=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtitle",{set:function(e){this._subtitle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{set:function(e){this._body=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"badge",{set:function(e){this._badge=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sound",{set:function(e){this._sound=e},enumerable:!1,configurable:!0}),e.prototype._setDefaultPayloadStructure=function(){},e.prototype.toObject=function(){return{}},e}(),L=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"configurations",{set:function(e){e&&e.length&&(this._configurations=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"notification",{get:function(){return this._payload.aps},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"title",{get:function(){return this._title},set:function(e){e&&e.length&&(this._payload.aps.alert.title=e,this._title=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"subtitle",{get:function(){return this._subtitle},set:function(e){e&&e.length&&(this._payload.aps.alert.subtitle=e,this._subtitle=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this._body},set:function(e){e&&e.length&&(this._payload.aps.alert.body=e,this._body=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"badge",{get:function(){return this._badge},set:function(e){null!=e&&(this._payload.aps.badge=e,this._badge=e)}
1,enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sound",{get:function(){return this._sound},set:function(e){e&&e.length&&(this._payload.aps.sound=e,this._sound=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"silent",{set:function(e){this._isSilent=e},enumerable:!1,configurable:!0}),n.prototype._setDefaultPayloadStructure=function(){this._payload.aps={alert:{}}},n.prototype.toObject=function(){var e=this,t=o({},this._payload),n=t.aps,r=n.alert;if(this._isSilent&&(n["content-available"]=1),"apns2"===this._apnsPushType){if(!this._configurations||!this._configurations.length)throw new ReferenceError("APNS2 configuration is missing");var i=[];this._configurations.forEach((function(t){i.push(e._objectFromAPNS2Configuration(t))})),i.length&&(t.pn_push=i)}return r&&Object.keys(r).length||delete n.alert,this._isSilent&&(delete n.alert,delete n.badge,delete n.sound,r={}),this._isSilent||Object.keys(r).length?t:null},n.prototype._objectFromAPNS2Configuration=function(e){var t=this;if(!e.targets||!e.targets.length)throw new ReferenceError("At least one APNS2 target should be provided");var n=[];e.targets.forEach((function(e){n.push(t._objectFromAPNSTarget(e))}));var r=e.collapseId,o=e.expirationDate,i={auth_method:"token",targets:n,version:"v2"};return r&&r.length&&(i.collapse_id=r),o&&(i.expiration=o.toISOString()),i},n.prototype._objectFromAPNSTarget=function(e){if(!e.topic||!e.topic.length)throw new TypeError("Target 'topic' undefined.");var t=e.topic,n=e.environment,r=void 0===n?"development":n,o=e.excludedDevices,i=void 0===o?[]:o,a={topic:t,environment:r};return i.length&&(a.excluded_devices=i),a},n}(G),K=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"backContent",{get:function(){return this._backContent},set:function(e){e&&e.length&&(this._payload.back_content=e,this._backContent=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"backTitle",{get:function(){return this._backTitle},set:function(e){e&&e.length&&(this._payload.back_title=e,this._backTitle=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"count",{get:function(){return this._count},set:function(e){null!=e&&(this._payload.count=e,this._count=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"title",{get:function(){return this._title},set:function(e){e&&e.length&&(this._payload.title=e,this._title=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this._type},set:function(e){e&&e.length&&(this._payload.type=e,this._type=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"subtitle",{get:function(){return this.backTitle},set:function(e){this.backTitle=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.backContent},set:function(e){this.backContent=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"badge",{get:function(){return this.count},set:function(e){this.count=e},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return Object.keys(this._payload).length?o({},this._payload):null},n}(G),B=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"notification",{get:function(){return this._payload.notification},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this._payload.data},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"title",{get:function(){return this._title},set:function(e){e&&e.length&&(this._payload.notification.title=e,this._title=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this._body},set:function(e){e&&e.length&&(this._payload.notification.body=e,this._body=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sound",{get:function(){return this._sound},set:function(e){e&&e.length&&(this._payload.notification.sound=e,this._sound=e)}
1,enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"icon",{get:function(){return this._icon},set:function(e){e&&e.length&&(this._payload.notification.icon=e,this._icon=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tag",{get:function(){return this._tag},set:function(e){e&&e.length&&(this._payload.notification.tag=e,this._tag=e)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"silent",{set:function(e){this._isSilent=e},enumerable:!1,configurable:!0}),n.prototype._setDefaultPayloadStructure=function(){this._payload.notification={},this._payload.data={}},n.prototype.toObject=function(){var e=o({},this._payload.data),t=null,n={};if(Object.keys(this._payload).length>2){var r=this._payload;r.notification,r.data;var a=i(r,["notification","data"]);e=o(o({},e),a)}return this._isSilent?e.notification=this._payload.notification:t=this._payload.notification,Object.keys(e).length&&(n.data=e),t&&Object.keys(t).length&&(n.notification=t),Object.keys(n).length?n:null},n}(G),H=function(){function e(e,t){this._payload={apns:{},mpns:{},fcm:{}},this._title=e,this._body=t,this.apns=new L(this._payload.apns,e,t),this.mpns=new K(this._payload.mpns,e,t),this.fcm=new B(this._payload.fcm,e,t)}return Object.defineProperty(e.prototype,"debugging",{set:function(e){this._debugging=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this._title},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this._body},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subtitle",{get:function(){return this._subtitle},set:function(e){this._subtitle=e,this.apns.subtitle=e,this.mpns.subtitle=e,this.fcm.subtitle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"badge",{get:function(){return this._badge},set:function(e){this._badge=e,this.apns.badge=e,this.mpns.badge=e,this.fcm.badge=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sound",{get:function(){return this._sound},set:function(e){this._sound=e,this.apns.sound=e,this.mpns.sound=e,this.fcm.sound=e},enumerable:!1,configurable:!0}),e.prototype.buildPayload=function(e){var t={};if(e.includes("apns")||e.includes("apns2")){this.apns._apnsPushType=e.includes("apns")?"apns":"apns2";var n=this.apns.toObject();n&&Object.keys(n).length&&(t.pn_apns=n)}if(e.includes("mpns")){var r=this.mpns.toObject();r&&Object.keys(r).length&&(t.pn_mpns=r)}if(e.includes("fcm")){var o=this.fcm.toObject();o&&Object.keys(o).length&&(t.pn_gcm=o)}return Object.keys(t).length&&this._debugging&&(t.pn_debug=!0),t},e}(),q=function(){function e(){this._listeners=[]}return e.prototype.addListener=function(e){this._listeners.includes(e)||this._listeners.push(e)},e.prototype.removeListener=function(e){var t=[];this._listeners.forEach((function(n){n!==e&&t.push(n)})),this._listeners=t},e.prototype.removeAllListeners=function(){this._listeners=[]},e.prototype.announcePresence=function(e){this._listeners.forEach((function(t){t.presence&&t.presence(e)}))},e.prototype.announceStatus=function(e){this._listeners.forEach((function(t){t.status&&t.status(e)}))},e.prototype.announceMessage=function(e){this._listeners.forEach((function(t){t.message&&t.message(e)}))},e.prototype.announceSignal=function(e){this._listeners.forEach((function(t){t.signal&&t.signal(e)}))},e.prototype.announceMessageAction=function(e){this._listeners.forEach((function(t){t.messageAction&&t.messageAction(e)}))},e.prototype.announceFile=function(e){this._listeners.forEach((function(t){t.file&&t.file(e)}))},e.prototype.announceObjects=function(e){this._listeners.forEach((function(t){t.objects&&t.objects(e)}))},e.prototype.announceUser=function(e){this._listeners.forEach((function(t){t.user&&t.user(e)}))},e.prototype.announceSpace=function(e){this._listeners.forEach((function(t){t.space&&t.space(e)}))},e.prototype.announceMembership=function(e){this._listeners.forEach((function(t){t.membership&&t.membership(e)}))},e.prototype.announceNetworkUp=function(){var e={};e.category=U.PNNetworkUpCategory,this.announceStatus(e)},e.prototype.announceNetworkDown=function(){var e={};e.category=U.PNNetworkDownCategory,this.announceStatus(e)},e}(),z=function(){function e(e,t){this._config=e,this._cbor=t}return e.prototype.setToken=function(e){e&&e.length>0?this._token=e:this._token=void 0},e.prototype.getToken=function(){return this._token},e.prototype.extractPermissions=function(e){var t={read:!1,write:!1,manage:!1,delete:!1,get:!1,update:!1,join:!1};return 128==(128&e)&&(t.join=!0),64==(64&e)&&(t.update=!0),32==(32&e)&&(t.get=!0),8==(8&e)&&(t.delete=!0),4==(4&e)&&(t.manage=!0),2==(2&e)&&(t.write=!0),1==(1&e)&&(t.read=!0),t},e.prototype.parseToken=function(e){var t=this,n=this._cbor.decodeToken(e);if(void 0!==n){var r=n.res.uuid?Object.keys(n.res.uuid):[],o=Object.keys(n.res.chan),i=Object.keys(n.res.grp),a=n.pat.uuid?Object.keys(n.pat.uuid):[],s=Object.keys(n.pat.chan),u=Object.keys(n.pat.grp),c={version:n.v,timestamp:n.t,ttl:n.ttl,authorized_uuid:n.uuid},l=r.length>0,p=o.length>0,h=i.length>0;(l||p||h)&&(c.resources={},l&&(c.resources.uuids={},r.forEach((function(e){c.resources.uuids[e]=t.extractPermissions(n.res.uuid[e])}))),p&&(c.resources.channels={},o.forEach((function(e){c.resources.channels[e]=t.extractPermissions(n.res.chan[e])}))),h&&(c.resources.groups={}
1,i.forEach((function(e){c.resources.groups[e]=t.extractPermissions(n.res.grp[e])}))));var f=a.length>0,d=s.length>0,y=u.length>0;return(f||d||y)&&(c.patterns={},f&&(c.patterns.uuids={},a.forEach((function(e){c.patterns.uuids[e]=t.extractPermissions(n.pat.uuid[e])}))),d&&(c.patterns.channels={},s.forEach((function(e){c.patterns.channels[e]=t.extractPermissions(n.pat.chan[e])}))),y&&(c.patterns.groups={},u.forEach((function(e){c.patterns.groups[e]=t.extractPermissions(n.pat.grp[e])})))),Object.keys(n.meta).length>0&&(c.meta=n.meta),c.signature=n.sig,c}},e}(),V=function(e){function n(t,n){var r=this.constructor,o=e.call(this,t)||this;return o.name=o.constructor.name,o.status=n,o.message=t,Object.setPrototypeOf(o,r.prototype),o}return t(n,e),n}(Error);function W(e){return(t={message:e}).type="validationError",t.error=!0,t;var t}function J(e,t,n){return e.usePost&&e.usePost(t,n)?e.postURL(t,n):e.usePatch&&e.usePatch(t,n)?e.patchURL(t,n):e.useGetFile&&e.useGetFile(t,n)?e.getFileURL(t,n):e.getURL(t,n)}function $(e){if(e.sdkName)return e.sdkName;var t="PubNub-JS-".concat(e.sdkFamily);e.partnerId&&(t+="-".concat(e.partnerId)),t+="/".concat(e.getVersion());var n=e._getPnsdkSuffix(" ");return n.length>0&&(t+=n),t}function Q(e,t,n){return t.usePost&&t.usePost(e,n)?"POST":t.usePatch&&t.usePatch(e,n)?"PATCH":t.useDelete&&t.useDelete(e,n)?"DELETE":t.useGetFile&&t.useGetFile(e,n)?"GETFILE":"GET"}function X(e,t,n,r,o){var i=e.config,a=e.crypto,s=Q(e,o,r);n.timestamp=Math.floor((new Date).getTime()/1e3),"PNPublishOperation"===o.getOperation()&&o.usePost&&o.usePost(e,r)&&(s="GET"),"GETFILE"===s&&(s="GET");var u="".concat(s,"\n").concat(i.publishKey,"\n").concat(t,"\n").concat(x.signPamFromParams(n),"\n");if("POST"===s)u+="string"==typeof(c=o.postPayload(e,r))?c:JSON.stringify(c);else if("PATCH"===s){var c;u+="string"==typeof(c=o.patchPayload(e,r))?c:JSON.stringify(c)}var l="v2.".concat(a.HMACSHA256(u));l=(l=(l=l.replace(/\+/g,"-")).replace(/\//g,"_")).replace(/=+$/,""),n.signature=l}function Y(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e.networking,a=e.config,s=e.telemetryManager,u=e.tokenManager,c=m(),l=null,p=null,h={};t.getOperation()===D.PNTimeOperation||t.getOperation()===D.PNChannelGroupsOperation?l=n[0]:(h=n[0],l=n[1]),"undefined"==typeof Promise||l||(p=x.createPromise());var f=t.validateParams(e,h);if(f)return l?l(W(f)):p?(p.reject(new V("Validation failed, check status for details",W(f))),p.promise):void 0;var d,y=t.prepareParams(e,h),g=J(t,e,h),v={url:g,operation:t.getOperation(),timeout:t.getRequestTimeout(e),headers:t.getRequestHeaders?t.getRequestHeaders():{},ignoreBody:"function"==typeof t.ignoreBody&&t.ignoreBody(e),forceBuffered:"function"==typeof t.forceBuffered?t.forceBuffered(e,h):null,abortSignal:"function"==typeof t.getAbortSignal?t.getAbortSignal(e,h):null};y.uuid=a.UUID,y.pnsdk=$(a);var b=s.operationsLatencyForRequest();if(Object.keys(b).length&&(y=o(o({},y),b)),a.useInstanceId&&(y.instanceid=a.instanceId),a.useRequestId&&(y.requestid=c),t.isAuthSupported()){var _=u.getToken()||a.getAuthKey();_&&(y.auth=_)}a.secretKey&&X(e,g,y,h,t);var S=function(n,r){if(n.error)return t.handleError&&t.handleError(e,h,n),void(l?l(n):p&&p.reject(new V("PubNub call failed, check status for details",n)));s.stopLatencyMeasure(t.getOperation(),c);var o=t.handleResponse(e,r,h);"function"!=typeof(null==o?void 0:o.then)&&(o=Promise.resolve(o)),o.then((function(e){l?l(n,e):p&&p.fulfill(e)})).catch((function(e){if(l){var n=e;t.getOperation()===D.PNSubscribeOperation&&(n={statusCode:400,error:!0,operation:t.getOperation(),errorData:e,category:U.PNUnknownCategory}),l(n,null)}else p&&p.reject(new V("PubNub call failed, check status for details",e))}))};if(s.startLatencyMeasure(t.getOperation(),c),"POST"===Q(e,t,h)){var w=t.postPayload(e,h);d=i.POST(y,w,v,S)}else"PATCH"===Q(e,t,h)?(w=t.patchPayload(e,h),d=i.PATCH(y,w,v,S)):d="DELETE"===Q(e,t,h)?i.DELETE(y,v,S):"GETFILE"===Q(e,t,h)?i.GETFILE(y,v,S):i.GET(y,v,S);return t.getOperation()===D.PNSubscribeOperation?d:p?p.promise:void 0}var Z=Object.freeze({__proto__:null,getOperation:function(){return D.PNAddChannelsToGroupOperation}
1,validateParams:function(e,t){var n=t.channels,r=t.channelGroup,o=e.config;return r?n&&0!==n.length?o.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(e,t){var n=t.channelGroup,r=e.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(x.encodeString(n))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channels;return{add:(void 0===n?[]:n).join(",")}},handleResponse:function(){return{}}}),ee=Object.freeze({__proto__:null,getOperation:function(){return D.PNRemoveChannelsFromGroupOperation},validateParams:function(e,t){var n=t.channels,r=t.channelGroup,o=e.config;return r?n&&0!==n.length?o.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"},getURL:function(e,t){var n=t.channelGroup,r=e.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(x.encodeString(n))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channels;return{remove:(void 0===n?[]:n).join(",")}},handleResponse:function(){return{}}}),te=Object.freeze({__proto__:null,getOperation:function(){return D.PNRemoveGroupOperation},validateParams:function(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(e,t){var n=t.channelGroup,r=e.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(x.encodeString(n),"/remove")},isAuthSupported:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},prepareParams:function(){return{}},handleResponse:function(){return{}}}),ne=Object.freeze({__proto__:null,getOperation:function(){return D.PNChannelGroupsOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e){var t=e.config;return"/v1/channel-registration/sub-key/".concat(t.subscribeKey,"/channel-group")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{groups:t.payload.groups}}}),re=Object.freeze({__proto__:null,getOperation:function(){return D.PNChannelsForGroupOperation},validateParams:function(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"},getURL:function(e,t){var n=t.channelGroup,r=e.config;return"/v1/channel-registration/sub-key/".concat(r.subscribeKey,"/channel-group/").concat(x.encodeString(n))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{channels:t.payload.channels}}}),oe=Object.freeze({__proto__:null,getOperation:function(){return D.PNPushNotificationEnabledChannelsOperation},validateParams:function(e,t){var n=t.device,r=t.pushGateway,o=t.channels,i=t.topic,a=e.config;return n?r?"apns2"!==r||i?o&&0!==o.length?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(e,t){var n=t.device,r=t.pushGateway,o=e.config;return"apns2"===r?"/v2/push/sub-key/".concat(o.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(o.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.pushGateway,r=t.channels,i=void 0===r?[]:r,a=t.environment,s=void 0===a?"development":a,u=t.topic,c={type:n,add:i.join(",")};return"apns2"===n&&delete(c=o(o({},c),{environment:s,topic:u})).type,c},handleResponse:function(){return{}}}),ie=Object.freeze({__proto__:null,getOperation:function(){return D.PNPushNotificationEnabledChannelsOperation},validateParams:function(e,t){var n=t.device,r=t.pushGateway,o=t.channels,i=t.topic,a=e.config;return n?r?"apns2"!==r||i?o&&0!==o.length?a.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(e,t){var n=t.device,r=t.pushGateway,o=e.config;return"apns2"===r?"/v2/push/sub-key/".concat(o.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(o.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.pushGateway,r=t.channels,i=void 0===r?[]:r,a=t.environment,s=void 0===a?"development":a,u=t.topic,c={type:n,remove:i.join(",")};return"apns2"===n&&delete(c=o(o({},c),{environment:s,topic:u})).type,c},handleResponse:function(){return{}}}),ae=Object.freeze({__proto__:null,getOperation:function(){return D.PNPushNotificationEnabledChannelsOperation}
1,validateParams:function(e,t){var n=t.device,r=t.pushGateway,o=t.topic,i=e.config;return n?r?"apns2"!==r||o?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(e,t){var n=t.device,r=t.pushGateway,o=e.config;return"apns2"===r?"/v2/push/sub-key/".concat(o.subscribeKey,"/devices-apns2/").concat(n):"/v1/push/sub-key/".concat(o.subscribeKey,"/devices/").concat(n)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.pushGateway,r=t.environment,i=void 0===r?"development":r,a=t.topic,s={type:n};return"apns2"===n&&delete(s=o(o({},s),{environment:i,topic:a})).type,s},handleResponse:function(e,t){return{channels:t}}}),se=Object.freeze({__proto__:null,getOperation:function(){return D.PNRemoveAllPushNotificationsOperation},validateParams:function(e,t){var n=t.device,r=t.pushGateway,o=t.topic,i=e.config;return n?r?"apns2"!==r||o?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing APNS2 topic":"Missing GW Type (pushGateway: gcm, apns or apns2)":"Missing Device ID (device)"},getURL:function(e,t){var n=t.device,r=t.pushGateway,o=e.config;return"apns2"===r?"/v2/push/sub-key/".concat(o.subscribeKey,"/devices-apns2/").concat(n,"/remove"):"/v1/push/sub-key/".concat(o.subscribeKey,"/devices/").concat(n,"/remove")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.pushGateway,r=t.environment,i=void 0===r?"development":r,a=t.topic,s={type:n};return"apns2"===n&&delete(s=o(o({},s),{environment:i,topic:a})).type,s},handleResponse:function(){return{}}}),ue=Object.freeze({__proto__:null,getOperation:function(){return D.PNUnsubscribeOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.channels,o=void 0===r?[]:r,i=o.length>0?o.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(i),"/leave")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channelGroups,r=void 0===n?[]:n,o={};return r.length>0&&(o["channel-group"]=r.join(",")),o},handleResponse:function(){return{}}}),ce=Object.freeze({__proto__:null,getOperation:function(){return D.PNWhereNowOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.uuid,o=void 0===r?n.UUID:r;return"/v2/presence/sub-key/".concat(n.subscribeKey,"/uuid/").concat(x.encodeString(o))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return t.payload?{channels:t.payload.channels}:{channels:[]}}}),le=Object.freeze({__proto__:null,getOperation:function(){return D.PNHeartbeatOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.channels,o=void 0===r?[]:r,i=o.length>0?o.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(i),"/heartbeat")},isAuthSupported:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},prepareParams:function(e,t){var n=t.channelGroups,r=void 0===n?[]:n,o=t.state,i=e.config,a={};return r.length>0&&(a["channel-group"]=r.join(",")),o&&(a.state=JSON.stringify(o)),a.heartbeat=i.getPresenceTimeout(),a},handleResponse:function(){return{}}}),pe=Object.freeze({__proto__:null,getOperation:function(){return D.PNGetStateOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.uuid,o=void 0===r?n.UUID:r,i=t.channels,a=void 0===i?[]:i,s=a.length>0?a.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(s),"/uuid/").concat(o)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channelGroups,r=void 0===n?[]:n,o={};return r.length>0&&(o["channel-group"]=r.join(",")),o},handleResponse:function(e,t,n){var r=n.channels,o=void 0===r?[]:r,
1i=n.channelGroups,a=void 0===i?[]:i,s={};return 1===o.length&&0===a.length?s[o[0]]=t.payload:s=t.payload,{channels:s}}}),he=Object.freeze({__proto__:null,getOperation:function(){return D.PNSetStateOperation},validateParams:function(e,t){var n=e.config,r=t.state,o=t.channels,i=void 0===o?[]:o,a=t.channelGroups,s=void 0===a?[]:a;return r?n.subscribeKey?0===i.length&&0===s.length?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"},getURL:function(e,t){var n=e.config,r=t.channels,o=void 0===r?[]:r,i=o.length>0?o.join(","):",";return"/v2/presence/sub-key/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(i),"/uuid/").concat(x.encodeString(n.UUID),"/data")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.state,r=t.channelGroups,o=void 0===r?[]:r,i={};return i.state=JSON.stringify(n),o.length>0&&(i["channel-group"]=o.join(",")),i},handleResponse:function(e,t){return{state:t.payload}}}),fe=Object.freeze({__proto__:null,getOperation:function(){return D.PNHereNowOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.channels,o=void 0===r?[]:r,i=t.channelGroups,a=void 0===i?[]:i,s="/v2/presence/sub-key/".concat(n.subscribeKey);if(o.length>0||a.length>0){var u=o.length>0?o.join(","):",";s+="/channel/".concat(x.encodeString(u))}return s},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.includeUUIDs,a=void 0===i||i,s=t.includeState,u=void 0!==s&&s,c=t.queryParameters,l=void 0===c?{}:c,p={};return a||(p.disable_uuids=1),u&&(p.state=1),r.length>0&&(p["channel-group"]=r.join(",")),o(o({},p),l)},handleResponse:function(e,t,n){var r=n.channels,o=void 0===r?[]:r,i=n.channelGroups,a=void 0===i?[]:i,s=n.includeUUIDs,u=void 0===s||s,c=n.includeState,l=void 0!==c&&c;return o.length>1||a.length>0||0===a.length&&0===o.length?function(){var e={};return e.totalChannels=t.payload.total_channels,e.totalOccupancy=t.payload.total_occupancy,e.channels={},Object.keys(t.payload.channels).forEach((function(n){var r=t.payload.channels[n],o=[];return e.channels[n]={occupants:o,name:n,occupancy:r.occupancy},u&&r.uuids.forEach((function(e){l?o.push({state:e.state,uuid:e.uuid}):o.push({state:null,uuid:e})})),e})),e}():function(){var e={},n=[];return e.totalChannels=1,e.totalOccupancy=t.occupancy,e.channels={},e.channels[o[0]]={occupants:n,name:o[0],occupancy:t.occupancy},u&&t.uuids&&t.uuids.forEach((function(e){l?n.push({state:e.state,uuid:e.uuid}):n.push({state:null,uuid:e})})),e}()},handleError:function(e,t,n){402!==n.statusCode||this.getURL(e,t).includes("channel")||(n.errorData.message="You have tried to perform a Global Here Now operation, your keyset configuration does not support that. Please provide a channel, or enable the Global Here Now feature from the Portal.")}}),de=Object.freeze({__proto__:null,getOperation:function(){return D.PNAddMessageActionOperation},validateParams:function(e,t){var n=e.config,r=t.action,o=t.channel;return t.messageTimetoken?n.subscribeKey?o?r?r.value?r.type?r.type.length>15?"Action.type value exceed maximum length of 15":void 0:"Missing Action.type":"Missing Action.value":"Missing Action":"Missing message channel":"Missing Subscribe Key":"Missing message timetoken"},usePost:function(){return!0},postURL:function(e,t){var n=e.config,r=t.channel,o=t.messageTimetoken;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(r),"/message/").concat(o)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},getRequestHeaders:function(){return{"Content-Type":"application/json"}},isAuthSupported:function(){return!0},prepareParams:function(){return{}},postPayload:function(e,t){return t.action},handleResponse:function(e,t){return{data:t.data}}}),ye=Object.freeze({__proto__:null,getOperation:function(){return D.PNRemoveMessageActionOperation}
1,validateParams:function(e,t){var n=e.config,r=t.channel,o=t.actionTimetoken;return t.messageTimetoken?o?n.subscribeKey?r?void 0:"Missing message channel":"Missing Subscribe Key":"Missing action timetoken":"Missing message timetoken"},useDelete:function(){return!0},getURL:function(e,t){var n=e.config,r=t.channel,o=t.actionTimetoken,i=t.messageTimetoken;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(r),"/message/").concat(i,"/action/").concat(o)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{data:t.data}}}),ge=Object.freeze({__proto__:null,getOperation:function(){return D.PNGetMessageActionsOperation},validateParams:function(e,t){var n=e.config,r=t.channel;return n.subscribeKey?r?void 0:"Missing message channel":"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.channel;return"/v1/message-actions/".concat(n.subscribeKey,"/channel/").concat(x.encodeString(r))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.limit,r=t.start,o=t.end,i={};return n&&(i.limit=n),r&&(i.start=r),o&&(i.end=o),i},handleResponse:function(e,t){var n={data:t.data,start:null,end:null};return n.data.length&&(n.end=n.data[n.data.length-1].actionTimetoken,n.start=n.data[0].actionTimetoken),n}}),me={getOperation:function(){return D.PNListFilesOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channel))return"channel can't be empty"},getURL:function(e,t){var n=e.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/files")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n={};return t.limit&&(n.limit=t.limit),t.next&&(n.next=t.next),n},handleResponse:function(e,t){return{status:t.status,data:t.data,next:t.next,count:t.count}}},ve={getOperation:function(){return D.PNGenerateUploadUrlOperation},validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.name)?void 0:"name can't be empty":"channel can't be empty"},usePost:function(){return!0},postURL:function(e,t){var n=e.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/generate-upload-url")},postPayload:function(e,t){return{name:t.name}},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{status:t.status,data:t.data,file_upload_request:t.file_upload_request}}},be={getOperation:function(){return D.PNPublishFileOperation},validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.fileId)?(null==t?void 0:t.fileName)?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},getURL:function(e,t){var n=e.config,r=n.publishKey,o=n.subscribeKey,i=function(e,t){var n=JSON.stringify(t);if(e.cryptoModule){var r=e.cryptoModule.encrypt(n);n="string"==typeof r?r:_(r),n=JSON.stringify(n)}return n||""}(e,{message:t.message,file:{name:t.fileName,id:t.fileId}});return"/v1/files/publish-file/".concat(r,"/").concat(o,"/0/").concat(x.encodeString(t.channel),"/0/").concat(x.encodeString(i))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n={};return t.ttl&&(n.ttl=t.ttl),void 0!==t.storeInHistory&&(n.store=t.storeInHistory?"1":"0"),t.meta&&"object"==typeof t.meta&&(n.meta=JSON.stringify(t.meta)),n},handleResponse:function(e,t){return{timetoken:t[2]}}},_e=function(e){var t=function(e){var t=this,n=e.generateUploadUrl,r=e.publishFile,o=e.modules,i=o.PubNubFile,u=o.config,c=o.cryptography,l=o.cryptoModule,p=o.networking;return function(e){var o=e.channel,h=e.file,f=e.message,d=e.cipherKey,y=e.meta,g=e.ttl,m=e.storeInHistory;return a(t,void 0,void 0,(function(){var e,t,a,v,b,_,S,w,O,P,E,T,A,k,C,N,M,j,R,x,U,I,D,F,G,L,K,B,H;return s(this,(function(s){switch(s.label){case 0:if(!o)throw new V("Validation failed, check status for details",W("channel can't be empty"));if(!h)throw new V("Validation failed, check status for details",W("file can't be empty"));return e=i.create(h),[4,n({channel:o,name:e.name})];case 1:return t=s.sent(),a=t.file_upload_request,v=a.url,b=a.form_fields,_=t.data,S=_.id,w=_.name,i.supportsEncryptFile&&(d||l)?null!=d?[3,3]:[4,l.encryptFile(e,i)]:[3,6];case 2:return O=s.sent(),[3,5];case 3:return[4,c.encryptFile(d,e,i)];case 4:O=s.sent(),s.label=5;case 5:e=O,s.label=6;case 6:P=b,e.mimeType&&(P=b.map((function(t){return"Content-Type"===t.key?{key:t.key,value:e.mimeType}:t}))),s.label=7;case 7:return s.trys.push([7,21,,22]),i.supportsFileUri&&h.uri?(A=(T=p).POSTFILE,k=[v,P],[4,e.toFileUri()]):[3,10];case 8:return[4,A.apply(T,k.concat([s.sent()]))];case 9:return E=s.sent(),[3,20];case 10:return i.supportsFile?(N=(C=p).POSTFILE,M=[v,P],[4,e.toFile()]):[3,13];case 11:return[4,N.apply(C,M.concat([s.sent()]))];case 12:return E=s.sent(),[3,20];case 13:return i.supportsBuffer?(R=(j=p).POSTFILE,x=[v,P],[4,e.toBuffer()]):[3,16];case 14:return[4,R.apply(j,x.concat([s.sent()]))];case 15:return E=s.sent(),[3,20];case 16:return i.supportsBlob?(I=(U=p).POSTFILE,D=[v,P],[4,e.toBlob()]):[3,19];case 17:return[4,I.apply(U,D.concat([s.sent()]))];case 18:return E=s.sent(),[3,20];case 19:throw new Error("Unsupported environment");case 20:return[3,22];case 21:throw(F=s.sent()).response&&"string"==typeof F.response.text?(G=F.response.text,L=/<Message>(.*)<\/Message>/gi.exec(G),new V(L?"Upload to bucket failed: ".concat(L[1]):"Upload to bucket failed.",F)):new V("Upload to bucket failed.",F);case 22:if(204!==E.status)throw new V("Upload to bucket was unsuccessful",E);K=u.fileUploadPublishRetryLimit,B=!1,H={timetoken:"0"},s.label=23;case 23:return s.trys.push([23,25,,26]),[4,r({channel:o,message:f,fileId:S,fileName:w,meta:y,storeIn
1History:m,ttl:g})];case 24:return H=s.sent(),B=!0,[3,26];case 25:return s.sent(),K-=1,[3,26];case 26:if(!B&&K>0)return[3,23];s.label=27;case 27:if(B)return[2,{timetoken:H.timetoken,id:S,name:w}];throw new V("Publish failed. You may want to execute that operation manually using pubnub.publishFile",{channel:o,id:S,name:w})}}))}))}}(e);return function(e,n){var r=t(e);return"function"==typeof n?(r.then((function(e){return n(null,e)})).catch((function(e){return n(e,null)})),r):r}},Se=function(e,t){var n=t.channel,r=t.id,o=t.name,i=e.config,a=e.networking,s=e.tokenManager;if(!n)throw new V("Validation failed, check status for details",W("channel can't be empty"));if(!r)throw new V("Validation failed, check status for details",W("file id can't be empty"));if(!o)throw new V("Validation failed, check status for details",W("file name can't be empty"));var u="/v1/files/".concat(i.subscribeKey,"/channels/").concat(x.encodeString(n),"/files/").concat(r,"/").concat(o),c={};c.uuid=i.getUUID(),c.pnsdk=$(i);var l=s.getToken()||i.getAuthKey();l&&(c.auth=l),i.secretKey&&X(e,u,c,{},{getOperation:function(){return"PubNubGetFileUrlOperation"}});var p=Object.keys(c).map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(c[e]))})).join("&");return""!==p?"".concat(a.getStandardOrigin()).concat(u,"?").concat(p):"".concat(a.getStandardOrigin()).concat(u)},we={getOperation:function(){return D.PNDownloadFileOperation},validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.name)?(null==t?void 0:t.id)?void 0:"id can't be empty":"name can't be empty":"channel can't be empty"},useGetFile:function(){return!0},getFileURL:function(e,t){var n=e.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/files/").concat(t.id,"/").concat(t.name)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},ignoreBody:function(){return!0},forceBuffered:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t,n){var r=e.PubNubFile,o=e.config,i=e.cryptography,u=e.cryptoModule;return a(void 0,void 0,void 0,(function(){var e,a,c,l;return s(this,(function(s){switch(s.label){case 0:return e=t.response.body,r.supportsEncryptFile&&(n.cipherKey||u)?null!=n.cipherKey?[3,2]:[4,u.decryptFile(r.create({data:e,name:n.name}),r)]:[3,5];case 1:return a=s.sent().data,[3,4];case 2:return[4,i.decrypt(null!==(c=n.cipherKey)&&void 0!==c?c:o.cipherKey,e)];case 3:a=s.sent(),s.label=4;case 4:e=a,s.label=5;case 5:return[2,r.create({data:e,name:null!==(l=t.response.name)&&void 0!==l?l:n.name,mimeType:t.response.type})]}}))}))}},Oe={getOperation:function(){return D.PNListFilesOperation},validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.id)?(null==t?void 0:t.name)?void 0:"file name can't be empty":"file id can't be empty":"channel can't be empty"},useDelete:function(){return!0},getURL:function(e,t){var n=e.config;return"/v1/files/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/files/").concat(t.id,"/").concat(t.name)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{status:t.status}}},Pe={getOperation:function(){return D.PNGetAllUUIDMetadataOperation},validateParams:function(){},getURL:function(e){var t=e.config;return"/v2/objects/".concat(t.subscribeKey,"/uuids")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h={include:["status","type"]};return(null==t?void 0:t.include)&&(null===(n=t.include)||void 0===n?void 0:n.customFields)&&h.include.push("custom"),h.include=h.include.join(","),(null===(r=null==t?void 0:t.include)||void 0===r?void 0:r.totalCount)&&(h.count=null===(o=t.include)||void 0===o?void 0:o.totalCount),(null===(i=null==t?void 0:t.page)||void 0===i?void 0:i.next)&&(h.start=null===(a=t.page)||void 0===a?void 0:a.next),(null===(s=null==t?void 0:t.page)||void 0===s?void 0:s.prev)&&(h.end=null===(u=t.page)||void 0===u?void 0:u.prev),(null==t?void 0:t.filter)&&(h.filter=t.filter),h.limit=null!==(l=null==t?void 0:t.limit)&&void 0!==l?l:100,(null==t?void 0:t.sort)&&(h.sort=Object.entries(null!==(p=t.sort)&&void 0!==p?p:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),h},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,next:t.next,prev:t.prev}}},Ee={getOperation:function(){return D.PNGetUUIDMetadataOperation}
1,validateParams:function(){},getURL:function(e,t){var n,r=e.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(x.encodeString(null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:r.getUUID()))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o=e.config,i={};return i.uuid=null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:o.getUUID(),i.include=["status","type","custom"],(null==t?void 0:t.include)&&!1===(null===(r=t.include)||void 0===r?void 0:r.customFields)&&i.include.pop(),i.include=i.include.join(","),i},handleResponse:function(e,t){return{status:t.status,data:t.data}}},Te={getOperation:function(){return D.PNSetUUIDMetadataOperation},validateParams:function(e,t){if(!(null==t?void 0:t.data))return"Data cannot be empty"},usePatch:function(){return!0},patchURL:function(e,t){var n,r=e.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(x.encodeString(null!==(n=t.uuid)&&void 0!==n?n:r.getUUID()))},patchPayload:function(e,t){return t.data},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o=e.config,i={};return i.uuid=null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:o.getUUID(),i.include=["status","type","custom"],(null==t?void 0:t.include)&&!1===(null===(r=t.include)||void 0===r?void 0:r.customFields)&&i.include.pop(),i.include=i.include.join(","),i},handleResponse:function(e,t){return{status:t.status,data:t.data}}},Ae={getOperation:function(){return D.PNRemoveUUIDMetadataOperation},validateParams:function(){},getURL:function(e,t){var n,r=e.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(x.encodeString(null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:r.getUUID()))},useDelete:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r=e.config;return{uuid:null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:r.getUUID()}},handleResponse:function(e,t){return{status:t.status,data:t.data}}},ke={getOperation:function(){return D.PNGetAllChannelMetadataOperation},validateParams:function(){},getURL:function(e){var t=e.config;return"/v2/objects/".concat(t.subscribeKey,"/channels")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h={include:["status","type"]};return(null==t?void 0:t.include)&&(null===(n=t.include)||void 0===n?void 0:n.customFields)&&h.include.push("custom"),h.include=h.include.join(","),(null===(r=null==t?void 0:t.include)||void 0===r?void 0:r.totalCount)&&(h.count=null===(o=t.include)||void 0===o?void 0:o.totalCount),(null===(i=null==t?void 0:t.page)||void 0===i?void 0:i.next)&&(h.start=null===(a=t.page)||void 0===a?void 0:a.next),(null===(s=null==t?void 0:t.page)||void 0===s?void 0:s.prev)&&(h.end=null===(u=t.page)||void 0===u?void 0:u.prev),(null==t?void 0:t.filter)&&(h.filter=t.filter),h.limit=null!==(l=null==t?void 0:t.limit)&&void 0!==l?l:100,(null==t?void 0:t.sort)&&(h.sort=Object.entries(null!==(p=t.sort)&&void 0!==p?p:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),h},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,prev:t.prev,next:t.next}}},Ce={getOperation:function(){return D.PNGetChannelMetadataOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channel))return"Channel cannot be empty"},getURL:function(e,t){var n=e.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r={include:["status","type","custom"]};return(null==t?void 0:t.include)&&!1===(null===(n=t.include)||void 0===n?void 0:n.customFields)&&r.include.pop(),r.include=r.include.join(","),r},handleResponse:function(e,t){return{status:t.status,data:t.data}}},Ne={getOperation:function(){return D.PNSetChannelMetadataOperation}
1,validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.data)?void 0:"Data cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(e,t){var n=e.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel))},patchPayload:function(e,t){return t.data},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r={include:["status","type","custom"]};return(null==t?void 0:t.include)&&!1===(null===(n=t.include)||void 0===n?void 0:n.customFields)&&r.include.pop(),r.include=r.include.join(","),r},handleResponse:function(e,t){return{status:t.status,data:t.data}}},Me={getOperation:function(){return D.PNRemoveChannelMetadataOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channel))return"Channel cannot be empty"},getURL:function(e,t){var n=e.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel))},useDelete:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{status:t.status,data:t.data}}},je={getOperation:function(){return D.PNGetMembersOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channel))return"channel cannot be empty"},getURL:function(e,t){var n=e.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/uuids")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h,f,d,y,g,m={include:[]};return(null==t?void 0:t.include)&&((null===(n=t.include)||void 0===n?void 0:n.statusField)&&m.include.push("status"),(null===(r=t.include)||void 0===r?void 0:r.customFields)&&m.include.push("custom"),(null===(o=t.include)||void 0===o?void 0:o.UUIDFields)&&m.include.push("uuid"),(null===(i=t.include)||void 0===i?void 0:i.customUUIDFields)&&m.include.push("uuid.custom"),(null===(a=t.include)||void 0===a?void 0:a.UUIDStatusField)&&m.include.push("uuid.status"),(null===(s=t.include)||void 0===s?void 0:s.UUIDTypeField)&&m.include.push("uuid.type")),m.include=m.include.join(","),(null===(u=null==t?void 0:t.include)||void 0===u?void 0:u.totalCount)&&(m.count=null===(l=t.include)||void 0===l?void 0:l.totalCount),(null===(p=null==t?void 0:t.page)||void 0===p?void 0:p.next)&&(m.start=null===(h=t.page)||void 0===h?void 0:h.next),(null===(f=null==t?void 0:t.page)||void 0===f?void 0:f.prev)&&(m.end=null===(d=t.page)||void 0===d?void 0:d.prev),(null==t?void 0:t.filter)&&(m.filter=t.filter),m.limit=null!==(y=null==t?void 0:t.limit)&&void 0!==y?y:100,(null==t?void 0:t.sort)&&(m.sort=Object.entries(null!==(g=t.sort)&&void 0!==g?g:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),m},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,prev:t.prev,next:t.next}}},Re={getOperation:function(){return D.PNSetMembersOperation},validateParams:function(e,t){return(null==t?void 0:t.channel)?(null==t?void 0:t.uuids)&&0!==(null==t?void 0:t.uuids.length)?void 0:"UUIDs cannot be empty":"Channel cannot be empty"},usePatch:function(){return!0},patchURL:function(e,t){var n=e.config;return"/v2/objects/".concat(n.subscribeKey,"/channels/").concat(x.encodeString(t.channel),"/uuids")},patchPayload:function(e,t){var n;return(n={set:[],delete:[]})[t.type]=t.uuids.map((function(e){return"string"==typeof e?{uuid:{id:e}}:{uuid:{id:e.id},custom:e.custom,status:e.status}})),n},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h={include:["uuid.status","uuid.type","type"]};return(null==t?void 0:t.include)&&((null===(n=t.include)||void 0===n?void 0:n.customFields)&&h.include.push("custom"),(null===(r=t.include)||void 0===r?void 0:r.customUUIDFields)&&h.include.push("uuid.custom"),(null===(o=t.include)||void 0===o?void 0:o.UUIDFields)&&h.include.push("uuid")),h.include=h.include.join(","),(null===(i=null==t?void 0:t.include)||void 0===i?void 0:i.totalCount)&&(h.count=!0),(null===(a=null==t?void 0:t.page)||void 0===a?void 0:a.next)&&(h.start=null===(s=t.page)||void 0===s?void 0:s.next),(null===(u=null==t?void 0:t.page)||void 0===u?void 0:u.prev)&&(h.end=null===(l=t.page)||void 0===l?void 0:l.prev),(null==t?void 0:t.filter)&&(h.filter=t.filter),null!=t.limit&&(h.limit=t.limit),(null==t?void 0:t.sort)&&(h.sort=Object.entries(null!==(p=t.sort)&&void 0!==p?p:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),h},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,prev:t.prev,next:t.next}}},xe={getOperation:function(){return D.PNGetMembershipsOperation}
1,validateParams:function(){},getURL:function(e,t){var n,r=e.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(x.encodeString(null!==(n=null==t?void 0:t.uuid)&&void 0!==n?n:r.getUUID()),"/channels")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h,f,d,y,g,m={include:[]};return(null==t?void 0:t.include)&&((null===(n=t.include)||void 0===n?void 0:n.statusField)&&m.include.push("status"),(null===(r=t.include)||void 0===r?void 0:r.customFields)&&m.include.push("custom"),(null===(o=t.include)||void 0===o?void 0:o.channelFields)&&m.include.push("channel"),(null===(i=t.include)||void 0===i?void 0:i.customChannelFields)&&m.include.push("channel.custom"),(null===(a=t.include)||void 0===a?void 0:a.channelStatusField)&&m.include.push("channel.status"),(null===(s=t.include)||void 0===s?void 0:s.channelTypeField)&&m.include.push("channel.type")),m.include=m.include.join(","),(null===(u=null==t?void 0:t.include)||void 0===u?void 0:u.totalCount)&&(m.count=null===(l=t.include)||void 0===l?void 0:l.totalCount),(null===(p=null==t?void 0:t.page)||void 0===p?void 0:p.next)&&(m.start=null===(h=t.page)||void 0===h?void 0:h.next),(null===(f=null==t?void 0:t.page)||void 0===f?void 0:f.prev)&&(m.end=null===(d=t.page)||void 0===d?void 0:d.prev),(null==t?void 0:t.filter)&&(m.filter=t.filter),m.limit=null!==(y=null==t?void 0:t.limit)&&void 0!==y?y:100,(null==t?void 0:t.sort)&&(m.sort=Object.entries(null!==(g=t.sort)&&void 0!==g?g:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),m},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,prev:t.prev,next:t.next}}},Ue={getOperation:function(){return D.PNSetMembershipsOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channels)||0===(null==t?void 0:t.channels.length))return"Channels cannot be empty"},usePatch:function(){return!0},patchURL:function(e,t){var n,r=e.config;return"/v2/objects/".concat(r.subscribeKey,"/uuids/").concat(x.encodeString(null!==(n=t.uuid)&&void 0!==n?n:r.getUUID()),"/channels")},patchPayload:function(e,t){var n;return(n={set:[],delete:[]})[t.type]=t.channels.map((function(e){return"string"==typeof e?{channel:{id:e}}:{channel:{id:e.id},custom:e.custom,status:e.status}})),n},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n,r,o,i,a,s,u,l,p,h={include:["channel.status","channel.type","status"]};return(null==t?void 0:t.include)&&((null===(n=t.include)||void 0===n?void 0:n.customFields)&&h.include.push("custom"),(null===(r=t.include)||void 0===r?void 0:r.customChannelFields)&&h.include.push("channel.custom"),(null===(o=t.include)||void 0===o?void 0:o.channelFields)&&h.include.push("channel")),h.include=h.include.join(","),(null===(i=null==t?void 0:t.include)||void 0===i?void 0:i.totalCount)&&(h.count=!0),(null===(a=null==t?void 0:t.page)||void 0===a?void 0:a.next)&&(h.start=null===(s=t.page)||void 0===s?void 0:s.next),(null===(u=null==t?void 0:t.page)||void 0===u?void 0:u.prev)&&(h.end=null===(l=t.page)||void 0===l?void 0:l.prev),(null==t?void 0:t.filter)&&(h.filter=t.filter),null!=t.limit&&(h.limit=t.limit),(null==t?void 0:t.sort)&&(h.sort=Object.entries(null!==(p=t.sort)&&void 0!==p?p:{}).map((function(e){var t=c(e,2),n=t[0],r=t[1];return"asc"===r||"desc"===r?"".concat(n,":").concat(r):n}))),h},handleResponse:function(e,t){return{status:t.status,data:t.data,totalCount:t.totalCount,prev:t.prev,next:t.next}}},Ie=Object.freeze({__proto__:null,getOperation:function(){return D.PNAccessManagerAudit},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e){var t=e.config;return"/v2/auth/audit/sub-key/".concat(t.subscribeKey)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(e,t){var n=t.channel,r=t.channelGroup,o=t.authKeys,i=void 0===o?[]:o,a={};return n&&(a.channel=n),r&&(a["channel-group"]=r),i.length>0&&(a.auth=i.join(",")),a},handleResponse:function(e,t){return t.payload}}),De=Object.freeze({__proto__:null,getOperation:function(){return D.PNAccessManagerGrant},validateParams:function(e,t){var n=e.config;return n.subscribeKey?n.publishKey?n.secretKey?null==t.uuids||t.authKeys?null==t.uuids||null==t.channels&&null==t.channelGroups?void 0:"Both channel/channelgroup and uuid cannot be used in the same request":"authKeys are required for grant request on uuids":"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"},getURL:function(e){var t=e.config;return"/v2/auth/grant/sub-key/".concat(t.subscribeKey)},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(e,t){var n=t.channels,r=void 0===n?[]:n,o=t.channelGroups,i=void 0===o?[]:o,a=t.uuids,s=void 0===a?[]:a,u=t.ttl,c=t.read,l=void 0!==c&&c,p=t.write,h=void 0!==p&&p,f=t.manage,d=void 0!==f&&f,y=t.get,g=void 0!==y&&y,m=t.join,v=void 0!==m&&m,b=t.update,_=void 0!==b&&b,S=t.authKeys,w=void 0===S?[]:S,O=t.delete,P={};return P.r=l?"1":"0",P.w=h?"1":"0",P.m=d?"1":"0",P.d=O?"1":"0",P.g=g?"1":"0",P.j=v?"1":"0",P.u=_?"1":"0",r.length>0&&(P.channel=r.join(",")),i.length>0&&(P["channel-group"]=i.join(",")),w.length>0&&(P.auth=w.join(",")),s.length>0&&(P["target-uuid"]=s.join(",")),(u||0===u)&&(P.ttl=u),P},handleResponse:function(){return{}}});function Fe(e){var t,n,r,o,i=void 0!==(null==e?void 0:e.authorizedUserId),a=void 0!==(null===(t=null==e?void 0:e.resources)||void 0===t?void 0:t.users),s=void 0!==(null===(n=null==e?void 0:e.resources)||void 0===n?void 0:n.spaces),u=void 0!==(null===(r=null==e?void 0:e.patterns)||void 0===r?void 0:r.users),c=void 0!==(null===(o=null==e?void 0:e.patterns)||void 0===o?void 0:o.spaces);return u||a||c||s||i}function Ge(e){var t=0;return e.join&&(t|=128),e.update&&(t|=64),e.get&&(t|=32),e.delete&&(t|=8),e.manage&&(t|=4),e.write&&(t|=2),e.read&&(t|=1),t}function Le(e,t){if(Fe(t))return function(e,t){var n=t.ttl,r=t.resources,o=t.patterns,i=t.meta,a=t.authorizedUserId,s={ttl:0,permissions:{resources:{channels:{},groups:{},uuids:{},users:{},spaces:{}},patterns:{channels:{},groups:{},uuids:{},users:{},spaces:{}},meta:{}}};if(r){var u=r.users,c=r.spaces,l=r.groups;u&&Object.keys(u).forEach((function(e){s.permissions.resources.uuids[e]=Ge(u[e])}
1)),c&&Object.keys(c).forEach((function(e){s.permissions.resources.channels[e]=Ge(c[e])})),l&&Object.keys(l).forEach((function(e){s.permissions.resources.groups[e]=Ge(l[e])}))}if(o){var p=o.users,h=o.spaces,f=o.groups;p&&Object.keys(p).forEach((function(e){s.permissions.patterns.uuids[e]=Ge(p[e])})),h&&Object.keys(h).forEach((function(e){s.permissions.patterns.channels[e]=Ge(h[e])})),f&&Object.keys(f).forEach((function(e){s.permissions.patterns.groups[e]=Ge(f[e])}))}return(n||0===n)&&(s.ttl=n),i&&(s.permissions.meta=i),a&&(s.permissions.uuid="".concat(a)),s}(0,t);var n=t.ttl,r=t.resources,o=t.patterns,i=t.meta,a=t.authorized_uuid,s={ttl:0,permissions:{resources:{channels:{},groups:{},uuids:{},users:{},spaces:{}},patterns:{channels:{},groups:{},uuids:{},users:{},spaces:{}},meta:{}}};if(r){var u=r.uuids,c=r.channels,l=r.groups;u&&Object.keys(u).forEach((function(e){s.permissions.resources.uuids[e]=Ge(u[e])})),c&&Object.keys(c).forEach((function(e){s.permissions.resources.channels[e]=Ge(c[e])})),l&&Object.keys(l).forEach((function(e){s.permissions.resources.groups[e]=Ge(l[e])}))}if(o){var p=o.uuids,h=o.channels,f=o.groups;p&&Object.keys(p).forEach((function(e){s.permissions.patterns.uuids[e]=Ge(p[e])})),h&&Object.keys(h).forEach((function(e){s.permissions.patterns.channels[e]=Ge(h[e])})),f&&Object.keys(f).forEach((function(e){s.permissions.patterns.groups[e]=Ge(f[e])}))}return(n||0===n)&&(s.ttl=n),i&&(s.permissions.meta=i),a&&(s.permissions.uuid="".concat(a)),s}var Ke=Object.freeze({__proto__:null,getOperation:function(){return D.PNAccessManagerGrantToken},extractPermissions:Ge,validateParams:function(e,t){var n,r,o,i,a,s,u=e.config;if(!u.subscribeKey)return"Missing Subscribe Key";if(!u.publishKey)return"Missing Publish Key";if(!u.secretKey)return"Missing Secret Key";if(!t.resources&&!t.patterns)return"Missing either Resources or Patterns.";var c=void 0!==(null==t?void 0:t.authorized_uuid),l=void 0!==(null===(n=null==t?void 0:t.resources)||void 0===n?void 0:n.uuids),p=void 0!==(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.channels),h=void 0!==(null===(o=null==t?void 0:t.resources)||void 0===o?void 0:o.groups),f=void 0!==(null===(i=null==t?void 0:t.patterns)||void 0===i?void 0:i.uuids),d=void 0!==(null===(a=null==t?void 0:t.patterns)||void 0===a?void 0:a.channels),y=void 0!==(null===(s=null==t?void 0:t.patterns)||void 0===s?void 0:s.groups),g=c||l||f||p||d||h||y;return Fe(t)&&g?"Cannot mix `users`, `spaces` and `authorizedUserId` with `uuids`, `channels`, `groups` and `authorized_uuid`":(!t.resources||t.resources.uuids&&0!==Object.keys(t.resources.uuids).length||t.resources.channels&&0!==Object.keys(t.resources.channels).length||t.resources.groups&&0!==Object.keys(t.resources.groups).length||t.resources.users&&0!==Object.keys(t.resources.users).length||t.resources.spaces&&0!==Object.keys(t.resources.spaces).length)&&(!t.patterns||t.patterns.uuids&&0!==Object.keys(t.patterns.uuids).length||t.patterns.channels&&0!==Object.keys(t.patterns.channels).length||t.patterns.groups&&0!==Object.keys(t.patterns.groups).length||t.patterns.users&&0!==Object.keys(t.patterns.users).length||t.patterns.spaces&&0!==Object.keys(t.patterns.spaces).length)?void 0:"Missing values for either Resources or Patterns."},postURL:function(e){var t=e.config;return"/v3/pam/".concat(t.subscribeKey,"/grant")},usePost:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(){return{}},postPayload:function(e,t){return Le(0,t)},handleResponse:function(e,t){return t.data.token}}),Be={getOperation:function(){return D.PNAccessManagerRevokeToken},validateParams:function(e,t){return e.config.secretKey?t?void 0:"token can't be empty":"Missing Secret Key"},getURL:function(e,t){var n=e.config;return"/v3/pam/".concat(n.subscribeKey,"/grant/").concat(x.encodeString(t))},useDelete:function(){return!0},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!1},prepareParams:function(e){return{uuid:e.config.getUUID()}},handleResponse:function(e,t){return{status:t.status,data:t.data}}};function He(e,t){var n=JSON.stringify(t);if(e.cryptoModule){var r=e.cryptoModule.encrypt(n);n="string"==typeof r?r:_(r),n=JSON.stringify(n)}return n||""}var qe=Object.freeze({__proto__:null,getOperation:function(){return D.PNPublishOperation}
1,validateParams:function(e,t){var n=e.config,r=t.message;return t.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},usePost:function(e,t){var n=t.sendByPost;return void 0!==n&&n},getURL:function(e,t){var n=e.config,r=t.channel,o=He(e,t.message);return"/publish/".concat(n.publishKey,"/").concat(n.subscribeKey,"/0/").concat(x.encodeString(r),"/0/").concat(x.encodeString(o))},postURL:function(e,t){var n=e.config,r=t.channel;return"/publish/".concat(n.publishKey,"/").concat(n.subscribeKey,"/0/").concat(x.encodeString(r),"/0")},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},postPayload:function(e,t){return He(e,t.message)},prepareParams:function(e,t){var n=t.meta,r=t.replicate,o=void 0===r||r,i=t.storeInHistory,a=t.ttl,s={};return null!=i&&(s.store=i?"1":"0"),a&&(s.ttl=a),!1===o&&(s.norep="true"),n&&"object"==typeof n&&(s.meta=JSON.stringify(n)),s},handleResponse:function(e,t){return{timetoken:t[2]}}}),ze=Object.freeze({__proto__:null,getOperation:function(){return D.PNSignalOperation},validateParams:function(e,t){var n=e.config,r=t.message;return t.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"},getURL:function(e,t){var n,r=e.config,o=t.channel,i=(n=t.message,JSON.stringify(n));return"/signal/".concat(r.publishKey,"/").concat(r.subscribeKey,"/0/").concat(x.encodeString(o),"/0/").concat(x.encodeString(i))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(){return{}},handleResponse:function(e,t){return{timetoken:t[2]}}}),Ve=Object.freeze({__proto__:null,getOperation:function(){return D.PNHistoryOperation},validateParams:function(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(e,t){var n=t.channel,r=e.config;return"/v2/history/sub-key/".concat(r.subscribeKey,"/channel/").concat(x.encodeString(n))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.start,r=t.end,o=t.reverse,i=t.count,a=void 0===i?100:i,s=t.stringifiedTimeToken,u=void 0!==s&&s,c=t.includeMeta,l=void 0!==c&&c,p={include_token:"true"};return p.count=a,n&&(p.start=n),r&&(p.end=r),u&&(p.string_message_token="true"),null!=o&&(p.reverse=o.toString()),l&&(p.include_meta="true"),p},handleResponse:function(e,t){var n={messages:[],startTimeToken:t[1],endTimeToken:t[2]};return Array.isArray(t[0])&&t[0].forEach((function(t){var r=function(e,t){var n={};if(!e.cryptoModule)return n.payload=t,n;try{var r=e.cryptoModule.decrypt(t),o=r instanceof ArrayBuffer?JSON.parse((new TextDecoder).decode(r)):r;return n.payload=o,n}catch(r){e.config.logVerbosity&&console&&console.log&&console.log("decryption error",r.message),n.payload=t,n.error="Error while decrypting message content: ".concat(r.message)}return n}(e,t.message),o={timetoken:t.timetoken,entry:r.payload};t.meta&&(o.meta=t.meta),r.error&&(o.error=r.error),n.messages.push(o)})),n}}),We=Object.freeze({__proto__:null,getOperation:function(){return D.PNDeleteMessagesOperation},validateParams:function(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},useDelete:function(){return!0},getURL:function(e,t){var n=t.channel,r=e.config;return"/v3/history/sub-key/".concat(r.subscribeKey,"/channel/").concat(x.encodeString(n))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.start,r=t.end,o={};return n&&(o.start=n),r&&(o.end=r),o},handleResponse:function(e,t){return t.payload}}),Je=Object.freeze({__proto__:null,getOperation:function(){return D.PNMessageCounts},validateParams:function(e,t){var n=t.channels,r=t.timetoken,o=t.channelTimetokens,i=e.config;return n?r&&o?"timetoken and channelTimetokens are incompatible together":o&&o.length>1&&n.length!==o.length?"Length of channelTimetokens and channels do not match":i.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"},getURL:function(e,t){var n=t.channels,r=e.config,o=n.join(",");return"/v3/history/sub-key/".concat(r.subscribeKey,"/message-counts/").concat(x.encodeString(o))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.timetoken,r=t.channelTimetokens,o={};if(r&&1===r.length){var i=c(r,1)[0];o.timetoken=i}else r?o.channelsTimetoken=r.join(","):n&&(o.timetoken=n);return o},handleResponse:function(e,t){return{channels:t.channels}}}),$e=Object.freeze({__proto__:null,getOperation:function(){return D.PNFetchMessagesOperation}
1,validateParams:function(e,t){var n=t.channels,r=t.includeMessageActions,o=void 0!==r&&r,i=e.config;if(!n||0===n.length)return"Missing channels";if(!i.subscribeKey)return"Missing Subscribe Key";if(o&&n.length>1)throw new TypeError("History can return actions data for a single channel only. Either pass a single channel or disable the includeMessageActions flag.")},getURL:function(e,t){var n=t.channels,r=void 0===n?[]:n,o=t.includeMessageActions,i=void 0!==o&&o,a=e.config,s=i?"history-with-actions":"history",u=r.length>0?r.join(","):",";return"/v3/".concat(s,"/sub-key/").concat(a.subscribeKey,"/channel/").concat(x.encodeString(u))},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=t.channels,r=t.start,o=t.end,i=t.includeMessageActions,a=t.count,s=t.stringifiedTimeToken,u=void 0!==s&&s,c=t.includeMeta,l=void 0!==c&&c,p=t.includeUuid,h=t.includeUUID,f=void 0===h||h,d=t.includeMessageType,y=void 0===d||d,g={};return g.max=a||(n.length>1||!0===i?25:100),r&&(g.start=r),o&&(g.end=o),u&&(g.string_message_token="true"),l&&(g.include_meta="true"),f&&!1!==p&&(g.include_uuid="true"),y&&(g.include_message_type="true"),g},handleResponse:function(e,t){var n={channels:{}};return Object.keys(t.channels||{}).forEach((function(r){n.channels[r]=[],(t.channels[r]||[]).forEach((function(t){var o={},i=function(e,t){var n={};if(!e.cryptoModule)return n.payload=t,n;try{var r=e.cryptoModule.decrypt(t),o=r instanceof ArrayBuffer?JSON.parse((new TextDecoder).decode(r)):r;return n.payload=o,n}catch(r){e.config.logVerbosity&&console&&console.log&&console.log("decryption error",r.message),n.payload=t,n.error="Error while decrypting message content: ".concat(r.message)}return n}(e,t.message);o.channel=r,o.timetoken=t.timetoken,o.message=i.payload,o.messageType=t.message_type,o.uuid=t.uuid,t.actions&&(o.actions=t.actions,o.data=t.actions),t.meta&&(o.meta=t.meta),i.error&&(o.error=i.error),n.channels[r].push(o)}))})),t.more&&(n.more=t.more),n}}),Qe=Object.freeze({__proto__:null,getOperation:function(){return D.PNTimeOperation},getURL:function(){return"/time/0"},getRequestTimeout:function(e){return e.config.getTransactionTimeout()},prepareParams:function(){return{}},isAuthSupported:function(){return!1},handleResponse:function(e,t){return{timetoken:t[0]}},validateParams:function(){}}),Xe=Object.freeze({__proto__:null,getOperation:function(){return D.PNSubscribeOperation},validateParams:function(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"},getURL:function(e,t){var n=e.config,r=t.channels,o=void 0===r?[]:r,i=o.length>0?o.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(x.encodeString(i),"/0")},getRequestTimeout:function(e){return e.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n=e.config,r=t.state,o=t.channelGroups,i=void 0===o?[]:o,a=t.timetoken,s=t.filterExpression,u=t.region,c={heartbeat:n.getPresenceTimeout()};return i.length>0&&(c["channel-group"]=i.join(",")),s&&s.length>0&&(c["filter-expr"]=s),Object.keys(r).length&&(c.state=JSON.stringify(r)),a&&(c.tt=a),u&&(c.tr=u),c},handleResponse:function(e,t){var n=[];t.m.forEach((function(e){var t={publishTimetoken:e.p.t,region:e.p.r},r={shard:parseInt(e.a,10),subscriptionMatch:e.b,channel:e.c,messageType:e.e,payload:e.d,flags:e.f,issuingClientId:e.i,subscribeKey:e.k,originationTimetoken:e.o,userMetadata:e.u,publishMetaData:t};n.push(r)}));var r={timetoken:t.t.t,region:t.t.r};return{messages:n,metadata:r}}}),Ye={getOperation:function(){return D.PNHandshakeOperation},validateParams:function(e,t){if(!(null==t?void 0:t.channels)&&!(null==t?void 0:t.channelGroups))return"channels and channleGroups both should not be empty"},getURL:function(e,t){var n=e.config,r=t.channels?t.channels.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(x.encodeString(r),"/0")},getRequestTimeout:function(e){return e.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},prepareParams:function(e,t){var n={};return t.channelGroups&&t.channelGroups.length>0&&(n["channel-group"]=t.channelGroups.join(",")),n.tt=0,t.state&&(n.state=JSON.stringify(t.state)),t.filterExpression&&t.filterExpression.length>0&&(n["filter-expr"]=t.filterExpression),n.ee="",n},handleResponse:function(e,t){return{region:t.t.r,timetoken:t.t.t}}},Ze={getOperation:function(){return D.PNReceiveMessagesOperation}
1,validateParams:function(e,t){return(null==t?void 0:t.channels)||(null==t?void 0:t.channelGroups)?(null==t?void 0:t.timetoken)?(null==t?void 0:t.region)?void 0:"region can not be empty":"timetoken can not be empty":"channels and channleGroups both should not be empty"},getURL:function(e,t){var n=e.config,r=t.channels?t.channels.join(","):",";return"/v2/subscribe/".concat(n.subscribeKey,"/").concat(x.encodeString(r),"/0")},getRequestTimeout:function(e){return e.config.getSubscribeTimeout()},isAuthSupported:function(){return!0},getAbortSignal:function(e,t){return t.abortSignal},prepareParams:function(e,t){var n={};return t.channelGroups&&t.channelGroups.length>0&&(n["channel-group"]=t.channelGroups.join(",")),t.filterExpression&&t.filterExpression.length>0&&(n["filter-expr"]=t.filterExpression),n.tt=t.timetoken,n.tr=t.region,n.ee="",n},handleResponse:function(e,t){var n=[];return t.m.forEach((function(e){var t={shard:parseInt(e.a,10),subscriptionMatch:e.b,channel:e.c,messageType:e.e,payload:e.d,flags:e.f,issuingClientId:e.i,subscribeKey:e.k,originationTimetoken:e.o,publishMetaData:{timetoken:e.p.t,region:e.p.r}};n.push(t)})),{messages:n,metadata:{region:t.t.r,timetoken:t.t.t}}}},et=function(){function e(e){void 0===e&&(e=!1),this.sync=e,this.listeners=new Set}return e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){t.listeners.delete(e)}},e.prototype.notify=function(e){var t=this,n=function(){t.listeners.forEach((function(t){t(e)}))};this.sync?n():setTimeout(n,0)},e}(),tt=function(){function e(e){this.label=e,this.transitionMap=new Map,this.enterEffects=[],this.exitEffects=[]}return e.prototype.transition=function(e,t){var n;if(this.transitionMap.has(t.type))return null===(n=this.transitionMap.get(t.type))||void 0===n?void 0:n(e,t)},e.prototype.on=function(e,t){return this.transitionMap.set(e,t),this},e.prototype.with=function(e,t){return[this,e,null!=t?t:[]]},e.prototype.onEnter=function(e){return this.enterEffects.push(e),this},e.prototype.onExit=function(e){return this.exitEffects.push(e),this},e}(),nt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.describe=function(e){return new tt(e)},n.prototype.start=function(e,t){this.currentState=e,this.currentContext=t,this.notify({type:"engineStarted",state:e,context:t})},n.prototype.transition=function(e){var t,n,r,o,i,a;if(!this.currentState)throw new Error("Start the engine first");this.notify({type:"eventReceived",event:e});var s=this.currentState.transition(this.currentContext,e);if(s){var l=c(s,3),p=l[0],h=l[1],f=l[2];try{for(var d=u(this.currentState.exitEffects),y=d.next();!y.done;y=d.next()){var g=y.value;this.notify({type:"invocationDispatched",invocation:g(this.currentContext)})}}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}var m=this.currentState;this.currentState=p;var v=this.currentContext;this.currentContext=h,this.notify({type:"transitionDone",fromState:m,fromContext:v,toState:p,toContext:h,event:e});try{for(var b=u(f),_=b.next();!_.done;_=b.next())g=_.value,this.notify({type:"invocationDispatched",invocation:g})}catch(e){r={error:e}}finally{try{_&&!_.done&&(o=b.return)&&o.call(b)}finally{if(r)throw r.error}}try{for(var S=u(this.currentState.enterEffects),w=S.next();!w.done;w=S.next())g=w.value,this.notify({type:"invocationDispatched",invocation:g(this.currentContext)})}catch(e){i={error:e}}finally{try{w&&!w.done&&(a=S.return)&&a.call(S)}finally{if(i)throw i.error}}}},n}(et),rt=function(){function e(e){this.dependencies=e,this.instances=new Map,this.handlers=new Map}return e.prototype.on=function(e,t){this.handlers.set(e,t)},e.prototype.dispatch=function(e){if("CANCEL"!==e.type){var t=this.handlers.get(e.type);if(!t)throw new Error("Unhandled invocation '".concat(e.type,"'"));var n=t(e.payload,this.dependencies);e.managed&&this.instances.set(e.type,n),n.start()}else if(this.instances.has(e.payload)){var r=this.instances.get(e.payload);null==r||r.cancel(),this.instances.delete(e.payload)}},e.prototype.dispose=function(){var e,t;
1try{for(var n=u(this.instances.entries()),r=n.next();!r.done;r=n.next()){var o=c(r.value,2),i=o[0];o[1].cancel(),this.instances.delete(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e}();function ot(e,t){var n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{type:e,payload:null==t?void 0:t.apply(void 0,l([],c(n),!1))}};return n.type=e,n}function it(e,t){var n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{type:e,payload:t.apply(void 0,l([],c(n),!1)),managed:!1}};return n.type=e,n}function at(e,t){var n=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return{type:e,payload:t.apply(void 0,l([],c(n),!1)),managed:!0}};return n.type=e,n.cancel={type:"CANCEL",payload:e,managed:!1},n}var st=function(e){function n(){var t=this.constructor,n=e.call(this,"The operation was aborted.")||this;return n.name="AbortError",Object.setPrototypeOf(n,t.prototype),n}return t(n,e),n}(Error),ut=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t._aborted=!1,t}return t(n,e),Object.defineProperty(n.prototype,"aborted",{get:function(){return this._aborted},enumerable:!1,configurable:!0}),n.prototype.throwIfAborted=function(){if(this._aborted)throw new st},n.prototype.abort=function(){this._aborted=!0,this.notify(new st)},n}(et),ct=function(e){function n(t,n,r){var o=e.call(this,t,n)||this;return o.asyncFunction=r,o.abortSignal=new ut,o}return t(n,e),n.prototype.start=function(){this.asyncFunction(this.payload,this.abortSignal,this.dependencies).catch((function(e){}))},n.prototype.cancel=function(){this.abortSignal.abort()},n}((function(e,t){this.payload=e,this.dependencies=t})),lt=function(e){return function(t,n){return new ct(t,n,e)}},pt=at("HANDSHAKE",(function(e,t){return{channels:e,groups:t}})),ht=at("RECEIVE_MESSAGES",(function(e,t,n){return{channels:e,groups:t,cursor:n}})),ft=it("EMIT_MESSAGES",(function(e){return e})),dt=it("EMIT_STATUS",(function(e){return e})),yt=at("RECEIVE_RECONNECT",(function(e){return e})),gt=at("HANDSHAKE_RECONNECT",(function(e){return e})),mt=ot("SUBSCRIPTION_CHANGED",(function(e,t){return{channels:e,groups:t}})),vt=ot("SUBSCRIPTION_RESTORED",(function(e,t,n,r){return{channels:e,groups:t,cursor:{timetoken:n,region:null!=r?r:0}}})),bt=ot("HANDSHAKE_SUCCESS",(function(e){return e})),_t=ot("HANDSHAKE_FAILURE",(function(e){return e})),St=ot("HANDSHAKE_RECONNECT_SUCCESS",(function(e){return{cursor:e}})),wt=ot("HANDSHAKE_RECONNECT_FAILURE",(function(e){return e})),Ot=ot("HANDSHAKE_RECONNECT_GIVEUP",(function(e){return e})),Pt=ot("RECEIVE_SUCCESS",(function(e,t){return{cursor:e,events:t}})),Et=ot("RECEIVE_FAILURE",(function(e){return e})),Tt=ot("RECEIVE_RECONNECT_SUCCESS",(function(e,t){return{cursor:e,events:t}})),At=ot("RECEIVE_RECONNECT_FAILURE",(function(e){return e})),kt=ot("RECEIVING_RECONNECT_GIVEUP",(function(e){return e})),Ct=ot("DISCONNECT",(function(){return{}})),Nt=ot("RECONNECT",(function(e,t){return{cursor:{timetoken:null!=e?e:"",region:null!=t?t:0}}})),Mt=ot("UNSUBSCRIBE_ALL",(function(){return{}})),jt=function(e){function n(t,n){var r=e.call(this,n)||this;return r.on(pt.type,lt((function(e,n,i){var u=i.handshake,c=i.presenceState,l=i.config;return a(r,void 0,void 0,(function(){var r,i;return s(this,(function(a){switch(a.label){case 0:n.throwIfAborted(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,u(o({abortSignal:n,channels:e.channels,channelGroups:e.groups,filterExpression:l.filterExpression},l.maintainPresenceState&&{state:c}))];case 2:return r=a.sent(),[2,t.transition(bt(r))];case 3:return(i=a.sent())instanceof Error&&"Aborted"===i.message?[2]:i instanceof V?[2,t.transition(_t(i))]:[3,4];case 4:return[2]}}
1))}))}))),r.on(ht.type,lt((function(e,n,o){var i=o.receiveMessages,u=o.config;return a(r,void 0,void 0,(function(){var r,o;return s(this,(function(a){switch(a.label){case 0:n.throwIfAborted(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i({abortSignal:n,channels:e.channels,channelGroups:e.groups,timetoken:e.cursor.timetoken,region:e.cursor.region,filterExpression:u.filterExpression})];case 2:return r=a.sent(),t.transition(Pt(r.metadata,r.messages)),[3,4];case 3:return(o=a.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof V&&!n.aborted?[2,t.transition(Et(o))]:[3,4];case 4:return[2]}}))}))}))),r.on(ft.type,lt((function(e,t,n){var o=n.emitMessages;return a(r,void 0,void 0,(function(){return s(this,(function(t){return e.length>0&&o(e),[2]}))}))}))),r.on(dt.type,lt((function(e,t,n){var o=n.emitStatus;return a(r,void 0,void 0,(function(){return s(this,(function(t){return o(e),[2]}))}))}))),r.on(yt.type,lt((function(e,n,o){var i=o.receiveMessages,u=o.delay,c=o.config;return a(r,void 0,void 0,(function(){var r,o;return s(this,(function(a){switch(a.label){case 0:return c.retryConfiguration&&c.retryConfiguration.shouldRetry(e.reason,e.attempts)?(n.throwIfAborted(),[4,u(c.retryConfiguration.getDelay(e.attempts,e.reason))]):[3,6];case 1:a.sent(),n.throwIfAborted(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,i({abortSignal:n,channels:e.channels,channelGroups:e.groups,timetoken:e.cursor.timetoken,region:e.cursor.region,filterExpression:c.filterExpression})];case 3:return r=a.sent(),[2,t.transition(Tt(r.metadata,r.messages))];case 4:return(o=a.sent())instanceof Error&&"Aborted"===o.message?[2]:o instanceof V?[2,t.transition(At(o))]:[3,5];case 5:return[3,7];case 6:return[2,t.transition(kt(new V(c.retryConfiguration.getGiveupReason(e.reason,e.attempts))))];case 7:return[2]}}
1))}))}))),r.on(gt.type,lt((function(e,n,i){var u=i.handshake,c=i.delay,l=i.presenceState,p=i.config;return a(r,void 0,void 0,(function(){var r,i;return s(this,(function(a){switch(a.label){case 0:return p.retryConfiguration&&p.retryConfiguration.shouldRetry(e.reason,e.attempts)?(n.throwIfAborted(),[4,c(p.retryConfiguration.getDelay(e.attempts,e.reason))]):[3,6];case 1:a.sent(),n.throwIfAborted(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,u(o({abortSignal:n,channels:e.channels,channelGroups:e.groups,filterExpression:p.filterExpression},p.maintainPresenceState&&{state:l}))];case 3:return r=a.sent(),[2,t.transition(St(r))];case 4:return(i=a.sent())instanceof Error&&"Aborted"===i.message?[2]:i instanceof V?[2,t.transition(wt(i))]:[3,5];case 5:return[3,7];case 6:return[2,t.transition(Ot(new V(p.retryConfiguration.getGiveupReason(e.reason,e.attempts))))];case 7:return[2]}}))}))}))),r}return t(n,e),n}(rt),Rt=new tt("HANDSHAKE_FAILED");Rt.on(mt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),Rt.on(Nt.type,(function(e,t){return Lt.with({channels:e.channels,groups:e.groups,cursor:t.payload.cursor||e.cursor})})),Rt.on(vt.type,(function(e,t){var n,r;return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region?t.payload.cursor.region:null!==(r=null===(n=null==e?void 0:e.cursor)||void 0===n?void 0:n.region)&&void 0!==r?r:0}})})),Rt.on(Mt.type,(function(e){return Kt.with()}));var xt=new tt("HANDSHAKE_STOPPED");xt.on(mt.type,(function(e,t){return xt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),xt.on(Nt.type,(function(e,t){return Lt.with(o(o({},e),{cursor:t.payload.cursor||e.cursor}))})),xt.on(vt.type,(function(e,t){var n;return xt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||(null===(n=null==e?void 0:e.cursor)||void 0===n?void 0:n.region)||0}})})),xt.on(Mt.type,(function(e){return Kt.with()}));var Ut=new tt("RECEIVE_FAILED");Ut.on(Nt.type,(function(e,t){var n;return Lt.with({channels:e.channels,groups:e.groups,cursor:{timetoken:t.payload.cursor.timetoken?null===(n=t.payload.cursor)||void 0===n?void 0:n.timetoken:e.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),Ut.on(mt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),Ut.on(vt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),Ut.on(Mt.type,(function(e){return Kt.with(void 0)}));var It=new tt("RECEIVE_STOPPED");It.on(mt.type,(function(e,t){return It.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),It.on(vt.type,(function(e,t){return It.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),It.on(Nt.type,(function(e,t){var n;return Lt.with({channels:e.channels,groups:e.groups,cursor:{timetoken:t.payload.cursor.timetoken?null===(n=t.payload.cursor)||void 0===n?void 0:n.timetoken:e.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),It.on(Mt.type,(function(){return Kt.with(void 0)}));var Dt=new tt("RECEIVE_RECONNECTING");Dt.onEnter((function(e){return yt(e)})),Dt.onExit((function(){return yt.cancel})),Dt.on(Tt.type,(function(e,t){return Ft.with({channels:e.channels,groups:e.groups,cursor:t.payload.cursor},[ft(t.payload.events)])})),Dt.on(At.type,(function(e,t){return Dt.with(o(o({},e),{attempts:e.attempts+1,reason:t.payload}))})),Dt.on(kt.type,(function(e,t){var n;return Ut.with({groups:e.groups,channels:e.channels,cursor:e.cursor,reason:t.payload},[dt({category:U.PNDisconnectedUnexpectedlyCategory,error:null===(n=t.payload)||void 0===n?void 0:n.message})])})),Dt.on(Ct.type,(function(e){return It.with({channels:e.channels,groups:e.groups,cursor:e.cursor},[dt({category:U.PNDisconnectedCategory})])})),Dt.on(vt.type,(function(e,t){return Ft.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),Dt.on(mt.type,(function(e,t){return Ft.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),Dt.on(Mt.type,(function(e){return Kt.with(void 0,[dt({category:U.PNDisconnectedCategory})])}));var Ft=new tt("RECEIVING");Ft.onEnter((function(e){return ht(e.channels,e.groups,e.cursor)})),Ft.onExit((function(){return ht.cancel})),Ft.on(Pt.type,(function(e,t){return Ft.with({channels:e.channels,groups:e.groups,cursor:t.payload.cursor},[ft(t.payload.events)])})),Ft.on(mt.type,(function(e,t){return 0===t.payload.channels.length&&0===t.payload.groups.length?Kt.with(void 0):Ft.with({cursor:e.cursor,channels:t.payload.channels,groups:t.payload.groups})})),Ft.on(vt.type,(function(e,t){return 0===t.payload.channels.length&&0===t.payload.groups.length?Kt.with(void 0):Ft.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||e.cursor.region}})})),Ft.on(Et.type,(function(e,t){return Dt.with(o(o({},e),{attempts:0,reason:t.payload}))})),Ft.on(Ct.type,(function(e){return It.with({channels:e.channels,groups:e.groups,cursor:e.cursor},[dt({category:U.PNDisconnectedCategory})])})),Ft.on(Mt.type,(function(e){return Kt.with(void 0,[dt({category:U.PNDisconnectedCategory})])}));var Gt=new tt("HANDSHAKE_RECONNECTING");Gt.onEnter((function(e){return gt(e)})),Gt.onExit((function(){return gt.cancel})),Gt.on(St.type,(function(e,t){var n,r,o={timetoken:(null===(n=e.curs
1or)||void 0===n?void 0:n.timetoken)?null===(r=e.cursor)||void 0===r?void 0:r.timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region};return Ft.with({channels:e.channels,groups:e.groups,cursor:o},[dt({category:U.PNConnectedCategory})])})),Gt.on(wt.type,(function(e,t){return Gt.with(o(o({},e),{attempts:e.attempts+1,reason:t.payload}))})),Gt.on(Ot.type,(function(e,t){var n;return Rt.with({groups:e.groups,channels:e.channels,cursor:e.cursor,reason:t.payload},[dt({category:U.PNConnectionErrorCategory,error:null===(n=t.payload)||void 0===n?void 0:n.message})])})),Gt.on(Ct.type,(function(e){return xt.with({channels:e.channels,groups:e.groups,cursor:e.cursor})})),Gt.on(mt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),Gt.on(vt.type,(function(e,t){var n,r;return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:(null===(n=t.payload.cursor)||void 0===n?void 0:n.region)||(null===(r=null==e?void 0:e.cursor)||void 0===r?void 0:r.region)||0}})})),Gt.on(Mt.type,(function(e){return Kt.with(void 0)}));var Lt=new tt("HANDSHAKING");Lt.onEnter((function(e){return pt(e.channels,e.groups)})),Lt.onExit((function(){return pt.cancel})),Lt.on(mt.type,(function(e,t){return 0===t.payload.channels.length&&0===t.payload.groups.length?Kt.with(void 0):Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:e.cursor})})),Lt.on(bt.type,(function(e,t){var n,r;return Ft.with({channels:e.channels,groups:e.groups,cursor:{timetoken:(null===(n=null==e?void 0:e.cursor)||void 0===n?void 0:n.timetoken)?null===(r=null==e?void 0:e.cursor)||void 0===r?void 0:r.timetoken:t.payload.timetoken,region:t.payload.region}},[dt({category:U.PNConnectedCategory})])})),Lt.on(_t.type,(function(e,t){return Gt.with({channels:e.channels,groups:e.groups,cursor:e.cursor,attempts:0,reason:t.payload})})),Lt.on(Ct.type,(function(e){return xt.with({channels:e.channels,groups:e.groups,cursor:e.cursor})})),Lt.on(vt.type,(function(e,t){var n;return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:{timetoken:t.payload.cursor.timetoken,region:t.payload.cursor.region||(null===(n=null==e?void 0:e.cursor)||void 0===n?void 0:n.region)||0}})})),Lt.on(Mt.type,(function(e){return Kt.with()}));var Kt=new tt("UNSUBSCRIBED");Kt.on(mt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups})})),Kt.on(vt.type,(function(e,t){return Lt.with({channels:t.payload.channels,groups:t.payload.groups,cursor:t.payload.cursor})}));var Bt=function(){function e(e){var t=this;this.engine=new nt,this.channels=[],this.groups=[],this.dependencies=e,this.dispatcher=new jt(this.engine,e),this._unsubscribeEngine=this.engine.subscribe((function(e){"invocationDispatched"===e.type&&t.dispatcher.dispatch(e.invocation)})),this.engine.start(Kt,void 0)}return Object.defineProperty(e.prototype,"_engine",{get:function(){return this.engine},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(e){var t=this,n=e.channels,r=e.channelGroups,o=e.timetoken,i=e.withPresence;this.channels=l(l([],c(this.channels),!1),c(null!=n?n:[]),!1),this.groups=l(l([],c(this.groups),!1),c(null!=r?r:[]),!1),i&&(this.channels.map((function(e){return t.channels.push("".concat(e,"-pnpres"))})),this.groups.map((function(e){return t.groups.push("".concat(e,"-pnpres"))}))),o?this.engine.transition(vt(this.channels,this.groups,o)):this.engine.transition(mt(this.channels,this.groups)),this.dependencies.join&&this.dependencies.join({channels:this.channels.filter((function(e){return!e.endsWith("-pnpres")})),groups:this.groups.filter((function(e){return!e.endsWith("-pnpres")}))})},e.prototype.unsubscribe=function(e){var t=this,n=e.channels,r=e.groups,o=null==n?void 0:n.slice(0);null==n||n.map((function(e){return o.push("".concat(e,"-pnpres"))})),this.channels=this.channels.filter((function(e){return!(null==o?void 0:o.includes(e))}));var i=null==r?void 0:r.slice(0);null==r||r.map((function(e){return i.push("".concat(e,"-pnpres"))})),this.groups=this.groups.filter((function(e){return!(null==i?void 0:i.includes(e))}
1)),this.dependencies.presenceState&&(null==n||n.forEach((function(e){return delete t.dependencies.presenceState[e]})),null==r||r.forEach((function(e){return delete t.dependencies.presenceState[e]}))),this.engine.transition(mt(this.channels.slice(0),this.groups.slice(0))),this.dependencies.leave&&this.dependencies.leave({channels:n,groups:r})},e.prototype.unsubscribeAll=function(){this.channels=[],this.groups=[],this.dependencies.presenceState&&(this.dependencies.presenceState={}),this.engine.transition(mt(this.channels.slice(0),this.groups.slice(0))),this.dependencies.leaveAll&&this.dependencies.leaveAll()},e.prototype.reconnect=function(e){var t=e.timetoken,n=e.region;this.engine.transition(Nt(t,n))},e.prototype.disconnect=function(){this.engine.transition(Ct()),this.dependencies.leaveAll&&this.dependencies.leaveAll()},e.prototype.getSubscribedChannels=function(){return this.channels.slice(0)},e.prototype.getSubscribedChannelGroups=function(){return this.groups.slice(0)},e.prototype.dispose=function(){this.disconnect(),this._unsubscribeEngine(),this.dispatcher.dispose()},e}(),Ht=ot("RECONNECT",(function(){return{}})),qt=ot("DISCONNECT",(function(){return{}})),zt=ot("JOINED",(function(e,t){return{channels:e,groups:t}})),Vt=ot("LEFT",(function(e,t){return{channels:e,groups:t}})),Wt=ot("LEFT_ALL",(function(){return{}})),Jt=ot("HEARTBEAT_SUCCESS",(function(e){return{statusCode:e}})),$t=ot("HEARTBEAT_FAILURE",(function(e){return e})),Qt=ot("HEARTBEAT_GIVEUP",(function(){return{}})),Xt=ot("TIMES_UP",(function(){return{}})),Yt=it("HEARTBEAT",(function(e,t){return{channels:e,groups:t}})),Zt=it("LEAVE",(function(e,t){return{channels:e,groups:t}})),en=it("EMIT_STATUS",(function(e){return e})),tn=at("WAIT",(function(){return{}})),nn=at("DELAYED_HEARTBEAT",(function(e){return e})),rn=function(e){function n(t,n){var r=e.call(this,n)||this;return r.on(Yt.type,lt((function(e,n,i){var u=i.heartbeat,c=i.presenceState,l=i.config;return a(r,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,u(o({channels:e.channels,channelGroups:e.groups},l.maintainPresenceState&&{state:c}))];case 1:return r.sent(),t.transition(Jt(200)),[3,3];case 2:return(n=r.sent())instanceof V?[2,t.transition($t(n))]:[3,3];case 3:return[2]}}
1))}))}))),r.on(Zt.type,lt((function(e,t,n){var o=n.leave,i=n.config;return a(r,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:if(i.suppressLeaveEvents)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,o({channels:e.channels,channelGroups:e.groups})];case 2:case 3:return t.sent(),[3,4];case 4:return[2]}}))}))}))),r.on(tn.type,lt((function(e,n,o){var i=o.heartbeatDelay;return a(r,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return n.throwIfAborted(),[4,i()];case 1:return e.sent(),n.throwIfAborted(),[2,t.transition(Xt())]}}))}))}))),r.on(nn.type,lt((function(e,n,i){var u=i.heartbeat,c=i.retryDelay,l=i.presenceState,p=i.config;return a(r,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return p.retryConfiguration&&p.retryConfiguration.shouldRetry(e.reason,e.attempts)?(n.throwIfAborted(),[4,c(p.retryConfiguration.getDelay(e.attempts,e.reason))]):[3,6];case 1:i.sent(),n.throwIfAborted(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,u(o({channels:e.channels,channelGroups:e.groups},p.maintainPresenceState&&{state:l}))];case 3:return i.sent(),[2,t.transition(Jt(200))];case 4:return(r=i.sent())instanceof Error&&"Aborted"===r.message?[2]:r instanceof V?[2,t.transition($t(r))]:[3,5];case 5:return[3,7];case 6:return[2,t.transition(Qt())];case 7:return[2]}}
1))}))}))),r.on(en.type,lt((function(e,t,n){var i=n.emitStatus,u=n.config;return a(r,void 0,void 0,(function(){var t;return s(this,(function(n){return u.announceFailedHeartbeats&&!0===(null===(t=null==e?void 0:e.status)||void 0===t?void 0:t.error)?i(e.status):u.announceSuccessfulHeartbeats&&200===e.statusCode&&i(o(o({},e),{operation:D.PNHeartbeatOperation,error:!1})),[2]}))}))}))),r}return t(n,e),n}(rt),on=new tt("HEARTBEAT_STOPPED");on.on(zt.type,(function(e,t){return on.with({channels:l(l([],c(e.channels),!1),c(t.payload.channels),!1),groups:l(l([],c(e.groups),!1),c(t.payload.groups),!1)})})),on.on(Vt.type,(function(e,t){return on.with({channels:e.channels.filter((function(e){return!t.payload.channels.includes(e)})),groups:e.groups.filter((function(e){return!t.payload.groups.includes(e)}))})})),on.on(Ht.type,(function(e,t){return cn.with({channels:e.channels,groups:e.groups})})),on.on(Wt.type,(function(e,t){return ln.with(void 0)}));var an=new tt("HEARTBEAT_COOLDOWN");an.onEnter((function(){return tn()})),an.onExit((function(){return tn.cancel})),an.on(Xt.type,(function(e,t){return cn.with({channels:e.channels,groups:e.groups})})),an.on(zt.type,(function(e,t){return cn.with({channels:l(l([],c(e.channels),!1),c(t.payload.channels),!1),groups:l(l([],c(e.groups),!1),c(t.payload.groups),!1)})})),an.on(Vt.type,(function(e,t){return cn.with({channels:e.channels.filter((function(e){return!t.payload.channels.includes(e)})),groups:e.groups.filter((function(e){return!t.payload.groups.includes(e)}))},[Zt(t.payload.channels,t.payload.groups)])})),an.on(qt.type,(function(e){return on.with({channels:e.channels,groups:e.groups},[Zt(e.channels,e.groups)])})),an.on(Wt.type,(function(e,t){return ln.with(void 0,[Zt(e.channels,e.groups)])}));var sn=new tt("HEARTBEAT_FAILED");sn.on(zt.type,(function(e,t){return cn.with({channels:l(l([],c(e.channels),!1),c(t.payload.channels),!1),groups:l(l([],c(e.groups),!1),c(t.payload.groups),!1)})})),sn.on(Vt.type,(function(e,t){return cn.with({channels:e.channels.filter((function(e){return!t.payload.channels.includes(e)})),groups:e.groups.filter((function(e){return!t.payload.groups.includes(e)}))},[Zt(t.payload.channels,t.payload.groups)])})),sn.on(Ht.type,(function(e,t){return cn.with({channels:e.channels,groups:e.groups})})),sn.on(qt.type,(function(e,t){return on.with({channels:e.channels,groups:e.groups},[Zt(e.channels,e.groups)])})),sn.on(Wt.type,(function(e,t){return ln.with(void 0,[Zt(e.channels,e.groups)])}));var un=new tt("HEARBEAT_RECONNECTING");un.onEnter((function(e){return nn(e)})),un.onExit((function(){return nn.cancel})),un.on(zt.type,(function(e,t){return cn.with({channels:l(l([],c(e.channels),!1),c(t.payload.channels),!1),groups:l(l([],c(e.groups),!1),c(t.payload.groups),!1)})})),un.on(Vt.type,(function(e,t){return cn.with({channels:e.channels.filter((function(e){return!t.payload.channels.includes(e)})),groups:e.groups.filter((function(e){return!t.payload.groups.includes(e)}))},[Zt(t.payload.channels,t.payload.groups)])})),un.on(qt.type,(function(e,t){on.with({channels:e.channels,groups:e.groups},[Zt(e.channels,e.groups)])})),un.on(Jt.type,(function(e,t){return an.with({channels:e.channels,groups:e.groups})})),un.on($t.type,(function(e,t){return un.with(o(o({},e),{attempts:e.attempts+1,reason:t.payload}))})),un.on(Qt.type,(function(e,t){return sn.with({channels:e.channels,groups:e.groups})})),un.on(Wt.type,(function(e,t){return ln.with(void 0,[Zt(e.channels,e.groups)])}));var cn=new tt("HEARTBEATING");cn.onEnter((function(e){return Yt(e.channels,e.groups)})),cn.on(Jt.type,(function(e,t){return an.with({channels:e.channels,groups:e.groups})})),cn.on(zt.type,(function(e,t){return cn.with({channels:l(l([],c(e.channels),!1),c(t.payload.channels),!1),groups:l(l([],c(e.groups),!1),c(t.payload.groups),!1)})})),cn.on(Vt.type,(function(e,t){return cn.with({channels:e.channels.filter((function(e){return!t.payload.channels.includes(e)})),groups:e.groups.filter((function(e){return!t.payload.groups.includes(e)}))},[Zt(t.payload.channels,t.payload.groups)])})),cn.on($t.type,(function(e,t){return un.with(o(o({},e),{attempts:0,reason:t.payload}))})),cn.on(qt.type,(function(e){return on.with({channels:e.channels,groups:e.groups},[Zt(e.channels,e.groups)])})),cn.on(Wt.type,(function(e,t){return ln.with(void 0,[Zt(e.channels,e.groups)])}));var ln=new tt("HEARTBEAT_INACTIVE");ln.on(zt.type,(function(e,t){return cn.with({channels:t.payload.channels,groups:t.payload.groups})}));var pn=function(){function e(e){var t=this;this.engine=new nt,this.channels=[],this.groups=[],this.dispatcher=new rn(this.engine,e),this.dependencies=e,this._unsubscribeEngine=this.engine.subscribe((function(e){"
1invocationDispatched"===e.type&&t.dispatcher.dispatch(e.invocation)})),this.engine.start(ln,void 0)}return Object.defineProperty(e.prototype,"_engine",{get:function(){return this.engine},enumerable:!1,configurable:!0}),e.prototype.join=function(e){var t=e.channels,n=e.groups;this.channels=l(l([],c(this.channels),!1),c(null!=t?t:[]),!1),this.groups=l(l([],c(this.groups),!1),c(null!=n?n:[]),!1),this.engine.transition(zt(this.channels.slice(0),this.groups.slice(0)))},e.prototype.leave=function(e){var t=this,n=e.channels,r=e.groups;this.dependencies.presenceState&&(null==n||n.forEach((function(e){return delete t.dependencies.presenceState[e]})),null==r||r.forEach((function(e){return delete t.dependencies.presenceState[e]}))),this.engine.transition(Vt(null!=n?n:[],null!=r?r:[]))},e.prototype.leaveAll=function(){this.engine.transition(Wt())},e.prototype.dispose=function(){this._unsubscribeEngine(),this.dispatcher.dispose()},e}(),hn=function(){function e(){}return e.LinearRetryPolicy=function(e){return{delay:e.delay,maximumRetry:e.maximumRetry,shouldRetry:function(e,t){var n;return 403!==(null===(n=null==e?void 0:e.status)||void 0===n?void 0:n.statusCode)&&this.maximumRetry>t},getDelay:function(e,t){var n;return 1e3*((null!==(n=t.retryAfter)&&void 0!==n?n:this.delay)+Math.random())},getGiveupReason:function(e,t){var n;return this.maximumRetry<=t?"retry attempts exhaused.":403===(null===(n=null==e?void 0:e.status)||void 0===n?void 0:n.statusCode)?"forbidden operation.":"unknown error"}}},e.ExponentialRetryPolicy=function(e){return{minimumDelay:e.minimumDelay,maximumDelay:e.maximumDelay,maximumRetry:e.maximumRetry,shouldRetry:function(e,t){var n;return 403!==(null===(n=null==e?void 0:e.status)||void 0===n?void 0:n.statusCode)&&this.maximumRetry>t},getDelay:function(e,t){var n;return 1e3*((null!==(n=t.retryAfter)&&void 0!==n?n:Math.min(Math.pow(2,e),this.maximumDelay))+Math.random())},getGiveupReason:function(e,t){var n;return this.maximumRetry<=t?"retry attempts exhaused.":403===(null===(n=null==e?void 0:e.status)||void 0===n?void 0:n.statusCode)?"forbidden operation.":"unknown error"}}},e}(),fn=function(){function e(e){var t=e.modules,n=e.listenerManager,r=e.getFileUrl;this.modules=t,this.listenerManager=n,this.getFileUrl=r,t.cryptoModule&&(this._decoder=new TextDecoder)}return e.prototype.emitEvent=function(e){var t=e.channel,n=e.publishMetaData,r=e.subscriptionMatch;if(t===r&&(r=null),e.channel.endsWith("-pnpres")){var a={channel:null,subscription:null};t&&(a.channel=t.substring(0,t.lastIndexOf("-pnpres"))),r&&(a.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),a.action=e.payload.action,a.state=e.payload.data,a.timetoken=n.publishTimetoken,a.occupancy=e.payload.occupancy,a.uuid=e.payload.uuid,a.timestamp=e.payload.timestamp,e.payload.join&&(a.join=e.payload.join),e.payload.leave&&(a.leave=e.payload.leave),e.payload.timeout&&(a.timeout=e.payload.timeout),this.listenerManager.announcePresence(a)}else if(1===e.messageType)(a={channel:null,subscription:null}).channel=t,a.subscription=r,a.timetoken=n.publishTimetoken,a.publisher=e.issuingClientId,e.userMetadata&&(a.userMetadata=e.userMetadata),a.message=e.payload,this.listenerManager.announceSignal(a);else if(2===e.messageType){if((a={channel:null,subscription:null}).channel=t,a.subscription=r,a.timetoken=n.publishTimetoken,a.publisher=e.issuingClientId,e.userMetadata&&(a.userMetadata=e.userMetadata),a.message={event:e.payload.event,type:e.payload.type,data:e.payload.data},this.listenerManager.announceObjects(a),"uuid"===e.payload.type){var s=this._renameChannelField(a);this.listenerManager.announceUser(o(o({},s),{message:o(o({},s.message),{event:this._renameEvent(s.message.event),type:"user"})}))}else if("channel"===message.payload.type)s=this._renameChannelField(a),this.listenerManager.announceSpace(o(o({},s),{message:o(o({},s.message),{event:this._renameEvent(s.message.event),type:"space"})}));else if("membership"===message.payload.type){var u=(s=this._renameChannelField(a)).message.data,c=u.uuid,l=u.channel,p=i(u,["uuid","channel"]);p.user=c,p.space=l,this.listenerManager.announceMembership(o(o({},s),{message:o(o({},s.message),{event:this._renameEvent(s.message.event),data:p})}))}}else if(3===e.messageType)(a={}).channel=t,a.subscription=r,a.timetoken=n.publishTimetoken,a.publisher=e.issuingClientId,a.data={messageTimetoken:e.payload.data.messageTimetoken,actionTimetoken:e.payload.data.actionTimetoken,type:e.payload.data.type,uuid:e.issuingClientId,value:e.payload.data.value},a.event=e.payload.event,this.listenerManager.announceMessageAction(a);else if(4===e.messageType){(a={}).channel=t,a.subscription=r,a.timetoken=n.publishTimetoken,a.publisher=e.issuingClientId;var h=e.payload;if(this.modules.cryptoModule){var f=void 0;try{f=(d=this.modules.cryptoModule.decrypt(e.payload))instanceof ArrayBuffer?JSON.parse(this._decoder.decode(d)):d}catch(e){f=null,a.error="Error while decrypting message content: ".concat(e.message)}null!==f&&(h=f)}e.userMetadata&&(a.userMetadata=e.userMetadata),a.message=h.message,a.file={id:h.file.id,name:h.file.name,url:this.getFileUrl({id:h.file.id,name:h.file.name,channel:t})},this.listenerManager.announceFile(a)}else{if((a={channel:null,subscription:null}).channel=t,a.subscription=r,a.timetoken=n.publishTimetoken,a.publisher=e.issuingClientId,e.userMetadata&&(a.userMetadata=e.userMetadata),this.modules.cryptoModule){f=void 0;try{var d;f=(d=this.modules.cryptoModule.decrypt(e.payload))instanceof ArrayBuffer?JSON.parse(this._decoder.decode(d)):d}catch(e){f=null,a.error="Error while decrypting message content: ".concat(e.message)}a.message=null!=f?f:e.payload}else a.message=e.payload;
1this.listenerManager.announceMessage(a)}},e.prototype._renameEvent=function(e){return"set"===e?"updated":"removed"},e.prototype._renameChannelField=function(e){var t=e.channel,n=i(e,["channel"]);return n.spaceId=t,n},e}(),dn=function(){function e(e){var t=this,n=e.networking,r=e.cbor,i=new v({setup:e});this._config=i;var a=new C({config:i}),s=e.cryptography;n.init(i);var p=new z(i,r);this._tokenManager=p;var h=new F({maximumSamplesCount:6e4});this._telemetryManager=h;var f=this._config.cryptoModule,d={config:i,networking:n,crypto:a,cryptography:s,tokenManager:p,telemetryManager:h,PubNubFile:e.PubNubFile,cryptoModule:f};this.File=e.PubNubFile,this.encryptFile=function(e,t){return 1==arguments.length&&"string"!=typeof e&&d.cryptoModule?(t=e,d.cryptoModule.encryptFile(t,this.File)):s.encryptFile(e,t,this.File)},this.decryptFile=function(e,t){return 1==arguments.length&&"string"!=typeof e&&d.cryptoModule?(t=e,d.cryptoModule.decryptFile(t,this.File)):s.decryptFile(e,t,this.File)};var y=Y.bind(this,d,Qe),g=Y.bind(this,d,ue),m=Y.bind(this,d,le),b=Y.bind(this,d,he),S=Y.bind(this,d,Xe),w=new q;if(this._listenerManager=w,this.iAmHere=Y.bind(this,d,le),this.iAmAway=Y.bind(this,d,ue),this.setPresenceState=Y.bind(this,d,he),this.handshake=Y.bind(this,d,Ye),this.receiveMessages=Y.bind(this,d,Ze),!0===i.enableEventEngine){if(this._eventEmitter=new fn({modules:d,listenerManager:this._listenerManager,getFileUrl:function(e){return Se(d,e)}}),i.maintainPresenceState&&(this.presenceState={},this.setState=function(e){var n,r;return null===(n=e.channels)||void 0===n||n.forEach((function(n){return t.presenceState[n]=e.state})),null===(r=e.channelGroups)||void 0===r||r.forEach((function(n){return t.presenceState[n]=e.state})),t.setPresenceState({channels:e.channels,channelGroups:e.channelGroups,state:t.presenceState})}),i.getHeartbeatInterval()){var O=new pn({heartbeat:this.iAmHere,leave:this.iAmAway,heartbeatDelay:function(){return new Promise((function(e){return setTimeout(e,1e3*d.config.getHeartbeatInterval())}))},retryDelay:function(e){return new Promise((function(t){return setTimeout(t,e)}))},config:d.config,presenceState:this.presenceState,emitStatus:function(e){w.announceStatus(e)}});this.presenceEventEngine=O,this.join=this.presenceEventEngine.join.bind(O),this.leave=this.presenceEventEngine.leave.bind(O),this.leaveAll=this.presenceEventEngine.leaveAll.bind(O)}var P=new Bt({handshake:this.handshake,receiveMessages:this.receiveMessages,delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))},join:this.join,leave:this.leave,leaveAll:this.leaveAll,presenceState:this.presenceState,config:d.config,emitMessages:function(e){var n,r;try{for(var o=u(e),i=o.next();!i.done;i=o.next()){var a=i.value;t._eventEmitter.emitEvent(a)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},emitStatus:function(e){w.announceStatus(e)}});this.subscribe=P.subscribe.bind(P),this.unsubscribe=P.unsubscribe.bind(P),this.unsubscribeAll=P.unsubscribeAll.bind(P),this.reconnect=P.reconnect.bind(P),this.disconnect=P.disconnect.bind(P),this.destroy=P.dispose.bind(P),this.getSubscribedChannels=P.getSubscribedChannels.bind(P),this.getSubscribedChannelGroups=P.getSubscribedChannelGroups.bind(P),this.eventEngine=P}else{var E=new I({timeEndpoint:y,leaveEndpoint:g,heartbeatEndpoint:m,setStateEndpoint:b,subscribeEndpoint:S,crypto:d.crypto,config:d.config,listenerManager:w,getFileUrl:function(e){return Se(d,e)},cryptoModule:d.cryptoModule});this.subscribe=E.adaptSubscribeChange.bind(E),this.unsubscribe=E.adaptUnsubscribeChange.bind(E),this.disconnect=E.disconnect.bind(E),this.reconnect=E.reconnect.bind(E),this.unsubscribeAll=E.unsubscribeAll.bind(E),this.getSubscribedChannels=E.getSubscribedChannels.bind(E),this.getSubscribedChannelGroups=E.getSubscribedChannelGroups.bind(E),this.setState=E.adaptStateChange.bind(E),this.presence=E.adaptPresenceChange.bind(E),this.destroy=function(e){E.unsubscribeAll(e),E.disconnect()}}this.addListener=w.addListener.bind(w),this.removeListener=w.removeListener.bind(w),this.removeAllListeners=w.removeAllListeners.bind(w),this.parseToken=p.parseToken.bind(p),this.setToken=p.setToken.bind(p),this.getToken=p.getToken.bind(p),this.channelGroups={listGroups:Y.bind(this,d,ne),listChannels:Y.bind(this,d,re),addChannels:Y.bind(this,d,Z),removeChannels:Y.bind(this,d,ee),deleteGroup:Y.bind(this,d,te)},this.push={addChannels:Y.bind(this,d,oe),removeChannels:Y.bind(this,d,ie),deleteDevice:Y.bind(this,d,se),listChannels:Y.bind(this,d,ae)},this.hereNow=Y.bind(this,d,fe),this.whereNow=Y.bind(this,d,ce),this.get
1State=Y.bind(this,d,pe),this.grant=Y.bind(this,d,De),this.grantToken=Y.bind(this,d,Ke),this.audit=Y.bind(this,d,Ie),this.revokeToken=Y.bind(this,d,Be),this.publish=Y.bind(this,d,qe),this.fire=function(e,n){return e.replicate=!1,e.storeInHistory=!1,t.publish(e,n)},this.signal=Y.bind(this,d,ze),this.history=Y.bind(this,d,Ve),this.deleteMessages=Y.bind(this,d,We),this.messageCounts=Y.bind(this,d,Je),this.fetchMessages=Y.bind(this,d,$e),this.addMessageAction=Y.bind(this,d,de),this.removeMessageAction=Y.bind(this,d,ye),this.getMessageActions=Y.bind(this,d,ge),this.listFiles=Y.bind(this,d,me);var T=Y.bind(this,d,ve);this.publishFile=Y.bind(this,d,be),this.sendFile=_e({generateUploadUrl:T,publishFile:this.publishFile,modules:d}),this.getFileUrl=function(e){return Se(d,e)},this.downloadFile=Y.bind(this,d,we),this.deleteFile=Y.bind(this,d,Oe),this.objects={getAllUUIDMetadata:Y.bind(this,d,Pe),getUUIDMetadata:Y.bind(this,d,Ee),setUUIDMetadata:Y.bind(this,d,Te),removeUUIDMetadata:Y.bind(this,d,Ae),getAllChannelMetadata:Y.bind(this,d,ke),getChannelMetadata:Y.bind(this,d,Ce),setChannelMetadata:Y.bind(this,d,Ne),removeChannelMetadata:Y.bind(this,d,Me),getChannelMembers:Y.bind(this,d,je),setChannelMembers:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Y.call.apply(Y,l([t,d,Re,o({type:"set"},e)],c(n),!1))},removeChannelMembers:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Y.call.apply(Y,l([t,d,Re,o({type:"delete"},e)],c(n),!1))},getMemberships:Y.bind(this,d,xe),setMemberships:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Y.call.apply(Y,l([t,d,Ue,o({type:"set"},e)],c(n),!1))},removeMemberships:function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return Y.call.apply(Y,l([t,d,Ue,o({type:"delete"},e)],c(n),!1))}},this.createUser=function(e){return t.objects.setUUIDMetadata({uuid:e.userId,data:e.data,include:e.include})},this.updateUser=this.createUser,this.removeUser=function(e){return t.objects.removeUUIDMetadata({uuid:null==e?void 0:e.userId})},this.fetchUser=function(e){return t.objects.getUUIDMetadata({uuid:null==e?void 0:e.userId,include:null==e?void 0:e.include})},this.fetchUsers=this.objects.getAllUUIDMetadata,this.createSpace=function(e){return t.objects.setChannelMetadata({channel:e.spaceId,data:e.data,include:e.include})},this.updateSpace=this.createSpace,this.removeSpace=function(e){return t.objects.removeChannelMetadata({channel:e.spaceId})},this.fetchSpace=function(e){return t.objects.getChannelMetadata({channel:e.spaceId,include:e.include})},this.fetchSpaces=this.objects.getAllChannelMetadata,this.addMemberships=function(e){var n,r;return"string"==typeof e.spaceId?t.objects.setChannelMembers({channel:e.spaceId,uuids:null===(n=e.users)||void 0===n?void 0:n.map((function(e){return"string"==typeof e?e:{id:e.userId,custom:e.custom,status:e.status}})),limit:0}):t.objects.setMemberships({uuid:e.userId,channels:null===(r=e.spaces)||void 0===r?void 0:r.map((function(e){return"string"==typeof e?e:{id:e.spaceId,custom:e.custom,status:e.status}})),limit:0})},this.updateMemberships=this.addMemberships,this.removeMemberships=function(e){return"string"==typeof e.spaceId?t.objects.removeChannelMembers({channel:e.spaceId,uuids:e.userIds,limit:0}):t.objects.removeMemberships({uuid:e.userId,channels:e.spaceIds,limit:0})},this.fetchMemberships=function(e){return"string"==typeof e.spaceId?t.objects.getChannelMembers({channel:e.spaceId,filter:e.filter,limit:e.limit,page:e.page,include:{customFields:e.include.customFields,UUIDFields:e.include.userFields,customUUIDFields:e.include.customUserFields,statusField:e.include.statusField,UUIDStatusField:e.include.userStatusField,UUIDTypeField:e.include.userTypeField,totalCount:e.include.totalCount},sort:null!=e.sort?Object.fromEntries(Object.entries(e.sort).map((function(e){var t=c(e,2),n=t[0],r=t[1];return[n.replace("user","uuid"),r]}))):null}).then((function(e){var t;return e.data=null===(t=e.data)||void 0===t?void 0:t.map((function(e){return{user:e.uuid,custom:e.custom,updated:e.updated,eTag:e.eTag}})),e})):t.objects.getMemberships({uuid:e.userId,filter:e.filter,limit:e.limit,page:e.page,include:{customFields:e.include.customFields,channelFields:e.include.spaceFields,customChannelFields:e.include.customSpaceFields,statusField:e.include.statusField,channelStatusField:e.include.spaceStatusField,channelTypeField:e.include.spaceTypeField,totalCount:e.include.totalCount},sort:null!=e.sort?Object.fromEntries(Object.entries(e.sort).map((function(e){var t=c(e,2),n=t[0],r=t[1];return[n.replace("space","channel"),r]}))):null}).then((function(e){var t;return e.data=null===(t=e.data)||void 0===t?void 0:t.map((function(e){return{space
1:e.channel,custom:e.custom,updated:e.updated,eTag:e.eTag}})),e}))},this.time=y,this.stop=this.destroy,this.encrypt=function(e,t){if(void 0===t&&d.cryptoModule){var n=d.cryptoModule.encrypt(e);return"string"==typeof n?n:_(n)}return a.encrypt(e,t)},this.decrypt=function(e,t){if(void 0===t&&f){var n=d.cryptoModule.decrypt(e);return n instanceof ArrayBuffer?JSON.parse((new TextDecoder).decode(n)):n}return a.decrypt(e,t)},this.getAuthKey=d.config.getAuthKey.bind(d.config),this.setAuthKey=d.config.setAuthKey.bind(d.config),this.getUUID=d.config.getUUID.bind(d.config),this.setUUID=d.config.setUUID.bind(d.config),this.getUserId=d.config.getUserId.bind(d.config),this.setUserId=d.config.setUserId.bind(d.config),this.getFilterExpression=d.config.getFilterExpression.bind(d.config),this.setFilterExpression=d.config.setFilterExpression.bind(d.config),this.setCipherKey=function(t){return d.config.setCipherKey(t,e,d)},this.setHeartbeatInterval=d.config.setHeartbeatInterval.bind(d.config),n.hasModule("proxy")&&(this.setProxy=function(e){d.config.setProxy(e),t.reconnect()})}return e.prototype.getVersion=function(){return this._config.getVersion()},e.prototype._addPnsdkSuffix=function(e,t){this._config._addPnsdkSuffix(e,t)},e.prototype.networkDownDetected=function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)},e.prototype.networkUpDetected=function(){this._listenerManager.announceNetworkUp(),this.reconnect()},e.notificationPayload=function(e,t){return new H(e,t)},e.generateUUID=function(){return m()},e.OPERATIONS=D,e.CATEGORIES=U,e.LinearRetryPolicy=hn.LinearRetryPolicy,e.ExponentialRetryPolicy=hn.ExponentialRetryPolicy,e}(),yn=function(){function e(e){var t=this;this._modules={},Object.keys(e).forEach((function(n){t._modules[n]=e[n].bind(t)}))}return e.prototype.init=function(e){this._config=e,Array.isArray(this._config.origin)?this._currentSubDomain=Math.floor(Math.random()*this._config.origin.length):this._currentSubDomain=0,this._coreParams={},this.shiftStandardOrigin()},e.prototype.nextOrigin=function(){var e=this._config.secure?"https://":"http://";if("string"==typeof this._config.origin)return"".concat(e).concat(this._config.origin);this._currentSubDomain+=1,this._currentSubDomain>=this._config.origin.length&&(this._currentSubDomain=0);var t=this._config.origin[this._currentSubDomain];return"".concat(e).concat(t)},e.prototype.hasModule=function(e){return e in this._modules},e.prototype.shiftStandardOrigin=function(){return this._standardOrigin=this.nextOrigin(),this._standardOrigin},e.prototype.getStandardOrigin=function(){return this._standardOrigin},e.prototype.POSTFILE=function(e,t,n){return this._modules.postfile(e,t,n)},e.prototype.GETFILE=function(e,t,n){return this._modules.getfile(e,t,n)},e.prototype.POST=function(e,t,n,r){return this._modules.post(e,t,n,r)},e.prototype.PATCH=function(e,t,n,r){return this._modules.patch(e,t,n,r)},e.prototype.GET=function(e,t,n){return this._modules.get(e,t,n)},e.prototype.DELETE=function(e,t,n){return this._modules.del(e,t,n)},e.prototype._detectErrorCategory=function(e){if("ENOTFOUND"===e.code)return U.PNNetworkIssuesCategory;if("ECONNREFUSED"===e.code)return U.PNNetworkIssuesCategory;if("ECONNRESET"===e.code)return U.PNNetworkIssuesCategory;if("EAI_AGAIN"===e.code)return U.PNNetworkIssuesCategory;if(0===e.status||e.hasOwnProperty("status")&&void 0===e.status)return U.PNNetworkIssuesCategory;if(e.timeout)return U.PNTimeoutCategory;if("ETIMEDOUT"===e.code)return U.PNNetworkIssuesCategory;if(e.response){if(e.response.badRequest)return U.PNBadRequestCategory;if(e.response.forbidden)return U.PNAccessDeniedCategory}return U.PNUnknownCategory},e}();function gn(e){var t=function(e){return e&&"object"==typeof e&&e.constructor===Object};if(!t(e))return e;var n={};return Object.keys(e).forEach((function(r){var o=function(e){return"string"==typeof e||e instanceof String}(r),i=r,a=e[r];Array.isArray(r)||o&&r.indexOf(",")>=0?i=(o?r.split(","):r).reduce((function(e,t){return e+String.fromCharCode(t)}),""):(function(e){return"number"==typeof e&&isFinite(e)}(r)||o&&!isNaN(r))&&(i=String.fromCharCode(o?parseInt(r,10):10)),n[i]=t(a)?gn(a):a})),n}var mn=function(){function e(e,t){this._base64ToBinary=t,this._decode=e}return e.prototype.decodeToken=function(e){var t="";e.length%4==3?t="=":e.length%4==2&&(t="==");var n=e.replace(/-/gi,"+").replace(/_/gi,"/")+t,r=this._decode(this._base64ToBinary(n));if("object"==typeof r)return r},e}
vendor: 4,791 bytes, line 1
1(),vn={exports:{}},bn={exports:{}};!function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(bn);var _n=Tn;Tn.default=Tn,Tn.stable=Nn,Tn.stableStringify=Nn;var Sn="[...]",wn="[Circular]",On=[],Pn=[];function En(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Tn(e,t,n,r){var o;void 0===r&&(r=En()),kn(e,"",0,[],void 0,0,r);try{o=0===Pn.length?JSON.stringify(e,t,n):JSON.stringify(e,jn(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==On.length;){var i=On.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function An(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);void 0!==o.get?o.configurable?(Object.defineProperty(r,n,{value:e}),On.push([r,n,t,o])):Pn.push([t,n,e]):(r[n]=e,On.push([r,n,t]))}function kn(e,t,n,r,o,i,a){var s;if(i+=1,"object"==typeof e&&null!==e){for(s=0;s<r.length;s++)if(r[s]===e)return void An(wn,e,t,o);if(void 0!==a.depthLimit&&i>a.depthLimit)return void An(Sn,e,t,o);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void An(Sn,e,t,o);if(r.push(e),Array.isArray(e))for(s=0;s<e.length;s++)kn(e[s],s,s,r,e,i,a);else{var u=Object.keys(e);for(s=0;s<u.length;s++){var c=u[s];kn(e[c],c,s,r,e,i,a)}}r.pop()}}function Cn(e,t){return e<t?-1:e>t?1:0}function Nn(e,t,n,r){void 0===r&&(r=En());var o,i=Mn(e,"",0,[],void 0,0,r)||e;try{o=0===Pn.length?JSON.stringify(i,t,n):JSON.stringify(i,jn(t),n)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==On.length;){var a=On.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return o}function Mn(e,t,n,r,o,i,a){var s;if(i+=1,"object"==typeof e&&null!==e){for(s=0;s<r.length;s++)if(r[s]===e)return void An(wn,e,t,o);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==a.depthLimit&&i>a.depthLimit)return void An(Sn,e,t,o);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void An(Sn,e,t,o);if(r.push(e),Array.isArray(e))for(s=0;s<e.length;s++)Mn(e[s],s,s,r,e,i,a);else{var u={},c=Object.keys(e).sort(Cn);for(s=0;s<c.length;s++){var l=c[s];Mn(e[l],l,s,r,e,i,a),u[l]=e[l]}if(void 0===o)return u;On.push([o,t,e]),o[t]=u}r.pop()}}function jn(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(Pn.length>0)for(var r=0;r<Pn.length;r++){var o=Pn[r];if(o[1]===t&&o[0]===n){n=o[2],Pn.splice(r,1);break}}return e.call(this,t,n)}}var Rn,xn="undefined"!=typeof Symbol&&Symbol,Un=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0},In="Function.prototype.bind called on incompatible ",Dn=Array.prototype.slice,Fn=Object.prototype.toString,Gn="[object Function]",Ln=function(e){var t=this;if("function"!=typeof t||Fn.call(t)!==Gn)throw new TypeError(In+t);
1for(var n,r=Dn.call(arguments,1),o=function(){if(this instanceof n){var o=t.apply(this,r.concat(Dn.call(arguments)));return Object(o)===o?o:this}return t.apply(e,r.concat(Dn.call(arguments)))},i=Math.max(0,t.length-r.length),a=[],s=0;s<i;s++)a.push("$"+s);if(n=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var u=function(){};u.prototype=t.prototype,n.prototype=new u,u.prototype=null}return n},Kn=Function.prototype.bind||Ln,Bn=Kn.call(Function.call,Object.prototype.hasOwnProperty),Hn=SyntaxError,qn=Function,zn=TypeError,Vn=function(e){try{return qn('"use strict"; return ('+e+").constructor;")()}catch(e){}},Wn=Object.getOwnPropertyDescriptor;if(Wn)try{Wn({},"")}catch(e){Wn=null}var Jn=function(){throw new zn},$n=Wn?function(){try{return Jn}catch(e){try{return Wn(arguments,"callee").get}catch(e){return Jn}}}():Jn,Qn="function"==typeof xn&&"function"==typeof Symbol&&"symbol"==typeof xn("foo")&&"symbol"==typeof Symbol("bar")&&Un(),Xn=Object.getPrototypeOf||function(e){return e.__proto__},Yn={},Zn="undefined"==typeof Uint8Array?Rn:Xn(Uint8Array),er={"%AggregateError%":"undefined"==typeof AggregateError?Rn:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?Rn:ArrayBuffer,"%ArrayIteratorPrototype%":Qn?Xn([][Symbol.iterator]()):Rn,"%AsyncFromSyncIteratorPrototype%":Rn,"%AsyncFunction%":Yn,"%AsyncGenerator%":Yn,"%AsyncGeneratorFunction%":Yn,"%AsyncIteratorPrototype%":Yn,"%Atomics%":"undefined"==typeof Atomics?Rn:Atomics,"%BigInt%":"undefined"==typeof BigInt?Rn:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?Rn:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?Rn:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?Rn:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?Rn:FinalizationRegistry,"%Function%":qn,"%GeneratorFunction%":Yn,"%Int8Array%":"undefined"==typeof Int8Array?Rn:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?Rn:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?Rn:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
1IteratorPrototype%":Qn?Xn(Xn([][Symbol.iterator]())):Rn,"%JSON%":"object"==typeof JSON?JSON:Rn,"%Map%":"undefined"==typeof Map?Rn:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&Qn?Xn((new Map)[Symbol.iterator]()):Rn,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?Rn:Promise,"%Proxy%":"undefined"==typeof Proxy?Rn:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?Rn:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?Rn:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&Qn?Xn((new Set)[Symbol.iterator]()):Rn,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?Rn:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Qn?Xn(""[Symbol.iterator]()):Rn,"%Symbol%":Qn?Symbol:Rn,"%SyntaxError%":Hn,"%ThrowTypeError%":$n,"%TypedArray%":Zn,"%TypeError%":zn,"%Uint8Array%":"undefined"==typeof Uint8Array?Rn:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?Rn:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?Rn:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?Rn:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?Rn:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?Rn:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?Rn:WeakSet},tr=function e(t){var n;if("%AsyncFunction%"===t)n=Vn("async function () {}");else if("%GeneratorFunction%"===t)n=Vn("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=Vn("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(n=Xn(o.prototype))}return er[t]=n,n},nr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},rr=Kn,or=Bn,ir=rr.call(Function.call,Array.prototype.concat),ar=rr.call(Function.apply,Array.prototype.splice),sr=rr.call(Function.call,String.prototype.replace),ur=rr.call(Function.call,String.prototype.slice),cr=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,lr=/\\(\\)?/g,pr=function(e){var t=ur(e,0,1),n=ur(e,-1);if("%"===t&&"%"!==n)throw new Hn("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new Hn("invalid intrinsic syntax, expected opening `%`");var r=[];return sr(e,cr,(function(e,t,n,o){r[r.length]=n?sr(o,lr,"$1"):t||e})),r},hr=function(e,t){var n,r=e;if(or(nr,r)&&(r="%"+(n=nr[r])[0]+"%"),or(er,r)){var o=er[r];if(o===Yn&&(o=tr(r)),void 0===o&&!t)throw new zn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new Hn("intrinsic "+e+" does not exist!")},fr=function(e,t){if("string"!=typeof e||0===e.length)throw new zn("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new zn('"allowMissing" argument must be a boolean');var n=pr(e),r=n.length>0?n[0]:"",o=hr("%"+r+"%",t),i=o.name,a=o.value,s=!1,u=o.alias;u&&(r=u[0],ar(n,ir([0,1],u)));for(var c=1,l=!0;c<n.length;c+=1){var p=n[c],h=ur(p,0,1),f=ur(p,-1);if(('"'===h||"'"===h||"`"===h||'"'===f||"'"===f||"`"===f)&&h!==f)throw new Hn("property names with quotes must have matching quotes");if("constructor"!==p&&l||(s=!0),or(er,i="%"+(r+="."+p)+"%"))a=er[i];
vendor: 5,409 bytes, line 1
1else if(null!=a){if(!(p in a)){if(!t)throw new zn("base intrinsic for "+e+" exists, but the property is not available.");return}if(Wn&&c+1>=n.length){var d=Wn(a,p);a=(l=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[p]}else l=or(a,p),a=a[p];l&&!s&&(er[i]=a)}}return a},dr={exports:{}};!function(e){var t=Kn,n=fr,r=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),i=n("%Reflect.apply%",!0)||t.call(o,r),a=n("%Object.getOwnPropertyDescriptor%",!0),s=n("%Object.defineProperty%",!0),u=n("%Math.max%");if(s)try{s({},"a",{value:1})}catch(e){s=null}e.exports=function(e){var n=i(t,o,arguments);return a&&s&&a(n,"length").configurable&&s(n,"length",{value:1+u(0,e.length-(arguments.length-1))}),n};var c=function(){return i(t,r,arguments)};s?s(e.exports,"apply",{value:c}):e.exports.apply=c}(dr);var yr=fr,gr=dr.exports,mr=gr(yr("String.prototype.indexOf")),vr=h(Object.freeze({__proto__:null,default:{}})),br="function"==typeof Map&&Map.prototype,_r=Object.getOwnPropertyDescriptor&&br?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Sr=br&&_r&&"function"==typeof _r.get?_r.get:null,wr=br&&Map.prototype.forEach,Or="function"==typeof Set&&Set.prototype,Pr=Object.getOwnPropertyDescriptor&&Or?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Er=Or&&Pr&&"function"==typeof Pr.get?Pr.get:null,Tr=Or&&Set.prototype.forEach,Ar="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,kr="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Cr="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Nr=Boolean.prototype.valueOf,Mr=Object.prototype.toString,jr=Function.prototype.toString,Rr=String.prototype.match,xr=String.prototype.slice,Ur=String.prototype.replace,Ir=String.prototype.toUpperCase,Dr=String.prototype.toLowerCase,Fr=RegExp.prototype.test,Gr=Array.prototype.concat,Lr=Array.prototype.join,Kr=Array.prototype.slice,Br=Math.floor,Hr="function"==typeof BigInt?BigInt.prototype.valueOf:null,qr=Object.getOwnPropertySymbols,zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Vr="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Wr="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,Jr=Object.prototype.propertyIsEnumerable,$r=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Qr(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||Fr.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var r=e<0?-Br(-e):Br(e);if(r!==e){var o=String(r),i=xr.call(t,o.length+1);return Ur.call(o,n,"$&_")+"."+Ur.call(Ur.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ur.call(t,n,"$&_")}var Xr=vr,Yr=Xr.custom,Zr=oo(Yr)?Yr:null;function eo(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}function to(e){return Ur.call(String(e),/"/g,"&quot;")}function no(e){return!("[object Array]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}function ro(e){return!("[object RegExp]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}function oo(e){if(Vr)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!zr)return!1;try{return zr.call(e),!0}catch(e){}return!1}var io=Object.prototype.hasOwnProperty||function(e){return e in this};function ao(e,t){return io.call(e,t)}function so(e){return Mr.call(e)}function uo(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function co(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return co(xr.call(e,0,t.maxStringLength),t)+r}return eo(Ur.call(Ur.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lo),"single",t)}function lo(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+Ir.call(t.toString(16))}function po(e){return"Object("+e+")"}function ho(e){return e+" { ? }"}function fo(e,t,n,r){return e+" ("+t+") {"+(r?yo(n,r):Lr.call(n,", "))+"}"}function yo(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return n+Lr.call(e,","+n)+"\n"+t.prev}function go(e,t){var n=no(e),r=[];if(n){r.length=e.length;for(var o=0;o<e.length;o++)r[o]=ao(e,o)?t(e[o],e):""}var i,a="function"==typeof qr?qr(e):[];if(Vr){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var u in e)ao(e,u)&&(n&&String(Number(u))===u&&u<e.length||Vr&&i["$"+u]instanceof Symbol||(Fr.call(/[^\w$]/,u)?r.push(t(u,e)+": "+t(e[u],e)):r.push(u+": "+t(e[u],e))));if("function"==typeof qr)for(var c=0;c<a.length;c++)Jr.call(e,a[c])&&r.push("["+t(a[c])+"]: "+t(e[a[c]],e));return r}var mo=fr,vo=function(e,t){var n=yr(e,!!t);return"function"==typeof n&&mr(e,".prototype.")>-1?gr(n):n},bo=function e(t,n,r,o){var i=n||{};if(ao(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ao(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!ao(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
vendor: 10,985 bytes, line 1
1if(ao(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ao(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=i.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return co(t,i);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var u=String(t);return s?Qr(t,u):u}if("bigint"==typeof t){var c=String(t)+"n";return s?Qr(t,c):c}var l=void 0===i.depth?5:i.depth;if(void 0===r&&(r=0),r>=l&&l>0&&"object"==typeof t)return no(t)?"[Array]":"[Object]";var h=function(e,t){var n;if("\t"===e.indent)n="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;n=Lr.call(Array(e.indent+1)," ")}return{base:n,prev:Lr.call(Array(t+1),n)}}(i,r);if(void 0===o)o=[];else if(uo(o,t)>=0)return"[Circular]";function f(t,n,a){if(n&&(o=Kr.call(o)).push(n),a){var s={depth:i.depth};return ao(i,"quoteStyle")&&(s.quoteStyle=i.quoteStyle),e(t,s,r+1,o)}return e(t,i,r+1,o)}if("function"==typeof t&&!ro(t)){var d=function(e){if(e.name)return e.name;var t=Rr.call(jr.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),y=go(t,f);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(y.length>0?" { "+Lr.call(y,", ")+" }":"")}if(oo(t)){var g=Vr?Ur.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):zr.call(t);return"object"!=typeof t||Vr?g:po(g)}if(function(e){return!(!e||"object"!=typeof e)&&("undefined"!=typeof HTMLElement&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(t)){for(var m="<"+Dr.call(String(t.nodeName)),v=t.attributes||[],b=0;b<v.length;b++)m+=" "+v[b].name+"="+eo(to(v[b].value),"double",i);return m+=">",t.childNodes&&t.childNodes.length&&(m+="..."),m+"</"+Dr.call(String(t.nodeName))+">"}if(no(t)){if(0===t.length)return"[]";var _=go(t,f);return h&&!function(e){for(var t=0;t<e.length;t++)if(uo(e[t],"\n")>=0)return!1;return!0}(_)?"["+yo(_,h)+"]":"[ "+Lr.call(_,", ")+" ]"}if(function(e){return!("[object Error]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}(t)){var S=go(t,f);return"cause"in Error.prototype||!("cause"in t)||Jr.call(t,"cause")?0===S.length?"["+String(t)+"]":"{ ["+String(t)+"] "+Lr.call(S,", ")+" }":"{ ["+String(t)+"] "+Lr.call(Gr.call("[cause]: "+f(t.cause),S),", ")+" }"}if("object"==typeof t&&a){if(Zr&&"function"==typeof t[Zr]&&Xr)return Xr(t,{depth:l-r});if("symbol"!==a&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!Sr||!e||"object"!=typeof e)return!1;try{Sr.call(e);try{Er.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var w=[];return wr&&wr.call(t,(function(e,n){w.push(f(n,t,!0)+" => "+f(e,t))})),fo("Map",Sr.call(t),w,h)}if(function(e){if(!Er||!e||"object"!=typeof e)return!1;try{Er.call(e);try{Sr.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var O=[];return Tr&&Tr.call(t,(function(e){O.push(f(e,t))})),fo("Set",Er.call(t),O,h)}if(function(e){if(!Ar||!e||"object"!=typeof e)return!1;try{Ar.call(e,Ar);try{kr.call(e,kr)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return ho("WeakMap");if(function(e){if(!kr||!e||"object"!=typeof e)return!1;try{kr.call(e,kr);try{Ar.call(e,Ar)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return ho("WeakSet");if(function(e){if(!Cr||!e||"object"!=typeof e)return!1;try{return Cr.call(e),!0}catch(e){}return!1}(t))return ho("WeakRef");if(function(e){return!("[object Number]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}(t))return po(f(Number(t)));if(function(e){if(!e||"object"!=typeof e||!Hr)return!1;try{return Hr.call(e),!0}catch(e){}return!1}(t))return po(f(Hr.call(t)));if(function(e){return!("[object Boolean]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}(t))return po(Nr.call(t));if(function(e){return!("[object String]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}(t))return po(f(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===p)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==so(e)||Wr&&"object"==typeof e&&Wr in e)}(t)&&!ro(t)){var P=go(t,f),E=$r?$r(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",A=!E&&Wr&&Object(t)===t&&Wr in t?xr.call(so(t),8,-1):T?"Object":"",k=(E||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(A||T?"["+Lr.call(Gr.call([],A||[],T||[]),": ")+"] ":"");return 0===P.length?k+"{}":h?k+"{"+yo(P,h)+"}":k+"{ "+Lr.call(P,", ")+" }"}return String(t)},_o=mo("%TypeError%"),So=mo("%WeakMap%",!0),wo=mo("%Map%",!0),Oo=vo("WeakMap.prototype.get",!0),Po=vo("WeakMap.prototype.set",!0),Eo=vo("WeakMap.prototype.has",!0),To=vo("Map.prototype.get",!0),Ao=vo("Map.prototype.set",!0),ko=vo("Map.prototype.has",!0),Co=function(e,t){for(var n,r=e;null!==(n=r.next);r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},No=String.prototype.replace,Mo=/%20/g,jo="RFC3986",Ro={default:jo,formatters:{RFC1738:function(e){return No.call(e,Mo,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:jo},xo=Ro,Uo=Object.prototype.hasOwnProperty,Io=Array.isArray,Do=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Fo=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},Go={arrayToObject:Fo,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var o=t[r],i=o.obj[o.prop],a=Object.keys(i),s=0;s<a.length;++s){var u=a[s],c=i[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:i,prop:u}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Io(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n,r,o){if(0===e.length)return e;var i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===n)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var a="",s=0;s<i.length;++s){var u=i.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===xo.RFC1738&&(40===u||41===u)?a+=i.charAt(s):u<128?a+=Do[u]:u<2048?a+=Do[192|u>>6]+Do[128|63&u]:u<55296||u>=57344?a+=Do[224|u>>12]+Do[128|u>>6&63]+Do[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&i.charCodeAt(s)),a+=Do[240|u>>18]+Do[128|u>>12&63]+Do[128|u>>6&63]+Do[128|63&u])}return a},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(Io(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(Io(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!Uo.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var o=t;return Io(t)&&!Io(n)&&(o=Fo(t,r)),Io(t)&&Io(n)?(n.forEach((function(n,o){if(Uo.call(t,o)){var i=t[o];i&&"object"==typeof i&&n&&"object"==typeof n?t[o]=e(i,n,r):t.push(n)}else t[o]=n})),t):Object.keys(n).reduce((function(t,o){var i=n[o];return Uo.call(t,o)?t[o]=e(t[o],i,r):t[o]=i,t}),o)}},Lo=function(){var e,t,n,r={assert:function(e){if(!r.has(e))throw new _o("Side channel does not contain "+bo(e))},get:function(r){if(So&&r&&("object"==typeof r||"function"==typeof r)){if(e)return Oo(e,r)}else if(wo){if(t)return To(t,r)}else if(n)return function(e,t){var n=Co(e,t);return n&&n.value}(n,r)},has:function(r){if(So&&r&&("object"==typeof r||"function"==typeof r)){if(e)return Eo(e,r)}else if(wo){if(t)return ko(t,r)}else if(n)return function(e,t){return!!Co(e,t)}(n,r);return!1},set:function(r,o){So&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new So),Po(e,r,o)):wo?(t||(t=new wo),Ao(t,r,o)):(n||(n={key:{},next:null}),function(e,t,n){var r=Co(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}}(n,r,o))}};return r},Ko=Go,Bo=Ro,Ho=Object.prototype.hasOwnProperty,qo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},zo=Array.isArray,Vo=Array.prototype.push,Wo=function(e,t){Vo.apply(e,zo(t)?t:[t])},Jo=Date.prototype.toISOString,$o=Bo.default,Qo={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ko.encode,encodeValuesOnly:!1,format:$o,formatter:Bo.formatters[$o],indices:!1,serializeDate:function(e){return Jo.call(e)},skipNulls:!1,strictNullHandling:!1},Xo={},Yo=function e(t,n,r,o,i,a,s,u,c,l,p,h,f,d,y,g){for(var m,v=t,b=g,_=0,S=!1;void 0!==(b=b.get(Xo))&&!S;){var w=b.get(t);if(_+=1,void 0!==w){if(w===_)throw new RangeError("Cyclic object value");S=!0}void 0===b.get(Xo)&&(_=0)}if("function"==typeof u?v=u(n,v):v instanceof Date?v=p(v):"comma"===r&&zo(v)&&(v=Ko.maybeMap(v,(function(e){return e instanceof Date?p(e):e}))),null===v){if(i)return s&&!d?s(n,Qo.encoder,y,"key",h):n;v=""}if("string"==typeof(m=v)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||Ko.isBuffer(v))return s?[f(d?n:s(n,Qo.encoder,y,"key",h))+"="+f(s(v,Qo.encoder,y,"value",h))]:[f(n)+"="+f(String(v))];var O,P=[];if(void 0===v)return P;if("comma"===r&&zo(v))d&&s&&(v=Ko.maybeMap(v,s)),O=[{value:v.length>0?v.join(",")||null:void 0}];else if(zo(u))O=u;else{var E=Object.keys(v);O=c?E.sort(c):E}for(var T=o&&zo(v)&&1===v.length?n+"[]":n,A=0;A<O.length;++A){var k=O[A],C="object"==typeof k&&void 0!==k.value?k.value:v[k];if(!a||null!==C){var N=zo(v)?"function"==typeof r?r(T,k):T:T+(l?"."+k:"["+k+"]");g.set(t,_);var M=Lo();M.set(Xo,g),Wo(P,e(C,N,r,o,i,a,"comma"===r&&d&&zo(v)?null:s,u,c,l,p,h,f,d,y,M))}}return P},Zo=Go,ei=Object.prototype.hasOwnProperty,ti=Array.isArray,ni={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Zo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ri=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},oi=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},ii=function(e,t,n,r){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=n.depth>0&&/(\[[^[\]]*])/.exec(o),s=a?o.slice(0,a.index):o,u=[];
vendor: 6,223 bytes, line 1
1if(s){if(!n.plainObjects&&ei.call(Object.prototype,s)&&!n.allowPrototypes)return;u.push(s)}for(var c=0;n.depth>0&&null!==(a=i.exec(o))&&c<n.depth;){if(c+=1,!n.plainObjects&&ei.call(Object.prototype,a[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+o.slice(a.index)+"]"),function(e,t,n,r){for(var o=r?t:oi(t,n),i=e.length-1;i>=0;--i){var a,s=e[i];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var u="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&s!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(a=[])[c]=o:"__proto__"!==u&&(a[u]=o):a={0:o}}o=a}return o}(u,t,n,r)}},ai=function(e,t){var n,r=e,o=function(e){if(!e)return Qo;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||Qo.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Bo.default;if(void 0!==e.format){if(!Ho.call(Bo.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=Bo.formatters[n],o=Qo.filter;return("function"==typeof e.filter||zo(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:Qo.addQueryPrefix,allowDots:void 0===e.allowDots?Qo.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:Qo.charsetSentinel,delimiter:void 0===e.delimiter?Qo.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:Qo.encode,encoder:"function"==typeof e.encoder?e.encoder:Qo.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:Qo.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:Qo.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:Qo.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:Qo.strictNullHandling}}(t);"function"==typeof o.filter?r=(0,o.filter)("",r):zo(o.filter)&&(n=o.filter);var i,a=[];if("object"!=typeof r||null===r)return"";i=t&&t.arrayFormat in qo?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var s=qo[i];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u="comma"===s&&t&&t.commaRoundTrip;n||(n=Object.keys(r)),o.sort&&n.sort(o.sort);for(var c=Lo(),l=0;l<n.length;++l){var p=n[l];o.skipNulls&&null===r[p]||Wo(a,Yo(r[p],p,s,u,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,c))}var h=a.join(o.delimiter),f=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),h.length>0?f+h:""},si={formats:Ro,parse:function(e,t){var n=function(e){if(!e)return ni;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?ni.charset:e.charset;return{allowDots:void 0===e.allowDots?ni.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:ni.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:ni.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:ni.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ni.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:ni.comma,decoder:"function"==typeof e.decoder?e.decoder:ni.decoder,delimiter:"string"==typeof e.delimiter||Zo.isRegExp(e.delimiter)?e.delimiter:ni.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:ni.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:ni.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:ni.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:ni.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ni.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var r="string"==typeof e?function(e,t){var n,r={__proto__:null},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=o.split(t.delimiter,i),s=-1,u=t.charset;if(t.charsetSentinel)for(n=0;n<a.length;++n)0===a[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[n]?u="utf-8":"utf8=%26%2310003%3B"===a[n]&&(u="iso-8859-1"),s=n,n=a.length);for(n=0;n<a.length;++n)if(n!==s){var c,l,p=a[n],h=p.indexOf("]="),f=-1===h?p.indexOf("="):h+1;-1===f?(c=t.decoder(p,ni.decoder,u,"key"),l=t.strictNullHandling?null:""):(c=t.decoder(p.slice(0,f),ni.decoder,u,"key"),l=Zo.maybeMap(oi(p.slice(f+1),t),(function(e){return t.decoder(e,ni.decoder,u,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===u&&(l=ri(l)),p.indexOf("[]=")>-1&&(l=ti(l)?[l]:l),ei.call(r,c)?r[c]=Zo.combine(r[c],l):r[c]=l}return r}(e,n):e,o=n.plainObjects?Object.create(null):{},i=Object.keys(r),a=0;a<i.length;++a){var s=i[a],u=ii(s,r[s],n,"string"==typeof e);o=Zo.merge(o,u,n)}return!0===n.allowSparse?o:Zo.compact(o)},stringify:ai},ui={};!function(e){function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}
vendor: 3,595 bytes, line 1
1}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.type=e=>e.split(/ *; */).shift(),e.params=e=>{const n={};var r,o=t(e.split(/ *; */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *= */),t=e.shift(),o=e.shift();t&&o&&(n[t]=o)}}catch(e){o.e(e)}finally{o.f()}return n},e.parseLinks=e=>{const n={};var r,o=t(e.split(/ *, */));try{for(o.s();!(r=o.n()).done;){const e=r.value.split(/ *; */),t=e[0].slice(1,-1);n[e[1].split(/ *= */)[1].slice(1,-1)]=t}}catch(e){o.e(e)}finally{o.f()}return n},e.cleanHeader=(e,t)=>(delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e),e.isObject=e=>null!==e&&"object"==typeof e,e.hasOwn=Object.hasOwn||function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(e),t)},e.mixin=(t,n)=>{for(const r in n)e.hasOwn(n,r)&&(t[r]=n[r])}}(ui);const ci=vr,li=ui.isObject,pi=ui.hasOwn;var hi=fi;function fi(){}fi.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},fi.prototype.parse=function(e){return this._parser=e,this},fi.prototype.responseType=function(e){return this._responseType=e,this},fi.prototype.serialize=function(e){return this._serializer=e,this},fi.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(const t in e)if(pi(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},fi.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};const di=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),yi=new Set([408,413,429,500,502,503,504,521,522,524]);fi.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{const n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&yi.has(t.status))return!0;if(e){if(e.code&&di.has(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},fi.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},fi.prototype.then=function(e,t){if(!this._fullfilledPromise){const e=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(((t,n)=>{e.on("abort",(()=>{if(this._maxRetries&&this._maxRetries>this._retries)return;if(this.timedout&&this.timedoutError)return void n(this.timedoutError);const e=new Error("Aborted");
1e.code="ABORTED",e.status=this.status,e.method=this.method,e.url=this.url,n(e)})),e.end(((e,r)=>{e?n(e):t(r)}))}))}return this._fullfilledPromise.then(e,t)},fi.prototype.catch=function(e){return this.then(void 0,e)},fi.prototype.use=function(e){return e(this),this},fi.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},fi.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},fi.prototype.get=function(e){return this._header[e.toLowerCase()]},fi.prototype.getHeader=fi.prototype.get,fi.prototype.set=function(e,t){if(li(e)){for(const t in e)pi(e,t)&&this.set(t,e[t]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},fi.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},fi.prototype.field=function(e,t,n){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(li(e)){for(const t in e)pi(e,t)&&this.field(t,e[t]);return this}if(Array.isArray(t)){for(const n in t)pi(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),n?this._getFormData().append(e,t,n):this._getFormData().append(e,t),this},fi.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(ci.gte(r.version,"v13.0.0")&&ci.lt(r.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},fi.prototype._auth=function(e,t,n,r){switch(n.type){case"basic":this.set("Authorization",`Basic ${r(`${e}:${t}`)}`);break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization",`Bearer ${e}`)}return this},fi.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},fi.prototype.redirects=function(e){return this._maxRedirects=e,this},fi.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},fi.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},fi.prototype.send=function(e){const t=li(e);let n=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&li(this._data))for(const r in e){if("bigint"==typeof e[r]&&!e[r].toJSON)throw new Error("Cannot serialize BigInt value to json");pi(e,r)&&(this._data[r]=e[r])}else{if("bigint"==typeof e)throw new Error("Cannot send value of type BigInt");"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],n&&(n=n.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===n?this._data?`${this._data}&${e}`:e:(this._data||"")+e):this._data=e}return!t||this._isHost(e)||n||this.type("json"),this},fi.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},fi.prototype._finalizeQueryString=function(){const e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){const e=this.url.indexOf("?");if(e>=0){const t=this.url.slice(e+1).split("&");"function"==typeof this._sort?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}},fi.prototype._appendQueryString=()=>{console.warn("Unsupported")},fi.prototype._timeoutError=function(e,t,n){if(this._aborted)return;const r=new Error(`${e+t}ms exceeded`);r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.timedoutError=r,this.abort(),this.callback(r)},fi.prototype._setTimeouts=function(){const e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((()=>{e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((()=>{e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};const gi=ui;var mi=vi;function vi(){}function bi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];
1if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return _i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Si(){this._defaults=[]}vi.prototype.get=function(e){return this.header[e.toLowerCase()]},vi.prototype._setHeaderProperties=function(e){const t=e["content-type"]||"";this.type=gi.type(t);const n=gi.params(t);for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(this[r]=n[r]);this.links={};try{e.link&&(this.links=gi.parseLinks(e.link))}catch(e){}},vi.prototype._setStatusProperties=function(e){const t=Math.trunc(e/100);this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e};for(var wi=0,Oi=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];wi<Oi.length;wi++){const e=Oi[wi];Si.prototype[e]=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this._defaults.push({fn:e,args:n}),this}}Si.prototype._setDefaults=function(e){var t,n=bi(this._defaults);try{for(n.s();!(t=n.n()).done;){const n=t.value;e[n.fn](...n.args)}}catch(e){n.e(e)}finally{n.f()}};var Pi=Si;!function(e,t){function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}let o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;const i=bn.exports,a=_n,s=si,u=hi,c=ui.isObject,l=ui.mixin,p=ui.hasOwn,h=mi,f=Pi;function d(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};const y=t=e.exports;t.Request=w,y.getXHR=()=>{if(o.XMLHttpRequest)return new o.XMLHttpRequest;throw new Error("Browser-only version of superagent could not find XHR")};const g="".trim?e=>e.trim():e=>e.replace(/(^\s*|\s*$)/g,"");function m(e){if(!c(e))return e;const t=[];for(const n in e)p(e,n)&&v(t,n,e[n]);return t.join("&")}function v(e,t,r){if(void 0!==r)if(null!==r)if(Array.isArray(r)){var o,i=n(r);try{for(i.s();!(o=i.n()).done;)v(e,t,o.value)}catch(e){i.e(e)}finally{i.f()}}else if(c(r))for(const n in r)p(r,n)&&v(e,`${t}[${n}]`,r[n]);else e.push(encodeURI(t)+"="+encodeURIComponent(r));else e.push(encodeURI(t))}function b(e){const t={},n=e.split("&");let r,o;for(let i=0,a=n.length;i<a;
vendor: 6,104 bytes, line 1
1++i)r=n[i],o=r.indexOf("="),-1===o?t[decodeURIComponent(r)]="":t[decodeURIComponent(r.slice(0,o))]=decodeURIComponent(r.slice(o+1));return t}function _(e){return/[/+]json($|[^-\w])/i.test(e)}function S(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;let t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){const t=e.split(/\r?\n/),n={};let r,o,i,a;for(let s=0,u=t.length;s<u;++s)o=t[s],r=o.indexOf(":"),-1!==r&&(i=o.slice(0,r).toLowerCase(),a=g(o.slice(r+1)),n[i]=a);return n}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(e,t){const n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(()=>{let e,t=null,r=null;try{r=new S(n)}catch(e){return t=new Error("Parser is unable to parse the response"),t.parse=!0,t.original=e,n.xhr?(t.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,t.status=n.xhr.status?n.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),n.callback(t)}n.emit("response",r);try{n._isResponseOK(r)||(e=new Error(r.statusText||r.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=r,e.status=e.status||r.status,n.callback(e,r)):n.callback(null,r)}))}y.serializeObject=m,y.parseString=b,y.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},y.serialize={"application/x-www-form-urlencoded":s.stringify,"application/json":a},y.parse={"application/x-www-form-urlencoded":b,"application/json":JSON.parse},l(S.prototype,h.prototype),S.prototype._parseBody=function(e){let t=y.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&_(this.type)&&(t=y.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},S.prototype.toError=function(){const e=this.req,t=e.method,n=e.url,r=`cannot ${t} ${n} (${this.status})`,o=new Error(r);return o.status=this.status,o.method=t,o.url=n,o},y.Response=S,i(w.prototype),l(w.prototype,u.prototype),w.prototype.type=function(e){return this.set("Content-Type",y.types[e]||e),this},w.prototype.accept=function(e){return this.set("Accept",y.types[e]||e),this},w.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"==typeof t&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});const r=n.encoder?n.encoder:e=>{if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,r)},w.prototype.query=function(e){return"string"!=typeof e&&(e=m(e)),e&&this._query.push(e),this},w.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},w.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();const n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},w.prototype.crossDomainError=function(){const e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=()=>{throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},w.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||d,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){const e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((()=>{e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));const e=this;this.xhr=y.getXHR();const t=this.xhr;let n=this._formData||this._data;this._setTimeouts(),t.addEventListener("readystatechange",(()=>{const n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4!==n)return;let r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}));const r=(t,n)=>{n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){const e=this._header["content-type"];let t=this._serializer||y.serialize[e?e.split(";")[0]:""];
1!t&&_(e)&&(t=y.serialize["application/json"]),t&&(n=t(n))}for(const o in this.header)null!==this.header[o]&&p(this.header,o)&&t.setRequestHeader(o,this.header[o]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},y.agent=()=>new f;for(var O=0,P=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];O<P.length;O++){const e=P[O];f.prototype[e.toLowerCase()]=function(t,n){const r=new y.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}function E(e,t,n){const r=y("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}f.prototype.del=f.prototype.delete,y.get=(e,t,n)=>{const r=y("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},y.head=(e,t,n)=>{const r=y("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},y.options=(e,t,n)=>{const r=y("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},y.del=E,y.delete=E,y.patch=(e,t,n)=>{const r=y("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},y.post=(e,t,n)=>{const r=y("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},y.put=(e,t,n)=>{const r=y("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}}(vn,vn.exports);var Ei=vn.exports;function Ti(e){var t=(new Date).getTime(),n=(new Date).toISOString(),r=console&&console.log?console:window&&window.console&&window.console.log?window.console:console;r.log("<<<<<"),r.log("[".concat(n,"]"),"\n",e.url,"\n",e.qs),r.log("-----"),e.on("response",(function(n){var o=(new Date).getTime()-t,i=(new Date).toISOString();r.log(">>>>>>"),r.log("[".concat(i," / ").concat(o,"]"),"\n",e.url,"\n",e.qs,"\n",n.text),r.log("-----")}))}function Ai(e,t,n){var r=this;this._config.logVerbosity&&(e=e.use(Ti)),this._config.proxy&&this._modules.proxy&&(e=this._modules.proxy.call(this,e)),this._config.keepAlive&&this._modules.keepAlive&&(e=this._modules.keepAlive(e));var o=e;if(t.abortSignal)var i=t.abortSignal.subscribe((function(){o.abort(),i()}));return!0===t.forceBuffered?o="undefined"==typeof Blob?o.buffer().responseType("arraybuffer"):o.responseType("arraybuffer"):!1===t.forceBuffered&&(o=o.buffer(!1)),(o=o.timeout(t.timeout)).on("abort",(function(){return n({category:U.PNUnknownCategory,error:!0,operation:t.operation,errorData:new Error("Aborted")},null)})),o.end((function(e,o){var i,a={};if(a.error=null!==e,a.operation=t.operation,o&&o.status&&(a.statusCode=o.status),e){if(e.response&&e.response.text&&!r._config.logVerbosity)try{a.errorData=JSON.parse(e.response.text)}catch(t){a.errorData=e}else a.errorData=e;return a.category=r._detectErrorCategory(e),n(a,null)}if(t.ignoreBody)i={headers:o.headers,redirects:o.redirects,response:o};else try{i=JSON.parse(o.text)}catch(e){return a.errorData=o,a.error=!0,n(a,null)}return i.error&&1===i.error&&i.status&&i.message&&i.service?(a.errorData=i,a.statusCode=i.status,a.error=!0,a.category=r._detectErrorCategory(a),n(a,null)):(i.error&&i.error.message&&(a.errorData=i.error),n(a,i))})),o}function ki(e,t,n){return a(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:return r=Ei.post(e),t.forEach((function(e){var t=e.key,n=e.value;r=r.field(t,n)})),r.attach("file",n,{contentType:"application/octet-stream"}),[4,r];case 1:return[2,o.sent()]}}))}))}function Ci(e,t,n){var r=Ei.get(this.getStandardOrigin()+t.url).set(t.headers).query(e);return Ai.call(this,r,t,n)}function Ni(e,t,n){var r=Ei.get(this.getStandardOrigin()+t.url).set(t.headers).query(e);return Ai.call(this,r,t,n)}function Mi(e,t,n,r){var o=Ei.post(this.getStandardOrigin()+n.url).query(e).set(n.headers).send(t);return Ai.call(this,o,n,r)}function ji(e,t,n,r){var o=Ei.patch(this.getStandardOrigin()+n.url).query(e).set(n.headers).send(t);return Ai.call(this,o,n,r)}function Ri(e,t,n){var r=Ei.delete(this.getStandardOrigin()+t.url).set(t.headers).query(e);return Ai.call(this,r,t,n)}function xi(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer}var Ui,Ii=function(){function e(){}return Object.defineProperty(e.prototype,"algo",{get:function(){return"aes-256-cbc"}
1,enumerable:!1,configurable:!0}),e.prototype.encrypt=function(e,t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.getKey(e)];case 1:if(n=r.sent(),t instanceof ArrayBuffer)return[2,this.encryptArrayBuffer(n,t)];if("string"==typeof t)return[2,this.encryptString(n,t)];throw new Error("Cannot encrypt this file. In browsers file encryption supports only string or ArrayBuffer")}}))}))},e.prototype.decrypt=function(e,t){return a(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,this.getKey(e)];case 1:if(n=r.sent(),t instanceof ArrayBuffer)return[2,this.decryptArrayBuffer(n,t)];if("string"==typeof t)return[2,this.decryptString(n,t)];throw new Error("Cannot decrypt this file. In browsers file decryption supports only string or ArrayBuffer")}}))}))},e.prototype.encryptFile=function(e,t,n){return a(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(a){switch(a.label){case 0:if(t.data.byteLength<=0)throw new Error("encryption error. empty content");return[4,this.getKey(e)];case 1:return r=a.sent(),[4,t.data.arrayBuffer()];case 2:return o=a.sent(),[4,this.encryptArrayBuffer(r,o)];case 3:return i=a.sent(),[2,n.create({name:t.name,mimeType:"application/octet-stream",data:i})]}}))}))},e.prototype.decryptFile=function(e,t,n){return a(this,void 0,void 0,(function(){var r,o,i;return s(this,(function(a){switch(a.label){case 0:return[4,this.getKey(e)];case 1:return r=a.sent(),[4,t.data.arrayBuffer()];case 2:return o=a.sent(),[4,this.decryptArrayBuffer(r,o)];case 3:return i=a.sent(),[2,n.create({name:t.name,data:i})]}}))}))},e.prototype.getKey=function(t){return a(this,void 0,void 0,(function(){var n,r,o;return s(this,(function(i){switch(i.label){case 0:return[4,crypto.subtle.digest("SHA-256",e.encoder.encode(t))];case 1:return n=i.sent(),r=Array.from(new Uint8Array(n)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""),o=e.encoder.encode(r.slice(0,32)).buffer,[2,crypto.subtle.importKey("raw",o,"AES-CBC",!0,["encrypt","decrypt"])]}}))}))},e.prototype.encryptArrayBuffer=function(e,t){return a(this,void 0,void 0,(function(){var n,r,o;return s(this,(function(i){switch(i.label){case 0:return n=crypto.getRandomValues(new Uint8Array(16)),r=xi,o=[n.buffer],[4,crypto.subtle.encrypt({name:"AES-CBC",iv:n},e,t)];case 1:return[2,r.apply(void 0,o.concat([i.sent()]))]}}))}))},e.prototype.decryptArrayBuffer=function(t,n){return a(this,void 0,void 0,(function(){var r;return s(this,(function(o){switch(o.label){case 0:if(r=n.slice(0,16),n.slice(e.IV_LENGTH).byteLength<=0)throw new Error("decryption error: empty content");return[4,crypto.subtle.decrypt({name:"AES-CBC",iv:r},t,n.slice(e.IV_LENGTH))];case 1:return[2,o.sent()]}}))}))},e.prototype.encryptString=function(t,n){return a(this,void 0,void 0,(function(){var r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return r=crypto.getRandomValues(new Uint8Array(16)),o=e.encoder.encode(n).buffer,[4,crypto.subtle.encrypt({name:"AES-CBC",iv:r},t,o)];case 1:return i=s.sent(),a=xi(r.buffer,i),[2,e.decoder.decode(a)]}}))}))},e.prototype.decryptString=function(t,n){return a(this,void 0,void 0,(function(){var r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return r=e.encoder.encode(n).buffer,o=r.slice(0,16),i=r.slice(16),[4,crypto.subtle.decrypt({name:"AES-CBC",iv:o},t,i)];case 1:return a=s.sent(),[2,e.decoder.decode(a)]}}))}))},e.IV_LENGTH=16,e.encoder=new TextEncoder,e.decoder=new TextDecoder,e}(),Di=(Ui=function(){function e(e){if(e instanceof File)this.data=e,this.name=this.data.name,this.mimeType=this.data.type;else if(e.data){var t=e.data;this.data=new File([t],e.name,{type:e.mimeType}),this.name=e.name,e.mimeType&&(this.mimeType=e.mimeType)}if(void 0===this.data)throw new Error("Couldn't construct a file out of supplied options.");if(void 0===this.name)throw new Error("Couldn't guess filename out of the options. Please provide one.")}return e.create=function(e){return new this(e)},e.prototype.toBuffer=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("This feature is only supported in Node.js environments.")}))}))}
1,e.prototype.toStream=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("This feature is only supported in Node.js environments.")}))}))},e.prototype.toFileUri=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("This feature is only supported in react native environments.")}))}))},e.prototype.toBlob=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.data]}))}))},e.prototype.toArrayBuffer=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){return[2,new Promise((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){if(r.result instanceof ArrayBuffer)return t(r.result)})),r.addEventListener("error",(function(){n(r.error)})),r.readAsArrayBuffer(e.data)}))]}))}))},e.prototype.toString=function(){return a(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){return[2,new Promise((function(t,n){var r=new FileReader;r.addEventListener("load",(function(){if("string"==typeof r.result)return t(r.result)})),r.addEventListener("error",(function(){n(r.error)})),r.readAsBinaryString(e.data)}))]}))}))},e.prototype.toFile=function(){return a(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.data]}))}))},e}(),Ui.supportsFile="undefined"!=typeof File,Ui.supportsBlob="undefined"!=typeof Blob,Ui.supportsArrayBuffer="undefined"!=typeof ArrayBuffer,Ui.supportsBuffer=!1,Ui.supportsStream=!1,Ui.supportsString=!0,Ui.supportsEncryptFile=!0,Ui.supportsFileUri=!1,Ui),Fi=function(){function e(e){this.config=e,this.cryptor=new C({config:e}),this.fileCryptor=new Ii}return Object.defineProperty(e.prototype,"identifier",{get:function(){return""},enumerable:!1,configurable:!0}),e.prototype.encrypt=function(e){var t="string"==typeof e?e:(new TextDecoder).decode(e);return{data:this.cryptor.encrypt(t),metadata:null}},e.prototype.decrypt=function(e){var t="string"==typeof e.data?e.data:_(e.data);return this.cryptor.decrypt(t)},e.prototype.encryptFile=function(e,t){var n;return a(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this.fileCryptor.encryptFile(null===(n=this.config)||void 0===n?void 0:n.cipherKey,e,t)]}))}))},e.prototype.decryptFile=function(e,t){return a(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this.fileCryptor.decryptFile(this.config.cipherKey,e,t)]}))}))},e}(),Gi=function(){function e(e){this.cipherKey=e.cipherKey,this.CryptoJS=A,this.encryptedKey=this.CryptoJS.SHA256(this.cipherKey)}return Object.defineProperty(e.prototype,"algo",{get:function(){return"AES-CBC"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return"ACRH"},enumerable:!1,configurable:!0}),e.prototype.getIv=function(){return crypto.getRandomValues(new Uint8Array(e.BLOCK_SIZE))},e.prototype.getKey=function(){return a(this,void 0,void 0,(function(){var t,n;return s(this,(function(r){switch(r.label){case 0:return t=e.encoder.encode(this.cipherKey),[4,crypto.subtle.digest("SHA-256",t.buffer)];case 1:return n=r.sent(),[2,crypto.subtle.importKey("raw",n,this.algo,!0,["encrypt","decrypt"])]}}))}))},e.prototype.encrypt=function(t){if(0===("string"==typeof t?t:e.decoder.decode(t)).length)throw new Error("encryption error. empty content");var n=this.getIv();return{metadata:n,data:b(this.CryptoJS.AES.encrypt(t,this.encryptedKey,{iv:this.bufferToWordArray(n),mode:this.CryptoJS.mode.CBC}).ciphertext.toString(this.CryptoJS.enc.Base64))}},e.prototype.decrypt=function(t){var n=this.bufferToWordArray(new Uint8ClampedArray(t.metadata)),r=this.bufferToWordArray(new Uint8ClampedArray(t.data));return e.encoder.encode(this.CryptoJS.AES.decrypt({ciphertext:r},this.encryptedKey,{iv:n,mode:this.CryptoJS.mode.CBC}).toString(this.CryptoJS.enc.Utf8)).buffer},e.prototype.encryptFileData=function(e){return a(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return[4,this.getKey()];case 1:return t=o.sent(),n=this.getIv(),r={},[4,crypto.subtle.encrypt({name:this.algo,iv:n},t,e)];case 2:return[2,(r.data=o.sent(),r.metadata=n,r)]}}))}))},e.prototype.decryptFileData=function(e){return a(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,this.getKey()];
1case 1:return t=n.sent(),[2,crypto.subtle.decrypt({name:this.algo,iv:e.metadata},t,e.data)]}}))}))},e.prototype.bufferToWordArray=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n[t/4|0]|=e[t]<<24-8*t;return this.CryptoJS.lib.WordArray.create(n,e.length)},e.BLOCK_SIZE=16,e.encoder=new TextEncoder,e.decoder=new TextDecoder,e}(),Li=function(){function e(e){var t;this.defaultCryptor=e.default,this.cryptors=null!==(t=e.cryptors)&&void 0!==t?t:[]}return e.legacyCryptoModule=function(e){var t;return new this({default:new Fi({cipherKey:e.cipherKey,useRandomIVs:null===(t=e.useRandomIVs)||void 0===t||t}),cryptors:[new Gi({cipherKey:e.cipherKey})]})},e.aesCbcCryptoModule=function(e){var t;return new this({default:new Gi({cipherKey:e.cipherKey}),cryptors:[new Fi({cipherKey:e.cipherKey,useRandomIVs:null===(t=e.useRandomIVs)||void 0===t||t})]})},e.withDefaultCryptor=function(e){return new this({default:e})},e.prototype.getAllCryptors=function(){return l([this.defaultCryptor],c(this.cryptors),!1)},e.prototype.encrypt=function(e){var t=this.defaultCryptor.encrypt(e);if(!t.metadata)return t.data;var n=this.getHeaderData(t);return this.concatArrayBuffer(n,t.data)},e.prototype.decrypt=function(e){var t="string"==typeof e?b(e):e,n=Ki.tryParse(t),r=this.getCryptor(n),o=n.length>0?t.slice(n.length-n.metadataLength,n.length):null;if(t.slice(n.length).byteLength<=0)throw new Error("decryption error. empty content");return r.decrypt({data:t.slice(n.length),metadata:o})},e.prototype.encryptFile=function(e,t){return a(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return this.defaultCryptor.identifier===Ki.LEGACY_IDENTIFIER?[2,this.defaultCryptor.encryptFile(e,t)]:[4,this.getFileData(e.data)];case 1:return n=o.sent(),[4,this.defaultCryptor.encryptFileData(n)];case 2:return r=o.sent(),[2,t.create({name:e.name,mimeType:"application/octet-stream",data:this.concatArrayBuffer(this.getHeaderData(r),r.data)})]}}))}))},e.prototype.decryptFile=function(t,n){return a(this,void 0,void 0,(function(){var r,o,i,a,u,c,l,p;return s(this,(function(s){switch(s.label){case 0:return[4,t.data.arrayBuffer()];case 1:return r=s.sent(),o=Ki.tryParse(r),(null==(i=this.getCryptor(o))?void 0:i.identifier)===e.LEGACY_IDENTIFIER?[2,i.decryptFile(t,n)]:[4,this.getFileData(r)];case 2:return a=s.sent(),u=a.slice(o.length-o.metadataLength,o.length),l=(c=n).create,p={name:t.name},[4,this.defaultCryptor.decryptFileData({data:r.slice(o.length),metadata:u})];case 3:return[2,l.apply(c,[(p.data=s.sent(),p)])]}}))}))},e.prototype.getCryptor=function(e){if(""===e){var t=this.getAllCryptors().find((function(e){return""===e.identifier}));if(t)return t;throw new Error("unknown cryptor error")}if(e instanceof Bi)return this.getCryptorFromId(e.identifier)},e.prototype.getCryptorFromId=function(e){var t=this.getAllCryptors().find((function(t){return e===t.identifier}));if(t)return t;throw Error("unknown cryptor error")},e.prototype.concatArrayBuffer=function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),n.buffer},e.prototype.getHeaderData=function(e){if(e.metadata){var t=Ki.from(this.defaultCryptor.identifier,e.metadata),n=new Uint8Array(t.length),r=0;return n.set(t.data,r),r+=t.length-e.metadata.byteLength,n.set(new Uint8Array(e.metadata),r),n.buffer}},e.prototype.getFileData=function(t){return a(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return t instanceof Blob?[4,t.arrayBuffer()]:[3,2];case 1:return[2,n.sent()];case 2:if(t instanceof ArrayBuffer)return[2,t];if("string"==typeof t)return[2,e.encoder.encode(t)];throw new Error("Cannot decrypt/encrypt file. In browsers file encrypt/decrypt supported for string, ArrayBuffer or Blob")}}))}))},e.LEGACY_IDENTIFIER="",e.encoder=new TextEncoder,e.decoder=new TextDecoder,e}(),Ki=function(){function e(){}return e.from=function(t,n){if(t!==e.LEGACY_IDENTIFIER)return new Bi(t,n.byteLength)},e.tryParse=function(t){var n=new Uint8Array(t),r="";if(n.byteLength>=4&&(r=n.slice(0,4),this.decoder.decode(r)!==e.SENTINEL))return"";if(!(n.byteLength>=5))throw new Error("decryption error. invalid header version");if(n[4]>e.MAX_VERSION)throw new Error("unknown cryptor error");var o="",i=5+e.IDENTIFIER_LENGTH;if(!(n.byteLength>=i))throw new Error("decryption error. invalid crypto identifier");o=n.slice(5,i);var a=null;if(!(n.byteLength>=i+1))throw new Error("decryption error. invalid metadata length");return a=n[i],i+=1,255===a&&n.byteLength>=i+2&&(a=new Uint16Array(n.slice(i,i+2)).reduce((function(e,t){return(e<<8)+t}),0),i+=2),new Bi(this.decoder.decode(o),a)}
1,e.SENTINEL="PNED",e.LEGACY_IDENTIFIER="",e.IDENTIFIER_LENGTH=4,e.VERSION=1,e.MAX_VERSION=1,e.decoder=new TextDecoder,e}(),Bi=function(){function e(e,t){this._identifier=e,this._metadataLength=t}return Object.defineProperty(e.prototype,"identifier",{get:function(){return this._identifier},set:function(e){this._identifier=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"metadataLength",{get:function(){return this._metadataLength},set:function(e){this._metadataLength=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return Ki.VERSION},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return Ki.SENTINEL.length+1+Ki.IDENTIFIER_LENGTH+(this.metadataLength<255?1:3)+this.metadataLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){var e=0,t=new Uint8Array(this.length),n=new TextEncoder;t.set(n.encode(Ki.SENTINEL)),t[e+=Ki.SENTINEL.length]=this.version,e++,this.identifier&&t.set(n.encode(this.identifier),e),e+=Ki.IDENTIFIER_LENGTH;var r=this.metadataLength;return r<255?t[e]=r:t.set([255,r>>8,255&r],e),t},enumerable:!1,configurable:!0}),e.IDENTIFIER_LENGTH=4,e.SENTINEL="PNED",e}();function Hi(e){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(e)}var qi=function(e){function n(t){var n=this,r=t.listenToBrowserNetworkEvents,o=void 0===r||r;return t.sdkFamily="Web",t.networking=new yn({del:Ri,get:Ni,post:Mi,patch:ji,sendBeacon:Hi,getfile:Ci,postfile:ki}),t.cbor=new mn((function(e){return gn(d.decode(e))}),b),t.PubNubFile=Di,t.cryptography=new Ii,t.initCryptoModule=function(e){return new Li({default:new Fi({cipherKey:e.cipherKey,useRandomIVs:e.useRandomIVs}),cryptors:[new Gi({cipherKey:e.cipherKey})]})},n=e.call(this,t)||this,o&&(window.addEventListener("offline",(function(){n.networkDownDetected()})),window.addEventListener("online",(function(){n.networkUpDetected()}))),n}return t(n,e),n.CryptoModule=Li,n}(dn);return qi}()}}]);

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