pusher-js 8.4.2 → 8.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.github/workflows/release.yml +5 -5
  2. package/.github/workflows/release_pr.yml +4 -4
  3. package/.github/workflows/run-tests.yml +13 -8
  4. package/CHANGELOG.md +12 -0
  5. package/dist/node/pusher.js +5715 -5673
  6. package/dist/node/pusher.js.map +1 -1
  7. package/dist/react-native/pusher.js +2 -8
  8. package/dist/react-native/pusher.js.LICENSE.txt +7 -0
  9. package/dist/react-native/pusher.js.map +1 -1
  10. package/dist/web/pusher-with-encryption.js +353 -363
  11. package/dist/web/pusher-with-encryption.js.map +1 -1
  12. package/dist/web/pusher-with-encryption.min.js +2 -8
  13. package/dist/web/pusher-with-encryption.min.js.LICENSE.txt +7 -0
  14. package/dist/web/pusher-with-encryption.min.js.map +1 -1
  15. package/dist/web/pusher.js +340 -348
  16. package/dist/web/pusher.js.map +1 -1
  17. package/dist/web/pusher.min.js +2 -8
  18. package/dist/web/pusher.min.js.LICENSE.txt +7 -0
  19. package/dist/web/pusher.min.js.map +1 -1
  20. package/dist/worker/pusher-with-encryption.worker.js +327 -337
  21. package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
  22. package/dist/worker/pusher-with-encryption.worker.min.js +2 -8
  23. package/dist/worker/pusher-with-encryption.worker.min.js.LICENSE.txt +7 -0
  24. package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
  25. package/dist/worker/pusher.worker.js +314 -322
  26. package/dist/worker/pusher.worker.js.map +1 -1
  27. package/dist/worker/pusher.worker.min.js +2 -8
  28. package/dist/worker/pusher.worker.min.js.LICENSE.txt +7 -0
  29. package/dist/worker/pusher.worker.min.js.map +1 -1
  30. package/integration_tests_server/package-lock.json +565 -245
  31. package/integration_tests_server/package.json +2 -1
  32. package/package.json +21 -8
  33. package/spec/config/jasmine/webpack.integration.js +1 -1
  34. package/spec/config/jasmine/webpack.unit.js +1 -1
  35. package/spec/config/karma/config.ci.js +18 -18
  36. package/spec/javascripts/helpers/mocks.js +1 -0
  37. package/spec/javascripts/integration/index.web.js +14 -0
  38. package/spec/javascripts/unit/core/connection/connection_manager_spec.js +43 -0
  39. package/spec/javascripts/unit/core/pusher_spec.js +58 -0
  40. package/src/core/auth/options.ts +9 -11
  41. package/src/core/config.ts +23 -14
  42. package/src/core/connection/connection_manager.ts +9 -0
  43. package/src/core/options.ts +5 -0
  44. package/src/core/pusher.ts +17 -6
  45. package/types/src/core/auth/options.d.ts +5 -10
  46. package/types/src/core/connection/connection_manager.d.ts +1 -0
  47. package/types/src/core/options.d.ts +4 -0
  48. package/types/src/core/pusher.d.ts +3 -1
  49. package/webpack/config.node.js +1 -2
  50. package/webpack/config.react-native.js +1 -2
  51. package/webpack/config.shared.js +6 -6
  52. package/webpack/config.web.js +1 -2
  53. package/webpack/config.worker.js +1 -2
  54. package/webpack/dev.server.js +2 -9
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Pusher JavaScript Library v8.4.0
2
+ * Pusher JavaScript Library v8.5.0
3
3
  * https://pusher.com/
4
4
  *
5
5
  * Copyright 2020, Pusher
@@ -15,96 +15,12 @@
15
15
  exports["Pusher"] = factory();
16
16
  else
17
17
  root["Pusher"] = factory();
