comprodls-sdk 2.22.0 → 2.24.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.
@@ -46,6 +46,7 @@ var integrations = require('./services/integrations');
46
46
  var validations = require('./token/validations');
47
47
  var drive = require('./services/drive');
48
48
  var taxonomy = require('./services/taxonomy');
49
+ var rules = require('./services/rules');
49
50
 
50
51
 
51
52
  /*********************************
@@ -147,8 +148,9 @@ comproDLS.prototype.Workflows = workflows;
147
148
  comproDLS.prototype.Integrations = integrations;
148
149
  comproDLS.prototype.Drive = drive;
149
150
  comproDLS.prototype.Taxonomy = taxonomy;
151
+ comproDLS.prototype.Rules = rules;
150
152
 
151
- },{"./config":2,"./helpers":3,"./open_access":10,"./services/activity":13,"./services/analytics":14,"./services/attempts":15,"./services/auth":16,"./services/collab":17,"./services/drive":18,"./services/integrations":19,"./services/invitations":20,"./services/lrs":21,"./services/product":22,"./services/pub":23,"./services/push":26,"./services/pushX":24,"./services/sisevents":27,"./services/spaces":28,"./services/superuser":29,"./services/taxonomy":30,"./services/workflows":31,"./services/xapi":32,"./token":33,"./token/validations":34}],2:[function(require,module,exports){
153
+ },{"./config":2,"./helpers":3,"./open_access":10,"./services/activity":13,"./services/analytics":14,"./services/attempts":15,"./services/auth":16,"./services/collab":17,"./services/drive":18,"./services/integrations":19,"./services/invitations":20,"./services/lrs":21,"./services/product":22,"./services/pub":23,"./services/push":26,"./services/pushX":24,"./services/rules":27,"./services/sisevents":28,"./services/spaces":29,"./services/superuser":30,"./services/taxonomy":31,"./services/workflows":32,"./services/xapi":33,"./token":34,"./token/validations":35}],2:[function(require,module,exports){
152
154
  /*************************************************************************
153
155
  *
154
156
  * COMPRO CONFIDENTIAL
@@ -467,6 +469,13 @@ exports.TAXONOMY_API_URLS = {
467
469
  associateTagsWithEntity: '/org/{orgId}/taxonomy/associate-tags-with-entity',
468
470
  tags: '/org/{orgId}/context/{context}/taxonomy/{taxonomyId}/tags'
469
471
  };
472
+
473
+ exports.RULES_API_URLS = {
474
+ rules: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules',
475
+ particularRule: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules/{ruleId}',
476
+ updateRuleDisplay: '/org/{orgId}/context/{context}/rule_type/{ruleType}/rules/{ruleId}/update-rule-display',
477
+ getUserRule: '/org/{orgId}/context/{context}/rule_type/{ruleType}/users/{userId}/rules'
478
+ };
470
479
 
471
480
  },{}],3:[function(require,module,exports){
472
481
  /*************************************************************************
@@ -753,7 +762,7 @@ function addClassIdQueryParam(url, classId) {
753
762
  function setupAPIToken(request, token) {
754
763
  return request.set('Authorization', token.access_token);
755
764
  };
756
- },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":89,"string-template":130,"superagent":132}],6:[function(require,module,exports){
765
+ },{"../../../config":2,"../../../helpers":3,"../errors":7,"./validations":6,"q":92,"string-template":133,"superagent":135}],6:[function(require,module,exports){
757
766
  /*************************************************************************
758
767
  *
759
768
  * COMPRO CONFIDENTIAL
@@ -1085,7 +1094,7 @@ validator.validators.contains = function(value, options) {
1085
1094
  }
1086
1095
  }
1087
1096
  };
1088
- },{"./errors":7,"validate.js":140}],10:[function(require,module,exports){
1097
+ },{"./errors":7,"validate.js":142}],10:[function(require,module,exports){
1089
1098
  /*************************************************************************
1090
1099
  *
1091
1100
  * COMPRO CONFIDENTIAL
@@ -1208,7 +1217,7 @@ function getSingleInvitation(organizationId, options) {
1208
1217
  }
1209
1218
 
1210
1219
 
1211
- },{"../helpers":3,"q":89,"superagent":132}],11:[function(require,module,exports){
1220
+ },{"../helpers":3,"q":92,"superagent":135}],11:[function(require,module,exports){
1212
1221
  /*************************************************************************
1213
1222
  *
1214
1223
  * COMPRO CONFIDENTIAL
@@ -1419,7 +1428,7 @@ Activity.prototype.getQuestionsCount = function () {
1419
1428
  return dfd.promise;
1420
1429
  }
1421
1430
 
1422
- },{"../../helpers":3,"./attempt":12,"extend":67,"q":89,"superagent":132}],12:[function(require,module,exports){
1431
+ },{"../../helpers":3,"./attempt":12,"extend":69,"q":92,"superagent":135}],12:[function(require,module,exports){
1423
1432
  /*************************************************************************
1424
1433
  *
1425
1434
  * COMPRO CONFIDENTIAL
@@ -1852,7 +1861,7 @@ Attempt.prototype.submit = function (userresponse) {
1852
1861
  return dfd.promise;
1853
1862
  };
1854
1863
 
1855
- },{"../../helpers":3,"extend":67,"q":89,"superagent":132}],13:[function(require,module,exports){
1864
+ },{"../../helpers":3,"extend":69,"q":92,"superagent":135}],13:[function(require,module,exports){
1856
1865
  /*************************************************************************
1857
1866
  *
1858
1867
  * COMPRO CONFIDENTIAL
@@ -3491,7 +3500,7 @@ function getTimeseriesAnalytics(options) {
3491
3500
  }
3492
3501
  return dfd.promise;
3493
3502
  }
3494
- },{"../../helpers":3,"agentkeepalive":36,"q":89,"superagent":132}],15:[function(require,module,exports){
3503
+ },{"../../helpers":3,"agentkeepalive":37,"q":92,"superagent":135}],15:[function(require,module,exports){
3495
3504
  /*************************************************************************
3496
3505
  *
3497
3506
  * COMPRO CONFIDENTIAL
@@ -3835,7 +3844,7 @@ function getUserLastAttemptForActivity(options) {
3835
3844
  return dfd.promise;
3836
3845
  }
3837
3846
 
3838
- },{"../../helpers":3,"q":89,"superagent":132}],16:[function(require,module,exports){
3847
+ },{"../../helpers":3,"q":92,"superagent":135}],16:[function(require,module,exports){
3839
3848
  /*************************************************************************
3840
3849
  *
3841
3850
  * COMPRO CONFIDENTIAL
@@ -4745,7 +4754,8 @@ function getAllClasses(options) {
4745
4754
  class_ownership: classEntity.class_ownership || { owner_status: 'ENROLLED', model: 'STRICT' },
4746
4755
  description: classEntity.description,
4747
4756
  provision_method: classEntity.class.provision_method,
4748
- title: classEntity.title
4757
+ title: classEntity.title,
4758
+ analyticsharingmodel: classEntity.analyticsharingmodel
4749
4759
  };
4750
4760
 
4751
4761
  /**
@@ -5444,6 +5454,7 @@ function encodeURLParameter(options) {
5444
5454
  * description: '', // Optional field
5445
5455
  * class_ownership: 'STRICT' / 'NO_OWNER', // Default - STRICT, Optional field
5446
5456
  * ext_data: {} // Optional
5457
+ * analyticsharingmodel: '' // Optional - Valid values: ['NOINHERIT_SYNCBACK']
5447
5458
  * }
5448
5459
  */