18
- })(window, function() {
19
- return /******/ (function(modules) { // webpackBootstrap
20
- /******/ // The module cache
21
- /******/ var installedModules = {};
22
- /******/
23
- /******/ // The require function
24
- /******/ function __webpack_require__(moduleId) {
25
- /******/
26
- /******/ // Check if module is in cache
27
- /******/ if(installedModules[moduleId]) {
28
- /******/ return installedModules[moduleId].exports;
29
- /******/ }
30
- /******/ // Create a new module (and put it into the cache)
31
- /******/ var module = installedModules[moduleId] = {
32
- /******/ i: moduleId,
33
- /******/ l: false,
34
- /******/ exports: {}
35
- /******/ };
36
- /******/
37
- /******/ // Execute the module function
38
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
39
- /******/
40
- /******/ // Flag the module as loaded
41
- /******/ module.l = true;
42
- /******/
43
- /******/ // Return the exports of the module
44
- /******/ return module.exports;
45
- /******/ }
46
- /******/
47
- /******/
48
- /******/ // expose the modules object (__webpack_modules__)
49
- /******/ __webpack_require__.m = modules;
50
- /******/
51
- /******/ // expose the module cache
52
- /******/ __webpack_require__.c = installedModules;
53
- /******/
54
- /******/ // define getter function for harmony exports
55
- /******/ __webpack_require__.d = function(exports, name, getter) {
56
- /******/ if(!__webpack_require__.o(exports, name)) {
57
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
58
- /******/ }
59
- /******/ };
60
- /******/
61
- /******/ // define __esModule on exports
62
- /******/ __webpack_require__.r = function(exports) {
63
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
64
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
65
- /******/ }
66
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
67
- /******/ };
68
- /******/
69
- /******/ // create a fake namespace object
70
- /******/ // mode & 1: value is a module id, require it
71
- /******/ // mode & 2: merge all properties of value into the ns
72
- /******/ // mode & 4: return value when already ns object
73
- /******/ // mode & 8|1: behave like require
74
- /******/ __webpack_require__.t = function(value, mode) {
75
- /******/ if(mode & 1) value = __webpack_require__(value);
76
- /******/ if(mode & 8) return value;
77
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
78
- /******/ var ns = Object.create(null);
79
- /******/ __webpack_require__.r(ns);
80
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
81
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
82
- /******/ return ns;
83
- /******/ };
84
- /******/
85
- /******/ // getDefaultExport function for compatibility with non-harmony modules
86
- /******/ __webpack_require__.n = function(module) {
87
- /******/ var getter = module && module.__esModule ?
88
- /******/ function getDefault() { return module['default']; } :
89
- /******/ function getModuleExports() { return module; };
90
- /******/ __webpack_require__.d(getter, 'a', getter);
91
- /******/ return getter;
92
- /******/ };
93
- /******/
94
- /******/ // Object.prototype.hasOwnProperty.call
95
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
96
- /******/
97
- /******/ // __webpack_public_path__
98
- /******/ __webpack_require__.p = "";
99
- /******/
100
- /******/
101
- /******/ // Load entry module and return exports
102
- /******/ return __webpack_require__(__webpack_require__.s = 3);
103
- /******/ })
104
- /************************************************************************/
105
- /******/ ([
106
- /* 0 */
107
- /***/ (function(module, exports, __webpack_require__) {
18
+ })(self, () => {
19
+ return /******/ (() => { // webpackBootstrap
20
+ /******/ var __webpack_modules__ = ({
21
+
22
+ /***/ 594
23
+ (__unused_webpack_module, exports) {
108
24
 
109
25
  "use strict";
110
26
 
@@ -123,7 +39,7 @@ var __extends = (this && this.__extends) || (function () {
123
39
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
124
40
  };
125
41
  })();
126
- Object.defineProperty(exports, "__esModule", { value: true });
42
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
127
43
  /**
128
44
  * Package base64 implements Base64 encoding and decoding.
129
45
  */
@@ -390,15 +306,17 @@ exports.decodedLength = function (s) {
390
306
  };
391
307
 
392
308
 
393
- /***/ }),
394
- /* 1 */
395
- /***/ (function(module, exports, __webpack_require__) {
309
+ /***/ },
310
+
311
+ /***/ 978
312
+ (__unused_webpack_module, exports) {
396
313
 
397
314
  "use strict";
315
+ var __webpack_unused_export__;
398
316
 
399
317
  // Copyright (C) 2016 Dmitry Chestnykh
400
318
  // MIT License. See LICENSE file for details.
401
- Object.defineProperty(exports, "__esModule", { value: true });
319
+ __webpack_unused_export__ = ({ value: true });
402
320
  /**
403
321
  * Package utf8 implements UTF-8 encoding and decoding.
404
322
  */
@@ -441,7 +359,7 @@ function encode(s) {
441
359
  }
442
360
  return arr;
443
361
  }
444
- exports.encode = encode;
362
+ __webpack_unused_export__ = encode;
445
363
  /**
446
364
  * Returns the number of bytes required to encode the given string into UTF-8.
447
365
  * Throws if the source string has invalid UTF-16 encoding.
@@ -472,7 +390,7 @@ function encodedLength(s) {
472
390
  }
473
391
  return result;
474
392
  }
475
- exports.encodedLength = encodedLength;
393
+ __webpack_unused_export__ = encodedLength;
476
394
  /**
477
395
  * Decodes the given byte array from UTF-8 into a string.
478
396
  * Throws if encoding is invalid.
@@ -542,12 +460,13 @@ function decode(arr) {
542
460
  }
543
461
  return chars.join("");
544
462
  }
545
- exports.decode = decode;
463
+ exports.D4 = decode;
464
+
546
465
 
466
+ /***/ },
547
467
 
548
- /***/ }),
549
- /* 2 */
550
- /***/ (function(module, exports, __webpack_require__) {
468
+ /***/ 601
469
+ (module, __unused_webpack_exports, __webpack_require__) {
551
470
 
552
471
  (function(nacl) {
553
472
  'use strict';
@@ -2928,7 +2847,7 @@ nacl.setPRNG = function(fn) {
2928
2847
  });
2929
2848
  } else if (true) {
2930
2849
  // Node.js.
2931
- crypto = __webpack_require__(4);
2850
+ crypto = __webpack_require__(281);
2932
2851
  if (crypto && crypto.randomBytes) {
2933
2852
  nacl.setPRNG(function(x, n) {
2934
2853
  var i, v = crypto.randomBytes(n);
@@ -2942,31 +2861,27 @@ nacl.setPRNG = function(fn) {
2942
2861
  })( true && module.exports ? module.exports : (self.nacl = self.nacl || {}));
2943
2862
 
2944
2863
 
2945
- /***/ }),
2946
- /* 3 */
2947
- /***/ (function(module, exports, __webpack_require__) {
2864
+ /***/ },
2948
2865
 
2949
- module.exports = __webpack_require__(5).default;
2866
+ /***/ 42
2867
+ (module, __unused_webpack_exports, __webpack_require__) {
2950
2868
 
2869
+ module.exports = __webpack_require__(499)["default"];
2951
2870
 
2952
- /***/ }),
2953
- /* 4 */
2954
- /***/ (function(module, exports) {
2955
2871
 
2956
- /* (ignored) */
2872
+ /***/ },
2957
2873
 
2958
- /***/ }),
2959
- /* 5 */
2960
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2874
+ /***/ 499
2875
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
2961
2876
 
2962
2877
  "use strict";
2963
- // ESM COMPAT FLAG
2964
- __webpack_require__.r(__webpack_exports__);
2965
2878
 
2966
2879
  // EXPORTS
2967
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ pusher_with_encryption_PusherWithEncryption; });
2880
+ __webpack_require__.d(__webpack_exports__, {
2881
+ "default": () => (/* binding */ PusherWithEncryption)
2882
+ });
2968
2883
 
2969
- // CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts
2884
+ ;// ./src/runtimes/web/dom/script_receiver_factory.ts
2970
2885
  class ScriptReceiverFactory {
2971
2886
  constructor(prefix, name) {
2972
2887
  this.lastId = 0;
@@ -2994,9 +2909,9 @@ class ScriptReceiverFactory {
2994
2909
  }
2995
2910
  var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.ScriptReceivers');
2996
2911
 
2997
- // CONCATENATED MODULE: ./src/core/defaults.ts
2912
+ ;// ./src/core/defaults.ts
2998
2913
  var Defaults = {
2999
- VERSION: "8.4.0",
2914
+ VERSION: "8.5.0",
3000
2915
  PROTOCOL: 7,
3001
2916
  wsPort: 80,
3002
2917
  wssPort: 443,
@@ -3023,12 +2938,12 @@ var Defaults = {
3023
2938
  cdn_https: "https://js.pusher.com",
3024
2939
  dependency_suffix: "",
3025
2940
  };
3026
- /* harmony default export */ var defaults = (Defaults);
2941
+ /* harmony default export */ const defaults = (Defaults);
3027
2942
 
3028
- // CONCATENATED MODULE: ./src/runtimes/web/dom/dependency_loader.ts
2943
+ ;// ./src/runtimes/web/dom/dependency_loader.ts
3029
2944
 
3030
2945
 
3031
- class dependency_loader_DependencyLoader {
2946
+ class DependencyLoader {
3032
2947
  constructor(options) {
3033
2948
  this.options = options;
3034
2949
  this.receivers = options.receivers || ScriptReceivers;
@@ -3076,12 +2991,12 @@ class dependency_loader_DependencyLoader {
3076
2991
  }
3077
2992
  }
3078
2993
 
3079
- // CONCATENATED MODULE: ./src/runtimes/web/dom/dependencies.ts
2994
+ ;// ./src/runtimes/web/dom/dependencies.ts
3080
2995
 
3081
2996
 
3082
2997
 
3083
2998
  var DependenciesReceivers = new ScriptReceiverFactory('_pusher_dependencies', 'Pusher.DependenciesReceivers');
3084
- var Dependencies = new dependency_loader_DependencyLoader({
2999
+ var Dependencies = new DependencyLoader({
3085
3000
  cdn_http: defaults.cdn_http,
3086
3001
  cdn_https: defaults.cdn_https,
3087
3002
  version: defaults.VERSION,
@@ -3089,7 +3004,7 @@ var Dependencies = new dependency_loader_DependencyLoader({
3089
3004
  receivers: DependenciesReceivers,
3090
3005
  });
3091
3006
 
3092
- // CONCATENATED MODULE: ./src/core/utils/url_store.ts
3007
+ ;// ./src/core/utils/url_store.ts
3093
3008
  const urlStore = {
3094
3009
  baseUrl: 'https://pusher.com',
3095
3010
  urls: {
@@ -3126,16 +3041,16 @@ const buildLogSuffix = function (key) {
3126
3041
  return '';
3127
3042
  return `${urlPrefix} ${url}`;
3128
3043
  };
3129
- /* harmony default export */ var url_store = ({ buildLogSuffix });
3044
+ /* harmony default export */ const url_store = ({ buildLogSuffix });
3130
3045
 
3131
- // CONCATENATED MODULE: ./src/core/auth/options.ts
3046
+ ;// ./src/core/auth/options.ts
3132
3047
  var AuthRequestType;
3133
3048
  (function (AuthRequestType) {
3134
3049
  AuthRequestType["UserAuthentication"] = "user-authentication";
3135
3050
  AuthRequestType["ChannelAuthorization"] = "channel-authorization";
3136
3051
  })(AuthRequestType || (AuthRequestType = {}));
3137
3052
 
3138
- // CONCATENATED MODULE: ./src/core/errors.ts
3053
+ ;// ./src/core/errors.ts
3139
3054
  class BadEventName extends Error {
3140
3055
  constructor(msg) {
3141
3056
  super(msg);
@@ -3192,7 +3107,7 @@ class HTTPAuthError extends Error {
3192
3107
  }
3193
3108
  }
3194
3109
 
3195
- // CONCATENATED MODULE: ./src/runtimes/isomorphic/auth/xhr_auth.ts
3110
+ ;// ./src/runtimes/isomorphic/auth/xhr_auth.ts
3196
3111
 
3197
3112
 
3198
3113
 
@@ -3244,17 +3159,17 @@ const ajax = function (context, query, authOptions, authRequestType, callback) {
3244
3159
  xhr.send(query);
3245
3160
  return xhr;
3246
3161
  };
3247
- /* harmony default export */ var xhr_auth = (ajax);
3162
+ /* harmony default export */ const xhr_auth = (ajax);
3248
3163
 
3249
- // CONCATENATED MODULE: ./src/core/base64.ts
3164
+ ;// ./src/core/base64.ts
3250
3165
  function encode(s) {
3251
3166
  return btoa(utob(s));
3252
3167
  }
3253
3168
  var fromCharCode = String.fromCharCode;
3254
3169
  var b64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
3255
3170
  var b64tab = {};
3256
- for (var base64_i = 0, l = b64chars.length; base64_i < l; base64_i++) {
3257
- b64tab[b64chars.charAt(base64_i)] = base64_i;
3171
+ for (var i = 0, l = b64chars.length; i < l; i++) {
3172
+ b64tab[b64chars.charAt(i)] = i;
3258
3173
  }
3259
3174
  var cb_utob = function (c) {
3260
3175
  var cc = c.charCodeAt(0);
@@ -3287,7 +3202,7 @@ var btoa = window.btoa ||
3287
3202
  return b.replace(/[\s\S]{1,3}/g, cb_encode);
3288
3203
  };
3289
3204
 
3290
- // CONCATENATED MODULE: ./src/core/utils/timers/abstract_timer.ts
3205
+ ;// ./src/core/utils/timers/abstract_timer.ts
3291
3206
  class Timer {
3292
3207
  constructor(set, clear, delay, callback) {
3293
3208
  this.clear = clear;
@@ -3307,9 +3222,9 @@ class Timer {
3307
3222
  }
3308
3223
  }
3309
3224
  }
3310
- /* harmony default export */ var abstract_timer = (Timer);
3225
+ /* harmony default export */ const abstract_timer = (Timer);
3311
3226
 
3312
- // CONCATENATED MODULE: ./src/core/utils/timers/index.ts
3227
+ ;// ./src/core/utils/timers/index.ts
3313
3228
 
3314
3229
  function timers_clearTimeout(timer) {
3315
3230
  window.clearTimeout(timer);
@@ -3317,7 +3232,7 @@ function timers_clearTimeout(timer) {
3317
3232
  function timers_clearInterval(timer) {
3318
3233
  window.clearInterval(timer);
3319
3234
  }
3320
- class timers_OneOffTimer extends abstract_timer {
3235
+ class OneOffTimer extends abstract_timer {
3321
3236
  constructor(delay, callback) {
3322
3237
  super(setTimeout, timers_clearTimeout, delay, function (timer) {
3323
3238
  callback();
@@ -3325,7 +3240,7 @@ class timers_OneOffTimer extends abstract_timer {
3325
3240
  });
3326
3241
  }
3327
3242
  }
3328
- class timers_PeriodicTimer extends abstract_timer {
3243
+ class PeriodicTimer extends abstract_timer {
3329
3244
  constructor(delay, callback) {
3330
3245
  super(setInterval, timers_clearInterval, delay, function (timer) {
3331
3246
  callback();
@@ -3334,7 +3249,7 @@ class timers_PeriodicTimer extends abstract_timer {
3334
3249
  }
3335
3250
  }
3336
3251
 
3337
- // CONCATENATED MODULE: ./src/core/util.ts
3252
+ ;// ./src/core/util.ts
3338
3253
 
3339
3254
  var Util = {
3340
3255
  now() {
@@ -3346,7 +3261,7 @@ var Util = {
3346
3261
  }
3347
3262
  },
3348
3263
  defer(callback) {
3349
- return new timers_OneOffTimer(0, callback);
3264
+ return new OneOffTimer(0, callback);
3350
3265
  },
3351
3266
  method(name, ...args) {
3352
3267
  var boundArguments = Array.prototype.slice.call(arguments, 1);
@@ -3355,9 +3270,9 @@ var Util = {
3355
3270
  };
3356
3271
  },
3357
3272
  };
3358
- /* harmony default export */ var util = (Util);
3273
+ /* harmony default export */ const util = (Util);
3359
3274
 
3360
- // CONCATENATED MODULE: ./src/core/utils/collections.ts
3275
+ ;// ./src/core/utils/collections.ts
3361
3276
 
3362
3277
 
3363
3278
  function extend(target, ...sources) {
@@ -3551,10 +3466,10 @@ function safeJSONStringify(source) {
3551
3466
  }
3552
3467
  }
3553
3468
 
3554
- // CONCATENATED MODULE: ./src/core/logger.ts
3469
+ ;// ./src/core/logger.ts
3555
3470
 
3556
3471
 
3557
- class logger_Logger {
3472
+ class Logger {
3558
3473
  constructor() {
3559
3474
  this.globalLog = (message) => {
3560
3475
  if (window.console && window.console.log) {
@@ -3589,18 +3504,18 @@ class logger_Logger {
3589
3504
  }
3590
3505
  log(defaultLoggingFunction, ...args) {
3591
3506
  var message = stringify.apply(this, arguments);
3592
- if (core_pusher.log) {
3593
- core_pusher.log(message);
3507
+ if (pusher.log) {
3508
+ pusher.log(message);
3594
3509
  }
3595
- else if (core_pusher.logToConsole) {
3510
+ else if (pusher.logToConsole) {
3596
3511
  const log = defaultLoggingFunction.bind(this);
3597
3512
  log(message);
3598
3513
  }
3599
3514
  }
3600
3515
  }
3601
- /* harmony default export */ var logger = (new logger_Logger());
3516
+ /* harmony default export */ const logger = (new Logger());
3602
3517
 
3603
- // CONCATENATED MODULE: ./src/runtimes/web/auth/jsonp_auth.ts
3518
+ ;// ./src/runtimes/web/auth/jsonp_auth.ts
3604
3519
 
3605
3520
  var jsonp = function (context, query, authOptions, authRequestType, callback) {
3606
3521
  if (authOptions.headers !== undefined ||
@@ -3624,9 +3539,9 @@ var jsonp = function (context, query, authOptions, authRequestType, callback) {
3624
3539
  var head = document.getElementsByTagName('head')[0] || document.documentElement;
3625
3540
  head.insertBefore(script, head.firstChild);
3626
3541
  };
3627
- /* harmony default export */ var jsonp_auth = (jsonp);
3542
+ /* harmony default export */ const jsonp_auth = (jsonp);
3628
3543
 
3629
- // CONCATENATED MODULE: ./src/runtimes/web/dom/script_request.ts
3544
+ ;// ./src/runtimes/web/dom/script_request.ts
3630
3545
  class ScriptRequest {
3631
3546
  constructor(src) {
3632
3547
  this.src = src;
@@ -3688,10 +3603,10 @@ class ScriptRequest {
3688
3603
  }
3689
3604
  }
3690
3605
 
3691
- // CONCATENATED MODULE: ./src/runtimes/web/dom/jsonp_request.ts
3606
+ ;// ./src/runtimes/web/dom/jsonp_request.ts
3692
3607
 
3693
3608
 
3694
- class jsonp_request_JSONPRequest {
3609
+ class JSONPRequest {
3695
3610
  constructor(url, data) {
3696
3611
  this.url = url;
3697
3612
  this.data = data;
@@ -3712,7 +3627,7 @@ class jsonp_request_JSONPRequest {
3712
3627
  }
3713
3628
  }
3714
3629
 
3715
- // CONCATENATED MODULE: ./src/runtimes/web/timeline/jsonp_timeline.ts
3630
+ ;// ./src/runtimes/web/timeline/jsonp_timeline.ts
3716
3631
 
3717
3632
 
3718
3633
  var getAgent = function (sender, useTLS) {
@@ -3737,9 +3652,9 @@ var jsonp_timeline_jsonp = {
3737
3652
  name: 'jsonp',
3738
3653
  getAgent,
3739
3654
  };
3740
- /* harmony default export */ var jsonp_timeline = (jsonp_timeline_jsonp);
3655
+ /* harmony default export */ const jsonp_timeline = (jsonp_timeline_jsonp);
3741
3656
 
3742
- // CONCATENATED MODULE: ./src/core/transports/url_schemes.ts
3657
+ ;// ./src/core/transports/url_schemes.ts
3743
3658
 
3744
3659
  function getGenericURL(baseScheme, params, path) {
3745
3660
  var scheme = baseScheme + (params.useTLS ? 's' : '');
@@ -3777,9 +3692,9 @@ var sockjs = {
3777
3692
  },
3778
3693
  };
3779
3694
 
3780
- // CONCATENATED MODULE: ./src/core/events/callback_registry.ts
3695
+ ;// ./src/core/events/callback_registry.ts
3781
3696
 
3782
- class callback_registry_CallbackRegistry {
3697
+ class CallbackRegistry {
3783
3698
  constructor() {
3784
3699
  this._callbacks = {};
3785
3700
  }
@@ -3829,12 +3744,12 @@ function prefix(name) {
3829
3744
  return '_' + name;
3830
3745
  }
3831
3746
 
3832
- // CONCATENATED MODULE: ./src/core/events/dispatcher.ts
3747
+ ;// ./src/core/events/dispatcher.ts
3833
3748
 
3834
3749
 
3835
- class dispatcher_Dispatcher {
3750
+ class Dispatcher {
3836
3751
  constructor(failThrough) {
3837
- this.callbacks = new callback_registry_CallbackRegistry();
3752
+ this.callbacks = new CallbackRegistry();
3838
3753
  this.global_callbacks = [];
3839
3754
  this.failThrough = failThrough;
3840
3755
  }
@@ -3887,13 +3802,13 @@ class dispatcher_Dispatcher {
3887
3802
  }
3888
3803
  }
3889
3804
 
3890
- // CONCATENATED MODULE: ./src/core/transports/transport_connection.ts
3805
+ ;// ./src/core/transports/transport_connection.ts
3891
3806
 
3892
3807
 
3893
3808
 
3894
3809
 
3895
3810
 
3896
- class transport_connection_TransportConnection extends dispatcher_Dispatcher {
3811
+ class TransportConnection extends Dispatcher {
3897
3812
  constructor(hooks, name, priority, key, options) {
3898
3813
  super();
3899
3814
  this.initialize = runtime.transportConnectionInitializer;
@@ -4034,9 +3949,9 @@ class transport_connection_TransportConnection extends dispatcher_Dispatcher {
4034
3949
  }
4035
3950
  }
4036
3951
 
4037
- // CONCATENATED MODULE: ./src/core/transports/transport.ts
3952
+ ;// ./src/core/transports/transport.ts
4038
3953
 
4039
- class transport_Transport {
3954
+ class Transport {
4040
3955
  constructor(hooks) {
4041
3956
  this.hooks = hooks;
4042
3957
  }
@@ -4044,16 +3959,16 @@ class transport_Transport {
4044
3959
  return this.hooks.isSupported(environment);
4045
3960
  }
4046
3961
  createConnection(name, priority, key, options) {
4047
- return new transport_connection_TransportConnection(this.hooks, name, priority, key, options);
3962
+ return new TransportConnection(this.hooks, name, priority, key, options);
4048
3963
  }
4049
3964
  }
4050
3965
 
4051
- // CONCATENATED MODULE: ./src/runtimes/isomorphic/transports/transports.ts
3966
+ ;// ./src/runtimes/isomorphic/transports/transports.ts
4052
3967
 
4053
3968
 
4054
3969
 
4055
3970
 
4056
- var WSTransport = new transport_Transport({
3971
+ var WSTransport = new Transport({
4057
3972
  urls: ws,
4058
3973
  handlesActivityChecks: false,
4059
3974
  supportsPing: false,
@@ -4090,23 +4005,23 @@ var xhrConfiguration = {
4090
4005
  return runtime.isXHRSupported();
4091
4006
  },
4092
4007
  };
4093
- var XHRStreamingTransport = new transport_Transport((extend({}, streamingConfiguration, xhrConfiguration)));
4094
- var XHRPollingTransport = new transport_Transport((extend({}, pollingConfiguration, xhrConfiguration)));
4008
+ var XHRStreamingTransport = new Transport((extend({}, streamingConfiguration, xhrConfiguration)));
4009
+ var XHRPollingTransport = new Transport((extend({}, pollingConfiguration, xhrConfiguration)));
4095
4010
  var Transports = {
4096
4011
  ws: WSTransport,
4097
4012
  xhr_streaming: XHRStreamingTransport,
4098
4013
  xhr_polling: XHRPollingTransport,
4099
4014
  };
4100
- /* harmony default export */ var transports = (Transports);
4015
+ /* harmony default export */ const transports = (Transports);
4101
4016
 
4102
- // CONCATENATED MODULE: ./src/runtimes/web/transports/transports.ts
4017
+ ;// ./src/runtimes/web/transports/transports.ts
4103
4018
 
4104
4019
 
4105
4020
 
4106
4021
 
4107
4022
 
4108
4023
 
4109
- var SockJSTransport = new transport_Transport({
4024
+ var SockJSTransport = new Transport({
4110
4025
  file: 'sockjs',
4111
4026
  urls: sockjs,
4112
4027
  handlesActivityChecks: true,
@@ -4137,16 +4052,16 @@ var xdrConfiguration = {
4137
4052
  return yes;
4138
4053
  },
4139
4054
  };
4140
- var XDRStreamingTransport = new transport_Transport((extend({}, streamingConfiguration, xdrConfiguration)));
4141
- var XDRPollingTransport = new transport_Transport((extend({}, pollingConfiguration, xdrConfiguration)));
4055
+ var XDRStreamingTransport = new Transport((extend({}, streamingConfiguration, xdrConfiguration)));
4056
+ var XDRPollingTransport = new Transport((extend({}, pollingConfiguration, xdrConfiguration)));
4142
4057
  transports.xdr_streaming = XDRStreamingTransport;
4143
4058
  transports.xdr_polling = XDRPollingTransport;
4144
4059
  transports.sockjs = SockJSTransport;
4145
- /* harmony default export */ var transports_transports = (transports);
4060
+ /* harmony default export */ const transports_transports = (transports);
4146
4061
 
4147
- // CONCATENATED MODULE: ./src/runtimes/web/net_info.ts
4062
+ ;// ./src/runtimes/web/net_info.ts
4148
4063
 
4149
- class net_info_NetInfo extends dispatcher_Dispatcher {
4064
+ class NetInfo extends Dispatcher {
4150
4065
  constructor() {
4151
4066
  super();
4152
4067
  var self = this;
@@ -4168,12 +4083,12 @@ class net_info_NetInfo extends dispatcher_Dispatcher {
4168
4083
  }
4169
4084
  }
4170
4085
  }
4171
- var net_info_Network = new net_info_NetInfo();
4086
+ var Network = new NetInfo();
4172
4087
 
4173
- // CONCATENATED MODULE: ./src/core/transports/assistant_to_the_transport_manager.ts
4088
+ ;// ./src/core/transports/assistant_to_the_transport_manager.ts
4174
4089
 
4175
4090
 
4176
- class assistant_to_the_transport_manager_AssistantToTheTransportManager {
4091
+ class AssistantToTheTransportManager {
4177
4092
  constructor(manager, transport, options) {
4178
4093
  this.manager = manager;
4179
4094
  this.transport = transport;
@@ -4213,7 +4128,7 @@ class assistant_to_the_transport_manager_AssistantToTheTransportManager {
4213
4128
  }
4214
4129
  }
4215
4130
 
4216
- // CONCATENATED MODULE: ./src/core/connection/protocol/protocol.ts
4131
+ ;// ./src/core/connection/protocol/protocol.ts
4217
4132
  const Protocol = {
4218
4133
  decodeMessage: function (messageEvent) {
4219
4134
  try {
@@ -4304,14 +4219,14 @@ const Protocol = {
4304
4219
  }
4305
4220
  },
4306
4221
  };
4307
- /* harmony default export */ var protocol_protocol = (Protocol);
4222
+ /* harmony default export */ const protocol = (Protocol);
4308
4223
 
4309
- // CONCATENATED MODULE: ./src/core/connection/connection.ts
4224
+ ;// ./src/core/connection/connection.ts
4310
4225
 
4311
4226
 
4312
4227
 
4313
4228
 
4314
- class connection_Connection extends dispatcher_Dispatcher {
4229
+ class Connection extends Dispatcher {
4315
4230
  constructor(id, transport) {
4316
4231
  super();
4317
4232
  this.id = id;
@@ -4331,7 +4246,7 @@ class connection_Connection extends dispatcher_Dispatcher {
4331
4246
  event.channel = channel;
4332
4247
  }
4333
4248
  logger.debug('Event sent', event);
4334
- return this.send(protocol_protocol.encodeMessage(event));
4249
+ return this.send(protocol.encodeMessage(event));
4335
4250
  }
4336
4251
  ping() {
4337
4252
  if (this.transport.supportsPing()) {
@@ -4349,7 +4264,7 @@ class connection_Connection extends dispatcher_Dispatcher {
4349
4264
  message: (messageEvent) => {
4350
4265
  var pusherEvent;
4351
4266
  try {
4352
- pusherEvent = protocol_protocol.decodeMessage(messageEvent);
4267
+ pusherEvent = protocol.decodeMessage(messageEvent);
4353
4268
  }
4354
4269
  catch (e) {
4355
4270
  this.emit('error', {
@@ -4402,8 +4317,8 @@ class connection_Connection extends dispatcher_Dispatcher {
4402
4317
  });
4403
4318
  }
4404
4319
  handleCloseEvent(closeEvent) {
4405
- var action = protocol_protocol.getCloseAction(closeEvent);
4406
- var error = protocol_protocol.getCloseError(closeEvent);
4320
+ var action = protocol.getCloseAction(closeEvent);
4321
+ var error = protocol.getCloseError(closeEvent);
4407
4322
  if (error) {
4408
4323
  this.emit('error', error);
4409
4324
  }
@@ -4413,11 +4328,11 @@ class connection_Connection extends dispatcher_Dispatcher {
4413
4328
  }
4414
4329
  }
4415
4330
 
4416
- // CONCATENATED MODULE: ./src/core/connection/handshake/index.ts
4331
+ ;// ./src/core/connection/handshake/index.ts
4417
4332
 
4418
4333
 
4419
4334
 
4420
- class handshake_Handshake {
4335
+ class Handshake {
4421
4336
  constructor(transport, callback) {
4422
4337
  this.transport = transport;
4423
4338
  this.callback = callback;
@@ -4432,7 +4347,7 @@ class handshake_Handshake {
4432
4347
  this.unbindListeners();
4433
4348
  var result;
4434
4349
  try {
4435
- result = protocol_protocol.processHandshake(m);
4350
+ result = protocol.processHandshake(m);
4436
4351
  }
4437
4352
  catch (e) {
4438
4353
  this.finish('error', { error: e });
@@ -4441,7 +4356,7 @@ class handshake_Handshake {
4441
4356
  }
4442
4357
  if (result.action === 'connected') {
4443
4358
  this.finish('connected', {
4444
- connection: new connection_Connection(result.id, this.transport),
4359
+ connection: new Connection(result.id, this.transport),
4445
4360
  activityTimeout: result.activityTimeout,
4446
4361
  });
4447
4362
  }
@@ -4452,8 +4367,8 @@ class handshake_Handshake {
4452
4367
  };
4453
4368
  this.onClosed = (closeEvent) => {
4454
4369
  this.unbindListeners();
4455
- var action = protocol_protocol.getCloseAction(closeEvent) || 'backoff';
4456
- var error = protocol_protocol.getCloseError(closeEvent);
4370
+ var action = protocol.getCloseAction(closeEvent) || 'backoff';
4371
+ var error = protocol.getCloseError(closeEvent);
4457
4372
  this.finish(action, { error: error });
4458
4373
  };
4459
4374
  this.transport.bind('message', this.onMessage);
@@ -4468,9 +4383,9 @@ class handshake_Handshake {
4468
4383
  }
4469
4384
  }
4470
4385
 
4471
- // CONCATENATED MODULE: ./src/core/timeline/timeline_sender.ts
4386
+ ;// ./src/core/timeline/timeline_sender.ts
4472
4387
 
4473
- class timeline_sender_TimelineSender {
4388
+ class TimelineSender {
4474
4389
  constructor(timeline, options) {
4475
4390
  this.timeline = timeline;
4476
4391
  this.options = options || {};
@@ -4483,13 +4398,13 @@ class timeline_sender_TimelineSender {
4483
4398
  }
4484
4399
  }
4485
4400
 
4486
- // CONCATENATED MODULE: ./src/core/channels/channel.ts
4401
+ ;// ./src/core/channels/channel.ts
4487
4402
 
4488
4403
 
4489
4404
 
4490
4405
 
4491
4406
 
4492
- class channel_Channel extends dispatcher_Dispatcher {
4407
+ class Channel extends Dispatcher {
4493
4408
  constructor(name, pusher) {
4494
4409
  super(function (event, data) {
4495
4410
  logger.debug('No callbacks on ' + name + ' for ' + event);
@@ -4585,9 +4500,9 @@ class channel_Channel extends dispatcher_Dispatcher {
4585
4500
  }
4586
4501
  }
4587
4502
 
4588
- // CONCATENATED MODULE: ./src/core/channels/private_channel.ts
4503
+ ;// ./src/core/channels/private_channel.ts
4589
4504
 
4590
- class private_channel_PrivateChannel extends channel_Channel {
4505
+ class PrivateChannel extends Channel {
4591
4506
  authorize(socketId, callback) {
4592
4507
  return this.pusher.config.channelAuthorizer({
4593
4508
  channelName: this.name,
@@ -4596,9 +4511,9 @@ class private_channel_PrivateChannel extends channel_Channel {
4596
4511
  }
4597
4512
  }
4598
4513
 
4599
- // CONCATENATED MODULE: ./src/core/channels/members.ts
4514
+ ;// ./src/core/channels/members.ts
4600
4515
 
4601
- class members_Members {
4516
+ class Members {
4602
4517
  constructor() {
4603
4518
  this.reset();
4604
4519
  }
@@ -4649,7 +4564,7 @@ class members_Members {
4649
4564
  }
4650
4565
  }
4651
4566
 
4652
- // CONCATENATED MODULE: ./src/core/channels/presence_channel.ts
4567
+ ;// ./src/core/channels/presence_channel.ts
4653
4568
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
4654
4569
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4655
4570
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -4663,10 +4578,10 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
4663
4578
 
4664
4579
 
4665
4580
 
4666
- class presence_channel_PresenceChannel extends private_channel_PrivateChannel {
4581
+ class PresenceChannel extends PrivateChannel {
4667
4582
  constructor(name, pusher) {
4668
4583
  super(name, pusher);
4669
- this.members = new members_Members();
4584
+ this.members = new Members();
4670
4585
  }
4671
4586
  authorize(socketId, callback) {
4672
4587
  super.authorize(socketId, (error, authData) => __awaiter(this, void 0, void 0, function* () {
@@ -4748,18 +4663,16 @@ class presence_channel_PresenceChannel extends private_channel_PrivateChannel {
4748
4663
  }
4749
4664
 
4750
4665
  // EXTERNAL MODULE: ./node_modules/@stablelib/utf8/lib/utf8.js
4751
- var utf8 = __webpack_require__(1);
4752
-
4666
+ var utf8 = __webpack_require__(978);
4753
4667
  // EXTERNAL MODULE: ./node_modules/@stablelib/base64/lib/base64.js
4754
- var base64 = __webpack_require__(0);
4755
-
4756
- // CONCATENATED MODULE: ./src/core/channels/encrypted_channel.ts
4668
+ var base64 = __webpack_require__(594);
4669
+ ;// ./src/core/channels/encrypted_channel.ts
4757
4670
 
4758
4671
 
4759
4672
 
4760
4673
 
4761
4674
 
4762
- class encrypted_channel_EncryptedChannel extends private_channel_PrivateChannel {
4675
+ class EncryptedChannel extends PrivateChannel {
4763
4676
  constructor(name, pusher, nacl) {
4764
4677
  super(name, pusher);
4765
4678
  this.key = null;
@@ -4776,7 +4689,7 @@ class encrypted_channel_EncryptedChannel extends private_channel_PrivateChannel
4776
4689
  callback(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`), null);
4777
4690
  return;
4778
4691
  }
4779
- this.key = Object(base64["decode"])(sharedSecret);
4692
+ this.key = (0,base64.decode)(sharedSecret);
4780
4693
  delete authData['shared_secret'];
4781
4694
  callback(null, authData);
4782
4695
  });
@@ -4804,12 +4717,12 @@ class encrypted_channel_EncryptedChannel extends private_channel_PrivateChannel
4804
4717
  data);
4805
4718
  return;
4806
4719
  }
4807
- let cipherText = Object(base64["decode"])(data.ciphertext);
4720
+ let cipherText = (0,base64.decode)(data.ciphertext);
4808
4721
  if (cipherText.length < this.nacl.secretbox.overheadLength) {
4809
4722
  logger.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${cipherText.length}`);
4810
4723
  return;
4811
4724
  }
4812
- let nonce = Object(base64["decode"])(data.nonce);
4725
+ let nonce = (0,base64.decode)(data.nonce);
4813
4726
  if (nonce.length < this.nacl.secretbox.nonceLength) {
4814
4727
  logger.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${nonce.length}`);
4815
4728
  return;
@@ -4835,7 +4748,7 @@ class encrypted_channel_EncryptedChannel extends private_channel_PrivateChannel
4835
4748
  this.emit(event, this.getDataToEmit(bytes));
4836
4749
  }
4837
4750
  getDataToEmit(bytes) {
4838
- let raw = Object(utf8["decode"])(bytes);
4751
+ let raw = (0,utf8/* decode */.D4)(bytes);
4839
4752
  try {
4840
4753
  return JSON.parse(raw);
4841
4754
  }
@@ -4845,13 +4758,13 @@ class encrypted_channel_EncryptedChannel extends private_channel_PrivateChannel
4845
4758
  }
4846
4759
  }
4847
4760
 
4848
- // CONCATENATED MODULE: ./src/core/connection/connection_manager.ts
4761
+ ;// ./src/core/connection/connection_manager.ts
4849
4762
 
4850
4763
 
4851
4764
 
4852
4765
 
4853
4766
 
4854
- class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4767
+ class ConnectionManager extends Dispatcher {
4855
4768
  constructor(key, options) {
4856
4769
  super();
4857
4770
  this.state = 'initialized';
@@ -4878,6 +4791,11 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4878
4791
  });
4879
4792
  this.updateStrategy();
4880
4793
  }
4794
+ switchCluster(key) {
4795
+ this.key = key;
4796
+ this.updateStrategy();
4797
+ this.retryIn(0);
4798
+ }
4881
4799
  connect() {
4882
4800
  if (this.connection || this.runner) {
4883
4801
  return;
@@ -4961,7 +4879,7 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4961
4879
  if (delay > 0) {
4962
4880
  this.emit('connecting_in', Math.round(delay / 1000));
4963
4881
  }
4964
- this.retryTimer = new timers_OneOffTimer(delay || 0, () => {
4882
+ this.retryTimer = new OneOffTimer(delay || 0, () => {
4965
4883
  this.disconnectInternally();
4966
4884
  this.connect();
4967
4885
  });
@@ -4973,7 +4891,7 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4973
4891
  }
4974
4892
  }
4975
4893
  setUnavailableTimer() {
4976
- this.unavailableTimer = new timers_OneOffTimer(this.options.unavailableTimeout, () => {
4894
+ this.unavailableTimer = new OneOffTimer(this.options.unavailableTimeout, () => {
4977
4895
  this.updateState('unavailable');
4978
4896
  });
4979
4897
  }
@@ -4985,7 +4903,7 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4985
4903
  sendActivityCheck() {
4986
4904
  this.stopActivityCheck();
4987
4905
  this.connection.ping();
4988
- this.activityTimer = new timers_OneOffTimer(this.options.pongTimeout, () => {
4906
+ this.activityTimer = new OneOffTimer(this.options.pongTimeout, () => {
4989
4907
  this.timeline.error({ pong_timed_out: this.options.pongTimeout });
4990
4908
  this.retryIn(0);
4991
4909
  });
@@ -4993,7 +4911,7 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
4993
4911
  resetActivityCheck() {
4994
4912
  this.stopActivityCheck();
4995
4913
  if (this.connection && !this.connection.handlesActivityChecks()) {
4996
- this.activityTimer = new timers_OneOffTimer(this.activityTimeout, () => {
4914
+ this.activityTimer = new OneOffTimer(this.activityTimeout, () => {
4997
4915
  this.sendActivityCheck();
4998
4916
  });
4999
4917
  }
@@ -5101,12 +5019,12 @@ class connection_manager_ConnectionManager extends dispatcher_Dispatcher {
5101
5019
  }
5102
5020
  }
5103
5021
 
5104
- // CONCATENATED MODULE: ./src/core/channels/channels.ts
5022
+ ;// ./src/core/channels/channels.ts
5105
5023
 
5106
5024
 
5107
5025
 
5108
5026
 
5109
- class channels_Channels {
5027
+ class Channels {
5110
5028
  constructor() {
5111
5029
  this.channels = {};
5112
5030
  }
@@ -5156,7 +5074,7 @@ function createChannel(name, pusher) {
5156
5074
  }
5157
5075
  }
5158
5076
 
5159
- // CONCATENATED MODULE: ./src/core/utils/factory.ts
5077
+ ;// ./src/core/utils/factory.ts
5160
5078
 
5161
5079
 
5162
5080
 
@@ -5168,38 +5086,38 @@ function createChannel(name, pusher) {
5168
5086
 
5169
5087
  var Factory = {
5170
5088
  createChannels() {
5171
- return new channels_Channels();
5089
+ return new Channels();
5172
5090
  },
5173
5091
  createConnectionManager(key, options) {
5174
- return new connection_manager_ConnectionManager(key, options);
5092
+ return new ConnectionManager(key, options);
5175
5093
  },
5176
5094
  createChannel(name, pusher) {
5177
- return new channel_Channel(name, pusher);
5095
+ return new Channel(name, pusher);
5178
5096
  },
5179
5097
  createPrivateChannel(name, pusher) {
5180
- return new private_channel_PrivateChannel(name, pusher);
5098
+ return new PrivateChannel(name, pusher);
5181
5099
  },
5182
5100
  createPresenceChannel(name, pusher) {
5183
- return new presence_channel_PresenceChannel(name, pusher);
5101
+ return new PresenceChannel(name, pusher);
5184
5102
  },
5185
5103
  createEncryptedChannel(name, pusher, nacl) {
5186
- return new encrypted_channel_EncryptedChannel(name, pusher, nacl);
5104
+ return new EncryptedChannel(name, pusher, nacl);
5187
5105
  },
5188
5106
  createTimelineSender(timeline, options) {
5189
- return new timeline_sender_TimelineSender(timeline, options);
5107
+ return new TimelineSender(timeline, options);
5190
5108
  },
5191
5109
  createHandshake(transport, callback) {
5192
- return new handshake_Handshake(transport, callback);
5110
+ return new Handshake(transport, callback);
5193
5111
  },
5194
5112
  createAssistantToTheTransportManager(manager, transport, options) {
5195
- return new assistant_to_the_transport_manager_AssistantToTheTransportManager(manager, transport, options);
5113
+ return new AssistantToTheTransportManager(manager, transport, options);
5196
5114
  },
5197
5115
  };
5198
- /* harmony default export */ var factory = (Factory);
5116
+ /* harmony default export */ const factory = (Factory);
5199
5117
 
5200
- // CONCATENATED MODULE: ./src/core/transports/transport_manager.ts
5118
+ ;// ./src/core/transports/transport_manager.ts
5201
5119
 
5202
- class transport_manager_TransportManager {
5120
+ class TransportManager {
5203
5121
  constructor(options) {
5204
5122
  this.options = options || {};
5205
5123
  this.livesLeft = this.options.lives || Infinity;
@@ -5218,11 +5136,11 @@ class transport_manager_TransportManager {
5218
5136
  }
5219
5137
  }
5220
5138
 
5221
- // CONCATENATED MODULE: ./src/core/strategies/sequential_strategy.ts
5139
+ ;// ./src/core/strategies/sequential_strategy.ts
5222
5140
 
5223
5141
 
5224
5142
 
5225
- class sequential_strategy_SequentialStrategy {
5143
+ class SequentialStrategy {
5226
5144
  constructor(strategies, options) {
5227
5145
  this.strategies = strategies;
5228
5146
  this.loop = Boolean(options.loop);
@@ -5278,7 +5196,7 @@ class sequential_strategy_SequentialStrategy {
5278
5196
  var timer = null;
5279
5197
  var runner = null;
5280
5198
  if (options.timeout > 0) {
5281
- timer = new timers_OneOffTimer(options.timeout, function () {
5199
+ timer = new OneOffTimer(options.timeout, function () {
5282
5200
  runner.abort();
5283
5201
  callback(true);
5284
5202
  });
@@ -5306,10 +5224,10 @@ class sequential_strategy_SequentialStrategy {
5306
5224
  }
5307
5225
  }
5308
5226
 
5309
- // CONCATENATED MODULE: ./src/core/strategies/best_connected_ever_strategy.ts
5227
+ ;// ./src/core/strategies/best_connected_ever_strategy.ts
5310
5228
 
5311
5229
 
5312
- class best_connected_ever_strategy_BestConnectedEverStrategy {
5230
+ class BestConnectedEverStrategy {
5313
5231
  constructor(strategies) {
5314
5232
  this.strategies = strategies;
5315
5233
  }
@@ -5361,12 +5279,12 @@ function abortRunner(runner) {
5361
5279
  }
5362
5280
  }
5363
5281
 
5364
- // CONCATENATED MODULE: ./src/core/strategies/websocket_prioritized_cached_strategy.ts
5282
+ ;// ./src/core/strategies/websocket_prioritized_cached_strategy.ts
5365
5283
 
5366
5284
 
5367
5285
 
5368
5286
 
5369
- class websocket_prioritized_cached_strategy_WebSocketPrioritizedCachedStrategy {
5287
+ class WebSocketPrioritizedCachedStrategy {
5370
5288
  constructor(strategy, transports, options) {
5371
5289
  this.strategy = strategy;
5372
5290
  this.transports = transports;
@@ -5391,7 +5309,7 @@ class websocket_prioritized_cached_strategy_WebSocketPrioritizedCachedStrategy {
5391
5309
  transport: info.transport,
5392
5310
  latency: info.latency,
5393
5311
  });
5394
- strategies.push(new sequential_strategy_SequentialStrategy([transport], {
5312
+ strategies.push(new SequentialStrategy([transport], {
5395
5313
  timeout: info.latency * 2 + 1000,
5396
5314
  failFast: true,
5397
5315
  }));
@@ -5477,9 +5395,9 @@ function flushTransportCache(usingTLS) {
5477
5395
  }
5478
5396
  }
5479
5397
 
5480
- // CONCATENATED MODULE: ./src/core/strategies/delayed_strategy.ts
5398
+ ;// ./src/core/strategies/delayed_strategy.ts
5481
5399
 
5482
- class delayed_strategy_DelayedStrategy {
5400
+ class DelayedStrategy {
5483
5401
  constructor(strategy, { delay: number }) {
5484
5402
  this.strategy = strategy;
5485
5403
  this.options = { delay: number };
@@ -5490,7 +5408,7 @@ class delayed_strategy_DelayedStrategy {
5490
5408
  connect(minPriority, callback) {
5491
5409
  var strategy = this.strategy;
5492
5410
  var runner;
5493
- var timer = new timers_OneOffTimer(this.options.delay, function () {
5411
+ var timer = new OneOffTimer(this.options.delay, function () {
5494
5412
  runner = strategy.connect(minPriority, callback);
5495
5413
  });
5496
5414
  return {
@@ -5510,7 +5428,7 @@ class delayed_strategy_DelayedStrategy {
5510
5428
  }
5511
5429
  }
5512
5430
 
5513
- // CONCATENATED MODULE: ./src/core/strategies/if_strategy.ts
5431
+ ;// ./src/core/strategies/if_strategy.ts
5514
5432
  class IfStrategy {
5515
5433
  constructor(test, trueBranch, falseBranch) {
5516
5434
  this.test = test;
@@ -5527,7 +5445,7 @@ class IfStrategy {
5527
5445
  }
5528
5446
  }
5529
5447
 
5530
- // CONCATENATED MODULE: ./src/core/strategies/first_connected_strategy.ts
5448
+ ;// ./src/core/strategies/first_connected_strategy.ts
5531
5449
  class FirstConnectedStrategy {
5532
5450
  constructor(strategy) {
5533
5451
  this.strategy = strategy;
@@ -5546,7 +5464,7 @@ class FirstConnectedStrategy {
5546
5464
  }
5547
5465
  }
5548
5466
 
5549
- // CONCATENATED MODULE: ./src/runtimes/web/default_strategy.ts
5467
+ ;// ./src/runtimes/web/default_strategy.ts
5550
5468
 
5551
5469
 
5552
5470
 
@@ -5584,11 +5502,11 @@ var getDefaultStrategy = function (config, baseOptions, defineTransport) {
5584
5502
  timeout: 15000,
5585
5503
  timeoutLimit: 60000,
5586
5504
  };
5587
- var ws_manager = new transport_manager_TransportManager({
5505
+ var ws_manager = new TransportManager({
5588
5506
  minPingDelay: 10000,
5589
5507
  maxPingDelay: config.activityTimeout,
5590
5508
  });
5591
- var streaming_manager = new transport_manager_TransportManager({
5509
+ var streaming_manager = new TransportManager({
5592
5510
  lives: 2,
5593
5511
  minPingDelay: 10000,
5594
5512
  maxPingDelay: config.activityTimeout,
@@ -5600,47 +5518,47 @@ var getDefaultStrategy = function (config, baseOptions, defineTransport) {
5600
5518
  var xdr_streaming_transport = defineTransportStrategy('xdr_streaming', 'xdr_streaming', 1, sockjs_options, streaming_manager);
5601
5519
  var xhr_polling_transport = defineTransportStrategy('xhr_polling', 'xhr_polling', 1, sockjs_options);
5602
5520
  var xdr_polling_transport = defineTransportStrategy('xdr_polling', 'xdr_polling', 1, sockjs_options);
5603
- var ws_loop = new sequential_strategy_SequentialStrategy([ws_transport], timeouts);
5604
- var wss_loop = new sequential_strategy_SequentialStrategy([wss_transport], timeouts);
5605
- var sockjs_loop = new sequential_strategy_SequentialStrategy([sockjs_transport], timeouts);
5606
- var streaming_loop = new sequential_strategy_SequentialStrategy([
5521
+ var ws_loop = new SequentialStrategy([ws_transport], timeouts);
5522
+ var wss_loop = new SequentialStrategy([wss_transport], timeouts);
5523
+ var sockjs_loop = new SequentialStrategy([sockjs_transport], timeouts);
5524
+ var streaming_loop = new SequentialStrategy([
5607
5525
  new IfStrategy(testSupportsStrategy(xhr_streaming_transport), xhr_streaming_transport, xdr_streaming_transport),
5608
5526
  ], timeouts);
5609
- var polling_loop = new sequential_strategy_SequentialStrategy([
5527
+ var polling_loop = new SequentialStrategy([
5610
5528
  new IfStrategy(testSupportsStrategy(xhr_polling_transport), xhr_polling_transport, xdr_polling_transport),
5611
5529
  ], timeouts);
5612
- var http_loop = new sequential_strategy_SequentialStrategy([
5613
- new IfStrategy(testSupportsStrategy(streaming_loop), new best_connected_ever_strategy_BestConnectedEverStrategy([
5530
+ var http_loop = new SequentialStrategy([
5531
+ new IfStrategy(testSupportsStrategy(streaming_loop), new BestConnectedEverStrategy([
5614
5532
  streaming_loop,
5615
- new delayed_strategy_DelayedStrategy(polling_loop, { delay: 4000 }),
5533
+ new DelayedStrategy(polling_loop, { delay: 4000 }),
5616
5534
  ]), polling_loop),
5617
5535
  ], timeouts);
5618
5536
  var http_fallback_loop = new IfStrategy(testSupportsStrategy(http_loop), http_loop, sockjs_loop);
5619
5537
  var wsStrategy;
5620
5538
  if (baseOptions.useTLS) {
5621
- wsStrategy = new best_connected_ever_strategy_BestConnectedEverStrategy([
5539
+ wsStrategy = new BestConnectedEverStrategy([
5622
5540
  ws_loop,
5623
- new delayed_strategy_DelayedStrategy(http_fallback_loop, { delay: 2000 }),
5541
+ new DelayedStrategy(http_fallback_loop, { delay: 2000 }),
5624
5542
  ]);
5625
5543
  }
5626
5544
  else {
5627
- wsStrategy = new best_connected_ever_strategy_BestConnectedEverStrategy([
5545
+ wsStrategy = new BestConnectedEverStrategy([
5628
5546
  ws_loop,
5629
- new delayed_strategy_DelayedStrategy(wss_loop, { delay: 2000 }),
5630
- new delayed_strategy_DelayedStrategy(http_fallback_loop, { delay: 5000 }),
5547
+ new DelayedStrategy(wss_loop, { delay: 2000 }),
5548
+ new DelayedStrategy(http_fallback_loop, { delay: 5000 }),
5631
5549
  ]);
5632
5550
  }
5633
- return new websocket_prioritized_cached_strategy_WebSocketPrioritizedCachedStrategy(new FirstConnectedStrategy(new IfStrategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {
5551
+ return new WebSocketPrioritizedCachedStrategy(new FirstConnectedStrategy(new IfStrategy(testSupportsStrategy(ws_transport), wsStrategy, http_fallback_loop)), definedTransports, {
5634
5552
  ttl: 1800000,
5635
5553
  timeline: baseOptions.timeline,
5636
5554
  useTLS: baseOptions.useTLS,
5637
5555
  });
5638
5556
  };
5639
- /* harmony default export */ var default_strategy = (getDefaultStrategy);
5557
+ /* harmony default export */ const default_strategy = (getDefaultStrategy);
5640
5558
 
5641
- // CONCATENATED MODULE: ./src/runtimes/web/transports/transport_connection_initializer.ts
5559
+ ;// ./src/runtimes/web/transports/transport_connection_initializer.ts
5642
5560
 
5643
- /* harmony default export */ var transport_connection_initializer = (function () {
5561
+ /* harmony default export */ function transport_connection_initializer() {
5644
5562
  var self = this;
5645
5563
  self.timeline.info(self.buildTimelineMessage({
5646
5564
  transport: self.name + (self.options.useTLS ? 's' : ''),
@@ -5667,11 +5585,11 @@ var getDefaultStrategy = function (config, baseOptions, defineTransport) {
5667
5585
  else {
5668
5586
  self.onClose();
5669
5587
  }
5670
- });
5588
+ }
5671
5589
 
5672
- // CONCATENATED MODULE: ./src/runtimes/web/http/http_xdomain_request.ts
5590
+ ;// ./src/runtimes/web/http/http_xdomain_request.ts
5673
5591
 
5674
- var http_xdomain_request_hooks = {
5592
+ var hooks = {
5675
5593
  getRequest: function (socket) {
5676
5594
  var xdr = new window.XDomainRequest();
5677
5595
  xdr.ontimeout = function () {
@@ -5701,13 +5619,13 @@ var http_xdomain_request_hooks = {
5701
5619
  xdr.abort();
5702
5620
  },
5703
5621
  };
5704
- /* harmony default export */ var http_xdomain_request = (http_xdomain_request_hooks);
5622
+ /* harmony default export */ const http_xdomain_request = (hooks);
5705
5623
 
5706
- // CONCATENATED MODULE: ./src/core/http/http_request.ts
5624
+ ;// ./src/core/http/http_request.ts
5707
5625
 
5708
5626
 
5709
5627
  const MAX_BUFFER_LENGTH = 256 * 1024;
5710
- class http_request_HTTPRequest extends dispatcher_Dispatcher {
5628
+ class HTTPRequest extends Dispatcher {
5711
5629
  constructor(hooks, method, url) {
5712
5630
  super();
5713
5631
  this.hooks = hooks;
@@ -5767,21 +5685,21 @@ class http_request_HTTPRequest extends dispatcher_Dispatcher {
5767
5685
  }
5768
5686
  }
5769
5687
 
5770
- // CONCATENATED MODULE: ./src/core/http/state.ts
5688
+ ;// ./src/core/http/state.ts
5771
5689
  var State;
5772
5690
  (function (State) {
5773
5691
  State[State["CONNECTING"] = 0] = "CONNECTING";
5774
5692
  State[State["OPEN"] = 1] = "OPEN";
5775
5693
  State[State["CLOSED"] = 3] = "CLOSED";
5776
5694
  })(State || (State = {}));
5777
- /* harmony default export */ var state = (State);
5695
+ /* harmony default export */ const state = (State);
5778
5696
 
5779
- // CONCATENATED MODULE: ./src/core/http/http_socket.ts
5697
+ ;// ./src/core/http/http_socket.ts
5780
5698
 
5781
5699
 
5782
5700
 
5783
5701
  var autoIncrement = 1;
5784
- class http_socket_HTTPSocket {
5702
+ class HTTPSocket {
5785
5703
  constructor(hooks, url) {
5786
5704
  this.hooks = hooks;
5787
5705
  this.session = randomNumber(1000) + '/' + randomString(8);
@@ -5946,9 +5864,9 @@ function randomString(length) {
5946
5864
  }
5947
5865
  return result.join('');
5948
5866
  }
5949
- /* harmony default export */ var http_socket = (http_socket_HTTPSocket);
5867
+ /* harmony default export */ const http_socket = (HTTPSocket);
5950
5868
 
5951
- // CONCATENATED MODULE: ./src/core/http/http_streaming_socket.ts
5869
+ ;// ./src/core/http/http_streaming_socket.ts
5952
5870
  var http_streaming_socket_hooks = {
5953
5871
  getReceiveURL: function (url, session) {
5954
5872
  return url.base + '/' + session + '/xhr_streaming' + url.queryString;
@@ -5963,9 +5881,9 @@ var http_streaming_socket_hooks = {
5963
5881
  socket.onClose(1006, 'Connection interrupted (' + status + ')', false);
5964
5882
  },
5965
5883
  };
5966
- /* harmony default export */ var http_streaming_socket = (http_streaming_socket_hooks);
5884
+ /* harmony default export */ const http_streaming_socket = (http_streaming_socket_hooks);
5967
5885
 
5968
- // CONCATENATED MODULE: ./src/core/http/http_polling_socket.ts
5886
+ ;// ./src/core/http/http_polling_socket.ts
5969
5887
  var http_polling_socket_hooks = {
5970
5888
  getReceiveURL: function (url, session) {
5971
5889
  return url.base + '/' + session + '/xhr' + url.queryString;
@@ -5984,9 +5902,9 @@ var http_polling_socket_hooks = {
5984
5902
  }
5985
5903
  },
5986
5904
  };
5987
- /* harmony default export */ var http_polling_socket = (http_polling_socket_hooks);
5905
+ /* harmony default export */ const http_polling_socket = (http_polling_socket_hooks);
5988
5906
 
5989
- // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http_xhr_request.ts
5907
+ ;// ./src/runtimes/isomorphic/http/http_xhr_request.ts
5990
5908
 
5991
5909
  var http_xhr_request_hooks = {
5992
5910
  getRequest: function (socket) {
@@ -6015,9 +5933,9 @@ var http_xhr_request_hooks = {
6015
5933
  xhr.abort();
6016
5934
  },
6017
5935
  };
6018
- /* harmony default export */ var http_xhr_request = (http_xhr_request_hooks);
5936
+ /* harmony default export */ const http_xhr_request = (http_xhr_request_hooks);
6019
5937
 
6020
- // CONCATENATED MODULE: ./src/runtimes/isomorphic/http/http.ts
5938
+ ;// ./src/runtimes/isomorphic/http/http.ts
6021
5939
 
6022
5940
 
6023
5941
 
@@ -6037,20 +5955,20 @@ var HTTP = {
6037
5955
  return this.createRequest(http_xhr_request, method, url);
6038
5956
  },
6039
5957
  createRequest(hooks, method, url) {
6040
- return new http_request_HTTPRequest(hooks, method, url);
5958
+ return new HTTPRequest(hooks, method, url);
6041
5959
  },
6042
5960
  };
6043
- /* harmony default export */ var http_http = (HTTP);
5961
+ /* harmony default export */ const http_http = (HTTP);
6044
5962
 
6045
- // CONCATENATED MODULE: ./src/runtimes/web/http/http.ts
5963
+ ;// ./src/runtimes/web/http/http.ts
6046
5964
 
6047
5965
 
6048
5966
  http_http.createXDR = function (method, url) {
6049
5967
  return this.createRequest(http_xdomain_request, method, url);
6050
5968
  };
6051
- /* harmony default export */ var web_http_http = (http_http);
5969
+ /* harmony default export */ const web_http_http = (http_http);
6052
5970
 
6053
- // CONCATENATED MODULE: ./src/runtimes/web/runtime.ts
5971
+ ;// ./src/runtimes/web/runtime.ts
6054
5972
 
6055
5973
 
6056
5974
 
@@ -6111,7 +6029,7 @@ var Runtime = {
6111
6029
  }
6112
6030
  },
6113
6031
  createJSONPRequest(url, data) {
6114
- return new jsonp_request_JSONPRequest(url, data);
6032
+ return new JSONPRequest(url, data);
6115
6033
  },
6116
6034
  createScriptRequest(src) {
6117
6035
  return new ScriptRequest(src);
@@ -6140,7 +6058,7 @@ var Runtime = {
6140
6058
  return new ActiveXObject('Microsoft.XMLHTTP');
6141
6059
  },
6142
6060
  getNetwork() {
6143
- return net_info_Network;
6061
+ return Network;
6144
6062
  },
6145
6063
  createWebSocket(url) {
6146
6064
  var Constructor = this.getWebSocketAPI();
@@ -6191,22 +6109,22 @@ var Runtime = {
6191
6109
  return Math.floor(random() * max);
6192
6110
  },
6193
6111
  };
6194
- /* harmony default export */ var runtime = (Runtime);
6112
+ /* harmony default export */ const runtime = (Runtime);
6195
6113
 
6196
- // CONCATENATED MODULE: ./src/core/timeline/level.ts
6114
+ ;// ./src/core/timeline/level.ts
6197
6115
  var TimelineLevel;
6198
6116
  (function (TimelineLevel) {
6199
6117
  TimelineLevel[TimelineLevel["ERROR"] = 3] = "ERROR";
6200
6118
  TimelineLevel[TimelineLevel["INFO"] = 6] = "INFO";
6201
6119
  TimelineLevel[TimelineLevel["DEBUG"] = 7] = "DEBUG";
6202
6120
  })(TimelineLevel || (TimelineLevel = {}));
6203
- /* harmony default export */ var timeline_level = (TimelineLevel);
6121
+ /* harmony default export */ const level = (TimelineLevel);
6204
6122
 
6205
- // CONCATENATED MODULE: ./src/core/timeline/timeline.ts
6123
+ ;// ./src/core/timeline/timeline.ts
6206
6124
 
6207
6125
 
6208
6126
 
6209
- class timeline_Timeline {
6127
+ class Timeline {
6210
6128
  constructor(key, session, options) {
6211
6129
  this.key = key;
6212
6130
  this.session = session;
@@ -6224,13 +6142,13 @@ class timeline_Timeline {
6224
6142
  }
6225
6143
  }
6226
6144
  error(event) {
6227
- this.log(timeline_level.ERROR, event);
6145
+ this.log(level.ERROR, event);
6228
6146
  }
6229
6147
  info(event) {
6230
- this.log(timeline_level.INFO, event);
6148
+ this.log(level.INFO, event);
6231
6149
  }
6232
6150
  debug(event) {
6233
- this.log(timeline_level.DEBUG, event);
6151
+ this.log(level.DEBUG, event);
6234
6152
  }
6235
6153
  isEmpty() {
6236
6154
  return this.events.length === 0;
@@ -6263,12 +6181,12 @@ class timeline_Timeline {
6263
6181
  }
6264
6182
  }
6265
6183
 
6266
- // CONCATENATED MODULE: ./src/core/strategies/transport_strategy.ts
6184
+ ;// ./src/core/strategies/transport_strategy.ts
6267
6185
 
6268
6186
 
6269
6187
 
6270
6188
 
6271
- class transport_strategy_TransportStrategy {
6189
+ class TransportStrategy {
6272
6190
  constructor(name, priority, transport, options) {
6273
6191
  this.name = name;
6274
6192
  this.priority = priority;
@@ -6361,14 +6279,14 @@ function failAttempt(error, callback) {
6361
6279
  };
6362
6280
  }
6363
6281
 
6364
- // CONCATENATED MODULE: ./src/core/strategies/strategy_builder.ts
6282
+ ;// ./src/core/strategies/strategy_builder.ts
6365
6283
 
6366
6284
 
6367
6285
 
6368
6286
 
6369
6287
 
6370
6288
  const { Transports: strategy_builder_Transports } = runtime;
6371
- var strategy_builder_defineTransport = function (config, name, type, priority, options, manager) {
6289
+ var defineTransport = function (config, name, type, priority, options, manager) {
6372
6290
  var transportClass = strategy_builder_Transports[type];
6373
6291
  if (!transportClass) {
6374
6292
  throw new UnsupportedTransport(type);
@@ -6380,7 +6298,7 @@ var strategy_builder_defineTransport = function (config, name, type, priority, o
6380
6298
  var transport;
6381
6299
  if (enabled) {
6382
6300
  options = Object.assign({ ignoreNullOrigin: config.ignoreNullOrigin }, options);
6383
- transport = new transport_strategy_TransportStrategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options);
6301
+ transport = new TransportStrategy(name, priority, manager ? manager.getAssistant(transportClass) : transportClass, options);
6384
6302
  }
6385
6303
  else {
6386
6304
  transport = strategy_builder_UnsupportedStrategy;
@@ -6404,7 +6322,7 @@ var strategy_builder_UnsupportedStrategy = {
6404
6322
  },
6405
6323
  };
6406
6324
 
6407
- // CONCATENATED MODULE: ./src/core/options.ts
6325
+ ;// ./src/core/options.ts
6408
6326
 
6409
6327
  function validateOptions(options) {
6410
6328
  if (options == null) {
@@ -6418,7 +6336,7 @@ function validateOptions(options) {
6418
6336
  }
6419
6337
  }
6420
6338
 
6421
- // CONCATENATED MODULE: ./src/core/auth/user_authenticator.ts
6339
+ ;// ./src/core/auth/user_authenticator.ts
6422
6340
 
6423
6341
 
6424
6342
  const composeChannelQuery = (params, authOptions) => {
@@ -6451,9 +6369,9 @@ const UserAuthenticator = (authOptions) => {
6451
6369
  runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.UserAuthentication, callback);
6452
6370
  };
6453
6371
  };
6454
- /* harmony default export */ var user_authenticator = (UserAuthenticator);
6372
+ /* harmony default export */ const user_authenticator = (UserAuthenticator);
6455
6373
 
6456
- // CONCATENATED MODULE: ./src/core/auth/channel_authorizer.ts
6374
+ ;// ./src/core/auth/channel_authorizer.ts
6457
6375
 
6458
6376
 
6459
6377
  const channel_authorizer_composeChannelQuery = (params, authOptions) => {
@@ -6487,9 +6405,9 @@ const ChannelAuthorizer = (authOptions) => {
6487
6405
  runtime.getAuthorizers()[authOptions.transport](runtime, query, authOptions, AuthRequestType.ChannelAuthorization, callback);
6488
6406
  };
6489
6407
  };
6490
- /* harmony default export */ var channel_authorizer = (ChannelAuthorizer);
6408
+ /* harmony default export */ const channel_authorizer = (ChannelAuthorizer);
6491
6409
 
6492
- // CONCATENATED MODULE: ./src/core/auth/deprecated_channel_authorizer.ts
6410
+ ;// ./src/core/auth/deprecated_channel_authorizer.ts
6493
6411
  const ChannelAuthorizerProxy = (pusher, authOptions, channelAuthorizerGenerator) => {
6494
6412
  const deprecatedAuthorizerOptions = {
6495
6413
  authTransport: authOptions.transport,
@@ -6506,7 +6424,7 @@ const ChannelAuthorizerProxy = (pusher, authOptions, channelAuthorizerGenerator)
6506
6424
  };
6507
6425
  };
6508
6426
 
6509
- // CONCATENATED MODULE: ./src/core/config.ts
6427
+ ;// ./src/core/config.ts
6510
6428
 
6511
6429
 
6512
6430
 
@@ -6581,10 +6499,12 @@ function getEnableStatsConfig(opts) {
6581
6499
  }
6582
6500
  return false;
6583
6501
  }
6502
+ const hasCustomHandler = (auth) => {
6503
+ return 'customHandler' in auth && auth['customHandler'] != null;
6504
+ };
6584
6505
  function buildUserAuthenticator(opts) {
6585
6506
  const userAuthentication = Object.assign(Object.assign({}, defaults.userAuthentication), opts.userAuthentication);
6586
- if ('customHandler' in userAuthentication &&
6587
- userAuthentication['customHandler'] != null) {
6507
+ if (hasCustomHandler(userAuthentication)) {
6588
6508
  return userAuthentication['customHandler'];
6589
6509
  }
6590
6510
  return user_authenticator(userAuthentication);
@@ -6605,24 +6525,26 @@ function buildChannelAuth(opts, pusher) {
6605
6525
  if ('headers' in opts.auth)
6606
6526
  channelAuthorization.headers = opts.auth.headers;
6607
6527
  }
6608
- if ('authorizer' in opts)
6609
- channelAuthorization.customHandler = ChannelAuthorizerProxy(pusher, channelAuthorization, opts.authorizer);
6528
+ if ('authorizer' in opts) {
6529
+ return {
6530
+ customHandler: ChannelAuthorizerProxy(pusher, channelAuthorization, opts.authorizer),
6531
+ };
6532
+ }
6610
6533
  }
6611
6534
  return channelAuthorization;
6612
6535
  }
6613
6536
  function buildChannelAuthorizer(opts, pusher) {
6614
6537
  const channelAuthorization = buildChannelAuth(opts, pusher);
6615
- if ('customHandler' in channelAuthorization &&
6616
- channelAuthorization['customHandler'] != null) {
6538
+ if (hasCustomHandler(channelAuthorization)) {
6617
6539
  return channelAuthorization['customHandler'];
6618
6540
  }
6619
6541
  return channel_authorizer(channelAuthorization);
6620
6542
  }
6621
6543
 
6622
- // CONCATENATED MODULE: ./src/core/watchlist.ts
6544
+ ;// ./src/core/watchlist.ts
6623
6545
 
6624
6546
 
6625
- class watchlist_WatchlistFacade extends dispatcher_Dispatcher {
6547
+ class WatchlistFacade extends Dispatcher {
6626
6548
  constructor(pusher) {
6627
6549
  super(function (eventName, data) {
6628
6550
  logger.debug(`No callbacks on watchlist events for ${eventName}`);
@@ -6645,7 +6567,7 @@ class watchlist_WatchlistFacade extends dispatcher_Dispatcher {
6645
6567
  }
6646
6568
  }
6647
6569
 
6648
- // CONCATENATED MODULE: ./src/core/utils/flat_promise.ts
6570
+ ;// ./src/core/utils/flat_promise.ts
6649
6571
  function flatPromise() {
6650
6572
  let resolve, reject;
6651
6573
  const promise = new Promise((res, rej) => {
@@ -6654,15 +6576,15 @@ function flatPromise() {
6654
6576
  });
6655
6577
  return { promise, resolve, reject };
6656
6578
  }
6657
- /* harmony default export */ var flat_promise = (flatPromise);
6579
+ /* harmony default export */ const flat_promise = (flatPromise);
6658
6580
 
6659
- // CONCATENATED MODULE: ./src/core/user.ts
6581
+ ;// ./src/core/user.ts
6660
6582
 
6661
6583
 
6662
6584
 
6663
6585
 
6664
6586
 
6665
- class user_UserFacade extends dispatcher_Dispatcher {
6587
+ class UserFacade extends Dispatcher {
6666
6588
  constructor(pusher) {
6667
6589
  super(function (eventName, data) {
6668
6590
  logger.debug('No callbacks on user for ' + eventName);
@@ -6693,7 +6615,7 @@ class user_UserFacade extends dispatcher_Dispatcher {
6693
6615
  this._newSigninPromiseIfNeeded();
6694
6616
  }
6695
6617
  });
6696
- this.watchlist = new watchlist_WatchlistFacade(pusher);
6618
+ this.watchlist = new WatchlistFacade(pusher);
6697
6619
  this.pusher.connection.bind('message', (event) => {
6698
6620
  var eventName = event.event;
6699
6621
  if (eventName === 'pusher:signin_success') {
@@ -6751,7 +6673,7 @@ class user_UserFacade extends dispatcher_Dispatcher {
6751
6673
  channel.subscribe();
6752
6674
  }
6753
6675
  };
6754
- this.serverToUserChannel = new channel_Channel(`#server-to-user-${this.user_data.id}`, this.pusher);
6676
+ this.serverToUserChannel = new Channel(`#server-to-user-${this.user_data.id}`, this.pusher);
6755
6677
  this.serverToUserChannel.bind_global((eventName, data) => {
6756
6678
  if (eventName.indexOf('pusher_internal:') === 0 ||
6757
6679
  eventName.indexOf('pusher:') === 0) {
@@ -6790,7 +6712,7 @@ class user_UserFacade extends dispatcher_Dispatcher {
6790
6712
  }
6791
6713
  }
6792
6714
 
6793
- // CONCATENATED MODULE: ./src/core/pusher.ts
6715
+ ;// ./src/core/pusher.ts
6794
6716
 
6795
6717
 
6796
6718
 
@@ -6804,11 +6726,11 @@ class user_UserFacade extends dispatcher_Dispatcher {
6804
6726
 
6805
6727
 
6806
6728
 
6807
- class pusher_Pusher {
6729
+ class Pusher {
6808
6730
  static ready() {
6809
- pusher_Pusher.isReady = true;
6810
- for (var i = 0, l = pusher_Pusher.instances.length; i < l; i++) {
6811
- pusher_Pusher.instances[i].connect();
6731
+ Pusher.isReady = true;
6732
+ for (var i = 0, l = Pusher.instances.length; i < l; i++) {
6733
+ Pusher.instances[i].connect();
6812
6734
  }
6813
6735
  }
6814
6736
  static getClientFeatures() {
@@ -6820,16 +6742,17 @@ class pusher_Pusher {
6820
6742
  checkAppKey(app_key);
6821
6743
  validateOptions(options);
6822
6744
  this.key = app_key;
6823
- this.config = getConfig(options, this);
6745
+ this.options = options;
6746
+ this.config = getConfig(this.options, this);
6824
6747
  this.channels = factory.createChannels();
6825
- this.global_emitter = new dispatcher_Dispatcher();
6748
+ this.global_emitter = new Dispatcher();
6826
6749
  this.sessionID = runtime.randomInt(1000000000);
6827
- this.timeline = new timeline_Timeline(this.key, this.sessionID, {
6750
+ this.timeline = new Timeline(this.key, this.sessionID, {
6828
6751
  cluster: this.config.cluster,
6829
- features: pusher_Pusher.getClientFeatures(),
6752
+ features: Pusher.getClientFeatures(),
6830
6753
  params: this.config.timelineParams || {},
6831
6754
  limit: 50,
6832
- level: timeline_level.INFO,
6755
+ level: level.INFO,
6833
6756
  version: defaults.VERSION,
6834
6757
  });
6835
6758
  if (this.config.enableStats) {
@@ -6839,7 +6762,7 @@ class pusher_Pusher {
6839
6762
  });
6840
6763
  }
6841
6764
  var getStrategy = (options) => {
6842
- return runtime.getDefaultStrategy(this.config, options, strategy_builder_defineTransport);
6765
+ return runtime.getDefaultStrategy(this.config, options, defineTransport);
6843
6766
  };
6844
6767
  this.connection = factory.createConnectionManager(this.key, {
6845
6768
  getStrategy: getStrategy,
@@ -6877,13 +6800,20 @@ class pusher_Pusher {
6877
6800
  this.connection.bind('error', (err) => {
6878
6801
  logger.warn(err);
6879
6802
  });
6880
- pusher_Pusher.instances.push(this);
6881
- this.timeline.info({ instances: pusher_Pusher.instances.length });
6882
- this.user = new user_UserFacade(this);
6883
- if (pusher_Pusher.isReady) {
6803
+ Pusher.instances.push(this);
6804
+ this.timeline.info({ instances: Pusher.instances.length });
6805
+ this.user = new UserFacade(this);
6806
+ if (Pusher.isReady) {
6884
6807
  this.connect();
6885
6808
  }
6886
6809
  }
6810
+ switchCluster(options) {
6811
+ const { appKey, cluster } = options;
6812
+ this.key = appKey;
6813
+ this.options = Object.assign(Object.assign({}, this.options), { cluster });
6814
+ this.config = getConfig(this.options, this);
6815
+ this.connection.switchCluster(this.key);
6816
+ }
6887
6817
  channel(name) {
6888
6818
  return this.channels.find(name);
6889
6819
  }
@@ -6896,7 +6826,7 @@ class pusher_Pusher {
6896
6826
  if (!this.timelineSenderTimer) {
6897
6827
  var usingTLS = this.connection.isUsingTLS();
6898
6828
  var timelineSender = this.timelineSender;
6899
- this.timelineSenderTimer = new timers_PeriodicTimer(60000, function () {
6829
+ this.timelineSenderTimer = new PeriodicTimer(60000, function () {
6900
6830
  timelineSender.send(usingTLS);
6901
6831
  });
6902
6832
  }
@@ -6970,32 +6900,31 @@ class pusher_Pusher {
6970
6900
  this.user.signin();
6971
6901
  }
6972
6902
  }
6973
- pusher_Pusher.instances = [];
6974
- pusher_Pusher.isReady = false;
6975
- pusher_Pusher.logToConsole = false;
6976
- pusher_Pusher.Runtime = runtime;
6977
- pusher_Pusher.ScriptReceivers = runtime.ScriptReceivers;
6978
- pusher_Pusher.DependenciesReceivers = runtime.DependenciesReceivers;
6979
- pusher_Pusher.auth_callbacks = runtime.auth_callbacks;
6980
- /* harmony default export */ var core_pusher = (pusher_Pusher);
6903
+ Pusher.instances = [];
6904
+ Pusher.isReady = false;
6905
+ Pusher.logToConsole = false;
6906
+ Pusher.Runtime = runtime;
6907
+ Pusher.ScriptReceivers = runtime.ScriptReceivers;
6908
+ Pusher.DependenciesReceivers = runtime.DependenciesReceivers;
6909
+ Pusher.auth_callbacks = runtime.auth_callbacks;
6910
+ /* harmony default export */ const pusher = (Pusher);
6981
6911
  function checkAppKey(key) {
6982
6912
  if (key === null || key === undefined) {
6983
6913
  throw 'You must pass your app key when you instantiate Pusher.';
6984
6914
  }
6985
6915
  }
6986
- runtime.setup(pusher_Pusher);
6916
+ runtime.setup(Pusher);
6987
6917
 
6988
6918
  // EXTERNAL MODULE: ./node_modules/tweetnacl/nacl-fast.js
6989
- var nacl_fast = __webpack_require__(2);
6919
+ var nacl_fast = __webpack_require__(601);
6920
+ ;// ./src/core/pusher-with-encryption.ts
6990
6921
 
6991
- // CONCATENATED MODULE: ./src/core/pusher-with-encryption.ts
6992
6922
 
6993
6923
 
6994
-
6995
- class pusher_with_encryption_PusherWithEncryption extends core_pusher {
6924
+ class PusherWithEncryption extends pusher {
6996
6925
  constructor(app_key, options) {
6997
- core_pusher.logToConsole = pusher_with_encryption_PusherWithEncryption.logToConsole;
6998
- core_pusher.log = pusher_with_encryption_PusherWithEncryption.log;
6926
+ pusher.logToConsole = PusherWithEncryption.logToConsole;
6927
+ pusher.log = PusherWithEncryption.log;
6999
6928
  validateOptions(options);
7000
6929
  options.nacl = nacl_fast;
7001
6930
  super(app_key, options);
@@ -7003,7 +6932,68 @@ class pusher_with_encryption_PusherWithEncryption extends core_pusher {
7003
6932
  }
7004
6933
 
7005
6934
 
7006
- /***/ })
7007
- /******/ ]);
6935
+ /***/ },
6936
+
6937
+ /***/ 281
6938
+ () {
6939
+
6940
+ /* (ignored) */
6941
+
6942
+ /***/ }
6943
+
6944
+ /******/ });
6945
+ /************************************************************************/
6946
+ /******/ // The module cache
6947
+ /******/ var __webpack_module_cache__ = {};
6948
+ /******/
6949
+ /******/ // The require function
6950
+ /******/ function __webpack_require__(moduleId) {
6951
+ /******/ // Check if module is in cache
6952
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
6953
+ /******/ if (cachedModule !== undefined) {
6954
+ /******/ return cachedModule.exports;
6955
+ /******/ }
6956
+ /******/ // Create a new module (and put it into the cache)
6957
+ /******/ var module = __webpack_module_cache__[moduleId] = {
6958
+ /******/ // no module.id needed
6959
+ /******/ // no module.loaded needed
6960
+ /******/ exports: {}
6961
+ /******/ };
6962
+ /******/
6963
+ /******/ // Execute the module function
6964
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
6965
+ /******/
6966
+ /******/ // Return the exports of the module
6967
+ /******/ return module.exports;
6968
+ /******/ }
6969
+ /******/
6970
+ /************************************************************************/
6971
+ /******/ /* webpack/runtime/define property getters */
6972
+ /******/ (() => {
6973
+ /******/ // define getter functions for harmony exports
6974
+ /******/ __webpack_require__.d = (exports, definition) => {
6975
+ /******/ for(var key in definition) {
6976
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
6977
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
6978
+ /******/ }
6979
+ /******/ }
6980
+ /******/ };
6981
+ /******/ })();
6982
+ /******/
6983
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
6984
+ /******/ (() => {
6985
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
6986
+ /******/ })();
6987
+ /******/
6988
+ /************************************************************************/
6989
+ /******/
6990
+ /******/ // startup
6991
+ /******/ // Load entry module and return exports
6992
+ /******/ // This entry module used 'module' so it can't be inlined
6993
+ /******/ var __webpack_exports__ = __webpack_require__(42);
6994
+ /******/
6995
+ /******/ return __webpack_exports__;
6996
+ /******/ })()
6997
+ ;
7008
6998
  });
7009
6999
  //# sourceMappingURL=pusher-with-encryption.js.map