5449
5460
  function createClass(options) {
@@ -5472,6 +5483,7 @@ function createClass(options) {
5472
5483
  if(options.description){ params.description = options.description; }
5473
5484
  if(options.class_ownership){ params.class_ownership = options.class_ownership; }
5474
5485
  if(options.ext_data){ params.ext_data = options.ext_data; }
5486
+ if(options.analyticsharingmodel){ params.ext_data = options.analyticsharingmodel; }
5475
5487
 
5476
5488
  //Setup request with URL and Params
5477
5489
  var requestAPI = request.post(url).send(params);
@@ -5565,6 +5577,7 @@ function updateClass(options) {
5565
5577
  "description": "string",
5566
5578
  "ext_data": {}, // optional
5567
5579
  "model": "STRICT",
5580
+ "analyticsharingmodel":"NOINHERIT_SYNCBACK" // optional
5568
5581
  "owner": {
5569
5582
  "userid": "string" //Mandatory if model is 'STRICT'
5570
5583
  },
@@ -6558,7 +6571,7 @@ function cloneClass(options) {
6558
6571
  return dfd.promise;
6559
6572
  }
6560
6573
 
6561
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":36,"q":89,"superagent":132}],17:[function(require,module,exports){
6574
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"agentkeepalive":37,"q":92,"superagent":135}],17:[function(require,module,exports){
6562
6575
  /*************************************************************************
6563
6576
  *
6564
6577
  * COMPRO CONFIDENTIAL
@@ -7028,7 +7041,7 @@ function updateConnectionForUser(orgid, token, config, options, action) {
7028
7041
  return dfd.promise;
7029
7042
  }
7030
7043
 
7031
- },{"../../helpers":3,"q":89,"superagent":132}],18:[function(require,module,exports){
7044
+ },{"../../helpers":3,"q":92,"superagent":135}],18:[function(require,module,exports){
7032
7045
  /*************************************************************************
7033
7046
  *
7034
7047
  * COMPRO CONFIDENTIAL
@@ -7174,7 +7187,7 @@ function getAllDocumentsInAFolder(options) {
7174
7187
  return dfd.promise;
7175
7188
  }
7176
7189
 
7177
- },{"../../helpers":3,"q":89,"superagent":132}],19:[function(require,module,exports){
7190
+ },{"../../helpers":3,"q":92,"superagent":135}],19:[function(require,module,exports){
7178
7191
  /*************************************************************************
7179
7192
  *
7180
7193
  * COMPRO CONFIDENTIAL
@@ -7512,7 +7525,7 @@ function publishCustomEvents(options) {
7512
7525
  return deferred.promise;
7513
7526
  }
7514
7527
 
7515
- },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":89,"superagent":132}],20:[function(require,module,exports){
7528
+ },{"../../helpers":3,"../../helpers/lib/api/converter":4,"q":92,"superagent":135}],20:[function(require,module,exports){
7516
7529
  /*************************************************************************
7517
7530
  *
7518
7531
  * COMPRO CONFIDENTIAL
@@ -7837,7 +7850,7 @@ function resendSingleInvitation(options) {
7837
7850
  return dfd.promise;
7838
7851
  }
7839
7852
 
7840
- },{"../../helpers":3,"q":89,"superagent":132}],21:[function(require,module,exports){
7853
+ },{"../../helpers":3,"q":92,"superagent":135}],21:[function(require,module,exports){
7841
7854
  /*************************************************************************
7842
7855
  *
7843
7856
  * COMPRO CONFIDENTIAL
@@ -8298,7 +8311,7 @@ function createStatement(options) {
8298
8311
  }*/
8299
8312
 
8300
8313
 
8301
- },{"../../helpers":3,"q":89,"tincanjs":134}],22:[function(require,module,exports){
8314
+ },{"../../helpers":3,"q":92,"tincanjs":136}],22:[function(require,module,exports){
8302
8315
  /*************************************************************************
8303
8316
  *
8304
8317
  * COMPRO CONFIDENTIAL
@@ -8646,7 +8659,7 @@ function getSingleProductFamily(options) {
8646
8659
  return dfd.promise;
8647
8660
  }
8648
8661
 
8649
- },{"../../helpers":3,"q":89,"superagent":132}],23:[function(require,module,exports){
8662
+ },{"../../helpers":3,"q":92,"superagent":135}],23:[function(require,module,exports){
8650
8663
  /*************************************************************************
8651
8664
  *
8652
8665
  * COMPRO CONFIDENTIAL
@@ -9246,7 +9259,7 @@ function getAllProductFamilies(options) {
9246
9259
  return dfd.promise;
9247
9260
  }
9248
9261
 
9249
- },{"../../helpers":3,"q":89,"superagent":132}],24:[function(require,module,exports){
9262
+ },{"../../helpers":3,"q":92,"superagent":135}],24:[function(require,module,exports){
9250
9263
  /*************************************************************************
9251
9264
  *
9252
9265
  * COMPRO CONFIDENTIAL
@@ -9438,7 +9451,7 @@ function grantByAccountIdOnExtUserId(options) {
9438
9451
  }
9439
9452
 
9440
9453
 
9441
- },{"../../helpers":3,"./pubnubClientWrapper":25,"q":89,"superagent":132}],25:[function(require,module,exports){
9454
+ },{"../../helpers":3,"./pubnubClientWrapper":25,"q":92,"superagent":135}],25:[function(require,module,exports){
9442
9455
  var pubNub = require("pubnub");
9443
9456
  var EventEmitter = require("events").EventEmitter;
9444
9457
  var helpers = require('../../helpers');
@@ -9651,7 +9664,7 @@ module.exports = function () {
9651
9664
 
9652
9665
  }; //End of Client Wrapper module
9653
9666
 
9654
- },{"../../helpers":3,"events":66,"pubnub":87}],26:[function(require,module,exports){
9667
+ },{"../../helpers":3,"events":68,"pubnub":90}],26:[function(require,module,exports){
9655
9668
  /*************************************************************************
9656
9669
  *
9657
9670
  * COMPRO CONFIDENTIAL
@@ -9840,7 +9853,474 @@ function _setup(orgId, userId) {
9840
9853
  return dfd.promise;
9841
9854
  }
9842
9855
 
9843
- },{"../../helpers":3,"events":66,"q":89,"socket.io-client":108}],27:[function(require,module,exports){
9856
+ },{"../../helpers":3,"events":68,"q":92,"socket.io-client":111}],27:[function(require,module,exports){
9857
+ /*************************************************************************
9858
+ *
9859
+ * COMPRO CONFIDENTIAL
9860
+ * __________________
9861
+ *
9862
+ * [2015] - [2020] Compro Technologies Private Limited
9863
+ * All Rights Reserved.
9864
+ *
9865
+ * NOTICE: All information contained herein is, and remains
9866
+ * the property of Compro Technologies Private Limited. The
9867
+ * intellectual and technical concepts contained herein are
9868
+ * proprietary to Compro Technologies Private Limited and may
9869
+ * be covered by U.S. and Foreign Patents, patents in process,
9870
+ * and are protected by trade secret or copyright law.
9871
+ *
9872
+ * Dissemination of this information or reproduction of this material
9873
+ * is strictly forbidden unless prior written permission is obtained
9874
+ * from Compro Technologies Pvt. Ltd..
9875
+ ***************************************************************************/
9876
+
9877
+ /***********************************************************
9878
+ * comproDLS SDK Rules API Adaptor
9879
+ * Functions for calling Rules API.
9880
+ ************************************************************/
9881
+
9882
+ var q = require('q');
9883
+ var request = require('superagent');
9884
+ var helpers = require('../../helpers');
9885
+
9886
+ var DLSError = helpers.errors.DLSError;
9887
+
9888
+ /*********************************
9889
+ * Setting Up Module Entry Point
9890
+ **********************************/
9891
+ module.exports = rules;
9892
+ //Rules Adaptor Contsructor
9893
+ function rules() {
9894
+ return {
9895
+ getRules: getRules.bind(this),
9896
+ getParticularRule: getParticularRule.bind(this),
9897
+ getUserRule: getUserRule.bind(this),
9898
+ updateRuleDisplay: updateRuleDisplay.bind(this),
9899
+ createRule: createRule.bind(this),
9900
+ updateRule: updateRule.bind(this),
9901
+ deleteRule: deleteRule.bind(this)
9902
+ };
9903
+ }
9904
+
9905
+ /*********************************
9906
+ * Public Function definitions
9907
+ **********************************/
9908
+
9909
+ /**
9910
+ * options = {
9911
+ * context: '', // Mandatory
9912
+ * ruleType: '', // Mandatory
9913
+ * cursor: '' // Optional
9914
+ * }
9915
+ */
9916
+ function getRules(options) {
9917
+ var self = this;
9918
+
9919
+ //Initializing promise
9920
+ var dfd = q.defer();
9921
+
9922
+ //Validations
9923
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
9924
+ if (err) {
9925
+ dfd.reject(err);
9926
+ } else {
9927
+ if (options && options.context && options.ruleType) {
9928
+ //Passed all validations, Contruct API url
9929
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.rules;
9930
+ url = helpers.api.constructAPIUrl(url, {
9931
+ orgId: self.orgId,
9932
+ context: encodeURIComponent(options.context),
9933
+ ruleType: options.ruleType
9934
+ });
9935
+
9936
+ //Setup request with URL and Params
9937
+ var queryParam = { cursor: options.cursor };
9938
+
9939
+ var requestAPI = request.get(url)
9940
+ .set('Content-Type', 'application/json')
9941
+ .set('Accept', 'application/json')
9942
+ .query(queryParam);
9943
+
9944
+ if (self.traceid) {
9945
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
9946
+ }
9947
+
9948
+ //Setup token in Authorization header
9949
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
9950
+
9951
+ requestAPI.end(function (err, response) {
9952
+ if (err) {
9953
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
9954
+ dfd.reject(err);
9955
+ } else {
9956
+ dfd.resolve(response.body);
9957
+ }
9958
+ });
9959
+ } else {
9960
+ err = {};
9961
+ err.message = err.description = 'context or ruleType not found in request options.';
9962
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
9963
+ dfd.reject(err);
9964
+ }
9965
+ }
9966
+ return dfd.promise;
9967
+ }
9968
+
9969
+ /**
9970
+ * options = {
9971
+ * context: '', // Mandatory
9972
+ * ruleType: '', // Mandatory
9973
+ * ruleId: '' // Mandatory
9974
+ * }
9975
+ */
9976
+ function getParticularRule(options) {
9977
+ var self = this;
9978
+
9979
+ //Initializing promise
9980
+ var dfd = q.defer();
9981
+
9982
+ //Validations
9983
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
9984
+ if (err) {
9985
+ dfd.reject(err);
9986
+ } else {
9987
+ if (options && options.context && options.ruleType && options.ruleId) {
9988
+ //Passed all validations, Contruct API url
9989
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
9990
+ url = helpers.api.constructAPIUrl(url, {
9991
+ orgId: self.orgId,
9992
+ context: encodeURIComponent(options.context),
9993
+ ruleType: options.ruleType,
9994
+ ruleId: options.ruleId
9995
+ });
9996
+
9997
+ //Setup request with URL and Params
9998
+ var requestAPI = request.get(url);
9999
+
10000
+ if (self.traceid) {
10001
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
10002
+ }
10003
+
10004
+ //Setup token in Authorization header
10005
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10006
+
10007
+ requestAPI.end(function (err, response) {
10008
+ if (err) {
10009
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
10010
+ dfd.reject(err);
10011
+ } else {
10012
+ dfd.resolve(response.body);
10013
+ }
10014
+ });
10015
+ } else {
10016
+ err = {};
10017
+ err.message = err.description = 'context or ruleType or ruleId not found' +
10018
+ ' in request options.';
10019
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10020
+ dfd.reject(err);
10021
+ }
10022
+ }
10023
+ return dfd.promise;
10024
+ }
10025
+
10026
+ /**
10027
+ * options = {
10028
+ * orgId: '', // Mandatory
10029
+ * context: '', // Mandatory
10030
+ * ruleType: '', // Mandatory
10031
+ * userId: '', // Mandatory
10032
+ * mergeGlobalRules:'' // Optional
10033
+ * }
10034
+ */
10035
+ function getUserRule(options) {
10036
+ var self = this;
10037
+
10038
+ //Initializing promise
10039
+ var dfd = q.defer();
10040
+
10041
+ if (options && options.orgId && options.context && options.ruleType && options.userId) {
10042
+ //Passed all validations, Contruct API url
10043
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.getUserRule;
10044
+ url = helpers.api.constructAPIUrl(url, {
10045
+ orgId: self.orgId,
10046
+ context: encodeURIComponent(options.context),
10047
+ ruleType: options.ruleType,
10048
+ userId: options.userId
10049
+ });
10050
+
10051
+ //Setup request with URL and Params
10052
+ var queryParam = { mergeGlobalRules: options.mergeGlobalRules };
10053
+
10054
+ var requestAPI = request.get(url)
10055
+ .set('Content-Type', 'application/json')
10056
+ .set('Accept', 'application/json')
10057
+ .query(queryParam);
10058
+
10059
+ if (self.traceid) {
10060
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
10061
+ }
10062
+
10063
+ //Setup token in Authorization header
10064
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10065
+
10066
+ requestAPI.end(function (err, response) {
10067
+ if (err) {
10068
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
10069
+ dfd.reject(err);
10070
+ } else {
10071
+ dfd.resolve(response.body);
10072
+ }
10073
+ });
10074
+ } else {
10075
+ var err = {};
10076
+ err.message = err.description = 'Mandatory params - orgId or context or ruleType or userId ' +
10077
+ 'not found in request options.';
10078
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10079
+ dfd.reject(err);
10080
+ }
10081
+
10082
+ return dfd.promise;
10083
+ }
10084
+
10085
+ /**
10086
+ * options = {
10087
+ * context: '', // Mandatory
10088
+ * ruleType: '', // Mandatory
10089
+ * ruleId: '', // Mandatory
10090
+ * body: {
10091
+ * rule_display: '' // Mandatory
10092
+ * }
10093
+ * }
10094
+ */
10095
+ function updateRuleDisplay(options) {
10096
+ var self = this;
10097
+ // Initializing promise
10098
+ var dfd = q.defer();
10099
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10100
+ if (err) { dfd.reject(err); }
10101
+ else {
10102
+ if (options && options.context && options.ruleType && options.ruleId &&
10103
+ options.body && options.body.rule_display) {
10104
+ // Passed all validations, Contruct API url
10105
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.updateRuleDisplay;
10106
+ url = helpers.api.constructAPIUrl(url, {
10107
+ orgId: self.orgId,
10108
+ context: encodeURIComponent(options.context),
10109
+ ruleType: options.ruleType,
10110
+ ruleId: options.ruleId
10111
+ });
10112
+
10113
+ // Setup request with URL and Params
10114
+ var requestAPI = request.put(url)
10115
+ .set('Content-Type', 'application/json')
10116
+ .set('Accept', 'application/json')
10117
+ .send(options.body);
10118
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10119
+
10120
+ //Setup token in Authorization header
10121
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10122
+
10123
+ requestAPI.end(function (error, response) {
10124
+ if (error) {
10125
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10126
+ dfd.reject(err);
10127
+ }
10128
+ else { dfd.resolve(response.body); }
10129
+ });
10130
+ } else {
10131
+ err = {};
10132
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId ' +
10133
+ 'or body.rule_display not found in request options.';
10134
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10135
+ dfd.reject(err);
10136
+ }
10137
+ }
10138
+ return dfd.promise;
10139
+ }
10140
+
10141
+ /**
10142
+ * options = {
10143
+ * context: '', // Mandatory
10144
+ * ruleType: '', // Mandatory
10145
+ * body: {
10146
+ * ruleid: '', // Mandatory
10147
+ * scope: '', // Mandatory
10148
+ * entities: [ // Min. length 1
10149
+ * {
10150
+ * id:'', // eg. item code
10151
+ * type:'' // eg. item/folder/product
10152
+ * },
10153
+ * ...],
10154
+ * user: ['extuserid1','extuserid2', ...],
10155
+ * rule_data_individual: {},
10156
+ * rule_data_common: {},
10157
+ * rule_display: {}
10158
+ * }
10159
+ * }
10160
+ */
10161
+ function createRule(options) {
10162
+ var self = this;
10163
+ // Initializing promise
10164
+ var dfd = q.defer();
10165
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10166
+ if (err) { dfd.reject(err); }
10167
+ else {
10168
+ if (options && options.context && options.ruleType && options.body) {
10169
+ // Passed all validations, Contruct API url
10170
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.rules;
10171
+ url = helpers.api.constructAPIUrl(url, {
10172
+ orgId: self.orgId,
10173
+ context: encodeURIComponent(options.context),
10174
+ ruleType: options.ruleType
10175
+ });
10176
+
10177
+ // Setup request with URL and Params
10178
+ var requestAPI = request.post(url)
10179
+ .set('Content-Type', 'application/json')
10180
+ .set('Accept', 'application/json')
10181
+ .send(options.body);
10182
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10183
+
10184
+ //Setup token in Authorization header
10185
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10186
+
10187
+ requestAPI.end(function (error, response) {
10188
+ if (error) {
10189
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10190
+ dfd.reject(err);
10191
+ }
10192
+ else { dfd.resolve(response.body); }
10193
+ });
10194
+ } else {
10195
+ err = {};
10196
+ err.message = err.description = 'Mandatory params - context or ruleType or body' +
10197
+ ' not found in request options.';
10198
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10199
+ dfd.reject(err);
10200
+ }
10201
+ }
10202
+ return dfd.promise;
10203
+ }
10204
+
10205
+ /**
10206
+ * options = {
10207
+ * context: '', // Mandatory
10208
+ * ruleType: '', // Mandatory
10209
+ * ruleId: '', // Mandatory
10210
+ * body: {
10211
+ * scope: '', // Mandatory
10212
+ * entities: [ // Min. length 1
10213
+ * {
10214
+ * id:'', // eg. item code
10215
+ * type:'' // eg. item/folder/product
10216
+ * },
10217
+ * ...],
10218
+ * user: ['extuserid1','extuserid2', ...],
10219
+ * rule_data_individual: {}, // Optional
10220
+ * rule_data_common: {} // Optional
10221
+ * }
10222
+ * }
10223
+ */
10224
+ function updateRule(options) {
10225
+ var self = this;
10226
+ // Initializing promise
10227
+ var dfd = q.defer();
10228
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10229
+ if (err) { dfd.reject(err); }
10230
+ else {
10231
+ if (options && options.context && options.ruleType && options.ruleId && options.body) {
10232
+ // Passed all validations, Contruct API url
10233
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
10234
+ url = helpers.api.constructAPIUrl(url, {
10235
+ orgId: self.orgId,
10236
+ context: encodeURIComponent(options.context),
10237
+ ruleType: options.ruleType,
10238
+ ruleId: options.ruleId
10239
+ });
10240
+
10241
+ // Setup request with URL and Params
10242
+ var requestAPI = request.put(url)
10243
+ .set('Content-Type', 'application/json')
10244
+ .set('Accept', 'application/json')
10245
+ .send(options.body);
10246
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10247
+
10248
+ //Setup token in Authorization header
10249
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10250
+
10251
+ requestAPI.end(function (error, response) {
10252
+ if (error) {
10253
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10254
+ dfd.reject(err);
10255
+ }
10256
+ else { dfd.resolve(response.body); }
10257
+ });
10258
+ } else {
10259
+ err = {};
10260
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId or body ' +
10261
+ 'not found in request options.';
10262
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10263
+ dfd.reject(err);
10264
+ }
10265
+ }
10266
+ return dfd.promise;
10267
+ }
10268
+
10269
+ /**
10270
+ * options = {
10271
+ * context: '', // Mandatory
10272
+ * ruleType: '', // Mandatory
10273
+ * ruleId: '' // Mandatory
10274
+ * }
10275
+ */
10276
+ function deleteRule(options) {
10277
+ var self = this;
10278
+ // Initializing promise
10279
+ var dfd = q.defer();
10280
+
10281
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
10282
+ if (err) { dfd.reject(err); }
10283
+ else {
10284
+ if (options && options.context && options.ruleType && options.ruleId) {
10285
+ // Passed all validations, Contruct API url
10286
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.RULES_API_URLS.particularRule;
10287
+ url = helpers.api.constructAPIUrl(url, {
10288
+ orgId: self.orgId,
10289
+ context: encodeURIComponent(options.context),
10290
+ ruleType: options.ruleType,
10291
+ ruleId: options.ruleId
10292
+ });
10293
+
10294
+ // Setup request with URL and Params
10295
+ var requestAPI = request.delete(url);
10296
+
10297
+ //Setup token in Authorization header
10298
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
10299
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
10300
+
10301
+ requestAPI.end(function (error, response) {
10302
+ if (error) {
10303
+ err = {};
10304
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
10305
+ dfd.reject(err);
10306
+ }
10307
+ else {
10308
+ dfd.resolve(response.body);
10309
+ }
10310
+ });
10311
+ }
10312
+ else {
10313
+ err = {};
10314
+ err.message = err.description = 'Mandatory params - context or ruleType or ruleId not found' +
10315
+ ' in request options.';
10316
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
10317
+ dfd.reject(err);
10318
+ }
10319
+ }
10320
+ return dfd.promise;
10321
+ }
10322
+
10323
+ },{"../../helpers":3,"q":92,"superagent":135}],28:[function(require,module,exports){
9844
10324
  /*************************************************************************
9845
10325
  *
9846
10326
  * COMPRO CONFIDENTIAL
@@ -9955,7 +10435,7 @@ function postSISEvent(options) {
9955
10435
  return dfd.promise;
9956
10436
  }
9957
10437
 
9958
- },{"../../helpers":3,"q":89,"superagent":132,"underscore":136}],28:[function(require,module,exports){
10438
+ },{"../../helpers":3,"q":92,"superagent":135,"underscore":138}],29:[function(require,module,exports){
9959
10439
  /*************************************************************************
9960
10440
  *
9961
10441
  * COMPRO CONFIDENTIAL
@@ -10992,7 +11472,7 @@ function updateInstituteTitle(options){
10992
11472
  return dfd.promise;
10993
11473
  }
10994
11474
 
10995
- },{"../../helpers":3,"q":89,"superagent":132}],29:[function(require,module,exports){
11475
+ },{"../../helpers":3,"q":92,"superagent":135}],30:[function(require,module,exports){
10996
11476
  /*************************************************************************
10997
11477
  *
10998
11478
  * COMPRO CONFIDENTIAL
@@ -11169,7 +11649,7 @@ function provisionSpacesToSuperAdmin(options) {
11169
11649
  return dfd.promise;
11170
11650
  }
11171
11651
 
11172
- },{"../../helpers":3,"q":89,"superagent":132}],30:[function(require,module,exports){
11652
+ },{"../../helpers":3,"q":92,"superagent":135}],31:[function(require,module,exports){
11173
11653
  /*************************************************************************
11174
11654
  *
11175
11655
  * COMPRO CONFIDENTIAL
@@ -11298,7 +11778,11 @@ function createTags(options) {
11298
11778
  if(options && options.context && options.taxonomyid && options.body && options.body.tags && (options.body.tags.length > 0)) {
11299
11779
  // Passed all validations, Contruct API url
11300
11780
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11301
- url = helpers.api.constructAPIUrl(url,{ orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
11781
+ url = helpers.api.constructAPIUrl(url, {
11782
+ orgId: self.orgId,
11783
+ context: encodeURIComponent(options.context),
11784
+ taxonomyId: options.taxonomyid
11785
+ });
11302
11786
 
11303
11787
  var requestAPI = request.post(url)
11304
11788
  .set('Content-Type', 'application/json')
@@ -11347,7 +11831,11 @@ function updateTags(options) {
11347
11831
 
11348
11832
  // Passed all validations, Contruct API url
11349
11833
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11350
- url = helpers.api.constructAPIUrl(url,{ orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
11834
+ url = helpers.api.constructAPIUrl(url, {
11835
+ orgId: self.orgId,
11836
+ context: encodeURIComponent(options.context),
11837
+ taxonomyId: options.taxonomyid
11838
+ });
11351
11839
 
11352
11840
  // Setup request with URL and Params
11353
11841
  var requestAPI = request.put(url)
@@ -11395,7 +11883,11 @@ function deleteTags(options) {
11395
11883
  if (options && options.context && options.taxonomyid) {
11396
11884
  // Passed all validations, Contruct API url
11397
11885
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11398
- url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
11886
+ url = helpers.api.constructAPIUrl(url, {
11887
+ orgId: self.orgId,
11888
+ context: encodeURIComponent(options.context),
11889
+ taxonomyId: options.taxonomyid
11890
+ });
11399
11891
 
11400
11892
  var queryParam = {};
11401
11893
  if(options.tagid) { queryParam.tagid = options.tagid; }
@@ -11446,14 +11938,18 @@ function getTag(options) {
11446
11938
  if(options && options.context && options.taxonomyid && options.tagid) {
11447
11939
  // Passed all validations, Contruct API url
11448
11940
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11449
- url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
11450
-
11941
+ url = helpers.api.constructAPIUrl(url, {
11942
+ orgId: self.orgId,
11943
+ context: encodeURIComponent(options.context),
11944
+ taxonomyId: options.taxonomyid
11945
+ });
11946
+
11451
11947
  // Setup request with URL and Params
11452
11948
  var queryParam = {
11453
11949
  hierarchy: false,
11454
11950
  tagid: options.tagid
11455
11951
  };
11456
-
11952
+
11457
11953
  var requestAPI = request.get(url)
11458
11954
  .set('Content-Type', 'application/json')
11459
11955
  .set('Accept', 'application/json')
@@ -11462,7 +11958,7 @@ function getTag(options) {
11462
11958
 
11463
11959
  //Setup token in Authorization header
11464
11960
  requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11465
-
11961
+
11466
11962
  requestAPI.end(function(error, response) {
11467
11963
  if(error) {
11468
11964
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
@@ -11498,14 +11994,18 @@ function getTagHierarchy(options) {
11498
11994
  if(options && options.context && options.taxonomyid && options.tagid) {
11499
11995
  // Passed all validations, Contruct API url
11500
11996
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11501
- url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
11502
-
11997
+ url = helpers.api.constructAPIUrl(url, {
11998
+ orgId: self.orgId,
11999
+ context: encodeURIComponent(options.context),
12000
+ taxonomyId: options.taxonomyid
12001
+ });
12002
+
11503
12003
  // Setup request with URL and Params
11504
12004
  var queryParam = {
11505
12005
  hierarchy: true,
11506
12006
  tagid: options.tagid
11507
12007
  };
11508
-
12008
+
11509
12009
  var requestAPI = request.get(url)
11510
12010
  .set('Content-Type', 'application/json')
11511
12011
  .set('Accept', 'application/json')
@@ -11514,7 +12014,7 @@ function getTagHierarchy(options) {
11514
12014
 
11515
12015
  //Setup token in Authorization header
11516
12016
  requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11517
-
12017
+
11518
12018
  requestAPI.end(function(error, response) {
11519
12019
  if(error) {
11520
12020
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
@@ -11549,7 +12049,11 @@ function getAllTags(options) {
11549
12049
  if(options && options.context && options.taxonomyid) {
11550
12050
  // Passed all validations, Contruct API url
11551
12051
  var url = self.config.DEFAULT_HOSTS.AUTH + self.config.TAXONOMY_API_URLS.tags;
11552
- url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, context: options.context, taxonomyId: options.taxonomyid });
12052
+ url = helpers.api.constructAPIUrl(url, {
12053
+ orgId: self.orgId,
12054
+ context: encodeURIComponent(options.context),
12055
+ taxonomyId: options.taxonomyid
12056
+ });
11553
12057
 
11554
12058
  // Setup request with URL and Params
11555
12059
  var queryParam = {
@@ -11564,7 +12068,7 @@ function getAllTags(options) {
11564
12068
 
11565
12069
  //Setup token in Authorization header
11566
12070
  requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
11567
-
12071
+
11568
12072
  requestAPI.end(function(error, response) {
11569
12073
  if(error) {
11570
12074
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
@@ -11580,8 +12084,9 @@ function getAllTags(options) {
11580
12084
  }
11581
12085
  }
11582
12086
  return dfd.promise;
11583
- }
11584
- },{"../../helpers":3,"q":89,"superagent":132}],31:[function(require,module,exports){
12087
+ }
12088
+
12089
+ },{"../../helpers":3,"q":92,"superagent":135}],32:[function(require,module,exports){
11585
12090
  /*************************************************************************
11586
12091
  *
11587
12092
  * COMPRO CONFIDENTIAL
@@ -12047,7 +12552,7 @@ function updateWorkflowRequest(options) {
12047
12552
  }
12048
12553
  return dfd.promise;
12049
12554
  }
12050
- },{"./../../helpers":3,"q":89,"superagent":132}],32:[function(require,module,exports){
12555
+ },{"./../../helpers":3,"q":92,"superagent":135}],33:[function(require,module,exports){
12051
12556
  /*************************************************************************
12052
12557
  *
12053
12558
  * COMPRO CONFIDENTIAL
@@ -12324,7 +12829,7 @@ function resetUserProductProgress(options) {
12324
12829
  return dfd.promise;
12325
12830
  }
12326
12831
 
12327
- },{"../../helpers":3,"q":89,"superagent":132}],33:[function(require,module,exports){
12832
+ },{"../../helpers":3,"q":92,"superagent":135}],34:[function(require,module,exports){
12328
12833
  /*************************************************************************
12329
12834
  *
12330
12835
  * COMPRO CONFIDENTIAL
@@ -12440,7 +12945,7 @@ function authWithToken(organizationId, token, options) {
12440
12945
  return dfd.promise;
12441
12946
  };
12442
12947
 
12443
- },{"../helpers":3,"./validations":34,"q":89,"superagent":132}],34:[function(require,module,exports){
12948
+ },{"../helpers":3,"./validations":35,"q":92,"superagent":135}],35:[function(require,module,exports){
12444
12949
  /*************************************************************************
12445
12950
  *
12446
12951
  * COMPRO CONFIDENTIAL
@@ -12530,7 +13035,7 @@ function validateAuthWithExtUser(organizationId, options) {
12530
13035
  };
12531
13036
 
12532
13037
 
12533
- },{"../helpers":3}],35:[function(require,module,exports){
13038
+ },{"../helpers":3}],36:[function(require,module,exports){
12534
13039
  module.exports = after
12535
13040
 
12536
13041
  function after(count, callback, err_cb) {
@@ -12560,14 +13065,14 @@ function after(count, callback, err_cb) {
12560
13065
 
12561
13066
  function noop() {}
12562
13067
 
12563
- },{}],36:[function(require,module,exports){
13068
+ },{}],37:[function(require,module,exports){
12564
13069
  module.exports = noop;
12565
13070
  module.exports.HttpsAgent = noop;
12566
13071
 
12567
13072
  // Noop function for browser since native api's don't use agents.
12568
13073
  function noop () {}
12569
13074
 
12570
- },{}],37:[function(require,module,exports){
13075
+ },{}],38:[function(require,module,exports){
12571
13076
  /**
12572
13077
  * An abstraction for slicing an arraybuffer even when
12573
13078
  * ArrayBuffer.prototype.slice is not supported
@@ -12598,7 +13103,7 @@ module.exports = function(arraybuffer, start, end) {
12598
13103
  return result.buffer;
12599
13104
  };
12600
13105
 
12601
- },{}],38:[function(require,module,exports){
13106
+ },{}],39:[function(require,module,exports){
12602
13107
 
12603
13108
  /**
12604
13109
  * Expose `Backoff`.
@@ -12685,7 +13190,7 @@ Backoff.prototype.setJitter = function(jitter){
12685
13190
  };
12686
13191
 
12687
13192
 
12688
- },{}],39:[function(require,module,exports){
13193
+ },{}],40:[function(require,module,exports){
12689
13194
  /*
12690
13195
  * base64-arraybuffer
12691
13196
  * https://github.com/niklasvh/base64-arraybuffer
@@ -12746,7 +13251,7 @@ Backoff.prototype.setJitter = function(jitter){
12746
13251
  };
12747
13252
  })("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
12748
13253
 
12749
- },{}],40:[function(require,module,exports){
13254
+ },{}],41:[function(require,module,exports){
12750
13255
  var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
12751
13256
 
12752
13257
  ;(function (exports) {
@@ -12872,7 +13377,7 @@ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
12872
13377
  exports.fromByteArray = uint8ToBase64
12873
13378
  }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
12874
13379
 
12875
- },{}],41:[function(require,module,exports){
13380
+ },{}],42:[function(require,module,exports){
12876
13381
  (function (global){
12877
13382
  /**
12878
13383
  * Create a blob builder even when vendor prefixes exist
@@ -12972,14 +13477,14 @@ module.exports = (function() {
12972
13477
  })();
12973
13478
 
12974
13479
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
12975
- },{}],42:[function(require,module,exports){
12976
-
12977
13480
  },{}],43:[function(require,module,exports){
13481
+
13482
+ },{}],44:[function(require,module,exports){
12978
13483
  (function (global){
12979
13484
  /*!
12980
13485
  * The buffer module from node.js, for the browser.
12981
13486
  *
12982
- * @author Feross Aboukhadijeh <http://feross.org>
13487
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
12983
13488
  * @license MIT
12984
13489
  */
12985
13490
  /* eslint-disable no-proto */
@@ -14526,7 +15031,7 @@ function blitBuffer (src, dst, offset, length) {
14526
15031
  }
14527
15032
 
14528
15033
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
14529
- },{"base64-js":40,"ieee754":73,"isarray":76}],44:[function(require,module,exports){
15034
+ },{"base64-js":41,"ieee754":75,"isarray":79}],45:[function(require,module,exports){
14530
15035
  module.exports = {
14531
15036
  "100": "Continue",
14532
15037
  "101": "Switching Protocols",
@@ -14587,7 +15092,7 @@ module.exports = {
14587
15092
  "511": "Network Authentication Required"
14588
15093
  }
14589
15094
 
14590
- },{}],45:[function(require,module,exports){
15095
+ },{}],46:[function(require,module,exports){
14591
15096
  /**
14592
15097
  * Slice reference.
14593
15098
  */
@@ -14612,7 +15117,172 @@ module.exports = function(obj, fn){
14612
15117
  }
14613
15118
  };
14614
15119
 
14615
- },{}],46:[function(require,module,exports){
15120
+ },{}],47:[function(require,module,exports){
15121
+
15122
+ /**
15123
+ * Expose `Emitter`.
15124
+ */
15125
+
15126
+ if (typeof module !== 'undefined') {
15127
+ module.exports = Emitter;
15128
+ }
15129
+
15130
+ /**
15131
+ * Initialize a new `Emitter`.
15132
+ *
15133
+ * @api public
15134
+ */
15135
+
15136
+ function Emitter(obj) {
15137
+ if (obj) return mixin(obj);
15138
+ };
15139
+
15140
+ /**
15141
+ * Mixin the emitter properties.
15142
+ *
15143
+ * @param {Object} obj
15144
+ * @return {Object}
15145
+ * @api private
15146
+ */
15147
+
15148
+ function mixin(obj) {
15149
+ for (var key in Emitter.prototype) {
15150
+ obj[key] = Emitter.prototype[key];
15151
+ }
15152
+ return obj;
15153
+ }
15154
+
15155
+ /**
15156
+ * Listen on the given `event` with `fn`.
15157
+ *
15158
+ * @param {String} event
15159
+ * @param {Function} fn
15160
+ * @return {Emitter}
15161
+ * @api public
15162
+ */
15163
+
15164
+ Emitter.prototype.on =
15165
+ Emitter.prototype.addEventListener = function(event, fn){
15166
+ this._callbacks = this._callbacks || {};
15167
+ (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
15168
+ .push(fn);
15169
+ return this;
15170
+ };
15171
+
15172
+ /**
15173
+ * Adds an `event` listener that will be invoked a single
15174
+ * time then automatically removed.
15175
+ *
15176
+ * @param {String} event
15177
+ * @param {Function} fn
15178
+ * @return {Emitter}
15179
+ * @api public
15180
+ */
15181
+
15182
+ Emitter.prototype.once = function(event, fn){
15183
+ function on() {
15184
+ this.off(event, on);
15185
+ fn.apply(this, arguments);
15186
+ }
15187
+
15188
+ on.fn = fn;
15189
+ this.on(event, on);
15190
+ return this;
15191
+ };
15192
+
15193
+ /**
15194
+ * Remove the given callback for `event` or all
15195
+ * registered callbacks.
15196
+ *
15197
+ * @param {String} event
15198
+ * @param {Function} fn
15199
+ * @return {Emitter}
15200
+ * @api public
15201
+ */
15202
+
15203
+ Emitter.prototype.off =
15204
+ Emitter.prototype.removeListener =
15205
+ Emitter.prototype.removeAllListeners =
15206
+ Emitter.prototype.removeEventListener = function(event, fn){
15207
+ this._callbacks = this._callbacks || {};
15208
+
15209
+ // all
15210
+ if (0 == arguments.length) {
15211
+ this._callbacks = {};
15212
+ return this;
15213
+ }
15214
+
15215
+ // specific event
15216
+ var callbacks = this._callbacks['$' + event];
15217
+ if (!callbacks) return this;
15218
+
15219
+ // remove all handlers
15220
+ if (1 == arguments.length) {
15221
+ delete this._callbacks['$' + event];
15222
+ return this;
15223
+ }
15224
+
15225
+ // remove specific handler
15226
+ var cb;
15227
+ for (var i = 0; i < callbacks.length; i++) {
15228
+ cb = callbacks[i];
15229
+ if (cb === fn || cb.fn === fn) {
15230
+ callbacks.splice(i, 1);
15231
+ break;
15232
+ }
15233
+ }
15234
+ return this;
15235
+ };
15236
+
15237
+ /**
15238
+ * Emit `event` with the given args.
15239
+ *
15240
+ * @param {String} event
15241
+ * @param {Mixed} ...
15242
+ * @return {Emitter}
15243
+ */
15244
+
15245
+ Emitter.prototype.emit = function(event){
15246
+ this._callbacks = this._callbacks || {};
15247
+ var args = [].slice.call(arguments, 1)
15248
+ , callbacks = this._callbacks['$' + event];
15249
+
15250
+ if (callbacks) {
15251
+ callbacks = callbacks.slice(0);
15252
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
15253
+ callbacks[i].apply(this, args);
15254
+ }
15255
+ }
15256
+
15257
+ return this;
15258
+ };
15259
+
15260
+ /**
15261
+ * Return array of callbacks for `event`.
15262
+ *
15263
+ * @param {String} event
15264
+ * @return {Array}
15265
+ * @api public
15266
+ */
15267
+
15268
+ Emitter.prototype.listeners = function(event){
15269
+ this._callbacks = this._callbacks || {};
15270
+ return this._callbacks['$' + event] || [];
15271
+ };
15272
+
15273
+ /**
15274
+ * Check if this emitter has `event` handlers.
15275
+ *
15276
+ * @param {String} event
15277
+ * @return {Boolean}
15278
+ * @api public
15279
+ */
15280
+
15281
+ Emitter.prototype.hasListeners = function(event){
15282
+ return !! this.listeners(event).length;
15283
+ };
15284
+
15285
+ },{}],48:[function(require,module,exports){
14616
15286
 
14617
15287
  module.exports = function(a, b){
14618
15288
  var fn = function(){};
@@ -14620,7 +15290,8 @@ module.exports = function(a, b){
14620
15290
  a.prototype = new fn;
14621
15291
  a.prototype.constructor = a;
14622
15292
  };
14623
- },{}],47:[function(require,module,exports){
15293
+ },{}],49:[function(require,module,exports){
15294
+ (function (Buffer){
14624
15295
  // Copyright Joyent, Inc. and other Node contributors.
14625
15296
  //
14626
15297
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -14723,17 +15394,18 @@ function isPrimitive(arg) {
14723
15394
  }
14724
15395
  exports.isPrimitive = isPrimitive;
14725
15396
 
14726
- exports.isBuffer = require('buffer').Buffer.isBuffer;
15397
+ exports.isBuffer = Buffer.isBuffer;
14727
15398
 
14728
15399
  function objectToString(o) {
14729
15400
  return Object.prototype.toString.call(o);
14730
15401
  }
14731
15402
 
14732
- },{"buffer":43}],48:[function(require,module,exports){
15403
+ }).call(this,{"isBuffer":require("../../is-buffer/index.js")})
15404
+ },{"../../is-buffer/index.js":78}],50:[function(require,module,exports){
14733
15405
 
14734
15406
  module.exports = require('./lib/');
14735
15407
 
14736
- },{"./lib/":49}],49:[function(require,module,exports){
15408
+ },{"./lib/":51}],51:[function(require,module,exports){
14737
15409
 
14738
15410
  module.exports = require('./socket');
14739
15411
 
@@ -14745,7 +15417,7 @@ module.exports = require('./socket');
14745
15417
  */
14746
15418
  module.exports.parser = require('engine.io-parser');
14747
15419
 
14748
- },{"./socket":50,"engine.io-parser":62}],50:[function(require,module,exports){
15420
+ },{"./socket":52,"engine.io-parser":64}],52:[function(require,module,exports){
14749
15421
  (function (global){
14750
15422
  /**
14751
15423
  * Module dependencies.
@@ -15477,7 +16149,7 @@ Socket.prototype.filterUpgrades = function (upgrades) {
15477
16149
  };
15478
16150
 
15479
16151
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15480
- },{"./transport":51,"./transports":52,"component-emitter":58,"debug":59,"engine.io-parser":62,"indexof":74,"parsejson":82,"parseqs":83,"parseuri":84}],51:[function(require,module,exports){
16152
+ },{"./transport":53,"./transports":54,"component-emitter":60,"debug":61,"engine.io-parser":64,"indexof":76,"parsejson":85,"parseqs":86,"parseuri":87}],53:[function(require,module,exports){
15481
16153
  /**
15482
16154
  * Module dependencies.
15483
16155
  */
@@ -15634,7 +16306,7 @@ Transport.prototype.onClose = function () {
15634
16306
  this.emit('close');
15635
16307
  };
15636
16308
 
15637
- },{"component-emitter":58,"engine.io-parser":62}],52:[function(require,module,exports){
16309
+ },{"component-emitter":60,"engine.io-parser":64}],54:[function(require,module,exports){
15638
16310
  (function (global){
15639
16311
  /**
15640
16312
  * Module dependencies
@@ -15691,7 +16363,7 @@ function polling(opts){
15691
16363
  }
15692
16364
 
15693
16365
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15694
- },{"./polling-jsonp":53,"./polling-xhr":54,"./websocket":56,"xmlhttprequest-ssl":57}],53:[function(require,module,exports){
16366
+ },{"./polling-jsonp":55,"./polling-xhr":56,"./websocket":58,"xmlhttprequest-ssl":59}],55:[function(require,module,exports){
15695
16367
  (function (global){
15696
16368
 
15697
16369
  /**
@@ -15933,7 +16605,7 @@ JSONPPolling.prototype.doWrite = function (data, fn) {
15933
16605
  };
15934
16606
 
15935
16607
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
15936
- },{"./polling":55,"component-inherit":46}],54:[function(require,module,exports){
16608
+ },{"./polling":57,"component-inherit":48}],56:[function(require,module,exports){
15937
16609
  (function (global){
15938
16610
  /**
15939
16611
  * Module requirements.
@@ -16349,7 +17021,7 @@ function unloadHandler() {
16349
17021
  }
16350
17022
 
16351
17023
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16352
- },{"./polling":55,"component-emitter":58,"component-inherit":46,"debug":59,"xmlhttprequest-ssl":57}],55:[function(require,module,exports){
17024
+ },{"./polling":57,"component-emitter":60,"component-inherit":48,"debug":61,"xmlhttprequest-ssl":59}],57:[function(require,module,exports){
16353
17025
  /**
16354
17026
  * Module dependencies.
16355
17027
  */
@@ -16598,7 +17270,7 @@ Polling.prototype.uri = function(){
16598
17270
  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
16599
17271
  };
16600
17272
 
16601
- },{"../transport":51,"component-inherit":46,"debug":59,"engine.io-parser":62,"parseqs":83,"xmlhttprequest-ssl":57,"yeast":143}],56:[function(require,module,exports){
17273
+ },{"../transport":53,"component-inherit":48,"debug":61,"engine.io-parser":64,"parseqs":86,"xmlhttprequest-ssl":59,"yeast":145}],58:[function(require,module,exports){
16602
17274
  (function (global){
16603
17275
  /**
16604
17276
  * Module dependencies.
@@ -16890,7 +17562,7 @@ WS.prototype.check = function(){
16890
17562
  };
16891
17563
 
16892
17564
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
16893
- },{"../transport":51,"component-inherit":46,"debug":59,"engine.io-parser":62,"parseqs":83,"ws":42,"yeast":143}],57:[function(require,module,exports){
17565
+ },{"../transport":53,"component-inherit":48,"debug":61,"engine.io-parser":64,"parseqs":86,"ws":43,"yeast":145}],59:[function(require,module,exports){
16894
17566
  // browser shim for xmlhttprequest module
16895
17567
  var hasCORS = require('has-cors');
16896
17568
 
@@ -16928,7 +17600,7 @@ module.exports = function(opts) {
16928
17600
  }
16929
17601
  }
16930
17602
 
16931
- },{"has-cors":71}],58:[function(require,module,exports){
17603
+ },{"has-cors":73}],60:[function(require,module,exports){
16932
17604
 
16933
17605
  /**
16934
17606
  * Expose `Emitter`.
@@ -17094,7 +17766,7 @@ Emitter.prototype.hasListeners = function(event){
17094
17766
  return !! this.listeners(event).length;
17095
17767
  };
17096
17768
 
17097
- },{}],59:[function(require,module,exports){
17769
+ },{}],61:[function(require,module,exports){
17098
17770
 
17099
17771
  /**
17100
17772
  * This is the web browser implementation of `debug()`.
@@ -17264,7 +17936,7 @@ function localstorage(){
17264
17936
  } catch (e) {}
17265
17937
  }
17266
17938
 
17267
- },{"./debug":60}],60:[function(require,module,exports){
17939
+ },{"./debug":62}],62:[function(require,module,exports){
17268
17940
 
17269
17941
  /**
17270
17942
  * This is the common logic for both the Node.js and web browser
@@ -17463,7 +18135,7 @@ function coerce(val) {
17463
18135
  return val;
17464
18136
  }
17465
18137
 
17466
- },{"ms":61}],61:[function(require,module,exports){
18138
+ },{"ms":63}],63:[function(require,module,exports){
17467
18139
  /**
17468
18140
  * Helpers.
17469
18141
  */
@@ -17590,7 +18262,7 @@ function plural(ms, n, name) {
17590
18262
  return Math.ceil(ms / n) + ' ' + name + 's';
17591
18263
  }
17592
18264
 
17593
- },{}],62:[function(require,module,exports){
18265
+ },{}],64:[function(require,module,exports){
17594
18266
  (function (global){
17595
18267
  /**
17596
18268
  * Module dependencies.
@@ -18188,7 +18860,7 @@ exports.decodePayloadAsBinary = function (data, binaryType, callback) {
18188
18860
  };
18189
18861
 
18190
18862
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
18191
- },{"./keys":63,"after":35,"arraybuffer.slice":37,"base64-arraybuffer":39,"blob":41,"has-binary":64,"utf8":138}],63:[function(require,module,exports){
18863
+ },{"./keys":65,"after":36,"arraybuffer.slice":38,"base64-arraybuffer":40,"blob":42,"has-binary":66,"utf8":140}],65:[function(require,module,exports){
18192
18864
 
18193
18865
  /**
18194
18866
  * Gets the keys for an object.
@@ -18209,7 +18881,7 @@ module.exports = Object.keys || function keys (obj){
18209
18881
  return arr;
18210
18882
  };
18211
18883
 
18212
- },{}],64:[function(require,module,exports){
18884
+ },{}],66:[function(require,module,exports){
18213
18885
  (function (global){
18214
18886
 
18215
18887
  /*
@@ -18271,12 +18943,12 @@ function hasBinary(data) {
18271
18943
  }
18272
18944
 
18273
18945
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
18274
- },{"isarray":65}],65:[function(require,module,exports){
18946
+ },{"isarray":67}],67:[function(require,module,exports){
18275
18947
  module.exports = Array.isArray || function (arr) {
18276
18948
  return Object.prototype.toString.call(arr) == '[object Array]';
18277
18949
  };
18278
18950
 
18279
- },{}],66:[function(require,module,exports){
18951
+ },{}],68:[function(require,module,exports){
18280
18952
  // Copyright Joyent, Inc. and other Node contributors.
18281
18953
  //
18282
18954
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -18579,7 +19251,7 @@ function isUndefined(arg) {
18579
19251
  return arg === void 0;
18580
19252
  }
18581
19253
 
18582
- },{}],67:[function(require,module,exports){
19254
+ },{}],69:[function(require,module,exports){
18583
19255
  var hasOwn = Object.prototype.hasOwnProperty;
18584
19256
  var toStr = Object.prototype.toString;
18585
19257
  var defineProperty = Object.defineProperty;
@@ -18700,7 +19372,7 @@ module.exports = function extend() {
18700
19372
  return target;
18701
19373
  };
18702
19374
 
18703
- },{}],68:[function(require,module,exports){
19375
+ },{}],70:[function(require,module,exports){
18704
19376
 
18705
19377
  var hasOwn = Object.prototype.hasOwnProperty;
18706
19378
  var toString = Object.prototype.toString;
@@ -18724,7 +19396,7 @@ module.exports = function forEach (obj, fn, ctx) {
18724
19396
  };
18725
19397
 
18726
19398
 
18727
- },{}],69:[function(require,module,exports){
19399
+ },{}],71:[function(require,module,exports){
18728
19400
  (function (global){
18729
19401
 
18730
19402
  /*
@@ -18787,9 +19459,9 @@ function hasBinary(data) {
18787
19459
  }
18788
19460
 
18789
19461
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
18790
- },{"isarray":70}],70:[function(require,module,exports){
18791
- arguments[4][65][0].apply(exports,arguments)
18792
- },{"dup":65}],71:[function(require,module,exports){
19462
+ },{"isarray":72}],72:[function(require,module,exports){
19463
+ arguments[4][67][0].apply(exports,arguments)
19464
+ },{"dup":67}],73:[function(require,module,exports){
18793
19465
 
18794
19466
  /**
18795
19467
  * Module exports.
@@ -18808,7 +19480,7 @@ try {
18808
19480
  module.exports = false;
18809
19481
  }
18810
19482
 
18811
- },{}],72:[function(require,module,exports){
19483
+ },{}],74:[function(require,module,exports){
18812
19484
  var http = require('http');
18813
19485
 
18814
19486
  var https = module.exports;
@@ -18824,8 +19496,7 @@ https.request = function (params, cb) {
18824
19496
  return http.request.call(this, params, cb);
18825
19497
  }
18826
19498
 
18827
- },{"http":126}],73:[function(require,module,exports){
18828
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
19499
+ },{"http":129}],75:[function(require,module,exports){
18829
19500
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
18830
19501
  var e, m
18831
19502
  var eLen = (nBytes * 8) - mLen - 1
@@ -18911,7 +19582,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
18911
19582
  buffer[offset + i - d] |= s * 128
18912
19583
  }
18913
19584
 
18914
- },{}],74:[function(require,module,exports){
19585
+ },{}],76:[function(require,module,exports){
18915
19586
 
18916
19587
  var indexOf = [].indexOf;
18917
19588
 
@@ -18922,43 +19593,62 @@ module.exports = function(arr, obj){
18922
19593
  }
18923
19594
  return -1;
18924
19595
  };
18925
- },{}],75:[function(require,module,exports){
19596
+ },{}],77:[function(require,module,exports){
18926
19597
  if (typeof Object.create === 'function') {
18927
19598
  // implementation from standard node.js 'util' module
18928
19599
  module.exports = function inherits(ctor, superCtor) {
18929
- if (superCtor) {
18930
- ctor.super_ = superCtor
18931
- ctor.prototype = Object.create(superCtor.prototype, {
18932
- constructor: {
18933
- value: ctor,
18934
- enumerable: false,
18935
- writable: true,
18936
- configurable: true
18937
- }
18938
- })
18939
- }
19600
+ ctor.super_ = superCtor
19601
+ ctor.prototype = Object.create(superCtor.prototype, {
19602
+ constructor: {
19603
+ value: ctor,
19604
+ enumerable: false,
19605
+ writable: true,
19606
+ configurable: true
19607
+ }
19608
+ });
18940
19609
  };
18941
19610
  } else {
18942
19611
  // old school shim for old browsers
18943
19612
  module.exports = function inherits(ctor, superCtor) {
18944
- if (superCtor) {
18945
- ctor.super_ = superCtor
18946
- var TempCtor = function () {}
18947
- TempCtor.prototype = superCtor.prototype
18948
- ctor.prototype = new TempCtor()
18949
- ctor.prototype.constructor = ctor
18950
- }
19613
+ ctor.super_ = superCtor
19614
+ var TempCtor = function () {}
19615
+ TempCtor.prototype = superCtor.prototype
19616
+ ctor.prototype = new TempCtor()
19617
+ ctor.prototype.constructor = ctor
18951
19618
  }
18952
19619
  }
18953
19620
 
18954
- },{}],76:[function(require,module,exports){
19621
+ },{}],78:[function(require,module,exports){
19622
+ /*!
19623
+ * Determine if an object is a Buffer
19624
+ *
19625
+ * @author Feross Aboukhadijeh <https://feross.org>
19626
+ * @license MIT
19627
+ */
19628
+
19629
+ // The _isBuffer check is for Safari 5-7 support, because it's missing
19630
+ // Object.prototype.constructor. Remove this eventually
19631
+ module.exports = function (obj) {
19632
+ return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
19633
+ }
19634
+
19635
+ function isBuffer (obj) {
19636
+ return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
19637
+ }
19638
+
19639
+ // For Node v0.10 support. Remove this eventually.
19640
+ function isSlowBuffer (obj) {
19641
+ return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
19642
+ }
19643
+
19644
+ },{}],79:[function(require,module,exports){
18955
19645
  var toString = {}.toString;
18956
19646
 
18957
19647
  module.exports = Array.isArray || function (arr) {
18958
19648
  return toString.call(arr) == '[object Array]';
18959
19649
  };
18960
19650
 
18961
- },{}],77:[function(require,module,exports){
19651
+ },{}],80:[function(require,module,exports){
18962
19652
  (function (global){
18963
19653
  /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
18964
19654
  ;(function () {
@@ -19864,7 +20554,7 @@ module.exports = Array.isArray || function (arr) {
19864
20554
  }).call(this);
19865
20555
 
19866
20556
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
19867
- },{}],78:[function(require,module,exports){
20557
+ },{}],81:[function(require,module,exports){
19868
20558
  'use strict';
19869
20559
 
19870
20560
  var keysShim;
@@ -19898,8 +20588,6 @@ if (!Object.keys) {
19898
20588
  $frames: true,
19899
20589
  $innerHeight: true,
19900
20590
  $innerWidth: true,
19901
- $onmozfullscreenchange: true,
19902
- $onmozfullscreenerror: true,
19903
20591
  $outerHeight: true,
19904
20592
  $outerWidth: true,
19905
20593
  $pageXOffset: true,
@@ -19988,7 +20676,7 @@ if (!Object.keys) {
19988
20676
  }
19989
20677
  module.exports = keysShim;
19990
20678
 
19991
- },{"./isArguments":80}],79:[function(require,module,exports){
20679
+ },{"./isArguments":83}],82:[function(require,module,exports){
19992
20680
  'use strict';
19993
20681
 
19994
20682
  var slice = Array.prototype.slice;
@@ -20022,7 +20710,7 @@ keysShim.shim = function shimObjectKeys() {
20022
20710
 
20023
20711
  module.exports = keysShim;
20024
20712
 
20025
- },{"./implementation":78,"./isArguments":80}],80:[function(require,module,exports){
20713
+ },{"./implementation":81,"./isArguments":83}],83:[function(require,module,exports){
20026
20714
  'use strict';
20027
20715
 
20028
20716
  var toStr = Object.prototype.toString;
@@ -20041,7 +20729,7 @@ module.exports = function isArguments(value) {
20041
20729
  return isArgs;
20042
20730
  };
20043
20731
 
20044
- },{}],81:[function(require,module,exports){
20732
+ },{}],84:[function(require,module,exports){
20045
20733
  exports.endianness = function () { return 'LE' };
20046
20734
 
20047
20735
  exports.hostname = function () {
@@ -20088,7 +20776,7 @@ exports.tmpdir = exports.tmpDir = function () {
20088
20776
 
20089
20777
  exports.EOL = '\n';
20090
20778
 
20091
- },{}],82:[function(require,module,exports){
20779
+ },{}],85:[function(require,module,exports){
20092
20780
  (function (global){
20093
20781
  /**
20094
20782
  * JSON parse.
@@ -20123,7 +20811,7 @@ module.exports = function parsejson(data) {
20123
20811
  }
20124
20812
  };
20125
20813
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
20126
- },{}],83:[function(require,module,exports){
20814
+ },{}],86:[function(require,module,exports){
20127
20815
  /**
20128
20816
  * Compiles a querystring
20129
20817
  * Returns string representation of the object
@@ -20162,7 +20850,7 @@ exports.decode = function(qs){
20162
20850
  return qry;
20163
20851
  };
20164
20852
 
20165
- },{}],84:[function(require,module,exports){
20853
+ },{}],87:[function(require,module,exports){
20166
20854
  /**
20167
20855
  * Parses an URI
20168
20856
  *
@@ -20203,12 +20891,11 @@ module.exports = function parseuri(str) {
20203
20891
  return uri;
20204
20892
  };
20205
20893
 
20206
- },{}],85:[function(require,module,exports){
20894
+ },{}],88:[function(require,module,exports){
20207
20895
  (function (process){
20208
20896
  'use strict';
20209
20897
 
20210
- if (typeof process === 'undefined' ||
20211
- !process.version ||
20898
+ if (!process.version ||
20212
20899
  process.version.indexOf('v0.') === 0 ||
20213
20900
  process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
20214
20901
  module.exports = { nextTick: nextTick };
@@ -20252,7 +20939,7 @@ function nextTick(fn, arg1, arg2, arg3) {
20252
20939
 
20253
20940
 
20254
20941
  }).call(this,require('_process'))
20255
- },{"_process":86}],86:[function(require,module,exports){
20942
+ },{"_process":89}],89:[function(require,module,exports){
20256
20943
  // shim for using process in browser
20257
20944
  var process = module.exports = {};
20258
20945
 
@@ -20438,11 +21125,11 @@ process.chdir = function (dir) {
20438
21125
  };
20439
21126
  process.umask = function() { return 0; };
20440
21127
 
20441
- },{}],87:[function(require,module,exports){
21128
+ },{}],90:[function(require,module,exports){
20442
21129
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.PubNub=t():e.PubNub=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){if(!navigator||!navigator.sendBeacon)return!1;navigator.sendBeacon(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=n(1),c=r(u),l=n(40),h=r(l),f=n(41),p=r(f),d=n(42),y=(n(5),function(e){function t(e){i(this,t);var n=e.listenToBrowserNetworkEvents,r=void 0===n||n;e.db=p.default,e.sdkFamily="Web",e.networking=new h.default({del:d.del,get:d.get,post:d.post,sendBeacon:a});var o=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r&&(window.addEventListener("offline",function(){o.networkDownDetected()}),window.addEventListener("online",function(){o.networkUpDetected()})),o}return o(t,e),t}(c.default));t.default=y,e.exports=t.default},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(2),u=i(a),c=n(6),l=i(c),h=n(8),f=i(h),p=n(9),d=i(p),y=n(16),g=i(y),b=n(17),v=r(b),_=n(18),m=r(_),k=n(19),P=r(k),O=n(20),T=r(O),S=n(21),w=r(S),C=n(22),M=r(C),E=n(23),x=r(E),N=n(24),R=r(N),A=n(25),D=r(A),K=n(26),j=r(K),G=n(27),U=r(G),I=n(28),H=r(I),B=n(29),L=r(B),q=n(30),F=r(q),z=n(31),X=r(z),W=n(32),J=r(W),V=n(33),$=r(V),Q=n(34),Y=r(Q),Z=n(35),ee=r(Z),te=n(36),ne=r(te),re=n(37),ie=r(re),se=n(38),oe=r(se),ae=n(12),ue=r(ae),ce=n(39),le=r(ce),he=n(13),fe=i(he),pe=n(10),de=i(pe),ye=(n(5),n(3)),ge=i(ye),be=function(){function e(t){var n=this;s(this,e);var r=t.db,i=t.networking,o=this._config=new u.default({setup:t,db:r}),a=new l.default({config:o});i.init(o);var c={config:o,networking:i,crypto:a},h=g.default.bind(this,c,ue),p=g.default.bind(this,c,j),y=g.default.bind(this,c,H),b=g.default.bind(this,c,F),_=g.default.bind(this,c,le),k=this._listenerManager=new d.default,O=new f.default({timeEndpoint:h,leaveEndpoint:p,heartbeatEndpoint:y,setStateEndpoint:b,subscribeEndpoint:_,crypto:c.crypto,config:c.config,listenerManager:k});this.addListener=k.addListener.bind(k),this.removeListener=k.removeListener.bind(k),this.removeAllListeners=k.removeAllListeners.bind(k),this.channelGroups={listGroups:g.default.bind(this,c,T),listChannels:g.default.bind(this,c,w),addChannels:g.default.bind(this,c,v),removeChannels:g.default.bind(this,c,m),deleteGroup:g.default.bind(this,c,P)},this.push={addChannels:g.default.bind(this,c,M),removeChannels:g.default.bind(this,c,x),deleteDevice:g.default.bind(this,c,D),listChannels:g.default.bind(this,c,R)},this.hereNow=g.default.bind(this,c,X),this.whereNow=g.default.bind(this,c,U),this.getState=g.default.bind(this,c,L),this.setState=O.adaptStateChange.bind(O),this.grant=g.default.bind(this,c,$),this.audit=g.default.bind(this,c,J),this.publish=g.default.bind(this,c,Y),this.fire=function(e,t){return e.replicate=!1,e.storeInHistory=!1,n.publish(e,t)},this.history=g.default.bind(this,c,ee),this.deleteMessages=g.default.bind(this,c,ne),this.messageCounts=g.default.bind(this,c,ie),this.fetchMessages=g.default.bind(this,c,oe),this.time=h,this.subscribe=O.adaptSubscribeChange.bind(O),this.presence=O.adaptPresenceChange.bind(O),this.unsubscribe=O.adaptUnsubscribeChange.bind(O),this.disconnect=O.disconnect.bind(O),this.reconnect=O.reconnect.bind(O),this.destroy=function(e){O.unsubscribeAll(e),O.disconnect()},this.stop=this.destroy,this.unsubscribeAll=O.unsubscribeAll.bind(O),this.getSubscribedChannels=O.getSubscribedChannels.bind(O),this.getSubscribedChannelGroups=O.getSubscribedChannelGroups.bind(O),this.encrypt=a.encrypt.bind(a),this.decrypt=a.decrypt.bind(a),this.getAuthKey=c.config.getAuthKey.bind(c.config),this.setAuthKey=c.config.setAuthKey.bind(c.config),this.setCipherKey=c.config.setCipherKey.bind(c.config),this.getUUID=c.config.getUUID.bind(c.config),this.setUUID=c.config.setUUID.bind(c.config),this.getFilterExpression=c.config.getFilterExpression.bind(c.config),this.setFilterExpression=c.config.setFilterExpression.bind(c.config),this.setHeartbeatInterval=c.config.setHeartbeatInterval.bind(c.config),i.hasModule("proxy")&&(this.setProxy=function(e){c.config.setProxy(e),n.reconnect()})}return o(e,[{key:"getVersion",value:function(){return this._config.getVersion()}},{key:"networkDownDetected",value:function(){this._listenerManager.announceNetworkDown(),this._config.restore?this.disconnect():this.destroy(!0)}},{key:"networkUpDetected",value:function(){this._listenerManager.announceNetworkUp(),this.reconnect()}}],[{key:"generateUUID",value:function(){return ge.default.createUUID()}}]),e}();be.OPERATIONS=fe.default,be.CATEGORIES=de.default,t.default=be,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(3),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=(n(5),function(){function e(t){var n=t.setup,i=t.db;r(this,e),this._db=i,this.instanceId="pn-"+o.default.createUUID(),this.secretKey=n.secretKey||n.secret_key,this.subscribeKey=n.subscribeKey||n.subscribe_key,this.publishKey=n.publishKey||n.publish_key,this.sdkName=n.sdkName,this.sdkFamily=n.sdkFamily,this.partnerId=n.partnerId,this.setAuthKey(n.authKey),this.setCipherKey(n.cipherKey),this.setFilterExpression(n.filterExpression),this.origin=n.origin||"ps.pndsn.com",this.secure=n.ssl||!1,this.restore=n.restore||!1,this.proxy=n.proxy,this.keepAlive=n.keepAlive,this.keepAliveSettings=n.keepAliveSettings,this.autoNetworkDetection=n.autoNetworkDetection||!1,this.dedupeOnSubscribe=n.dedupeOnSubscribe||!1,this.maximumCacheSize=n.maximumCacheSize||100,this.customEncrypt=n.customEncrypt,this.customDecrypt=n.customDecrypt,"undefined"!=typeof location&&"https:"===location.protocol&&(this.secure=!0),this.logVerbosity=n.logVerbosity||!1,this.suppressLeaveEvents=n.suppressLeaveEvents||!1,this.announceFailedHeartbeats=n.announceFailedHeartbeats||!0,this.announceSuccessfulHeartbeats=n.announceSuccessfulHeartbeats||!1,this.useInstanceId=n.useInstanceId||!1,this.useRequestId=n.useRequestId||!1,this.requestMessageCountThreshold=n.requestMessageCountThreshold,this.setTransactionTimeout(n.transactionalRequestTimeout||15e3),this.setSubscribeTimeout(n.subscribeRequestTimeout||31e4),this.setSendBeaconConfig(n.useSendBeacon||!0),this.setPresenceTimeout(n.presenceTimeout||300),null!=n.heartbeatInterval&&this.setHeartbeatInterval(n.heartbeatInterval),this.setUUID(this._decideUUID(n.uuid))}return i(e,[{key:"getAuthKey",value:function(){return this.authKey}},{key:"setAuthKey",value:function(e){return this.authKey=e,this}},{key:"setCipherKey",value:function(e){return this.cipherKey=e,this}},{key:"getUUID",value:function(){return this.UUID}},{key:"setUUID",value:function(e){return this._db&&this._db.set&&this._db.set(this.subscribeKey+"uuid",e),this.UUID=e,this}},{key:"getFilterExpression",value:function(){return this.filterExpression}},{key:"setFilterExpression",value:function(e){return this.filterExpression=e,this}},{key:"getPresenceTimeout",value:function(){return this._presenceTimeout}},{key:"setPresenceTimeout",value:function(e){return this._presenceTimeout=e,this.setHeartbeatInterval(this._presenceTimeout/2-1),this}},{key:"setProxy",value:function(e){this.proxy=e}},{key:"getHeartbeatInterval",value:function(){return this._heartbeatInterval}},{key:"setHeartbeatInterval",value:function(e){return this._heartbeatInterval=e,this}},{key:"getSubscribeTimeout",value:function(){return this._subscribeRequestTimeout}},{key:"setSubscribeTimeout",value:function(e){return this._subscribeRequestTimeout=e,this}},{key:"getTransactionTimeout",value:function(){return this._transactionalRequestTimeout}},{key:"setTransactionTimeout",value:function(e){return this._transactionalRequestTimeout=e,this}},{key:"isSendBeaconEnabled",value:function(){return this._useSendBeacon}},{key:"setSendBeaconConfig",value:function(e){return this._useSendBeacon=e,this}},{key:"getVersion",value:function(){return"4.24.2"}},{key:"_decideUUID",value:function(e){return e||(this._db&&this._db.get&&this._db.get(this.subscribeKey+"uuid")?this._db.get(this.subscribeKey+"uuid"):"pn-"+o.default.createUUID())}}]),e}());t.default=a,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default={createUUID:function(){return i.default.uuid?i.default.uuid():(0,i.default)()}},e.exports=t.default},function(e,t,n){var r,i,s;!function(n,o){i=[t],r=o,void 0!==(s="function"==typeof r?r.apply(t,i):r)&&(e.exports=s)}(0,function(e){function t(){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 n(e,t){var n=r[t||"all"];return n&&n.test(e)||!1}var r={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};t.isUUID=n,t.VERSION="0.1.0",e.uuid=t,e.isUUID=n})},function(e,t){"use strict";e.exports={}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(7)),u=r(a),c=function(){function e(t){var n=t.config;i(this,e),this._config=n,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 s(e,[{key:"HMACSHA256",value:function(e){return u.default.HmacSHA256(e,this._config.secretKey).toString(u.default.enc.Base64)}},{key:"SHA256",value:function(e){return u.default.SHA256(e).toString(u.default.enc.Hex)}},{key:"_parseOptions",value: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}},{key:"_decodeKey",value:function(e,t){return"base64"===t.keyEncoding?u.default.enc.Base64.parse(e):"hex"===t.keyEncoding?u.default.enc.Hex.parse(e):e}},{key:"_getPaddedKey",value:function(e,t){return e=this._decodeKey(e,t),t.encryptKey?u.default.enc.Utf8.parse(this.SHA256(e).slice(0,32)):e}},{key:"_getMode",value:function(e){return"ecb"===e.mode?u.default.mode.ECB:u.default.mode.CBC}},{key:"_getIV",value:function(e){return"cbc"===e.mode?u.default.enc.Utf8.parse(this._iv):null}},{key:"encrypt",value:function(e,t,n){return this._config.customEncrypt?this._config.customEncrypt(e):this.pnEncrypt(e,t,n)}},{key:"decrypt",value:function(e,t,n){return this._config.customDecrypt?this._config.customDecrypt(e):this.pnDecrypt(e,t,n)}},{key:"pnEncrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);return u.default.AES.encrypt(e,s,{iv:r,mode:i}).ciphertext.toString(u.default.enc.Base64)||e}},{key:"pnDecrypt",value:function(e,t,n){if(!t&&!this._config.cipherKey)return e;n=this._parseOptions(n);var r=this._getIV(n),i=this._getMode(n),s=this._getPaddedKey(t||this._config.cipherKey,n);try{var o=u.default.enc.Base64.parse(e),a=u.default.AES.decrypt({ciphertext:o},s,{iv:r,mode:i}).toString(u.default.enc.Utf8);return JSON.parse(a)}catch(e){return null}}}]),e}();t.default=c,e.exports=t.default},function(e,t){"use strict";var n=n||function(e,t){var n={},r=n.lib={},i=function(){},s=r.Base={extend:function(e){i.prototype=this;var t=new i;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)}},o=r.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=void 0!=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 i=0;i<e;i++)t[r+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(r+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[r+i>>>2]=n[i>>>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=s.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 o.init(n,t)}}),a=n.enc={},u=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],r=0;r<e;r++){var i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).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 o.init(n,t/2)}},c=a.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 o.init(n,t)}},l=a.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)))}},h=r.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.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,i=n.sigBytes,s=this.blockSize,a=i/(4*s),a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0);if(t=a*s,i=e.min(4*t,i),t){for(var u=0;u<t;u+=s)this._doProcessBlock(r,u);u=r.splice(0,t),n.sigBytes-=i}return new o.init(u,i)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});r.Hasher=h.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.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 f.HMAC.init(e,n).finalize(t)}}});var f=n.algo={};return n}(Math);!function(e){for(var t=n,r=t.lib,i=r.WordArray,s=r.Hasher,r=t.algo,o=[],a=[],u=function(e){return 4294967296*(e-(0|e))|0},c=2,l=0;64>l;){var h;e:{h=c;for(var f=e.sqrt(h),p=2;p<=f;p++)if(!(h%p)){h=!1;break e}h=!0}h&&(8>l&&(o[l]=u(e.pow(c,.5))),a[l]=u(e.pow(c,1/3)),l++),c++}var d=[],r=r.SHA256=s.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)d[f]=0|e[t+f];else{var p=d[f-15],y=d[f-2];d[f]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+d[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+d[f-16]}p=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+a[f]+d[f],y=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=o+p|0,o=s,s=i,i=r,r=p+y|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(r),t.HmacSHA256=s._createHmacHelper(r)}(Math),function(){var e=n,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,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))}})}(),function(){var e=n,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var s=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)e.push(r.charAt(s>>>6*(3-o)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map,i=r.charAt(64);i&&-1!=(i=e.indexOf(i))&&(n=i);for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(e.charAt(o-1))<<o%4*2,u=r.indexOf(e.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return t.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,s,o){return((e=e+(t&n|~t&r)+i+o)<<s|e>>>32-s)+t}function r(e,t,n,r,i,s,o){return((e=e+(t&r|n&~r)+i+o)<<s|e>>>32-s)+t}function i(e,t,n,r,i,s,o){return((e=e+(t^n^r)+i+o)<<s|e>>>32-s)+t}function s(e,t,n,r,i,s,o){return((e=e+(n^(t|~r))+i+o)<<s|e>>>32-s)+t}for(var o=n,a=o.lib,u=a.WordArray,c=a.Hasher,a=o.algo,l=[],h=0;64>h;h++)l[h]=4294967296*e.abs(e.sin(h+1))|0;a=a.MD5=c.extend({_doReset:function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,n){for(var o=0;16>o;o++){var a=n+o,u=e[a];e[a]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}var o=this._hash.words,a=e[n+0],u=e[n+1],c=e[n+2],h=e[n+3],f=e[n+4],p=e[n+5],d=e[n+6],y=e[n+7],g=e[n+8],b=e[n+9],v=e[n+10],_=e[n+11],m=e[n+12],k=e[n+13],P=e[n+14],O=e[n+15],T=o[0],S=o[1],w=o[2],C=o[3],T=t(T,S,w,C,a,7,l[0]),C=t(C,T,S,w,u,12,l[1]),w=t(w,C,T,S,c,17,l[2]),S=t(S,w,C,T,h,22,l[3]),T=t(T,S,w,C,f,7,l[4]),C=t(C,T,S,w,p,12,l[5]),w=t(w,C,T,S,d,17,l[6]),S=t(S,w,C,T,y,22,l[7]),T=t(T,S,w,C,g,7,l[8]),C=t(C,T,S,w,b,12,l[9]),w=t(w,C,T,S,v,17,l[10]),S=t(S,w,C,T,_,22,l[11]),T=t(T,S,w,C,m,7,l[12]),C=t(C,T,S,w,k,12,l[13]),w=t(w,C,T,S,P,17,l[14]),S=t(S,w,C,T,O,22,l[15]),T=r(T,S,w,C,u,5,l[16]),C=r(C,T,S,w,d,9,l[17]),w=r(w,C,T,S,_,14,l[18]),S=r(S,w,C,T,a,20,l[19]),T=r(T,S,w,C,p,5,l[20]),C=r(C,T,S,w,v,9,l[21]),w=r(w,C,T,S,O,14,l[22]),S=r(S,w,C,T,f,20,l[23]),T=r(T,S,w,C,b,5,l[24]),C=r(C,T,S,w,P,9,l[25]),w=r(w,C,T,S,h,14,l[26]),S=r(S,w,C,T,g,20,l[27]),T=r(T,S,w,C,k,5,l[28]),C=r(C,T,S,w,c,9,l[29]),w=r(w,C,T,S,y,14,l[30]),S=r(S,w,C,T,m,20,l[31]),T=i(T,S,w,C,p,4,l[32]),C=i(C,T,S,w,g,11,l[33]),w=i(w,C,T,S,_,16,l[34]),S=i(S,w,C,T,P,23,l[35]),T=i(T,S,w,C,u,4,l[36]),C=i(C,T,S,w,f,11,l[37]),w=i(w,C,T,S,y,16,l[38]),S=i(S,w,C,T,v,23,l[39]),T=i(T,S,w,C,k,4,l[40]),C=i(C,T,S,w,a,11,l[41]),w=i(w,C,T,S,h,16,l[42]),S=i(S,w,C,T,d,23,l[43]),T=i(T,S,w,C,b,4,l[44]),C=i(C,T,S,w,m,11,l[45]),w=i(w,C,T,S,O,16,l[46]),S=i(S,w,C,T,c,23,l[47]),T=s(T,S,w,C,a,6,l[48]),C=s(C,T,S,w,y,10,l[49]),w=s(w,C,T,S,P,15,l[50]),S=s(S,w,C,T,p,21,l[51]),T=s(T,S,w,C,m,6,l[52]),C=s(C,T,S,w,h,10,l[53]),w=s(w,C,T,S,v,15,l[54]),S=s(S,w,C,T,u,21,l[55]),T=s(T,S,w,C,g,6,l[56]),C=s(C,T,S,w,O,10,l[57]),w=s(w,C,T,S,d,15,l[58]),S=s(S,w,C,T,k,21,l[59]),T=s(T,S,w,C,f,6,l[60]),C=s(C,T,S,w,_,10,l[61]),w=s(w,C,T,S,c,15,l[62]),S=s(S,w,C,T,b,21,l[63]);o[0]=o[0]+T|0,o[1]=o[1]+S|0,o[2]=o[2]+w|0,o[3]=o[3]+C|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),t=this._hash,n=t.words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=c.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=c._createHelper(a),o.HmacMD5=c._createHmacHelper(a)}(Math),function(){var e=n,t=e.lib,r=t.Base,i=t.WordArray,t=e.algo,s=t.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:t.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),s=i.create(),o=s.words,a=n.keySize,n=n.iterations;o.length<a;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var c=1;c<n;c++)u=r.finalize(u),r.reset();s.concat(u)}return s.sigBytes=4*a,s}});e.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,s=r.WordArray,o=r.BufferedBlockAlgorithm,a=t.enc.Base64,u=t.algo.EvpKDF,c=r.Cipher=o.extend({cfg:i.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?y:d).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?y:d).decrypt(e,t,n,r)}}}});r.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},h=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},f=(r.BlockCipherMode=i.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();f.Encryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;h.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),f.Decryptor=f.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),h.call(this,e,t,r),this._prevBlock=i}}),l=l.CBC=f,f=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,n=n-e.sigBytes%n,r=n<<24|n<<16|n<<8|n,i=[],o=0;o<n;o+=4)i.push(r);n=s.create(i,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},r.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:f}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.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=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),l=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return e=e.salt,(e?s.create([1398893684,1701076831]).concat(e).concat(t):t).toString(a)},parse:function(e){e=a.parse(e);var t=e.words;if(1398893684==t[0]&&1701076831==t[1]){var n=s.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},d=r.SerializableCipher=i.extend({cfg:i.extend({format:l}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,p.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.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}}),t=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){return r||(r=s.random(8)),e=u.create({keySize:t+n}).compute(e,r),n=s.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:r})}},y=r.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:t}),encrypt:function(e,t,n,r){return r=this.cfg.extend(r),n=r.kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,e=d.encrypt.call(this,e,t,n.key,r),e.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,d.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=[],y=0;256>y;y++)d[y]=128>y?y<<1:y<<1^283;for(var g=0,b=0,y=0;256>y;y++){var v=b^b<<1^b<<2^b<<3^b<<4,v=v>>>8^255&v^99;i[g]=v,s[v]=g;var _=d[g],m=d[_],k=d[m],P=257*d[v]^16843008*v;o[g]=P<<24|P>>>8,a[g]=P<<16|P>>>16,u[g]=P<<8|P>>>24,c[g]=P,P=16843009*k^65537*m^257*_^16843008*g,l[v]=P<<24|P>>>8,h[v]=P<<16|P>>>16,f[v]=P<<8|P>>>24,p[v]=P,g?(g=_^d[d[d[k^_]]],b^=d[d[b]]):g=b=1}var O=[0,1,2,4,8,16,32,64,128,27,54],r=r.AES=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes/4,e=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],s=0;s<e;s++)if(s<n)r[s]=t[s];else{var o=r[s-1];s%n?6<n&&4==s%n&&(o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o]):(o=o<<8|o>>>24,o=i[o>>>24]<<24|i[o>>>16&255]<<16|i[o>>>8&255]<<8|i[255&o],o^=O[s/n|0]<<24),r[s]=r[s-n]^o}for(t=this._invKeySchedule=[],n=0;n<e;n++)s=e-n,o=n%4?r[s]:r[s-4],t[n]=4>n||4>=s?o:l[i[o>>>24]]^h[i[o>>>16&255]]^f[i[o>>>8&255]]^p[i[255&o]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,u,c,i)},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,l,h,f,p,s),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,s,o,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],f=e[t+3]^n[3],p=4,d=1;d<u;d++)var y=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],g=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],b=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++],f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=y,l=g,h=b;y=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],g=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],b=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],e[t]=y,e[t+1]=g,e[t+2]=b,e[t+3]=f},keySize:8});e.AES=t._createHelper(r)}(),n.mode.ECB=function(){var e=n.lib.BlockCipherMode.extend();return e.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}(),e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(6),a=(r(o),n(2)),u=(r(a),n(9)),c=(r(u),n(11)),l=r(c),h=n(14),f=r(h),p=n(15),d=r(p),y=(n(5),n(10)),g=r(y),b=function(){function e(t){var n=t.subscribeEndpoint,r=t.leaveEndpoint,s=t.heartbeatEndpoint,o=t.setStateEndpoint,a=t.timeEndpoint,u=t.config,c=t.crypto,h=t.listenerManager;i(this,e),this._listenerManager=h,this._config=u,this._leaveEndpoint=r,this._heartbeatEndpoint=s,this._setStateEndpoint=o,this._subscribeEndpoint=n,this._crypto=c,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 l.default({timeEndpoint:a}),this._dedupingManager=new f.default({config:u})}return s(e,[{key:"adaptStateChange",value:function(e,t){var n=this,r=e.state,i=e.channels,s=void 0===i?[]:i,o=e.channelGroups,a=void 0===o?[]:o;return s.forEach(function(e){e in n._channels&&(n._channels[e].state=r)}),a.forEach(function(e){e in n._channelGroups&&(n._channelGroups[e].state=r)}),this._setStateEndpoint({state:r,channels:s,channelGroups:a},t)}},{key:"adaptPresenceChange",value:function(e){var t=this,n=e.connected,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s;n?(i.forEach(function(e){t._heartbeatChannels[e]={state:{}}}),o.forEach(function(e){t._heartbeatChannelGroups[e]={state:{}}})):(i.forEach(function(e){e in t._heartbeatChannels&&delete t._heartbeatChannels[e]}),o.forEach(function(e){e in t._heartbeatChannelGroups&&delete t._heartbeatChannelGroups[e]}),!1===this._config.suppressLeaveEvents&&this._leaveEndpoint({channels:i,channelGroups:o},function(e){t._listenerManager.announceStatus(e)})),this.reconnect()}},{key:"adaptSubscribeChange",value:function(e){var t=this,n=e.timetoken,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=e.withPresence,u=void 0!==a&&a,c=e.withHeartbeats,l=void 0!==c&&c;if(!this._config.subscribeKey||""===this._config.subscribeKey)return void(console&&console.log&&console.log("subscribe key missing; aborting subscribe"));n&&(this._lastTimetoken=this._currentTimetoken,
20443
21130
  this._currentTimetoken=n),"0"!==this._currentTimetoken&&0!==this._currentTimetoken&&(this._storedTimetoken=this._currentTimetoken,this._currentTimetoken=0),i.forEach(function(e){t._channels[e]={state:{}},u&&(t._presenceChannels[e]={}),l&&(t._heartbeatChannels[e]={}),t._pendingChannelSubscriptions.push(e)}),o.forEach(function(e){t._channelGroups[e]={state:{}},u&&(t._presenceChannelGroups[e]={}),l&&(t._heartbeatChannelGroups[e]={}),t._pendingChannelGroupSubscriptions.push(e)}),this._subscriptionStatusAnnounced=!1,this.reconnect()}},{key:"adaptUnsubscribeChange",value:function(e,t){var n=this,r=e.channels,i=void 0===r?[]:r,s=e.channelGroups,o=void 0===s?[]:s,a=[],u=[];i.forEach(function(e){e in n._channels&&(delete n._channels[e],a.push(e),e in n._heartbeatChannels&&delete n._heartbeatChannels[e]),e in n._presenceChannels&&(delete n._presenceChannels[e],a.push(e))}),o.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._channelGroups[e],u.push(e))}),0===a.length&&0===u.length||(!1!==this._config.suppressLeaveEvents||t||this._leaveEndpoint({channels:a,channelGroups:u},function(e){e.affectedChannels=a,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())}},{key:"unsubscribeAll",value:function(e){this.adaptUnsubscribeChange({channels:this.getSubscribedChannels(),channelGroups:this.getSubscribedChannelGroups()},e)}},{key:"getHeartbeatChannels",value:function(){return Object.keys(this._heartbeatChannels)}},{key:"getHeartbeatChannelGroups",value:function(){return Object.keys(this._heartbeatChannelGroups)}},{key:"getSubscribedChannels",value:function(){return Object.keys(this._channels)}},{key:"getSubscribedChannelGroups",value:function(){return Object.keys(this._channelGroups)}},{key:"reconnect",value:function(){this._startSubscribeLoop(),this._registerHeartbeatTimer()}},{key:"disconnect",value:function(){this._stopSubscribeLoop(),this._stopHeartbeatTimer(),this._reconnectionManager.stopPolling()}},{key:"_registerHeartbeatTimer",value:function(){this._stopHeartbeatTimer(),0!==this._config.getHeartbeatInterval()&&(this._performHeartbeatLoop(),this._heartbeatTimer=setInterval(this._performHeartbeatLoop.bind(this),1e3*this._config.getHeartbeatInterval()))}},{key:"_stopHeartbeatTimer",value:function(){this._heartbeatTimer&&(clearInterval(this._heartbeatTimer),this._heartbeatTimer=null)}},{key:"_performHeartbeatLoop",value:function(){var e=this,t=this.getHeartbeatChannels(),n=this.getHeartbeatChannelGroups(),r={};if(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)});var i=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)};this._heartbeatEndpoint({channels:t,channelGroups:n,state:r},i.bind(this))}}},{key:"_startSubscribeLoop",value:function(){var e=this;this._stopSubscribeLoop();var t={},n=[],r=[];if(Object.keys(this._channels).forEach(function(r){var i=e._channels[r].state;Object.keys(i).length&&(t[r]=i),n.push(r)}),Object.keys(this._presenceChannels).forEach(function(e){n.push(e+"-pnpres")}),Object.keys(this._channelGroups).forEach(function(n){var i=e._channelGroups[n].state;Object.keys(i).length&&(t[n]=i),r.push(n)}),Object.keys(this._presenceChannelGroups).forEach(function(e){r.push(e+"-pnpres")}),0!==n.length||0!==r.length){var i={channels:n,channelGroups:r,state:t,timetoken:this._currentTimetoken,filterExpression:this._config.filterExpression,region:this._region};this._subscribeCall=this._subscribeEndpoint(i,this._processSubscribeResponse.bind(this))}}},{key:"_processSubscribeResponse",value:function(e,t){var n=this;if(e.error)return void(e.category===g.default.PNTimeoutCategory?this._startSubscribeLoop():e.category===g.default.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:g.default.PNReconnectedCategory,operation:e.operation,lastTimetoken:n._lastTimetoken,currentTimetoken:n._currentTimetoken};n._listenerManager.announceStatus(t)}),this._reconnectionManager.startPolling(),this._listenerManager.announceStatus(e)):e.category===g.default.PNBadRequestCategory?(this._stopHeartbeatTimer(),this._listenerManager.announceStatus(e)):this._listenerManager.announceStatus(e));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=g.default.PNConnectedCategory,r.operation=e.operation,r.affectedChannels=this._pendingChannelSubscriptions,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 i=t.messages||[],s=this._config,o=s.requestMessageCountThreshold,a=s.dedupeOnSubscribe;if(o&&i.length>=o){var u={};u.category=g.default.PNRequestMessageCountExceededCategory,u.operation=e.operation,this._listenerManager.announceStatus(u)}i.forEach(function(e){var t=e.channel,r=e.subscriptionMatch,i=e.publishMetaData;if(t===r&&(r=null),a){if(n._dedupingManager.isDuplicate(e))return;n._dedupingManager.addEntry(e)}if(d.default.endsWith(e.channel,"-pnpres")){var s={};s.channel=null,s.subscription=null,s.actualChannel=null!=r?t:null,s.subscribedChannel=null!=r?r:t,t&&(s.channel=t.substring(0,t.lastIndexOf("-pnpres"))),r&&(s.subscription=r.substring(0,r.lastIndexOf("-pnpres"))),s.action=e.payload.action,s.state=e.payload.data,s.timetoken=i.publishTimetoken,s.occupancy=e.payload.occupancy,s.uuid=e.payload.uuid,s.timestamp=e.payload.timestamp,e.payload.join&&(s.join=e.payload.join),e.payload.leave&&(s.leave=e.payload.leave),e.payload.timeout&&(s.timeout=e.payload.timeout),n._listenerManager.announcePresence(s)}else{var o={};o.channel=null,o.subscription=null,o.actualChannel=null!=r?t:null,o.subscribedChannel=null!=r?r:t,o.channel=t,o.subscription=r,o.timetoken=i.publishTimetoken,o.publisher=e.issuingClientId,e.userMetadata&&(o.userMetadata=e.userMetadata),n._config.cipherKey?o.message=n._crypto.decrypt(e.payload):o.message=e.payload,n._listenerManager.announceMessage(o)}}),this._region=t.metadata.region,this._startSubscribeLoop()}},{key:"_stopSubscribeLoop",value:function(){this._subscribeCall&&("function"==typeof this._subscribeCall.abort&&this._subscribeCall.abort(),this._subscribeCall=null)}}]),e}();t.default=b,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=(n(5),n(10)),o=function(e){return e&&e.__esModule?e:{default:e}}(s),a=function(){function e(){r(this,e),this._listeners=[]}return i(e,[{key:"addListener",value:function(e){this._listeners.push(e)}},{key:"removeListener",value:function(e){var t=[];this._listeners.forEach(function(n){n!==e&&t.push(n)}),this._listeners=t}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"announcePresence",value:function(e){this._listeners.forEach(function(t){t.presence&&t.presence(e)})}},{key:"announceStatus",value:function(e){this._listeners.forEach(function(t){t.status&&t.status(e)})}},{key:"announceMessage",value:function(e){this._listeners.forEach(function(t){t.message&&t.message(e)})}},{key:"announceNetworkUp",value:function(){var e={};e.category=o.default.PNNetworkUpCategory,this.announceStatus(e)}},{key:"announceNetworkDown",value:function(){var e={};e.category=o.default.PNNetworkDownCategory,this.announceStatus(e)}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNNetworkUpCategory:"PNNetworkUpCategory",PNNetworkDownCategory:"PNNetworkDownCategory",PNNetworkIssuesCategory:"PNNetworkIssuesCategory",PNTimeoutCategory:"PNTimeoutCategory",PNBadRequestCategory:"PNBadRequestCategory",PNAccessDeniedCategory:"PNAccessDeniedCategory",PNUnknownCategory:"PNUnknownCategory",PNReconnectedCategory:"PNReconnectedCategory",PNConnectedCategory:"PNConnectedCategory",PNRequestMessageCountExceededCategory:"PNRequestMessageCountExceededCategory"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(12),o=(function(e){e&&e.__esModule}(s),n(5),function(){function e(t){var n=t.timeEndpoint;r(this,e),this._timeEndpoint=n}return i(e,[{key:"onReconnection",value:function(e){this._reconnectionCallback=e}},{key:"startPolling",value:function(){this._timeTimer=setInterval(this._performTimeLoop.bind(this),3e3)}},{key:"stopPolling",value:function(){clearInterval(this._timeTimer)}},{key:"_performTimeLoop",value:function(){var e=this;this._timeEndpoint(function(t){t.error||(clearInterval(e._timeTimer),e._reconnectionCallback())})}}]),e}());t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(){return h.default.PNTimeOperation}function i(){return"/time/0"}function s(e){return e.config.getTransactionTimeout()}function o(){return{}}function a(){return!1}function u(e,t){return{timetoken:t[0]}}function c(){}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.getURL=i,t.getRequestTimeout=s,t.prepareParams=o,t.isAuthSupported=a,t.handleResponse=u,t.validateParams=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PNTimeOperation:"PNTimeOperation",PNHistoryOperation:"PNHistoryOperation",PNDeleteMessagesOperation:"PNDeleteMessagesOperation",PNFetchMessagesOperation:"PNFetchMessagesOperation",PNMessageCounts:"PNMessageCountsOperation",PNSubscribeOperation:"PNSubscribeOperation",PNUnsubscribeOperation:"PNUnsubscribeOperation",PNPublishOperation:"PNPublishOperation",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",PNAccessManagerAudit:"PNAccessManagerAudit"},e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),o=(function(e){e&&e.__esModule}(s),n(5),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}),a=function(){function e(t){var n=t.config;r(this,e),this.hashHistory=[],this._config=n}return i(e,[{key:"getKey",value:function(e){var t=o(JSON.stringify(e.payload)).toString();return e.publishMetaData.publishTimetoken+"-"+t}},{key:"isDuplicate",value:function(e){return this.hashHistory.includes(this.getKey(e))}},{key:"addEntry",value:function(e){this.hashHistory.length>=this._config.maximumCacheSize&&this.hashHistory.shift(),this.hashHistory.push(this.getKey(e))}},{key:"clearHistory",value:function(){this.hashHistory=[]}}]),e}();t.default=a,e.exports=t.default},function(e,t){"use strict";function n(e){var t=[];return Object.keys(e).forEach(function(e){return t.push(e)}),t}function r(e){return encodeURIComponent(e).replace(/[!~*'()]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function i(e){return n(e).sort()}function s(e){return i(e).map(function(t){return t+"="+r(e[t])}).join("&")}function o(e,t){return-1!==e.indexOf(t,this.length-t.length)}function a(){var e=void 0,t=void 0;return{promise:new Promise(function(n,r){e=n,t=r}),reject:t,fulfill:e}}e.exports={signPamFromParams:s,endsWith:o,createPromise:a,encodeString:r}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){return e.type=t,e.error=!0,e}function u(e){return a({message:e},"validationError")}function c(e,t,n){return e.usePost&&e.usePost(t,n)?e.postURL(t,n):e.getURL(t,n)}function l(e){if(e.sdkName)return e.sdkName;var t="PubNub-JS-"+e.sdkFamily;return e.partnerId&&(t+="-"+e.partnerId),t+="/"+e.getVersion()}function h(e,t,n){var r=e.config,i=e.crypto;n.timestamp=Math.floor((new Date).getTime()/1e3);var s=r.subscribeKey+"\n"+r.publishKey+"\n"+t+"\n";s+=y.default.signPamFromParams(n);var o=i.HMACSHA256(s);o=o.replace(/\+/g,"-"),o=o.replace(/\//g,"_"),n.signature=o}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.networking,r=e.config,i=null,s=null,o={};t.getOperation()===v.default.PNTimeOperation||t.getOperation()===v.default.PNChannelGroupsOperation?i=arguments.length<=2?void 0:arguments[2]:(o=arguments.length<=2?void 0:arguments[2],i=arguments.length<=3?void 0:arguments[3]),"undefined"==typeof Promise||i||(s=y.default.createPromise());var a=t.validateParams(e,o);if(!a){var f=t.prepareParams(e,o),d=c(t,e,o),g=void 0,b={url:d,operation:t.getOperation(),timeout:t.getRequestTimeout(e)};f.uuid=r.UUID,f.pnsdk=l(r),r.useInstanceId&&(f.instanceid=r.instanceId),r.useRequestId&&(f.requestid=p.default.createUUID()),t.isAuthSupported()&&r.getAuthKey()&&(f.auth=r.getAuthKey()),r.secretKey&&h(e,d,f);var m=function(n,r){if(n.error)return void(i?i(n):s&&s.reject(new _("PubNub call failed, check status for details",n)));var a=t.handleResponse(e,r,o);i?i(n,a):s&&s.fulfill(a)};if(t.usePost&&t.usePost(e,o)){var k=t.postPayload(e,o);g=n.POST(f,k,b,m)}else g=t.useDelete&&t.useDelete()?n.DELETE(f,b,m):n.GET(f,b,m);return t.getOperation()===v.default.PNSubscribeOperation?g:s?s.promise:void 0}return i?i(u(a)):s?(s.reject(new _("Validation failed, check status for details",u(a))),s.promise):void 0};var f=n(3),p=r(f),d=(n(5),n(15)),y=r(d),g=n(2),b=(r(g),n(13)),v=r(b),_=function(e){function t(e,n){i(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.name=r.constructor.name,r.status=n,r.message=e,r}return o(t,e),t}(Error);e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNAddChannelsToGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{add:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveChannelsFromGroupOperation}function s(e,t){var n=t.channels,r=t.channelGroup,i=e.config;return r?n&&0!==n.length?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channels;return{remove:(void 0===n?[]:n).join(",")}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNRemoveGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)+"/remove"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(){return{}}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNChannelGroupsOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return{groups:t.payload.groups}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNChannelsForGroupOperation}function s(e,t){var n=t.channelGroup,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channel Group"}function o(e,t){var n=t.channelGroup;return"/v1/channel-registration/sub-key/"+e.config.subscribeKey+"/channel-group/"+d.default.encodeString(n)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(){return{}}function l(e,t){return{channels:t.payload.channels}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,add:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=t.channels,s=e.config;return n?r?i&&0!==i.length?s.subscribeKey?void 0:"Missing Subscribe Key":"Missing Channels":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){var n=t.pushGateway,r=t.channels;return{type:n,remove:(void 0===r?[]:r).join(",")}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNPushNotificationEnabledChannelsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(e,t){return{channels:t}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNRemoveAllPushNotificationsOperation}function i(e,t){var n=t.device,r=t.pushGateway,i=e.config;return n?r?i.subscribeKey?void 0:"Missing Subscribe Key":"Missing GW Type (pushGateway: gcm or apns)":"Missing Device ID (device)"}function s(e,t){var n=t.device;return"/v1/push/sub-key/"+e.config.subscribeKey+"/devices/"+n+"/remove"}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(e,t){return{type:t.pushGateway}}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNUnsubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/leave"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNWhereNowOperation}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r;return"/v2/presence/sub-key/"+n.subscribeKey+"/uuid/"+i}function o(e){return e.config.getTransactionTimeout()}function a(){return!0}function u(){return{}}function c(e,t){return t.payload?{channels:t.payload.channels}:{channels:[]}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHeartbeatOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/heartbeat"}function a(){return!0}function u(e){return e.config.getTransactionTimeout()}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.state,s=void 0===i?{}:i,o=e.config,a={};return r.length>0&&(a["channel-group"]=r.join(",")),a.state=JSON.stringify(s),a.heartbeat=o.getPresenceTimeout(),a}function l(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.isAuthSupported=a,t.getRequestTimeout=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNGetStateOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.uuid,i=void 0===r?n.UUID:r,s=t.channels,o=void 0===s?[]:s,a=o.length>0?o.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(a)+"/uuid/"+i}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i={};return r.length>0&&(i["channel-group"]=r.join(",")),i}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a={};return 1===i.length&&0===o.length?a[i[0]]=t.payload:a=t.payload,{channels:a}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSetStateOperation}function s(e,t){var n=e.config,r=t.state,i=t.channels,s=void 0===i?[]:i,o=t.channelGroups,a=void 0===o?[]:o;return r?n.subscribeKey?0===s.length&&0===a.length?"Please provide a list of channels and/or channel-groups":void 0:"Missing Subscribe Key":"Missing State"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/presence/sub-key/"+n.subscribeKey+"/channel/"+d.default.encodeString(s)+"/uuid/"+n.UUID+"/data"}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.state,r=t.channelGroups,i=void 0===r?[]:r,s={};return s.state=JSON.stringify(n),i.length>0&&(s["channel-group"]=i.join(",")),s}function l(e,t){return{state:t.payload}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNHereNowOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=t.channelGroups,o=void 0===s?[]:s,a="/v2/presence/sub-key/"+n.subscribeKey;if(i.length>0||o.length>0){var u=i.length>0?i.join(","):",";a+="/channel/"+d.default.encodeString(u)}return a}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.channelGroups,r=void 0===n?[]:n,i=t.includeUUIDs,s=void 0===i||i,o=t.includeState,a=void 0!==o&&o,u={};return s||(u.disable_uuids=1),a&&(u.state=1),r.length>0&&(u["channel-group"]=r.join(",")),u}function l(e,t,n){var r=n.channels,i=void 0===r?[]:r,s=n.channelGroups,o=void 0===s?[]:s,a=n.includeUUIDs,u=void 0===a||a,c=n.includeState,l=void 0!==c&&c;return i.length>1||o.length>0||0===o.length&&0===i.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],i=[];return e.channels[n]={occupants:i,name:n,occupancy:r.occupancy},u&&r.uuids.forEach(function(e){l?i.push({state:e.state,uuid:e.uuid}):i.push({state:null,uuid:e})}),e}),e}():function(){var e={},n=[];return e.totalChannels=1,e.totalOccupancy=t.occupancy,e.channels={},e.channels[i[0]]={occupants:n,name:i[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}()}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerAudit}function i(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function s(e){return"/v2/auth/audit/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channel,r=t.channelGroup,i=t.authKeys,s=void 0===i?[]:i,o={};return n&&(o.channel=n),r&&(o["channel-group"]=r),s.length>0&&(o.auth=s.join(",")),o}function c(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(){return h.default.PNAccessManagerGrant}function i(e){var t=e.config;return t.subscribeKey?t.publishKey?t.secretKey?void 0:"Missing Secret Key":"Missing Publish Key":"Missing Subscribe Key"}function s(e){return"/v2/auth/grant/sub-key/"+e.config.subscribeKey}function o(e){return e.config.getTransactionTimeout()}function a(){return!1}function u(e,t){var n=t.channels,r=void 0===n?[]:n,i=t.channelGroups,s=void 0===i?[]:i,o=t.ttl,a=t.read,u=void 0!==a&&a,c=t.write,l=void 0!==c&&c,h=t.manage,f=void 0!==h&&h,p=t.authKeys,d=void 0===p?[]:p,y={};return y.r=u?"1":"0",y.w=l?"1":"0",y.m=f?"1":"0",r.length>0&&(y.channel=r.join(",")),s.length>0&&(y["channel-group"]=s.join(",")),
20444
21131
  d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=r,t.validateParams=i,t.getURL=s,t.getRequestTimeout=o,t.isAuthSupported=a,t.prepareParams=u,t.handleResponse=c;var l=(n(5),n(13)),h=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.crypto,r=e.config,i=JSON.stringify(t);return r.cipherKey&&(i=n.encrypt(i),i=JSON.stringify(i)),i}function s(){return b.default.PNPublishOperation}function o(e,t){var n=e.config,r=t.message;return t.channel?r?n.subscribeKey?void 0:"Missing Subscribe Key":"Missing Message":"Missing Channel"}function a(e,t){var n=t.sendByPost;return void 0!==n&&n}function u(e,t){var n=e.config,r=t.channel,s=t.message,o=i(e,s);return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0/"+_.default.encodeString(o)}function c(e,t){var n=e.config,r=t.channel;return"/publish/"+n.publishKey+"/"+n.subscribeKey+"/0/"+_.default.encodeString(r)+"/0"}function l(e){return e.config.getTransactionTimeout()}function h(){return!0}function f(e,t){return i(e,t.message)}function p(e,t){var n=t.meta,r=t.replicate,i=void 0===r||r,s=t.storeInHistory,o=t.ttl,a={};return null!=s&&(a.store=s?"1":"0"),o&&(a.ttl=o),!1===i&&(a.norep="true"),n&&"object"===(void 0===n?"undefined":y(n))&&(a.meta=JSON.stringify(n)),a}function d(e,t){return{timetoken:t[2]}}Object.defineProperty(t,"__esModule",{value:!0});var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getOperation=s,t.validateParams=o,t.usePost=a,t.getURL=u,t.postURL=c,t.getRequestTimeout=l,t.isAuthSupported=h,t.postPayload=f,t.prepareParams=p,t.handleResponse=d;var g=(n(5),n(13)),b=r(g),v=n(15),_=r(v)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNHistoryOperation}function o(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function a(e,t){var n=t.channel;return"/v2/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.reverse,s=t.count,o=void 0===s?100:s,a=t.stringifiedTimeToken,u=void 0!==a&&a,c={include_token:"true"};return c.count=o,n&&(c.start=n),r&&(c.end=r),u&&(c.string_message_token="true"),null!=i&&(c.reverse=i.toString()),c}function h(e,t){var n={messages:[],startTimeToken:t[1],endTimeToken:t[2]};return t[0].forEach(function(t){var r={timetoken:t.timetoken,entry:i(e,t.message)};n.messages.push(r)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNDeleteMessagesOperation}function s(e,t){var n=t.channel,r=e.config;return n?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(){return!0}function a(e,t){var n=t.channel;return"/v3/history/sub-key/"+e.config.subscribeKey+"/channel/"+y.default.encodeString(n)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i={};return n&&(i.start=n),r&&(i.end=r),i}function h(e,t){return t.payload}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.useDelete=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return p.default.PNMessageCounts}function s(e,t){var n=t.channels,r=t.timetoken,i=t.channelTimetokens,s=e.config;return n?r&&i?"timetoken and channelTimetokens are incompatible together":r&&i&&i.length>1&&n.length!==i.length?"Length of channelTimetokens and channels do not match":s.subscribeKey?void 0:"Missing Subscribe Key":"Missing channel"}function o(e,t){var n=t.channels,r=e.config,i=n.join(",");return"/v3/history/sub-key/"+r.subscribeKey+"/message-counts/"+y.default.encodeString(i)}function a(e){return e.config.getTransactionTimeout()}function u(){return!0}function c(e,t){var n=t.timetoken,r=t.channelTimetokens,i={};if(r&&1===r.length){var s=h(r,1),o=s[0];i.timetoken=o}else r?i.channelsTimetoken=r.join(","):n&&(i.timetoken=n);return i}function l(e,t){return{channels:t.channels}}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(e,t){var n=[],r=!0,i=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(i)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var f=n(13),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=e.config,r=e.crypto;if(!n.cipherKey)return t;try{return r.decrypt(t)}catch(e){return t}}function s(){return p.default.PNFetchMessagesOperation}function o(e,t){var n=t.channels,r=e.config;return n&&0!==n.length?r.subscribeKey?void 0:"Missing Subscribe Key":"Missing channels"}function a(e,t){var n=t.channels,r=void 0===n?[]:n,i=e.config,s=r.length>0?r.join(","):",";return"/v3/history/sub-key/"+i.subscribeKey+"/channel/"+y.default.encodeString(s)}function u(e){return e.config.getTransactionTimeout()}function c(){return!0}function l(e,t){var n=t.start,r=t.end,i=t.count,s=t.stringifiedTimeToken,o=void 0!==s&&s,a={};return i&&(a.max=i),n&&(a.start=n),r&&(a.end=r),o&&(a.string_message_token="true"),a}function h(e,t){var n={channels:{}};return Object.keys(t.channels||{}).forEach(function(r){n.channels[r]=[],(t.channels[r]||[]).forEach(function(t){var s={};s.channel=r,s.subscription=null,s.timetoken=t.timetoken,s.message=i(e,t.message),n.channels[r].push(s)})}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=s,t.validateParams=o,t.getURL=a,t.getRequestTimeout=u,t.isAuthSupported=c,t.prepareParams=l,t.handleResponse=h;var f=(n(5),n(13)),p=r(f),d=n(15),y=r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return f.default.PNSubscribeOperation}function s(e){if(!e.config.subscribeKey)return"Missing Subscribe Key"}function o(e,t){var n=e.config,r=t.channels,i=void 0===r?[]:r,s=i.length>0?i.join(","):",";return"/v2/subscribe/"+n.subscribeKey+"/"+d.default.encodeString(s)+"/0"}function a(e){return e.config.getSubscribeTimeout()}function u(){return!0}function c(e,t){var n=e.config,r=t.state,i=t.channelGroups,s=void 0===i?[]:i,o=t.timetoken,a=t.filterExpression,u=t.region,c={heartbeat:n.getPresenceTimeout()};return s.length>0&&(c["channel-group"]=s.join(",")),a&&a.length>0&&(c["filter-expr"]=a),Object.keys(r).length&&(c.state=JSON.stringify(r)),o&&(c.tt=o),u&&(c.tr=u),c}function l(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,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}}Object.defineProperty(t,"__esModule",{value:!0}),t.getOperation=i,t.validateParams=s,t.getURL=o,t.getRequestTimeout=a,t.isAuthSupported=u,t.prepareParams=c,t.handleResponse=l;var h=(n(5),n(13)),f=r(h),p=n(15),d=r(p)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(2),a=(r(o),n(10)),u=r(a),c=(n(5),function(){function e(t){var n=this;i(this,e),this._modules={},Object.keys(t).forEach(function(e){n._modules[e]=t[e].bind(n)})}return s(e,[{key:"init",value:function(e){this._config=e,this._maxSubDomain=20,this._currentSubDomain=Math.floor(Math.random()*this._maxSubDomain),this._providedFQDN=(this._config.secure?"https://":"http://")+this._config.origin,this._coreParams={},this.shiftStandardOrigin()}},{key:"nextOrigin",value:function(){if(-1===this._providedFQDN.indexOf("ps."))return this._providedFQDN;var e=void 0;return this._currentSubDomain=this._currentSubDomain+1,this._currentSubDomain>=this._maxSubDomain&&(this._currentSubDomain=1),e=this._currentSubDomain.toString(),this._providedFQDN.replace("ps.","ps"+e+".")}},{key:"hasModule",value:function(e){return e in this._modules}},{key:"shiftStandardOrigin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._standardOrigin=this.nextOrigin(e),this._standardOrigin}},{key:"getStandardOrigin",value:function(){return this._standardOrigin}},{key:"POST",value:function(e,t,n,r){return this._modules.post(e,t,n,r)}},{key:"GET",value:function(e,t,n){return this._modules.get(e,t,n)}},{key:"DELETE",value:function(e,t,n){return this._modules.del(e,t,n)}},{key:"_detectErrorCategory",value:function(e){if("ENOTFOUND"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNREFUSED"===e.code)return u.default.PNNetworkIssuesCategory;if("ECONNRESET"===e.code)return u.default.PNNetworkIssuesCategory;if("EAI_AGAIN"===e.code)return u.default.PNNetworkIssuesCategory;if(0===e.status||e.hasOwnProperty("status")&&void 0===e.status)return u.default.PNNetworkIssuesCategory;if(e.timeout)return u.default.PNTimeoutCategory;if("ETIMEDOUT"===e.code)return u.default.PNNetworkIssuesCategory;if(e.response){if(e.response.badRequest)return u.default.PNBadRequestCategory;if(e.response.forbidden)return u.default.PNAccessDeniedCategory}return u.default.PNUnknownCategory}}]),e}());t.default=c,e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={get:function(e){try{return localStorage.getItem(e)}catch(e){return null}},set:function(e,t){try{return localStorage.setItem(e,t)}catch(e){return null}}},e.exports=t.default},function(e,t,n){"use strict";function r(e){var t=(new Date).getTime(),n=(new Date).toISOString(),r=function(){return console&&console.log?console:window&&window.console&&window.console.log?window.console:console}();r.log("<<<<<"),r.log("["+n+"]","\n",e.url,"\n",e.qs),r.log("-----"),e.on("response",function(n){var i=(new Date).getTime(),s=i-t,o=(new Date).toISOString();r.log(">>>>>>"),r.log("["+o+" / "+s+"]","\n",e.url,"\n",e.qs,"\n",n.text),r.log("-----")})}function i(e,t,n){var i=this;return this._config.logVerbosity&&(e=e.use(r)),this._config.proxy&&this._modules.proxy&&(e=this._modules.proxy.call(this,e)),this._config.keepAlive&&this._modules.keepAlive&&(e=this._modules.keepAlive(e)),e.timeout(t.timeout).end(function(e,r){var s=void 0,o={};if(o.error=null!==e,o.operation=t.operation,r&&r.status&&(o.statusCode=r.status),e){if(e.response&&e.response.text&&!i._config.logVerbosity)try{o.errorData=JSON.parse(e.response.text)}catch(t){o.errorData=e}else o.errorData=e;return o.category=i._detectErrorCategory(e),n(o,null)}try{s=JSON.parse(r.text)}catch(e){return o.errorData=r,o.error=!0,n(o,null)}return s.error&&1===s.error&&s.status&&s.message&&s.service?(o.errorData=s,o.statusCode=s.status,o.error=!0,o.category=i._detectErrorCategory(o),n(o,null)):n(o,s)})}function s(e,t,n){var r=c.default.get(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}function o(e,t,n,r){var s=c.default.post(this.getStandardOrigin()+n.url).query(e).send(t);return i.call(this,s,n,r)}function a(e,t,n){var r=c.default.delete(this.getStandardOrigin()+t.url).query(e);return i.call(this,r,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.get=s,t.post=o,t.del=a;var u=n(43),c=function(e){return e&&e.__esModule?e:{default:e}}(u);n(5)},function(e,t,n){function r(){}function i(e){if(!y(e))return e;var t=[];for(var n in e)s(t,n,e[n]);return t.join("&")}function s(e,t,n){if(null!=n)if(Array.isArray(n))n.forEach(function(n){s(e,t,n)});else if(y(n))for(var r in n)s(e,t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+"="+encodeURIComponent(n));else null===n&&e.push(encodeURIComponent(t))}function o(e){for(var t,n,r={},i=e.split("&"),s=0,o=i.length;s<o;++s)t=i[s],n=t.indexOf("="),-1==n?r[decodeURIComponent(t)]="":r[decodeURIComponent(t.slice(0,n))]=decodeURIComponent(t.slice(n+1));return r}function a(e){for(var t,n,r,i,s=e.split(/\r?\n/),o={},a=0,u=s.length;a<u;++a)n=s[a],-1!==(t=n.indexOf(":"))&&(r=n.slice(0,t).toLowerCase(),i=_(n.slice(t+1)),o[r]=i);return o}function u(e){return/[\/+]json($|[^-\w])/.test(e)}function c(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;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.header=this.headers=a(this.xhr.getAllResponseHeaders()),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?this._parseBody(this.text?this.text:this.xhr.response):null}function l(e,t){var n=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new c(n)}catch(t){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=t,n.xhr?(e.rawResponse=void 0===n.xhr.responseType?n.xhr.responseText:n.xhr.response,e.status=n.xhr.status?n.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),n.callback(e)}n.emit("response",t);var r;try{n._isResponseOK(t)||(r=new Error(t.statusText||"Unsuccessful HTTP response"))}catch(e){r=e}r?(r.original=e,r.response=t,r.status=t.status,n.callback(r,t)):n.callback(null,t)})}function h(e,t,n){var r=v("DELETE",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}var f;"undefined"!=typeof window?f=window:"undefined"!=typeof self?f=self:(console.warn("Using browser-only version of superagent in non-browser environment"),f=this);var p=n(44),d=n(45),y=n(46),g=n(47),b=n(49),v=t=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)};t.Request=l,v.getXHR=function(){if(!(!f.XMLHttpRequest||f.location&&"file:"==f.location.protocol&&f.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw Error("Browser-only version of superagent could not find XHR")};var _="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};v.serializeObject=i,v.parseString=o,v.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"},v.serialize={"application/x-www-form-urlencoded":i,"application/json":JSON.stringify},v.parse={"application/x-www-form-urlencoded":o,"application/json":JSON.parse},g(c.prototype),c.prototype._parseBody=function(e){var t=v.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&u(this.type)&&(t=v.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null)},c.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot "+t+" "+n+" ("+this.status+")",i=new Error(r);return i.status=this.status,i.method=t,i.url=n,i},v.Response=c,p(l.prototype),d(l.prototype),l.prototype.type=function(e){return this.set("Content-Type",v.types[e]||e),this},l.prototype.accept=function(e){return this.set("Accept",v.types[e]||e),this},l.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"});var r=function(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)},l.prototype.query=function(e){return"string"!=typeof e&&(e=i(e)),e&&this._query.push(e),this},l.prototype.attach=function(e,t,n){if(t){if(this._data)throw Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new f.FormData),this._formData},l.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},l.prototype.crossDomainError=function(){var 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)},l.prototype.buffer=l.prototype.ca=l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.pipe=l.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},l.prototype._isHost=function(e){return e&&"object"==typeof e&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},l.prototype.end=function(e){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||r,this._finalizeQueryString(),this._end()},l.prototype._end=function(){var e=this,t=this.xhr=v.getXHR(),n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4==n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.onprogress=r.bind(null,"download"),t.upload&&(t.upload.onprogress=r.bind(null,"upload"))}catch(e){}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)){var i=this._header["content-type"],s=this._serializer||v.serialize[i?i.split(";")[0]:""];!s&&u(i)&&(s=v.serialize["application/json"]),s&&(n=s(n))}for(var o in this.header)null!=this.header[o]&&this.header.hasOwnProperty(o)&&t.setRequestHeader(o,this.header[o]);return this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0!==n?n:null),this},v.agent=function(){return new b},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(e){b.prototype[e.toLowerCase()]=function(t,n){var r=new v.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}}),b.prototype.del=b.prototype.delete,v.get=function(e,t,n){var r=v("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.head=function(e,t,n){var r=v("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},v.options=function(e,t,n){var r=v("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.del=h,v.delete=h,v.patch=function(e,t,n){var r=v("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.post=function(e,t,n){var r=v("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},v.put=function(e,t,n){var r=v("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t,n){function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if((r=n[i])===t||r.fn===t){n.splice(i,1);break}return this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(46);e.exports=r,r.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,this},r.prototype.parse=function(e){return this._parser=e,this},r.prototype.responseType=function(e){return this._responseType=e,this},r.prototype.serialize=function(e){return this._serializer=e,this},r.prototype.timeout=function(e){if(!e||"object"!=typeof e)return this._timeout=e,this._responseTimeout=0,this;for(var t in e)switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;default:console.warn("Unknown timeout option",t)}return this},r.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};var o=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];r.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var n=this._retryCallback(e,t);if(!0===n)return!0;if(!1===n)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!=t.status)return!0;if(e){if(e.code&&~o.indexOf(e.code))return!0;if(e.timeout&&"ECONNABORTED"==e.code)return!0;if(e.crossDomain)return!0}return!1},r.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},r.prototype.then=function(e,t){if(!this._fullfilledPromise){var n=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(function(e,t){n.end(function(n,r){n?t(n):e(r)})})}return this._fullfilledPromise.then(e,t)},r.prototype.catch=function(e){return this.then(void 0,e)},r.prototype.use=function(e){return e(this),this},r.prototype.ok=function(e){if("function"!=typeof e)throw Error("Callback required");return this._okCallback=e,this},r.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},r.prototype.get=function(e){return this._header[e.toLowerCase()]},r.prototype.getHeader=r.prototype.get,r.prototype.set=function(e,t){if(s(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},r.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},r.prototype.field=function(e,t){if(null===e||void 0===e)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),s(e)){for(var n in e)this.field(n,e[n]);return this}if(Array.isArray(t)){for(var r in t)this.field(e,t[r]);return this}if(null===t||void 0===t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=""+t),this._getFormData().append(e,t),this},r.prototype.abort=function(){return this._aborted?this:(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort"),this)},r.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},r.prototype.withCredentials=function(e){return void 0==e&&(e=!0),this._withCredentials=e,this},r.prototype.redirects=function(e){return this._maxRedirects=e,this},r.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw TypeError("Invalid argument");return this._maxResponseSize=e,this},r.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},r.prototype.send=function(e){var t=s(e),n=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(t&&s(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(n||this.type("form"),n=this._header["content-type"],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)?this:(n||this.type("json"),this)},r.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},r.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var n=this.url.substring(t+1).split("&");"function"==typeof this._sort?n.sort(this._sort):n.sort(),this.url=this.url.substring(0,t)+"?"+n.join("&")}}},r.prototype._appendQueryString=function(){console.trace("Unsupported")},r.prototype._timeoutError=function(e,t,n){if(!this._aborted){var r=new Error(e+t+"ms exceeded");r.timeout=t,r.code="ECONNABORTED",r.errno=n,this.timedout=!0,this.abort(),this.callback(r)}},r.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t){"use strict";function n(e){return null!==e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict";function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}var s=n(48);e.exports=r,r.prototype.get=function(e){return this.header[e.toLowerCase()]},r.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=s.type(t);var n=s.params(t);for(var r in n)this[r]=n[r];this.links={};try{e.link&&(this.links=s.parseLinks(e.link))}catch(e){}},r.prototype._setStatusProperties=function(e){var t=e/100|0;this.status=this.statusCode=e,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}},function(e,t){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce(function(e,t){var n=t.split(/ *= */),r=n.shift(),i=n.shift();return r&&i&&(e[r]=i),e},{})},t.parseLinks=function(e){return e.split(/ *, */).reduce(function(e,t){var n=t.split(/ *; */),r=n[0].slice(1,-1);return e[n[1].split(/ *= */)[1].slice(1,-1)]=r,e},{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(e){n.prototype[e]=function(){return this._defaults.push({fn:e,arguments:arguments}),this}}),n.prototype._setDefaults=function(e){this._defaults.forEach(function(t){e[t.fn].apply(e,t.arguments)})},e.exports=n}])});
20445
- },{}],88:[function(require,module,exports){
21132
+ },{}],91:[function(require,module,exports){
20446
21133
  (function (global){
20447
21134
  /*! https://mths.be/punycode v1.4.1 by @mathias */
20448
21135
  ;(function(root) {
@@ -20979,7 +21666,7 @@ d.length>0&&(y.auth=d.join(",")),(o||0===o)&&(y.ttl=o),y}function c(){return{}}O
20979
21666
  }(this));
20980
21667
 
20981
21668
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
20982
- },{}],89:[function(require,module,exports){
21669
+ },{}],92:[function(require,module,exports){
20983
21670
  (function (process){
20984
21671
  // vim:ts=4:sts=4:sw=4:
20985
21672
  /*!
@@ -23031,7 +23718,7 @@ return Q;
23031
23718
  });
23032
23719
 
23033
23720
  }).call(this,require('_process'))
23034
- },{"_process":86}],90:[function(require,module,exports){
23721
+ },{"_process":89}],93:[function(require,module,exports){
23035
23722
  // Copyright Joyent, Inc. and other Node contributors.
23036
23723
  //
23037
23724
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23117,7 +23804,7 @@ var isArray = Array.isArray || function (xs) {
23117
23804
  return Object.prototype.toString.call(xs) === '[object Array]';
23118
23805
  };
23119
23806
 
23120
- },{}],91:[function(require,module,exports){
23807
+ },{}],94:[function(require,module,exports){
23121
23808
  // Copyright Joyent, Inc. and other Node contributors.
23122
23809
  //
23123
23810
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23204,16 +23891,16 @@ var objectKeys = Object.keys || function (obj) {
23204
23891
  return res;
23205
23892
  };
23206
23893
 
23207
- },{}],92:[function(require,module,exports){
23894
+ },{}],95:[function(require,module,exports){
23208
23895
  'use strict';
23209
23896
 
23210
23897
  exports.decode = exports.parse = require('./decode');
23211
23898
  exports.encode = exports.stringify = require('./encode');
23212
23899
 
23213
- },{"./decode":90,"./encode":91}],93:[function(require,module,exports){
23900
+ },{"./decode":93,"./encode":94}],96:[function(require,module,exports){
23214
23901
  module.exports = require('./lib/_stream_duplex.js');
23215
23902
 
23216
- },{"./lib/_stream_duplex.js":94}],94:[function(require,module,exports){
23903
+ },{"./lib/_stream_duplex.js":97}],97:[function(require,module,exports){
23217
23904
  // Copyright Joyent, Inc. and other Node contributors.
23218
23905
  //
23219
23906
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23259,7 +23946,7 @@ var objectKeys = Object.keys || function (obj) {
23259
23946
  module.exports = Duplex;
23260
23947
 
23261
23948
  /*<replacement>*/
23262
- var util = Object.create(require('core-util-is'));
23949
+ var util = require('core-util-is');
23263
23950
  util.inherits = require('inherits');
23264
23951
  /*</replacement>*/
23265
23952
 
@@ -23345,7 +24032,7 @@ Duplex.prototype._destroy = function (err, cb) {
23345
24032
 
23346
24033
  pna.nextTick(cb, err);
23347
24034
  };
23348
- },{"./_stream_readable":96,"./_stream_writable":98,"core-util-is":47,"inherits":75,"process-nextick-args":85}],95:[function(require,module,exports){
24035
+ },{"./_stream_readable":99,"./_stream_writable":101,"core-util-is":49,"inherits":77,"process-nextick-args":88}],98:[function(require,module,exports){
23349
24036
  // Copyright Joyent, Inc. and other Node contributors.
23350
24037
  //
23351
24038
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -23378,7 +24065,7 @@ module.exports = PassThrough;
23378
24065
  var Transform = require('./_stream_transform');
23379
24066
 
23380
24067
  /*<replacement>*/
23381
- var util = Object.create(require('core-util-is'));
24068
+ var util = require('core-util-is');
23382
24069
  util.inherits = require('inherits');
23383
24070
  /*</replacement>*/
23384
24071
 
@@ -23393,7 +24080,7 @@ function PassThrough(options) {
23393
24080
  PassThrough.prototype._transform = function (chunk, encoding, cb) {
23394
24081
  cb(null, chunk);
23395
24082
  };
23396
- },{"./_stream_transform":97,"core-util-is":47,"inherits":75}],96:[function(require,module,exports){
24083
+ },{"./_stream_transform":100,"core-util-is":49,"inherits":77}],99:[function(require,module,exports){
23397
24084
  (function (process,global){
23398
24085
  // Copyright Joyent, Inc. and other Node contributors.
23399
24086
  //
@@ -23461,7 +24148,7 @@ function _isUint8Array(obj) {
23461
24148
  /*</replacement>*/
23462
24149
 
23463
24150
  /*<replacement>*/
23464
- var util = Object.create(require('core-util-is'));
24151
+ var util = require('core-util-is');
23465
24152
  util.inherits = require('inherits');
23466
24153
  /*</replacement>*/
23467
24154
 
@@ -24415,7 +25102,7 @@ function indexOf(xs, x) {
24415
25102
  return -1;
24416
25103
  }
24417
25104
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
24418
- },{"./_stream_duplex":94,"./internal/streams/BufferList":99,"./internal/streams/destroy":100,"./internal/streams/stream":101,"_process":86,"core-util-is":47,"events":66,"inherits":75,"isarray":76,"process-nextick-args":85,"safe-buffer":107,"string_decoder/":131,"util":42}],97:[function(require,module,exports){
25105
+ },{"./_stream_duplex":97,"./internal/streams/BufferList":102,"./internal/streams/destroy":103,"./internal/streams/stream":104,"_process":89,"core-util-is":49,"events":68,"inherits":77,"isarray":79,"process-nextick-args":88,"safe-buffer":110,"string_decoder/":134,"util":43}],100:[function(require,module,exports){
24419
25106
  // Copyright Joyent, Inc. and other Node contributors.
24420
25107
  //
24421
25108
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -24486,7 +25173,7 @@ module.exports = Transform;
24486
25173
  var Duplex = require('./_stream_duplex');
24487
25174
 
24488
25175
  /*<replacement>*/
24489
- var util = Object.create(require('core-util-is'));
25176
+ var util = require('core-util-is');
24490
25177
  util.inherits = require('inherits');
24491
25178
  /*</replacement>*/
24492
25179
 
@@ -24630,7 +25317,7 @@ function done(stream, er, data) {
24630
25317
 
24631
25318
  return stream.push(null);
24632
25319
  }
24633
- },{"./_stream_duplex":94,"core-util-is":47,"inherits":75}],98:[function(require,module,exports){
25320
+ },{"./_stream_duplex":97,"core-util-is":49,"inherits":77}],101:[function(require,module,exports){
24634
25321
  (function (process,global){
24635
25322
  // Copyright Joyent, Inc. and other Node contributors.
24636
25323
  //
@@ -24698,7 +25385,7 @@ var Duplex;
24698
25385
  Writable.WritableState = WritableState;
24699
25386
 
24700
25387
  /*<replacement>*/
24701
- var util = Object.create(require('core-util-is'));
25388
+ var util = require('core-util-is');
24702
25389
  util.inherits = require('inherits');
24703
25390
  /*</replacement>*/
24704
25391
 
@@ -25320,7 +26007,7 @@ Writable.prototype._destroy = function (err, cb) {
25320
26007
  cb(err);
25321
26008
  };
25322
26009
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
25323
- },{"./_stream_duplex":94,"./internal/streams/destroy":100,"./internal/streams/stream":101,"_process":86,"core-util-is":47,"inherits":75,"process-nextick-args":85,"safe-buffer":107,"util-deprecate":139}],99:[function(require,module,exports){
26010
+ },{"./_stream_duplex":97,"./internal/streams/destroy":103,"./internal/streams/stream":104,"_process":89,"core-util-is":49,"inherits":77,"process-nextick-args":88,"safe-buffer":110,"util-deprecate":141}],102:[function(require,module,exports){
25324
26011
  'use strict';
25325
26012
 
25326
26013
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -25400,7 +26087,7 @@ if (util && util.inspect && util.inspect.custom) {
25400
26087
  return this.constructor.name + ' ' + obj;
25401
26088
  };
25402
26089
  }
25403
- },{"safe-buffer":107,"util":42}],100:[function(require,module,exports){
26090
+ },{"safe-buffer":110,"util":43}],103:[function(require,module,exports){
25404
26091
  'use strict';
25405
26092
 
25406
26093
  /*<replacement>*/
@@ -25475,13 +26162,13 @@ module.exports = {
25475
26162
  destroy: destroy,
25476
26163
  undestroy: undestroy
25477
26164
  };
25478
- },{"process-nextick-args":85}],101:[function(require,module,exports){
26165
+ },{"process-nextick-args":88}],104:[function(require,module,exports){
25479
26166
  module.exports = require('events').EventEmitter;
25480
26167
 
25481
- },{"events":66}],102:[function(require,module,exports){
26168
+ },{"events":68}],105:[function(require,module,exports){
25482
26169
  module.exports = require('./readable').PassThrough
25483
26170
 
25484
- },{"./readable":103}],103:[function(require,module,exports){
26171
+ },{"./readable":106}],106:[function(require,module,exports){
25485
26172
  exports = module.exports = require('./lib/_stream_readable.js');
25486
26173
  exports.Stream = exports;
25487
26174
  exports.Readable = exports;
@@ -25490,13 +26177,13 @@ exports.Duplex = require('./lib/_stream_duplex.js');
25490
26177
  exports.Transform = require('./lib/_stream_transform.js');
25491
26178
  exports.PassThrough = require('./lib/_stream_passthrough.js');
25492
26179
 
25493
- },{"./lib/_stream_duplex.js":94,"./lib/_stream_passthrough.js":95,"./lib/_stream_readable.js":96,"./lib/_stream_transform.js":97,"./lib/_stream_writable.js":98}],104:[function(require,module,exports){
26180
+ },{"./lib/_stream_duplex.js":97,"./lib/_stream_passthrough.js":98,"./lib/_stream_readable.js":99,"./lib/_stream_transform.js":100,"./lib/_stream_writable.js":101}],107:[function(require,module,exports){
25494
26181
  module.exports = require('./readable').Transform
25495
26182
 
25496
- },{"./readable":103}],105:[function(require,module,exports){
26183
+ },{"./readable":106}],108:[function(require,module,exports){
25497
26184
  module.exports = require('./lib/_stream_writable.js');
25498
26185
 
25499
- },{"./lib/_stream_writable.js":98}],106:[function(require,module,exports){
26186
+ },{"./lib/_stream_writable.js":101}],109:[function(require,module,exports){
25500
26187
 
25501
26188
  /**
25502
26189
  * Reduce `arr` with `fn`.
@@ -25521,7 +26208,7 @@ module.exports = function(arr, fn, initial){
25521
26208
 
25522
26209
  return curr;
25523
26210
  };
25524
- },{}],107:[function(require,module,exports){
26211
+ },{}],110:[function(require,module,exports){
25525
26212
  /* eslint-disable node/no-deprecated-api */
25526
26213
  var buffer = require('buffer')
25527
26214
  var Buffer = buffer.Buffer
@@ -25585,7 +26272,7 @@ SafeBuffer.allocUnsafeSlow = function (size) {
25585
26272
  return buffer.SlowBuffer(size)
25586
26273
  }
25587
26274
 
25588
- },{"buffer":43}],108:[function(require,module,exports){
26275
+ },{"buffer":44}],111:[function(require,module,exports){
25589
26276
 
25590
26277
  /**
25591
26278
  * Module dependencies.
@@ -25679,7 +26366,7 @@ exports.connect = lookup;
25679
26366
  exports.Manager = require('./manager');
25680
26367
  exports.Socket = require('./socket');
25681
26368
 
25682
- },{"./manager":109,"./socket":111,"./url":112,"debug":114,"socket.io-parser":118}],109:[function(require,module,exports){
26369
+ },{"./manager":112,"./socket":114,"./url":115,"debug":117,"socket.io-parser":121}],112:[function(require,module,exports){
25683
26370
 
25684
26371
  /**
25685
26372
  * Module dependencies.
@@ -26238,7 +26925,7 @@ Manager.prototype.onreconnect = function(){
26238
26925
  this.emitAll('reconnect', attempt);
26239
26926
  };
26240
26927
 
26241
- },{"./on":110,"./socket":111,"backo2":38,"component-bind":45,"component-emitter":113,"debug":114,"engine.io-client":48,"indexof":74,"socket.io-parser":118}],110:[function(require,module,exports){
26928
+ },{"./on":113,"./socket":114,"backo2":39,"component-bind":46,"component-emitter":116,"debug":117,"engine.io-client":50,"indexof":76,"socket.io-parser":121}],113:[function(require,module,exports){
26242
26929
 
26243
26930
  /**
26244
26931
  * Module exports.
@@ -26264,7 +26951,7 @@ function on(obj, ev, fn) {
26264
26951
  };
26265
26952
  }
26266
26953
 
26267
- },{}],111:[function(require,module,exports){
26954
+ },{}],114:[function(require,module,exports){
26268
26955
 
26269
26956
  /**
26270
26957
  * Module dependencies.
@@ -26678,7 +27365,7 @@ Socket.prototype.compress = function(compress){
26678
27365
  return this;
26679
27366
  };
26680
27367
 
26681
- },{"./on":110,"component-bind":45,"component-emitter":113,"debug":114,"has-binary":69,"socket.io-parser":118,"to-array":135}],112:[function(require,module,exports){
27368
+ },{"./on":113,"component-bind":46,"component-emitter":116,"debug":117,"has-binary":71,"socket.io-parser":121,"to-array":137}],115:[function(require,module,exports){
26682
27369
  (function (global){
26683
27370
 
26684
27371
  /**
@@ -26758,7 +27445,7 @@ function url(uri, loc){
26758
27445
  }
26759
27446
 
26760
27447
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26761
- },{"debug":114,"parseuri":84}],113:[function(require,module,exports){
27448
+ },{"debug":117,"parseuri":87}],116:[function(require,module,exports){
26762
27449
 
26763
27450
  /**
26764
27451
  * Expose `Emitter`.
@@ -26921,13 +27608,13 @@ Emitter.prototype.hasListeners = function(event){
26921
27608
  return !! this.listeners(event).length;
26922
27609
  };
26923
27610
 
26924
- },{}],114:[function(require,module,exports){
26925
- arguments[4][59][0].apply(exports,arguments)
26926
- },{"./debug":115,"dup":59}],115:[function(require,module,exports){
26927
- arguments[4][60][0].apply(exports,arguments)
26928
- },{"dup":60,"ms":116}],116:[function(require,module,exports){
27611
+ },{}],117:[function(require,module,exports){
26929
27612
  arguments[4][61][0].apply(exports,arguments)
26930
- },{"dup":61}],117:[function(require,module,exports){
27613
+ },{"./debug":118,"dup":61}],118:[function(require,module,exports){
27614
+ arguments[4][62][0].apply(exports,arguments)
27615
+ },{"dup":62,"ms":119}],119:[function(require,module,exports){
27616
+ arguments[4][63][0].apply(exports,arguments)
27617
+ },{"dup":63}],120:[function(require,module,exports){
26931
27618
  (function (global){
26932
27619
  /*global Blob,File*/
26933
27620
 
@@ -27072,7 +27759,7 @@ exports.removeBlobs = function(data, callback) {
27072
27759
  };
27073
27760
 
27074
27761
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27075
- },{"./is-buffer":119,"isarray":123}],118:[function(require,module,exports){
27762
+ },{"./is-buffer":122,"isarray":126}],121:[function(require,module,exports){
27076
27763
 
27077
27764
  /**
27078
27765
  * Module dependencies.
@@ -27474,7 +28161,7 @@ function error(data){
27474
28161
  };
27475
28162
  }
27476
28163
 
27477
- },{"./binary":117,"./is-buffer":119,"component-emitter":120,"debug":121,"isarray":123,"json3":77}],119:[function(require,module,exports){
28164
+ },{"./binary":120,"./is-buffer":122,"component-emitter":123,"debug":124,"isarray":126,"json3":80}],122:[function(require,module,exports){
27478
28165
  (function (global){
27479
28166
 
27480
28167
  module.exports = isBuf;
@@ -27491,17 +28178,17 @@ function isBuf(obj) {
27491
28178
  }
27492
28179
 
27493
28180
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27494
- },{}],120:[function(require,module,exports){
27495
- arguments[4][58][0].apply(exports,arguments)
27496
- },{"dup":58}],121:[function(require,module,exports){
27497
- arguments[4][59][0].apply(exports,arguments)
27498
- },{"./debug":122,"dup":59}],122:[function(require,module,exports){
28181
+ },{}],123:[function(require,module,exports){
27499
28182
  arguments[4][60][0].apply(exports,arguments)
27500
- },{"dup":60,"ms":124}],123:[function(require,module,exports){
27501
- arguments[4][65][0].apply(exports,arguments)
27502
- },{"dup":65}],124:[function(require,module,exports){
28183
+ },{"dup":60}],124:[function(require,module,exports){
27503
28184
  arguments[4][61][0].apply(exports,arguments)
27504
- },{"dup":61}],125:[function(require,module,exports){
28185
+ },{"./debug":125,"dup":61}],125:[function(require,module,exports){
28186
+ arguments[4][62][0].apply(exports,arguments)
28187
+ },{"dup":62,"ms":127}],126:[function(require,module,exports){
28188
+ arguments[4][67][0].apply(exports,arguments)
28189
+ },{"dup":67}],127:[function(require,module,exports){
28190
+ arguments[4][63][0].apply(exports,arguments)
28191
+ },{"dup":63}],128:[function(require,module,exports){
27505
28192
  // Copyright Joyent, Inc. and other Node contributors.
27506
28193
  //
27507
28194
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -27630,7 +28317,7 @@ Stream.prototype.pipe = function(dest, options) {
27630
28317
  return dest;
27631
28318
  };
27632
28319
 
27633
- },{"events":66,"inherits":75,"readable-stream/duplex.js":93,"readable-stream/passthrough.js":102,"readable-stream/readable.js":103,"readable-stream/transform.js":104,"readable-stream/writable.js":105}],126:[function(require,module,exports){
28320
+ },{"events":68,"inherits":77,"readable-stream/duplex.js":96,"readable-stream/passthrough.js":105,"readable-stream/readable.js":106,"readable-stream/transform.js":107,"readable-stream/writable.js":108}],129:[function(require,module,exports){
27634
28321
  var ClientRequest = require('./lib/request')
27635
28322
  var extend = require('xtend')
27636
28323
  var statusCodes = require('builtin-status-codes')
@@ -27705,7 +28392,7 @@ http.METHODS = [
27705
28392
  'UNLOCK',
27706
28393
  'UNSUBSCRIBE'
27707
28394
  ]
27708
- },{"./lib/request":128,"builtin-status-codes":44,"url":137,"xtend":142}],127:[function(require,module,exports){
28395
+ },{"./lib/request":131,"builtin-status-codes":45,"url":139,"xtend":144}],130:[function(require,module,exports){
27709
28396
  (function (global){
27710
28397
  exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream)
27711
28398
 
@@ -27749,7 +28436,7 @@ function isFunction (value) {
27749
28436
  xhr = null // Help gc
27750
28437
 
27751
28438
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
27752
- },{}],128:[function(require,module,exports){
28439
+ },{}],131:[function(require,module,exports){
27753
28440
  (function (process,global,Buffer){
27754
28441
  // var Base64 = require('Base64')
27755
28442
  var capability = require('./capability')
@@ -28031,7 +28718,7 @@ var unsafeHeaders = [
28031
28718
  ]
28032
28719
 
28033
28720
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
28034
- },{"./capability":127,"./response":129,"_process":86,"buffer":43,"foreach":68,"indexof":74,"inherits":75,"object-keys":79,"stream":125}],129:[function(require,module,exports){
28721
+ },{"./capability":130,"./response":132,"_process":89,"buffer":44,"foreach":70,"indexof":76,"inherits":77,"object-keys":82,"stream":128}],132:[function(require,module,exports){
28035
28722
  (function (process,global,Buffer){
28036
28723
  var capability = require('./capability')
28037
28724
  var foreach = require('foreach')
@@ -28208,7 +28895,7 @@ IncomingMessage.prototype._onXHRProgress = function () {
28208
28895
  }
28209
28896
 
28210
28897
  }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer)
28211
- },{"./capability":127,"_process":86,"buffer":43,"foreach":68,"inherits":75,"stream":125}],130:[function(require,module,exports){
28898
+ },{"./capability":130,"_process":89,"buffer":44,"foreach":70,"inherits":77,"stream":128}],133:[function(require,module,exports){
28212
28899
  var nargs = /\{([0-9a-zA-Z_]+)\}/g
28213
28900
 
28214
28901
  module.exports = template
@@ -28246,7 +28933,7 @@ function template(string) {
28246
28933
  })
28247
28934
  }
28248
28935
 
28249
- },{}],131:[function(require,module,exports){
28936
+ },{}],134:[function(require,module,exports){
28250
28937
  // Copyright Joyent, Inc. and other Node contributors.
28251
28938
  //
28252
28939
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -28543,7 +29230,7 @@ function simpleWrite(buf) {
28543
29230
  function simpleEnd(buf) {
28544
29231
  return buf && buf.length ? this.write(buf) : '';
28545
29232
  }
28546
- },{"safe-buffer":107}],132:[function(require,module,exports){
29233
+ },{"safe-buffer":110}],135:[function(require,module,exports){
28547
29234
  /**
28548
29235
  * Module dependencies.
28549
29236
  */
@@ -29736,172 +30423,7 @@ request.put = function(url, data, fn){
29736
30423
 
29737
30424
  module.exports = request;
29738
30425
 
29739
- },{"emitter":133,"reduce":106}],133:[function(require,module,exports){
29740
-
29741
- /**
29742
- * Expose `Emitter`.
29743
- */
29744
-
29745
- if (typeof module !== 'undefined') {
29746
- module.exports = Emitter;
29747
- }
29748
-
29749
- /**
29750
- * Initialize a new `Emitter`.
29751
- *
29752
- * @api public
29753
- */
29754
-
29755
- function Emitter(obj) {
29756
- if (obj) return mixin(obj);
29757
- };
29758
-
29759
- /**
29760
- * Mixin the emitter properties.
29761
- *
29762
- * @param {Object} obj
29763
- * @return {Object}
29764
- * @api private
29765
- */
29766
-
29767
- function mixin(obj) {
29768
- for (var key in Emitter.prototype) {
29769
- obj[key] = Emitter.prototype[key];
29770
- }
29771
- return obj;
29772
- }
29773
-
29774
- /**
29775
- * Listen on the given `event` with `fn`.
29776
- *
29777
- * @param {String} event
29778
- * @param {Function} fn
29779
- * @return {Emitter}
29780
- * @api public
29781
- */
29782
-
29783
- Emitter.prototype.on =
29784
- Emitter.prototype.addEventListener = function(event, fn){
29785
- this._callbacks = this._callbacks || {};
29786
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
29787
- .push(fn);
29788
- return this;
29789
- };
29790
-
29791
- /**
29792
- * Adds an `event` listener that will be invoked a single
29793
- * time then automatically removed.
29794
- *
29795
- * @param {String} event
29796
- * @param {Function} fn
29797
- * @return {Emitter}
29798
- * @api public
29799
- */
29800
-
29801
- Emitter.prototype.once = function(event, fn){
29802
- function on() {
29803
- this.off(event, on);
29804
- fn.apply(this, arguments);
29805
- }
29806
-
29807
- on.fn = fn;
29808
- this.on(event, on);
29809
- return this;
29810
- };
29811
-
29812
- /**
29813
- * Remove the given callback for `event` or all
29814
- * registered callbacks.
29815
- *
29816
- * @param {String} event
29817
- * @param {Function} fn
29818
- * @return {Emitter}
29819
- * @api public
29820
- */
29821
-
29822
- Emitter.prototype.off =
29823
- Emitter.prototype.removeListener =
29824
- Emitter.prototype.removeAllListeners =
29825
- Emitter.prototype.removeEventListener = function(event, fn){
29826
- this._callbacks = this._callbacks || {};
29827
-
29828
- // all
29829
- if (0 == arguments.length) {
29830
- this._callbacks = {};
29831
- return this;
29832
- }
29833
-
29834
- // specific event
29835
- var callbacks = this._callbacks['$' + event];
29836
- if (!callbacks) return this;
29837
-
29838
- // remove all handlers
29839
- if (1 == arguments.length) {
29840
- delete this._callbacks['$' + event];
29841
- return this;
29842
- }
29843
-
29844
- // remove specific handler
29845
- var cb;
29846
- for (var i = 0; i < callbacks.length; i++) {
29847
- cb = callbacks[i];
29848
- if (cb === fn || cb.fn === fn) {
29849
- callbacks.splice(i, 1);
29850
- break;
29851
- }
29852
- }
29853
- return this;
29854
- };
29855
-
29856
- /**
29857
- * Emit `event` with the given args.
29858
- *
29859
- * @param {String} event
29860
- * @param {Mixed} ...
29861
- * @return {Emitter}
29862
- */
29863
-
29864
- Emitter.prototype.emit = function(event){
29865
- this._callbacks = this._callbacks || {};
29866
- var args = [].slice.call(arguments, 1)
29867
- , callbacks = this._callbacks['$' + event];
29868
-
29869
- if (callbacks) {
29870
- callbacks = callbacks.slice(0);
29871
- for (var i = 0, len = callbacks.length; i < len; ++i) {
29872
- callbacks[i].apply(this, args);
29873
- }
29874
- }
29875
-
29876
- return this;
29877
- };
29878
-
29879
- /**
29880
- * Return array of callbacks for `event`.
29881
- *
29882
- * @param {String} event
29883
- * @return {Array}
29884
- * @api public
29885
- */
29886
-
29887
- Emitter.prototype.listeners = function(event){
29888
- this._callbacks = this._callbacks || {};
29889
- return this._callbacks['$' + event] || [];
29890
- };
29891
-
29892
- /**
29893
- * Check if this emitter has `event` handlers.
29894
- *
29895
- * @param {String} event
29896
- * @return {Boolean}
29897
- * @api public
29898
- */
29899
-
29900
- Emitter.prototype.hasListeners = function(event){
29901
- return !! this.listeners(event).length;
29902
- };
29903
-
29904
- },{}],134:[function(require,module,exports){
30426
+ },{"emitter":47,"reduce":109}],136:[function(require,module,exports){
29905
30427
  (function (Buffer){
29906
30428
  "0.50.0";
29907
30429
  /*
@@ -38098,7 +38620,7 @@ TinCan client library
38098
38620
  }());
38099
38621
 
38100
38622
  }).call(this,require("buffer").Buffer)
38101
- },{"buffer":43,"querystring":92,"xhr2":141}],135:[function(require,module,exports){
38623
+ },{"buffer":44,"querystring":95,"xhr2":143}],137:[function(require,module,exports){
38102
38624
  module.exports = toArray
38103
38625
 
38104
38626
  function toArray(list, index) {
@@ -38113,7 +38635,7 @@ function toArray(list, index) {
38113
38635
  return array
38114
38636
  }
38115
38637
 
38116
- },{}],136:[function(require,module,exports){
38638
+ },{}],138:[function(require,module,exports){
38117
38639
  // Underscore.js 1.8.3
38118
38640
  // http://underscorejs.org
38119
38641
  // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
@@ -39663,7 +40185,7 @@ function toArray(list, index) {
39663
40185
  }
39664
40186
  }.call(this));
39665
40187
 
39666
- },{}],137:[function(require,module,exports){
40188
+ },{}],139:[function(require,module,exports){
39667
40189
  // Copyright Joyent, Inc. and other Node contributors.
39668
40190
  //
39669
40191
  // Permission is hereby granted, free of charge, to any person obtaining a
@@ -40372,7 +40894,7 @@ function isNullOrUndefined(arg) {
40372
40894
  return arg == null;
40373
40895
  }
40374
40896
 
40375
- },{"punycode":88,"querystring":92}],138:[function(require,module,exports){
40897
+ },{"punycode":91,"querystring":95}],140:[function(require,module,exports){
40376
40898
  (function (global){
40377
40899
  /*! https://mths.be/utf8js v2.0.0 by @mathias */
40378
40900
  ;(function(root) {
@@ -40620,7 +41142,7 @@ function isNullOrUndefined(arg) {
40620
41142
  }(this));
40621
41143
 
40622
41144
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
40623
- },{}],139:[function(require,module,exports){
41145
+ },{}],141:[function(require,module,exports){
40624
41146
  (function (global){
40625
41147
 
40626
41148
  /**
@@ -40691,7 +41213,7 @@ function config (name) {
40691
41213
  }
40692
41214
 
40693
41215
  }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
40694
- },{}],140:[function(require,module,exports){
41216
+ },{}],142:[function(require,module,exports){
40695
41217
  /*!
40696
41218
  * validate.js 0.9.0
40697
41219
  *
@@ -41779,7 +42301,7 @@ function config (name) {
41779
42301
  typeof module !== 'undefined' ? /* istanbul ignore next */ module : null,
41780
42302
  typeof define !== 'undefined' ? /* istanbul ignore next */ define : null);
41781
42303
 
41782
- },{}],141:[function(require,module,exports){
42304
+ },{}],143:[function(require,module,exports){
41783
42305
  (function (process,Buffer){
41784
42306
  // Generated by CoffeeScript 1.6.3
41785
42307
  (function() {
@@ -42617,7 +43139,7 @@ function config (name) {
42617
43139
  }).call(this);
42618
43140
 
42619
43141
  }).call(this,require('_process'),require("buffer").Buffer)
42620
- },{"_process":86,"buffer":43,"http":126,"https":72,"os":81,"url":137}],142:[function(require,module,exports){
43142
+ },{"_process":89,"buffer":44,"http":129,"https":74,"os":84,"url":139}],144:[function(require,module,exports){
42621
43143
  module.exports = extend
42622
43144
 
42623
43145
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -42638,7 +43160,7 @@ function extend() {
42638
43160
  return target
42639
43161
  }
42640
43162
 
42641
- },{}],143:[function(require,module,exports){
43163
+ },{}],145:[function(require,module,exports){
42642
43164
  'use strict';
42643
43165
 
42644
43166
  var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')