@ably/ui 8.1.0 → 8.2.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.
package/core/Meganav.jsx CHANGED
@@ -36,7 +36,7 @@ module.exports = __webpack_require__(5647)
36
36
 
37
37
 
38
38
  __webpack_require__(2702).polyfill();
39
- __webpack_require__(4301);
39
+ const axios = __webpack_require__(9669).default;
40
40
 
41
41
  /**
42
42
  * Fetch search results of search suggestions from the Addsearch API
@@ -172,7 +172,7 @@ var executeApiFetch = function(apiHostname, sitekey, type, settings, cb, fuzzyRe
172
172
  // Suggest
173
173
  else if (type === 'suggest') {
174
174
  apiPath = type;
175
- qs = settingToQueryParam(settings.suggestionsSize, 'size') +
175
+ qs = settingToQueryParam(settings.suggestionsSize, 'size') +
176
176
  settingToQueryParam(settings.lang, 'lang');
177
177
  kw = settings.suggestionsPrefix;
178
178
  }
@@ -187,35 +187,33 @@ var executeApiFetch = function(apiHostname, sitekey, type, settings, cb, fuzzyRe
187
187
 
188
188
 
189
189
  // Execute API call
190
- fetch('https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs)
190
+ axios.get('https://' + apiHostname + '/v1/' + apiPath + '/' + sitekey + '?term=' + kw + qs)
191
191
  .then(function(response) {
192
- return response.json();
193
- }).then(function(json) {
194
-
195
- // Search again with fuzzy=true if no hits
196
- if (type === 'search' && settings.fuzzy === 'retry' && json.total_hits === 0 && fuzzyRetry !== true) {
197
- executeApiFetch(apiHostname, sitekey, type, settings, cb, true);
198
- }
192
+ var json = response.data;
193
+ // Search again with fuzzy=true if no hits
194
+ if (type === 'search' && settings.fuzzy === 'retry' && json.total_hits === 0 && fuzzyRetry !== true) {
195
+ executeApiFetch(apiHostname, sitekey, type, settings, cb, true);
196
+ }
199
197
 
200
- // Fuzzy not "retry" OR fuzzyRetry already returning
201
- else {
198
+ // Fuzzy not "retry" OR fuzzyRetry already returning
199
+ else {
202
200
 
203
- // Cap fuzzy results to one page as quality decreases quickly
204
- if (fuzzyRetry === true) {
205
- var pageSize = settings.paging.pageSize;
206
- if (json.total_hits >= pageSize) {
207
- json.total_hits = pageSize;
201
+ // Cap fuzzy results to one page as quality decreases quickly
202
+ if (fuzzyRetry === true) {
203
+ var pageSize = settings.paging.pageSize;
204
+ if (json.total_hits >= pageSize) {
205
+ json.total_hits = pageSize;
206
+ }
208
207
  }
209
- }
210
-
211
- // Callback
212
- cb(json);
213
- }
214
208
 
215
- }).catch(function(ex) {
216
- console.log(ex);
217
- cb({error: {response: RESPONSE_SERVER_ERROR, message: 'invalid server response'}});
218
- });
209
+ // Callback
210
+ cb(json);
211
+ }
212
+ })
213
+ .catch(function(ex) {
214
+ console.log(ex);
215
+ cb({error: {response: RESPONSE_SERVER_ERROR, message: 'invalid server response'}});
216
+ });
219
217
  };
220
218
  module.exports = executeApiFetch;
221
219
 
@@ -417,20 +415,20 @@ var client = function(sitekey, privatekey) {
417
415
  this.enableLogicalOperators = function(enableLogicalOperators) { this.settings.enableLogicalOperators(enableLogicalOperators) }
418
416
  this.setSearchOperator = function(operator) { this.settings.setSearchOperator(operator) }
419
417
 
420
- this.sendStatsEvent = function(type, keyword, data) {
418
+ this.sendStatsEvent = function(type, keyword,data) {
421
419
  if (type === 'search') {
422
- var data = {
420
+ var payload = {
423
421
  action: 'search',
424
422
  session: this.sessionId,
425
423
  keyword: keyword,
426
424
  numberOfResults: data.numberOfResults,
427
425
  analyticsTag: this.getSettings().analyticsTag
428
426
  };
429
- sendStats(this.apiHostname, this.sitekey, data);
427
+ sendStats(this.apiHostname, this.sitekey, payload);
430
428
  }
431
429
 
432
430
  else if (type === 'click') {
433
- var data = {
431
+ var payload = {
434
432
  action: 'click',
435
433
  session: this.sessionId,
436
434
  keyword: keyword,
@@ -438,7 +436,7 @@ var client = function(sitekey, privatekey) {
438
436
  position: data.position,
439
437
  analyticsTag: this.getSettings().analyticsTag
440
438
  };
441
- sendStats(this.apiHostname, this.sitekey, data);
439
+ sendStats(this.apiHostname, this.sitekey, payload);
442
440
  }
443
441
 
444
442
  else {
@@ -464,9 +462,9 @@ module.exports = client;
464
462
  "use strict";
465
463
 
466
464
 
467
- __webpack_require__(4301);
468
465
  const util = __webpack_require__(5159);
469
466
  const Promise = __webpack_require__(2702).Promise;
467
+ const axios = __webpack_require__(9669).default;
470
468
 
471
469
  const getHeaders = function(sitekey, privatekey) {
472
470
  return {
@@ -482,14 +480,13 @@ const getHeaders = function(sitekey, privatekey) {
482
480
  var getDocument = function(apiHostname, sitekey, privatekey, id) {
483
481
  const promise = new Promise((resolve, reject) => {
484
482
 
485
- fetch('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/' + id,
483
+ axios.get('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/' + id,
486
484
  {
487
- method: 'GET',
488
485
  headers: getHeaders(sitekey, privatekey)
489
486
  })
490
487
  .then((response) => {
491
488
  if (response.status == 200) {
492
- resolve(response.json());
489
+ resolve(response.data);
493
490
  }
494
491
  else {
495
492
  reject({status: response.status, text: response.statusText});
@@ -508,14 +505,16 @@ var getDocument = function(apiHostname, sitekey, privatekey, id) {
508
505
  var saveDocument = function(apiHostname, sitekey, privatekey, document) {
509
506
 
510
507
  // If the doc has id or url field, PUT instead of POST
508
+
511
509
  const isPut = document.id || document.url;
512
510
 
513
511
  const promise = new Promise((resolve, reject) => {
514
- fetch('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/',
512
+ axios(
515
513
  {
516
- method: isPut ? 'PUT' : 'POST',
514
+ url: 'https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/',
515
+ method: isPut ? 'put' : 'post',
517
516
  headers: getHeaders(sitekey, privatekey),
518
- body: JSON.stringify(document)
517
+ data: document
519
518
  })
520
519
  .then((response) => {
521
520
  if (response.status == 202) {
@@ -525,8 +524,8 @@ var saveDocument = function(apiHostname, sitekey, privatekey, document) {
525
524
  reject({status: response.status, text: response.statusText});
526
525
  }
527
526
  }).catch((ex) => {
528
- reject({status: 400, text: ex});
529
- });
527
+ reject({status: 400, text: ex});
528
+ });
530
529
  });
531
530
 
532
531
  return promise;
@@ -539,11 +538,12 @@ var saveDocument = function(apiHostname, sitekey, privatekey, document) {
539
538
  var saveDocumentsBatch = function(apiHostname, sitekey, privatekey, documents) {
540
539
 
541
540
  const promise = new Promise((resolve, reject) => {
542
- fetch('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents:batch',
541
+ axios(
543
542
  {
544
- method: 'PUT',
543
+ method: 'put',
544
+ url: 'https://' + apiHostname + '/v2/indices/' + sitekey + '/documents:batch',
545
545
  headers: getHeaders(sitekey, privatekey),
546
- body: JSON.stringify(documents)
546
+ data: documents
547
547
  })
548
548
  .then((response) => {
549
549
  if (response.status == 202) {
@@ -566,9 +566,8 @@ var saveDocumentsBatch = function(apiHostname, sitekey, privatekey, documents) {
566
566
  */
567
567
  var deleteDocument = function(apiHostname, sitekey, privatekey, id) {
568
568
  const promise = new Promise((resolve, reject) => {
569
- fetch('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/' + id,
569
+ axios.delete('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents/' + id,
570
570
  {
571
- method: 'DELETE',
572
571
  headers: getHeaders(sitekey, privatekey)
573
572
  })
574
573
  .then((response) => {
@@ -592,11 +591,10 @@ var deleteDocument = function(apiHostname, sitekey, privatekey, id) {
592
591
  */
593
592
  var deleteDocumentsBatch = function(apiHostname, sitekey, privatekey, batch) {
594
593
  const promise = new Promise((resolve, reject) => {
595
- fetch('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents:batch',
594
+ axios.delete('https://' + apiHostname + '/v2/indices/' + sitekey + '/documents:batch',
596
595
  {
597
- method: 'DELETE',
598
596
  headers: getHeaders(sitekey, privatekey),
599
- body: JSON.stringify(batch)
597
+ data: batch
600
598
  })
601
599
  .then((response) => {
602
600
  if (response.status == 202) {
@@ -873,23 +871,21 @@ module.exports = settings;
873
871
 
874
872
 
875
873
  __webpack_require__(2702).polyfill();
876
- __webpack_require__(4301);
874
+ const axios = __webpack_require__(9669).default;
877
875
 
878
- var sendStats = function(apiHostname, sitekey, data) {
876
+ var sendStats = function(apiHostname, sitekey, payload) {
879
877
 
880
878
  // Beacon in browsers
881
879
  if (typeof window !== 'undefined' && window.navigator && window.navigator.sendBeacon) {
882
- navigator.sendBeacon('https://' + apiHostname + '/v1/stats/' + sitekey + '/', JSON.stringify(data));
880
+ navigator.sendBeacon('https://' + apiHostname + '/v1/stats/' + sitekey + '/', JSON.stringify(payload));
883
881
  }
884
882
 
885
883
  // POST in node
886
884
  else {
887
- fetch('https://' + apiHostname + '/v1/stats/' + sitekey + '/', {
888
- method: 'POST',
889
- headers: {
890
- 'Content-Type': 'text/plain',
891
- },
892
- body: JSON.stringify(data)
885
+ axios.post('https://' + apiHostname + '/v1/stats/' + sitekey + '/', payload, {
886
+ headers: {
887
+ 'Content-Type': 'text/plain',
888
+ }
893
889
  });
894
890
  }
895
891
  };
@@ -951,27 +947,2392 @@ module.exports = throttle;
951
947
 
952
948
  /***/ }),
953
949
 
954
- /***/ 5159:
955
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
950
+ /***/ 5159:
951
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
952
+
953
+ const isFunction = function(fn) {
954
+ return fn && {}.toString.call(fn) === '[object Function]';
955
+ }
956
+
957
+ const base64 = function(s) {
958
+ __webpack_require__.g.window = {};
959
+ if (window && window.btoa) {
960
+ return window.btoa(s);
961
+ }
962
+ else if (Buffer) {
963
+ return Buffer.from(s).toString('base64');
964
+ }
965
+ }
966
+
967
+ module.exports = {
968
+ isFunction,
969
+ base64
970
+ }
971
+
972
+ /***/ }),
973
+
974
+ /***/ 9669:
975
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
976
+
977
+ module.exports = __webpack_require__(1609);
978
+
979
+ /***/ }),
980
+
981
+ /***/ 5448:
982
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
983
+
984
+ "use strict";
985
+
986
+
987
+ var utils = __webpack_require__(4867);
988
+ var settle = __webpack_require__(6026);
989
+ var cookies = __webpack_require__(4372);
990
+ var buildURL = __webpack_require__(5327);
991
+ var buildFullPath = __webpack_require__(4097);
992
+ var parseHeaders = __webpack_require__(4109);
993
+ var isURLSameOrigin = __webpack_require__(7985);
994
+ var transitionalDefaults = __webpack_require__(7874);
995
+ var AxiosError = __webpack_require__(2648);
996
+ var CanceledError = __webpack_require__(644);
997
+ var parseProtocol = __webpack_require__(205);
998
+
999
+ module.exports = function xhrAdapter(config) {
1000
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
1001
+ var requestData = config.data;
1002
+ var requestHeaders = config.headers;
1003
+ var responseType = config.responseType;
1004
+ var onCanceled;
1005
+ function done() {
1006
+ if (config.cancelToken) {
1007
+ config.cancelToken.unsubscribe(onCanceled);
1008
+ }
1009
+
1010
+ if (config.signal) {
1011
+ config.signal.removeEventListener('abort', onCanceled);
1012
+ }
1013
+ }
1014
+
1015
+ if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {
1016
+ delete requestHeaders['Content-Type']; // Let the browser set it
1017
+ }
1018
+
1019
+ var request = new XMLHttpRequest();
1020
+
1021
+ // HTTP basic authentication
1022
+ if (config.auth) {
1023
+ var username = config.auth.username || '';
1024
+ var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
1025
+ requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
1026
+ }
1027
+
1028
+ var fullPath = buildFullPath(config.baseURL, config.url);
1029
+
1030
+ request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
1031
+
1032
+ // Set the request timeout in MS
1033
+ request.timeout = config.timeout;
1034
+
1035
+ function onloadend() {
1036
+ if (!request) {
1037
+ return;
1038
+ }
1039
+ // Prepare the response
1040
+ var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
1041
+ var responseData = !responseType || responseType === 'text' || responseType === 'json' ?
1042
+ request.responseText : request.response;
1043
+ var response = {
1044
+ data: responseData,
1045
+ status: request.status,
1046
+ statusText: request.statusText,
1047
+ headers: responseHeaders,
1048
+ config: config,
1049
+ request: request
1050
+ };
1051
+
1052
+ settle(function _resolve(value) {
1053
+ resolve(value);
1054
+ done();
1055
+ }, function _reject(err) {
1056
+ reject(err);
1057
+ done();
1058
+ }, response);
1059
+
1060
+ // Clean up request
1061
+ request = null;
1062
+ }
1063
+
1064
+ if ('onloadend' in request) {
1065
+ // Use onloadend if available
1066
+ request.onloadend = onloadend;
1067
+ } else {
1068
+ // Listen for ready state to emulate onloadend
1069
+ request.onreadystatechange = function handleLoad() {
1070
+ if (!request || request.readyState !== 4) {
1071
+ return;
1072
+ }
1073
+
1074
+ // The request errored out and we didn't get a response, this will be
1075
+ // handled by onerror instead
1076
+ // With one exception: request that using file: protocol, most browsers
1077
+ // will return status as 0 even though it's a successful request
1078
+ if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
1079
+ return;
1080
+ }
1081
+ // readystate handler is calling before onerror or ontimeout handlers,
1082
+ // so we should call onloadend on the next 'tick'
1083
+ setTimeout(onloadend);
1084
+ };
1085
+ }
1086
+
1087
+ // Handle browser request cancellation (as opposed to a manual cancellation)
1088
+ request.onabort = function handleAbort() {
1089
+ if (!request) {
1090
+ return;
1091
+ }
1092
+
1093
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
1094
+
1095
+ // Clean up request
1096
+ request = null;
1097
+ };
1098
+
1099
+ // Handle low level network errors
1100
+ request.onerror = function handleError() {
1101
+ // Real errors are hidden from us by the browser
1102
+ // onerror should only fire if it's a network error
1103
+ reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, request));
1104
+
1105
+ // Clean up request
1106
+ request = null;
1107
+ };
1108
+
1109
+ // Handle timeout
1110
+ request.ontimeout = function handleTimeout() {
1111
+ var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
1112
+ var transitional = config.transitional || transitionalDefaults;
1113
+ if (config.timeoutErrorMessage) {
1114
+ timeoutErrorMessage = config.timeoutErrorMessage;
1115
+ }
1116
+ reject(new AxiosError(
1117
+ timeoutErrorMessage,
1118
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
1119
+ config,
1120
+ request));
1121
+
1122
+ // Clean up request
1123
+ request = null;
1124
+ };
1125
+
1126
+ // Add xsrf header
1127
+ // This is only done if running in a standard browser environment.
1128
+ // Specifically not if we're in a web worker, or react-native.
1129
+ if (utils.isStandardBrowserEnv()) {
1130
+ // Add xsrf header
1131
+ var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
1132
+ cookies.read(config.xsrfCookieName) :
1133
+ undefined;
1134
+
1135
+ if (xsrfValue) {
1136
+ requestHeaders[config.xsrfHeaderName] = xsrfValue;
1137
+ }
1138
+ }
1139
+
1140
+ // Add headers to the request
1141
+ if ('setRequestHeader' in request) {
1142
+ utils.forEach(requestHeaders, function setRequestHeader(val, key) {
1143
+ if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
1144
+ // Remove Content-Type if data is undefined
1145
+ delete requestHeaders[key];
1146
+ } else {
1147
+ // Otherwise add header to the request
1148
+ request.setRequestHeader(key, val);
1149
+ }
1150
+ });
1151
+ }
1152
+
1153
+ // Add withCredentials to request if needed
1154
+ if (!utils.isUndefined(config.withCredentials)) {
1155
+ request.withCredentials = !!config.withCredentials;
1156
+ }
1157
+
1158
+ // Add responseType to request if needed
1159
+ if (responseType && responseType !== 'json') {
1160
+ request.responseType = config.responseType;
1161
+ }
1162
+
1163
+ // Handle progress if needed
1164
+ if (typeof config.onDownloadProgress === 'function') {
1165
+ request.addEventListener('progress', config.onDownloadProgress);
1166
+ }
1167
+
1168
+ // Not all browsers support upload events
1169
+ if (typeof config.onUploadProgress === 'function' && request.upload) {
1170
+ request.upload.addEventListener('progress', config.onUploadProgress);
1171
+ }
1172
+
1173
+ if (config.cancelToken || config.signal) {
1174
+ // Handle cancellation
1175
+ // eslint-disable-next-line func-names
1176
+ onCanceled = function(cancel) {
1177
+ if (!request) {
1178
+ return;
1179
+ }
1180
+ reject(!cancel || (cancel && cancel.type) ? new CanceledError() : cancel);
1181
+ request.abort();
1182
+ request = null;
1183
+ };
1184
+
1185
+ config.cancelToken && config.cancelToken.subscribe(onCanceled);
1186
+ if (config.signal) {
1187
+ config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
1188
+ }
1189
+ }
1190
+
1191
+ if (!requestData) {
1192
+ requestData = null;
1193
+ }
1194
+
1195
+ var protocol = parseProtocol(fullPath);
1196
+
1197
+ if (protocol && [ 'http', 'https', 'file' ].indexOf(protocol) === -1) {
1198
+ reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
1199
+ return;
1200
+ }
1201
+
1202
+
1203
+ // Send the request
1204
+ request.send(requestData);
1205
+ });
1206
+ };
1207
+
1208
+
1209
+ /***/ }),
1210
+
1211
+ /***/ 1609:
1212
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1213
+
1214
+ "use strict";
1215
+
1216
+
1217
+ var utils = __webpack_require__(4867);
1218
+ var bind = __webpack_require__(1849);
1219
+ var Axios = __webpack_require__(321);
1220
+ var mergeConfig = __webpack_require__(7185);
1221
+ var defaults = __webpack_require__(5546);
1222
+
1223
+ /**
1224
+ * Create an instance of Axios
1225
+ *
1226
+ * @param {Object} defaultConfig The default config for the instance
1227
+ * @return {Axios} A new instance of Axios
1228
+ */
1229
+ function createInstance(defaultConfig) {
1230
+ var context = new Axios(defaultConfig);
1231
+ var instance = bind(Axios.prototype.request, context);
1232
+
1233
+ // Copy axios.prototype to instance
1234
+ utils.extend(instance, Axios.prototype, context);
1235
+
1236
+ // Copy context to instance
1237
+ utils.extend(instance, context);
1238
+
1239
+ // Factory for creating new instances
1240
+ instance.create = function create(instanceConfig) {
1241
+ return createInstance(mergeConfig(defaultConfig, instanceConfig));
1242
+ };
1243
+
1244
+ return instance;
1245
+ }
1246
+
1247
+ // Create the default instance to be exported
1248
+ var axios = createInstance(defaults);
1249
+
1250
+ // Expose Axios class to allow class inheritance
1251
+ axios.Axios = Axios;
1252
+
1253
+ // Expose Cancel & CancelToken
1254
+ axios.CanceledError = __webpack_require__(644);
1255
+ axios.CancelToken = __webpack_require__(4972);
1256
+ axios.isCancel = __webpack_require__(6502);
1257
+ axios.VERSION = __webpack_require__(7288).version;
1258
+ axios.toFormData = __webpack_require__(7675);
1259
+
1260
+ // Expose AxiosError class
1261
+ axios.AxiosError = __webpack_require__(2648);
1262
+
1263
+ // alias for CanceledError for backward compatibility
1264
+ axios.Cancel = axios.CanceledError;
1265
+
1266
+ // Expose all/spread
1267
+ axios.all = function all(promises) {
1268
+ return Promise.all(promises);
1269
+ };
1270
+ axios.spread = __webpack_require__(8713);
1271
+
1272
+ // Expose isAxiosError
1273
+ axios.isAxiosError = __webpack_require__(6268);
1274
+
1275
+ module.exports = axios;
1276
+
1277
+ // Allow use of default import syntax in TypeScript
1278
+ module.exports.default = axios;
1279
+
1280
+
1281
+ /***/ }),
1282
+
1283
+ /***/ 4972:
1284
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1285
+
1286
+ "use strict";
1287
+
1288
+
1289
+ var CanceledError = __webpack_require__(644);
1290
+
1291
+ /**
1292
+ * A `CancelToken` is an object that can be used to request cancellation of an operation.
1293
+ *
1294
+ * @class
1295
+ * @param {Function} executor The executor function.
1296
+ */
1297
+ function CancelToken(executor) {
1298
+ if (typeof executor !== 'function') {
1299
+ throw new TypeError('executor must be a function.');
1300
+ }
1301
+
1302
+ var resolvePromise;
1303
+
1304
+ this.promise = new Promise(function promiseExecutor(resolve) {
1305
+ resolvePromise = resolve;
1306
+ });
1307
+
1308
+ var token = this;
1309
+
1310
+ // eslint-disable-next-line func-names
1311
+ this.promise.then(function(cancel) {
1312
+ if (!token._listeners) return;
1313
+
1314
+ var i;
1315
+ var l = token._listeners.length;
1316
+
1317
+ for (i = 0; i < l; i++) {
1318
+ token._listeners[i](cancel);
1319
+ }
1320
+ token._listeners = null;
1321
+ });
1322
+
1323
+ // eslint-disable-next-line func-names
1324
+ this.promise.then = function(onfulfilled) {
1325
+ var _resolve;
1326
+ // eslint-disable-next-line func-names
1327
+ var promise = new Promise(function(resolve) {
1328
+ token.subscribe(resolve);
1329
+ _resolve = resolve;
1330
+ }).then(onfulfilled);
1331
+
1332
+ promise.cancel = function reject() {
1333
+ token.unsubscribe(_resolve);
1334
+ };
1335
+
1336
+ return promise;
1337
+ };
1338
+
1339
+ executor(function cancel(message) {
1340
+ if (token.reason) {
1341
+ // Cancellation has already been requested
1342
+ return;
1343
+ }
1344
+
1345
+ token.reason = new CanceledError(message);
1346
+ resolvePromise(token.reason);
1347
+ });
1348
+ }
1349
+
1350
+ /**
1351
+ * Throws a `CanceledError` if cancellation has been requested.
1352
+ */
1353
+ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
1354
+ if (this.reason) {
1355
+ throw this.reason;
1356
+ }
1357
+ };
1358
+
1359
+ /**
1360
+ * Subscribe to the cancel signal
1361
+ */
1362
+
1363
+ CancelToken.prototype.subscribe = function subscribe(listener) {
1364
+ if (this.reason) {
1365
+ listener(this.reason);
1366
+ return;
1367
+ }
1368
+
1369
+ if (this._listeners) {
1370
+ this._listeners.push(listener);
1371
+ } else {
1372
+ this._listeners = [listener];
1373
+ }
1374
+ };
1375
+
1376
+ /**
1377
+ * Unsubscribe from the cancel signal
1378
+ */
1379
+
1380
+ CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
1381
+ if (!this._listeners) {
1382
+ return;
1383
+ }
1384
+ var index = this._listeners.indexOf(listener);
1385
+ if (index !== -1) {
1386
+ this._listeners.splice(index, 1);
1387
+ }
1388
+ };
1389
+
1390
+ /**
1391
+ * Returns an object that contains a new `CancelToken` and a function that, when called,
1392
+ * cancels the `CancelToken`.
1393
+ */
1394
+ CancelToken.source = function source() {
1395
+ var cancel;
1396
+ var token = new CancelToken(function executor(c) {
1397
+ cancel = c;
1398
+ });
1399
+ return {
1400
+ token: token,
1401
+ cancel: cancel
1402
+ };
1403
+ };
1404
+
1405
+ module.exports = CancelToken;
1406
+
1407
+
1408
+ /***/ }),
1409
+
1410
+ /***/ 644:
1411
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1412
+
1413
+ "use strict";
1414
+
1415
+
1416
+ var AxiosError = __webpack_require__(2648);
1417
+ var utils = __webpack_require__(4867);
1418
+
1419
+ /**
1420
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
1421
+ *
1422
+ * @class
1423
+ * @param {string=} message The message.
1424
+ */
1425
+ function CanceledError(message) {
1426
+ // eslint-disable-next-line no-eq-null,eqeqeq
1427
+ AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED);
1428
+ this.name = 'CanceledError';
1429
+ }
1430
+
1431
+ utils.inherits(CanceledError, AxiosError, {
1432
+ __CANCEL__: true
1433
+ });
1434
+
1435
+ module.exports = CanceledError;
1436
+
1437
+
1438
+ /***/ }),
1439
+
1440
+ /***/ 6502:
1441
+ /***/ ((module) => {
1442
+
1443
+ "use strict";
1444
+
1445
+
1446
+ module.exports = function isCancel(value) {
1447
+ return !!(value && value.__CANCEL__);
1448
+ };
1449
+
1450
+
1451
+ /***/ }),
1452
+
1453
+ /***/ 321:
1454
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1455
+
1456
+ "use strict";
1457
+
1458
+
1459
+ var utils = __webpack_require__(4867);
1460
+ var buildURL = __webpack_require__(5327);
1461
+ var InterceptorManager = __webpack_require__(782);
1462
+ var dispatchRequest = __webpack_require__(3572);
1463
+ var mergeConfig = __webpack_require__(7185);
1464
+ var buildFullPath = __webpack_require__(4097);
1465
+ var validator = __webpack_require__(4875);
1466
+
1467
+ var validators = validator.validators;
1468
+ /**
1469
+ * Create a new instance of Axios
1470
+ *
1471
+ * @param {Object} instanceConfig The default config for the instance
1472
+ */
1473
+ function Axios(instanceConfig) {
1474
+ this.defaults = instanceConfig;
1475
+ this.interceptors = {
1476
+ request: new InterceptorManager(),
1477
+ response: new InterceptorManager()
1478
+ };
1479
+ }
1480
+
1481
+ /**
1482
+ * Dispatch a request
1483
+ *
1484
+ * @param {Object} config The config specific for this request (merged with this.defaults)
1485
+ */
1486
+ Axios.prototype.request = function request(configOrUrl, config) {
1487
+ /*eslint no-param-reassign:0*/
1488
+ // Allow for axios('example/url'[, config]) a la fetch API
1489
+ if (typeof configOrUrl === 'string') {
1490
+ config = config || {};
1491
+ config.url = configOrUrl;
1492
+ } else {
1493
+ config = configOrUrl || {};
1494
+ }
1495
+
1496
+ config = mergeConfig(this.defaults, config);
1497
+
1498
+ // Set config.method
1499
+ if (config.method) {
1500
+ config.method = config.method.toLowerCase();
1501
+ } else if (this.defaults.method) {
1502
+ config.method = this.defaults.method.toLowerCase();
1503
+ } else {
1504
+ config.method = 'get';
1505
+ }
1506
+
1507
+ var transitional = config.transitional;
1508
+
1509
+ if (transitional !== undefined) {
1510
+ validator.assertOptions(transitional, {
1511
+ silentJSONParsing: validators.transitional(validators.boolean),
1512
+ forcedJSONParsing: validators.transitional(validators.boolean),
1513
+ clarifyTimeoutError: validators.transitional(validators.boolean)
1514
+ }, false);
1515
+ }
1516
+
1517
+ // filter out skipped interceptors
1518
+ var requestInterceptorChain = [];
1519
+ var synchronousRequestInterceptors = true;
1520
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
1521
+ if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
1522
+ return;
1523
+ }
1524
+
1525
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
1526
+
1527
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
1528
+ });
1529
+
1530
+ var responseInterceptorChain = [];
1531
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
1532
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
1533
+ });
1534
+
1535
+ var promise;
1536
+
1537
+ if (!synchronousRequestInterceptors) {
1538
+ var chain = [dispatchRequest, undefined];
1539
+
1540
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
1541
+ chain = chain.concat(responseInterceptorChain);
1542
+
1543
+ promise = Promise.resolve(config);
1544
+ while (chain.length) {
1545
+ promise = promise.then(chain.shift(), chain.shift());
1546
+ }
1547
+
1548
+ return promise;
1549
+ }
1550
+
1551
+
1552
+ var newConfig = config;
1553
+ while (requestInterceptorChain.length) {
1554
+ var onFulfilled = requestInterceptorChain.shift();
1555
+ var onRejected = requestInterceptorChain.shift();
1556
+ try {
1557
+ newConfig = onFulfilled(newConfig);
1558
+ } catch (error) {
1559
+ onRejected(error);
1560
+ break;
1561
+ }
1562
+ }
1563
+
1564
+ try {
1565
+ promise = dispatchRequest(newConfig);
1566
+ } catch (error) {
1567
+ return Promise.reject(error);
1568
+ }
1569
+
1570
+ while (responseInterceptorChain.length) {
1571
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
1572
+ }
1573
+
1574
+ return promise;
1575
+ };
1576
+
1577
+ Axios.prototype.getUri = function getUri(config) {
1578
+ config = mergeConfig(this.defaults, config);
1579
+ var fullPath = buildFullPath(config.baseURL, config.url);
1580
+ return buildURL(fullPath, config.params, config.paramsSerializer);
1581
+ };
1582
+
1583
+ // Provide aliases for supported request methods
1584
+ utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
1585
+ /*eslint func-names:0*/
1586
+ Axios.prototype[method] = function(url, config) {
1587
+ return this.request(mergeConfig(config || {}, {
1588
+ method: method,
1589
+ url: url,
1590
+ data: (config || {}).data
1591
+ }));
1592
+ };
1593
+ });
1594
+
1595
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
1596
+ /*eslint func-names:0*/
1597
+
1598
+ function generateHTTPMethod(isForm) {
1599
+ return function httpMethod(url, data, config) {
1600
+ return this.request(mergeConfig(config || {}, {
1601
+ method: method,
1602
+ headers: isForm ? {
1603
+ 'Content-Type': 'multipart/form-data'
1604
+ } : {},
1605
+ url: url,
1606
+ data: data
1607
+ }));
1608
+ };
1609
+ }
1610
+
1611
+ Axios.prototype[method] = generateHTTPMethod();
1612
+
1613
+ Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
1614
+ });
1615
+
1616
+ module.exports = Axios;
1617
+
1618
+
1619
+ /***/ }),
1620
+
1621
+ /***/ 2648:
1622
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1623
+
1624
+ "use strict";
1625
+
1626
+
1627
+ var utils = __webpack_require__(4867);
1628
+
1629
+ /**
1630
+ * Create an Error with the specified message, config, error code, request and response.
1631
+ *
1632
+ * @param {string} message The error message.
1633
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
1634
+ * @param {Object} [config] The config.
1635
+ * @param {Object} [request] The request.
1636
+ * @param {Object} [response] The response.
1637
+ * @returns {Error} The created error.
1638
+ */
1639
+ function AxiosError(message, code, config, request, response) {
1640
+ Error.call(this);
1641
+ this.message = message;
1642
+ this.name = 'AxiosError';
1643
+ code && (this.code = code);
1644
+ config && (this.config = config);
1645
+ request && (this.request = request);
1646
+ response && (this.response = response);
1647
+ }
1648
+
1649
+ utils.inherits(AxiosError, Error, {
1650
+ toJSON: function toJSON() {
1651
+ return {
1652
+ // Standard
1653
+ message: this.message,
1654
+ name: this.name,
1655
+ // Microsoft
1656
+ description: this.description,
1657
+ number: this.number,
1658
+ // Mozilla
1659
+ fileName: this.fileName,
1660
+ lineNumber: this.lineNumber,
1661
+ columnNumber: this.columnNumber,
1662
+ stack: this.stack,
1663
+ // Axios
1664
+ config: this.config,
1665
+ code: this.code,
1666
+ status: this.response && this.response.status ? this.response.status : null
1667
+ };
1668
+ }
1669
+ });
1670
+
1671
+ var prototype = AxiosError.prototype;
1672
+ var descriptors = {};
1673
+
1674
+ [
1675
+ 'ERR_BAD_OPTION_VALUE',
1676
+ 'ERR_BAD_OPTION',
1677
+ 'ECONNABORTED',
1678
+ 'ETIMEDOUT',
1679
+ 'ERR_NETWORK',
1680
+ 'ERR_FR_TOO_MANY_REDIRECTS',
1681
+ 'ERR_DEPRECATED',
1682
+ 'ERR_BAD_RESPONSE',
1683
+ 'ERR_BAD_REQUEST',
1684
+ 'ERR_CANCELED'
1685
+ // eslint-disable-next-line func-names
1686
+ ].forEach(function(code) {
1687
+ descriptors[code] = {value: code};
1688
+ });
1689
+
1690
+ Object.defineProperties(AxiosError, descriptors);
1691
+ Object.defineProperty(prototype, 'isAxiosError', {value: true});
1692
+
1693
+ // eslint-disable-next-line func-names
1694
+ AxiosError.from = function(error, code, config, request, response, customProps) {
1695
+ var axiosError = Object.create(prototype);
1696
+
1697
+ utils.toFlatObject(error, axiosError, function filter(obj) {
1698
+ return obj !== Error.prototype;
1699
+ });
1700
+
1701
+ AxiosError.call(axiosError, error.message, code, config, request, response);
1702
+
1703
+ axiosError.name = error.name;
1704
+
1705
+ customProps && Object.assign(axiosError, customProps);
1706
+
1707
+ return axiosError;
1708
+ };
1709
+
1710
+ module.exports = AxiosError;
1711
+
1712
+
1713
+ /***/ }),
1714
+
1715
+ /***/ 782:
1716
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1717
+
1718
+ "use strict";
1719
+
1720
+
1721
+ var utils = __webpack_require__(4867);
1722
+
1723
+ function InterceptorManager() {
1724
+ this.handlers = [];
1725
+ }
1726
+
1727
+ /**
1728
+ * Add a new interceptor to the stack
1729
+ *
1730
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
1731
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
1732
+ *
1733
+ * @return {Number} An ID used to remove interceptor later
1734
+ */
1735
+ InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
1736
+ this.handlers.push({
1737
+ fulfilled: fulfilled,
1738
+ rejected: rejected,
1739
+ synchronous: options ? options.synchronous : false,
1740
+ runWhen: options ? options.runWhen : null
1741
+ });
1742
+ return this.handlers.length - 1;
1743
+ };
1744
+
1745
+ /**
1746
+ * Remove an interceptor from the stack
1747
+ *
1748
+ * @param {Number} id The ID that was returned by `use`
1749
+ */
1750
+ InterceptorManager.prototype.eject = function eject(id) {
1751
+ if (this.handlers[id]) {
1752
+ this.handlers[id] = null;
1753
+ }
1754
+ };
1755
+
1756
+ /**
1757
+ * Iterate over all the registered interceptors
1758
+ *
1759
+ * This method is particularly useful for skipping over any
1760
+ * interceptors that may have become `null` calling `eject`.
1761
+ *
1762
+ * @param {Function} fn The function to call for each interceptor
1763
+ */
1764
+ InterceptorManager.prototype.forEach = function forEach(fn) {
1765
+ utils.forEach(this.handlers, function forEachHandler(h) {
1766
+ if (h !== null) {
1767
+ fn(h);
1768
+ }
1769
+ });
1770
+ };
1771
+
1772
+ module.exports = InterceptorManager;
1773
+
1774
+
1775
+ /***/ }),
1776
+
1777
+ /***/ 4097:
1778
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1779
+
1780
+ "use strict";
1781
+
1782
+
1783
+ var isAbsoluteURL = __webpack_require__(1793);
1784
+ var combineURLs = __webpack_require__(7303);
1785
+
1786
+ /**
1787
+ * Creates a new URL by combining the baseURL with the requestedURL,
1788
+ * only when the requestedURL is not already an absolute URL.
1789
+ * If the requestURL is absolute, this function returns the requestedURL untouched.
1790
+ *
1791
+ * @param {string} baseURL The base URL
1792
+ * @param {string} requestedURL Absolute or relative URL to combine
1793
+ * @returns {string} The combined full path
1794
+ */
1795
+ module.exports = function buildFullPath(baseURL, requestedURL) {
1796
+ if (baseURL && !isAbsoluteURL(requestedURL)) {
1797
+ return combineURLs(baseURL, requestedURL);
1798
+ }
1799
+ return requestedURL;
1800
+ };
1801
+
1802
+
1803
+ /***/ }),
1804
+
1805
+ /***/ 3572:
1806
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1807
+
1808
+ "use strict";
1809
+
1810
+
1811
+ var utils = __webpack_require__(4867);
1812
+ var transformData = __webpack_require__(8527);
1813
+ var isCancel = __webpack_require__(6502);
1814
+ var defaults = __webpack_require__(5546);
1815
+ var CanceledError = __webpack_require__(644);
1816
+
1817
+ /**
1818
+ * Throws a `CanceledError` if cancellation has been requested.
1819
+ */
1820
+ function throwIfCancellationRequested(config) {
1821
+ if (config.cancelToken) {
1822
+ config.cancelToken.throwIfRequested();
1823
+ }
1824
+
1825
+ if (config.signal && config.signal.aborted) {
1826
+ throw new CanceledError();
1827
+ }
1828
+ }
1829
+
1830
+ /**
1831
+ * Dispatch a request to the server using the configured adapter.
1832
+ *
1833
+ * @param {object} config The config that is to be used for the request
1834
+ * @returns {Promise} The Promise to be fulfilled
1835
+ */
1836
+ module.exports = function dispatchRequest(config) {
1837
+ throwIfCancellationRequested(config);
1838
+
1839
+ // Ensure headers exist
1840
+ config.headers = config.headers || {};
1841
+
1842
+ // Transform request data
1843
+ config.data = transformData.call(
1844
+ config,
1845
+ config.data,
1846
+ config.headers,
1847
+ config.transformRequest
1848
+ );
1849
+
1850
+ // Flatten headers
1851
+ config.headers = utils.merge(
1852
+ config.headers.common || {},
1853
+ config.headers[config.method] || {},
1854
+ config.headers
1855
+ );
1856
+
1857
+ utils.forEach(
1858
+ ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
1859
+ function cleanHeaderConfig(method) {
1860
+ delete config.headers[method];
1861
+ }
1862
+ );
1863
+
1864
+ var adapter = config.adapter || defaults.adapter;
1865
+
1866
+ return adapter(config).then(function onAdapterResolution(response) {
1867
+ throwIfCancellationRequested(config);
1868
+
1869
+ // Transform response data
1870
+ response.data = transformData.call(
1871
+ config,
1872
+ response.data,
1873
+ response.headers,
1874
+ config.transformResponse
1875
+ );
1876
+
1877
+ return response;
1878
+ }, function onAdapterRejection(reason) {
1879
+ if (!isCancel(reason)) {
1880
+ throwIfCancellationRequested(config);
1881
+
1882
+ // Transform response data
1883
+ if (reason && reason.response) {
1884
+ reason.response.data = transformData.call(
1885
+ config,
1886
+ reason.response.data,
1887
+ reason.response.headers,
1888
+ config.transformResponse
1889
+ );
1890
+ }
1891
+ }
1892
+
1893
+ return Promise.reject(reason);
1894
+ });
1895
+ };
1896
+
1897
+
1898
+ /***/ }),
1899
+
1900
+ /***/ 7185:
1901
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1902
+
1903
+ "use strict";
1904
+
1905
+
1906
+ var utils = __webpack_require__(4867);
1907
+
1908
+ /**
1909
+ * Config-specific merge-function which creates a new config-object
1910
+ * by merging two configuration objects together.
1911
+ *
1912
+ * @param {Object} config1
1913
+ * @param {Object} config2
1914
+ * @returns {Object} New object resulting from merging config2 to config1
1915
+ */
1916
+ module.exports = function mergeConfig(config1, config2) {
1917
+ // eslint-disable-next-line no-param-reassign
1918
+ config2 = config2 || {};
1919
+ var config = {};
1920
+
1921
+ function getMergedValue(target, source) {
1922
+ if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
1923
+ return utils.merge(target, source);
1924
+ } else if (utils.isPlainObject(source)) {
1925
+ return utils.merge({}, source);
1926
+ } else if (utils.isArray(source)) {
1927
+ return source.slice();
1928
+ }
1929
+ return source;
1930
+ }
1931
+
1932
+ // eslint-disable-next-line consistent-return
1933
+ function mergeDeepProperties(prop) {
1934
+ if (!utils.isUndefined(config2[prop])) {
1935
+ return getMergedValue(config1[prop], config2[prop]);
1936
+ } else if (!utils.isUndefined(config1[prop])) {
1937
+ return getMergedValue(undefined, config1[prop]);
1938
+ }
1939
+ }
1940
+
1941
+ // eslint-disable-next-line consistent-return
1942
+ function valueFromConfig2(prop) {
1943
+ if (!utils.isUndefined(config2[prop])) {
1944
+ return getMergedValue(undefined, config2[prop]);
1945
+ }
1946
+ }
1947
+
1948
+ // eslint-disable-next-line consistent-return
1949
+ function defaultToConfig2(prop) {
1950
+ if (!utils.isUndefined(config2[prop])) {
1951
+ return getMergedValue(undefined, config2[prop]);
1952
+ } else if (!utils.isUndefined(config1[prop])) {
1953
+ return getMergedValue(undefined, config1[prop]);
1954
+ }
1955
+ }
1956
+
1957
+ // eslint-disable-next-line consistent-return
1958
+ function mergeDirectKeys(prop) {
1959
+ if (prop in config2) {
1960
+ return getMergedValue(config1[prop], config2[prop]);
1961
+ } else if (prop in config1) {
1962
+ return getMergedValue(undefined, config1[prop]);
1963
+ }
1964
+ }
1965
+
1966
+ var mergeMap = {
1967
+ 'url': valueFromConfig2,
1968
+ 'method': valueFromConfig2,
1969
+ 'data': valueFromConfig2,
1970
+ 'baseURL': defaultToConfig2,
1971
+ 'transformRequest': defaultToConfig2,
1972
+ 'transformResponse': defaultToConfig2,
1973
+ 'paramsSerializer': defaultToConfig2,
1974
+ 'timeout': defaultToConfig2,
1975
+ 'timeoutMessage': defaultToConfig2,
1976
+ 'withCredentials': defaultToConfig2,
1977
+ 'adapter': defaultToConfig2,
1978
+ 'responseType': defaultToConfig2,
1979
+ 'xsrfCookieName': defaultToConfig2,
1980
+ 'xsrfHeaderName': defaultToConfig2,
1981
+ 'onUploadProgress': defaultToConfig2,
1982
+ 'onDownloadProgress': defaultToConfig2,
1983
+ 'decompress': defaultToConfig2,
1984
+ 'maxContentLength': defaultToConfig2,
1985
+ 'maxBodyLength': defaultToConfig2,
1986
+ 'beforeRedirect': defaultToConfig2,
1987
+ 'transport': defaultToConfig2,
1988
+ 'httpAgent': defaultToConfig2,
1989
+ 'httpsAgent': defaultToConfig2,
1990
+ 'cancelToken': defaultToConfig2,
1991
+ 'socketPath': defaultToConfig2,
1992
+ 'responseEncoding': defaultToConfig2,
1993
+ 'validateStatus': mergeDirectKeys
1994
+ };
1995
+
1996
+ utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
1997
+ var merge = mergeMap[prop] || mergeDeepProperties;
1998
+ var configValue = merge(prop);
1999
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2000
+ });
2001
+
2002
+ return config;
2003
+ };
2004
+
2005
+
2006
+ /***/ }),
2007
+
2008
+ /***/ 6026:
2009
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2010
+
2011
+ "use strict";
2012
+
2013
+
2014
+ var AxiosError = __webpack_require__(2648);
2015
+
2016
+ /**
2017
+ * Resolve or reject a Promise based on response status.
2018
+ *
2019
+ * @param {Function} resolve A function that resolves the promise.
2020
+ * @param {Function} reject A function that rejects the promise.
2021
+ * @param {object} response The response.
2022
+ */
2023
+ module.exports = function settle(resolve, reject, response) {
2024
+ var validateStatus = response.config.validateStatus;
2025
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
2026
+ resolve(response);
2027
+ } else {
2028
+ reject(new AxiosError(
2029
+ 'Request failed with status code ' + response.status,
2030
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2031
+ response.config,
2032
+ response.request,
2033
+ response
2034
+ ));
2035
+ }
2036
+ };
2037
+
2038
+
2039
+ /***/ }),
2040
+
2041
+ /***/ 8527:
2042
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2043
+
2044
+ "use strict";
2045
+
2046
+
2047
+ var utils = __webpack_require__(4867);
2048
+ var defaults = __webpack_require__(5546);
2049
+
2050
+ /**
2051
+ * Transform the data for a request or a response
2052
+ *
2053
+ * @param {Object|String} data The data to be transformed
2054
+ * @param {Array} headers The headers for the request or response
2055
+ * @param {Array|Function} fns A single function or Array of functions
2056
+ * @returns {*} The resulting transformed data
2057
+ */
2058
+ module.exports = function transformData(data, headers, fns) {
2059
+ var context = this || defaults;
2060
+ /*eslint no-param-reassign:0*/
2061
+ utils.forEach(fns, function transform(fn) {
2062
+ data = fn.call(context, data, headers);
2063
+ });
2064
+
2065
+ return data;
2066
+ };
2067
+
2068
+
2069
+ /***/ }),
2070
+
2071
+ /***/ 5546:
2072
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2073
+
2074
+ "use strict";
2075
+
2076
+
2077
+ var utils = __webpack_require__(4867);
2078
+ var normalizeHeaderName = __webpack_require__(6016);
2079
+ var AxiosError = __webpack_require__(2648);
2080
+ var transitionalDefaults = __webpack_require__(7874);
2081
+ var toFormData = __webpack_require__(7675);
2082
+
2083
+ var DEFAULT_CONTENT_TYPE = {
2084
+ 'Content-Type': 'application/x-www-form-urlencoded'
2085
+ };
2086
+
2087
+ function setContentTypeIfUnset(headers, value) {
2088
+ if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
2089
+ headers['Content-Type'] = value;
2090
+ }
2091
+ }
2092
+
2093
+ function getDefaultAdapter() {
2094
+ var adapter;
2095
+ if (typeof XMLHttpRequest !== 'undefined') {
2096
+ // For browsers use XHR adapter
2097
+ adapter = __webpack_require__(5448);
2098
+ } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
2099
+ // For node use HTTP adapter
2100
+ adapter = __webpack_require__(5448);
2101
+ }
2102
+ return adapter;
2103
+ }
2104
+
2105
+ function stringifySafely(rawValue, parser, encoder) {
2106
+ if (utils.isString(rawValue)) {
2107
+ try {
2108
+ (parser || JSON.parse)(rawValue);
2109
+ return utils.trim(rawValue);
2110
+ } catch (e) {
2111
+ if (e.name !== 'SyntaxError') {
2112
+ throw e;
2113
+ }
2114
+ }
2115
+ }
2116
+
2117
+ return (encoder || JSON.stringify)(rawValue);
2118
+ }
2119
+
2120
+ var defaults = {
2121
+
2122
+ transitional: transitionalDefaults,
2123
+
2124
+ adapter: getDefaultAdapter(),
2125
+
2126
+ transformRequest: [function transformRequest(data, headers) {
2127
+ normalizeHeaderName(headers, 'Accept');
2128
+ normalizeHeaderName(headers, 'Content-Type');
2129
+
2130
+ if (utils.isFormData(data) ||
2131
+ utils.isArrayBuffer(data) ||
2132
+ utils.isBuffer(data) ||
2133
+ utils.isStream(data) ||
2134
+ utils.isFile(data) ||
2135
+ utils.isBlob(data)
2136
+ ) {
2137
+ return data;
2138
+ }
2139
+ if (utils.isArrayBufferView(data)) {
2140
+ return data.buffer;
2141
+ }
2142
+ if (utils.isURLSearchParams(data)) {
2143
+ setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
2144
+ return data.toString();
2145
+ }
2146
+
2147
+ var isObjectPayload = utils.isObject(data);
2148
+ var contentType = headers && headers['Content-Type'];
2149
+
2150
+ var isFileList;
2151
+
2152
+ if ((isFileList = utils.isFileList(data)) || (isObjectPayload && contentType === 'multipart/form-data')) {
2153
+ var _FormData = this.env && this.env.FormData;
2154
+ return toFormData(isFileList ? {'files[]': data} : data, _FormData && new _FormData());
2155
+ } else if (isObjectPayload || contentType === 'application/json') {
2156
+ setContentTypeIfUnset(headers, 'application/json');
2157
+ return stringifySafely(data);
2158
+ }
2159
+
2160
+ return data;
2161
+ }],
2162
+
2163
+ transformResponse: [function transformResponse(data) {
2164
+ var transitional = this.transitional || defaults.transitional;
2165
+ var silentJSONParsing = transitional && transitional.silentJSONParsing;
2166
+ var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2167
+ var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';
2168
+
2169
+ if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {
2170
+ try {
2171
+ return JSON.parse(data);
2172
+ } catch (e) {
2173
+ if (strictJSONParsing) {
2174
+ if (e.name === 'SyntaxError') {
2175
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
2176
+ }
2177
+ throw e;
2178
+ }
2179
+ }
2180
+ }
2181
+
2182
+ return data;
2183
+ }],
2184
+
2185
+ /**
2186
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
2187
+ * timeout is not created.
2188
+ */
2189
+ timeout: 0,
2190
+
2191
+ xsrfCookieName: 'XSRF-TOKEN',
2192
+ xsrfHeaderName: 'X-XSRF-TOKEN',
2193
+
2194
+ maxContentLength: -1,
2195
+ maxBodyLength: -1,
2196
+
2197
+ env: {
2198
+ FormData: __webpack_require__(1623)
2199
+ },
2200
+
2201
+ validateStatus: function validateStatus(status) {
2202
+ return status >= 200 && status < 300;
2203
+ },
2204
+
2205
+ headers: {
2206
+ common: {
2207
+ 'Accept': 'application/json, text/plain, */*'
2208
+ }
2209
+ }
2210
+ };
2211
+
2212
+ utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
2213
+ defaults.headers[method] = {};
2214
+ });
2215
+
2216
+ utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
2217
+ defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
2218
+ });
2219
+
2220
+ module.exports = defaults;
2221
+
2222
+
2223
+ /***/ }),
2224
+
2225
+ /***/ 7874:
2226
+ /***/ ((module) => {
2227
+
2228
+ "use strict";
2229
+
2230
+
2231
+ module.exports = {
2232
+ silentJSONParsing: true,
2233
+ forcedJSONParsing: true,
2234
+ clarifyTimeoutError: false
2235
+ };
2236
+
2237
+
2238
+ /***/ }),
2239
+
2240
+ /***/ 7288:
2241
+ /***/ ((module) => {
2242
+
2243
+ module.exports = {
2244
+ "version": "0.27.2"
2245
+ };
2246
+
2247
+ /***/ }),
2248
+
2249
+ /***/ 1849:
2250
+ /***/ ((module) => {
2251
+
2252
+ "use strict";
2253
+
2254
+
2255
+ module.exports = function bind(fn, thisArg) {
2256
+ return function wrap() {
2257
+ var args = new Array(arguments.length);
2258
+ for (var i = 0; i < args.length; i++) {
2259
+ args[i] = arguments[i];
2260
+ }
2261
+ return fn.apply(thisArg, args);
2262
+ };
2263
+ };
2264
+
2265
+
2266
+ /***/ }),
2267
+
2268
+ /***/ 5327:
2269
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2270
+
2271
+ "use strict";
2272
+
2273
+
2274
+ var utils = __webpack_require__(4867);
2275
+
2276
+ function encode(val) {
2277
+ return encodeURIComponent(val).
2278
+ replace(/%3A/gi, ':').
2279
+ replace(/%24/g, '$').
2280
+ replace(/%2C/gi, ',').
2281
+ replace(/%20/g, '+').
2282
+ replace(/%5B/gi, '[').
2283
+ replace(/%5D/gi, ']');
2284
+ }
2285
+
2286
+ /**
2287
+ * Build a URL by appending params to the end
2288
+ *
2289
+ * @param {string} url The base of the url (e.g., http://www.google.com)
2290
+ * @param {object} [params] The params to be appended
2291
+ * @returns {string} The formatted url
2292
+ */
2293
+ module.exports = function buildURL(url, params, paramsSerializer) {
2294
+ /*eslint no-param-reassign:0*/
2295
+ if (!params) {
2296
+ return url;
2297
+ }
2298
+
2299
+ var serializedParams;
2300
+ if (paramsSerializer) {
2301
+ serializedParams = paramsSerializer(params);
2302
+ } else if (utils.isURLSearchParams(params)) {
2303
+ serializedParams = params.toString();
2304
+ } else {
2305
+ var parts = [];
2306
+
2307
+ utils.forEach(params, function serialize(val, key) {
2308
+ if (val === null || typeof val === 'undefined') {
2309
+ return;
2310
+ }
2311
+
2312
+ if (utils.isArray(val)) {
2313
+ key = key + '[]';
2314
+ } else {
2315
+ val = [val];
2316
+ }
2317
+
2318
+ utils.forEach(val, function parseValue(v) {
2319
+ if (utils.isDate(v)) {
2320
+ v = v.toISOString();
2321
+ } else if (utils.isObject(v)) {
2322
+ v = JSON.stringify(v);
2323
+ }
2324
+ parts.push(encode(key) + '=' + encode(v));
2325
+ });
2326
+ });
2327
+
2328
+ serializedParams = parts.join('&');
2329
+ }
2330
+
2331
+ if (serializedParams) {
2332
+ var hashmarkIndex = url.indexOf('#');
2333
+ if (hashmarkIndex !== -1) {
2334
+ url = url.slice(0, hashmarkIndex);
2335
+ }
2336
+
2337
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
2338
+ }
2339
+
2340
+ return url;
2341
+ };
2342
+
2343
+
2344
+ /***/ }),
2345
+
2346
+ /***/ 7303:
2347
+ /***/ ((module) => {
2348
+
2349
+ "use strict";
2350
+
2351
+
2352
+ /**
2353
+ * Creates a new URL by combining the specified URLs
2354
+ *
2355
+ * @param {string} baseURL The base URL
2356
+ * @param {string} relativeURL The relative URL
2357
+ * @returns {string} The combined URL
2358
+ */
2359
+ module.exports = function combineURLs(baseURL, relativeURL) {
2360
+ return relativeURL
2361
+ ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2362
+ : baseURL;
2363
+ };
2364
+
2365
+
2366
+ /***/ }),
2367
+
2368
+ /***/ 4372:
2369
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2370
+
2371
+ "use strict";
2372
+
2373
+
2374
+ var utils = __webpack_require__(4867);
2375
+
2376
+ module.exports = (
2377
+ utils.isStandardBrowserEnv() ?
2378
+
2379
+ // Standard browser envs support document.cookie
2380
+ (function standardBrowserEnv() {
2381
+ return {
2382
+ write: function write(name, value, expires, path, domain, secure) {
2383
+ var cookie = [];
2384
+ cookie.push(name + '=' + encodeURIComponent(value));
2385
+
2386
+ if (utils.isNumber(expires)) {
2387
+ cookie.push('expires=' + new Date(expires).toGMTString());
2388
+ }
2389
+
2390
+ if (utils.isString(path)) {
2391
+ cookie.push('path=' + path);
2392
+ }
2393
+
2394
+ if (utils.isString(domain)) {
2395
+ cookie.push('domain=' + domain);
2396
+ }
2397
+
2398
+ if (secure === true) {
2399
+ cookie.push('secure');
2400
+ }
2401
+
2402
+ document.cookie = cookie.join('; ');
2403
+ },
2404
+
2405
+ read: function read(name) {
2406
+ var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
2407
+ return (match ? decodeURIComponent(match[3]) : null);
2408
+ },
2409
+
2410
+ remove: function remove(name) {
2411
+ this.write(name, '', Date.now() - 86400000);
2412
+ }
2413
+ };
2414
+ })() :
2415
+
2416
+ // Non standard browser env (web workers, react-native) lack needed support.
2417
+ (function nonStandardBrowserEnv() {
2418
+ return {
2419
+ write: function write() {},
2420
+ read: function read() { return null; },
2421
+ remove: function remove() {}
2422
+ };
2423
+ })()
2424
+ );
2425
+
2426
+
2427
+ /***/ }),
2428
+
2429
+ /***/ 1793:
2430
+ /***/ ((module) => {
2431
+
2432
+ "use strict";
2433
+
2434
+
2435
+ /**
2436
+ * Determines whether the specified URL is absolute
2437
+ *
2438
+ * @param {string} url The URL to test
2439
+ * @returns {boolean} True if the specified URL is absolute, otherwise false
2440
+ */
2441
+ module.exports = function isAbsoluteURL(url) {
2442
+ // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2443
+ // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2444
+ // by any combination of letters, digits, plus, period, or hyphen.
2445
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2446
+ };
2447
+
2448
+
2449
+ /***/ }),
2450
+
2451
+ /***/ 6268:
2452
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2453
+
2454
+ "use strict";
2455
+
2456
+
2457
+ var utils = __webpack_require__(4867);
2458
+
2459
+ /**
2460
+ * Determines whether the payload is an error thrown by Axios
2461
+ *
2462
+ * @param {*} payload The value to test
2463
+ * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
2464
+ */
2465
+ module.exports = function isAxiosError(payload) {
2466
+ return utils.isObject(payload) && (payload.isAxiosError === true);
2467
+ };
2468
+
2469
+
2470
+ /***/ }),
2471
+
2472
+ /***/ 7985:
2473
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2474
+
2475
+ "use strict";
2476
+
2477
+
2478
+ var utils = __webpack_require__(4867);
2479
+
2480
+ module.exports = (
2481
+ utils.isStandardBrowserEnv() ?
2482
+
2483
+ // Standard browser envs have full support of the APIs needed to test
2484
+ // whether the request URL is of the same origin as current location.
2485
+ (function standardBrowserEnv() {
2486
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
2487
+ var urlParsingNode = document.createElement('a');
2488
+ var originURL;
2489
+
2490
+ /**
2491
+ * Parse a URL to discover it's components
2492
+ *
2493
+ * @param {String} url The URL to be parsed
2494
+ * @returns {Object}
2495
+ */
2496
+ function resolveURL(url) {
2497
+ var href = url;
2498
+
2499
+ if (msie) {
2500
+ // IE needs attribute set twice to normalize properties
2501
+ urlParsingNode.setAttribute('href', href);
2502
+ href = urlParsingNode.href;
2503
+ }
2504
+
2505
+ urlParsingNode.setAttribute('href', href);
2506
+
2507
+ // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
2508
+ return {
2509
+ href: urlParsingNode.href,
2510
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
2511
+ host: urlParsingNode.host,
2512
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
2513
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
2514
+ hostname: urlParsingNode.hostname,
2515
+ port: urlParsingNode.port,
2516
+ pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
2517
+ urlParsingNode.pathname :
2518
+ '/' + urlParsingNode.pathname
2519
+ };
2520
+ }
2521
+
2522
+ originURL = resolveURL(window.location.href);
2523
+
2524
+ /**
2525
+ * Determine if a URL shares the same origin as the current location
2526
+ *
2527
+ * @param {String} requestURL The URL to test
2528
+ * @returns {boolean} True if URL shares the same origin, otherwise false
2529
+ */
2530
+ return function isURLSameOrigin(requestURL) {
2531
+ var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
2532
+ return (parsed.protocol === originURL.protocol &&
2533
+ parsed.host === originURL.host);
2534
+ };
2535
+ })() :
2536
+
2537
+ // Non standard browser envs (web workers, react-native) lack needed support.
2538
+ (function nonStandardBrowserEnv() {
2539
+ return function isURLSameOrigin() {
2540
+ return true;
2541
+ };
2542
+ })()
2543
+ );
2544
+
2545
+
2546
+ /***/ }),
2547
+
2548
+ /***/ 6016:
2549
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2550
+
2551
+ "use strict";
2552
+
2553
+
2554
+ var utils = __webpack_require__(4867);
2555
+
2556
+ module.exports = function normalizeHeaderName(headers, normalizedName) {
2557
+ utils.forEach(headers, function processHeader(value, name) {
2558
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
2559
+ headers[normalizedName] = value;
2560
+ delete headers[name];
2561
+ }
2562
+ });
2563
+ };
2564
+
2565
+
2566
+ /***/ }),
2567
+
2568
+ /***/ 1623:
2569
+ /***/ ((module) => {
2570
+
2571
+ // eslint-disable-next-line strict
2572
+ module.exports = null;
2573
+
2574
+
2575
+ /***/ }),
2576
+
2577
+ /***/ 4109:
2578
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2579
+
2580
+ "use strict";
2581
+
2582
+
2583
+ var utils = __webpack_require__(4867);
2584
+
2585
+ // Headers whose duplicates are ignored by node
2586
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
2587
+ var ignoreDuplicateOf = [
2588
+ 'age', 'authorization', 'content-length', 'content-type', 'etag',
2589
+ 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
2590
+ 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
2591
+ 'referer', 'retry-after', 'user-agent'
2592
+ ];
2593
+
2594
+ /**
2595
+ * Parse headers into an object
2596
+ *
2597
+ * ```
2598
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
2599
+ * Content-Type: application/json
2600
+ * Connection: keep-alive
2601
+ * Transfer-Encoding: chunked
2602
+ * ```
2603
+ *
2604
+ * @param {String} headers Headers needing to be parsed
2605
+ * @returns {Object} Headers parsed into an object
2606
+ */
2607
+ module.exports = function parseHeaders(headers) {
2608
+ var parsed = {};
2609
+ var key;
2610
+ var val;
2611
+ var i;
2612
+
2613
+ if (!headers) { return parsed; }
2614
+
2615
+ utils.forEach(headers.split('\n'), function parser(line) {
2616
+ i = line.indexOf(':');
2617
+ key = utils.trim(line.substr(0, i)).toLowerCase();
2618
+ val = utils.trim(line.substr(i + 1));
2619
+
2620
+ if (key) {
2621
+ if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
2622
+ return;
2623
+ }
2624
+ if (key === 'set-cookie') {
2625
+ parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
2626
+ } else {
2627
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
2628
+ }
2629
+ }
2630
+ });
2631
+
2632
+ return parsed;
2633
+ };
2634
+
2635
+
2636
+ /***/ }),
2637
+
2638
+ /***/ 205:
2639
+ /***/ ((module) => {
2640
+
2641
+ "use strict";
2642
+
2643
+
2644
+ module.exports = function parseProtocol(url) {
2645
+ var match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
2646
+ return match && match[1] || '';
2647
+ };
2648
+
2649
+
2650
+ /***/ }),
2651
+
2652
+ /***/ 8713:
2653
+ /***/ ((module) => {
2654
+
2655
+ "use strict";
2656
+
2657
+
2658
+ /**
2659
+ * Syntactic sugar for invoking a function and expanding an array for arguments.
2660
+ *
2661
+ * Common use case would be to use `Function.prototype.apply`.
2662
+ *
2663
+ * ```js
2664
+ * function f(x, y, z) {}
2665
+ * var args = [1, 2, 3];
2666
+ * f.apply(null, args);
2667
+ * ```
2668
+ *
2669
+ * With `spread` this example can be re-written.
2670
+ *
2671
+ * ```js
2672
+ * spread(function(x, y, z) {})([1, 2, 3]);
2673
+ * ```
2674
+ *
2675
+ * @param {Function} callback
2676
+ * @returns {Function}
2677
+ */
2678
+ module.exports = function spread(callback) {
2679
+ return function wrap(arr) {
2680
+ return callback.apply(null, arr);
2681
+ };
2682
+ };
2683
+
2684
+
2685
+ /***/ }),
2686
+
2687
+ /***/ 7675:
2688
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2689
+
2690
+ "use strict";
2691
+
2692
+
2693
+ var utils = __webpack_require__(4867);
2694
+
2695
+ /**
2696
+ * Convert a data object to FormData
2697
+ * @param {Object} obj
2698
+ * @param {?Object} [formData]
2699
+ * @returns {Object}
2700
+ **/
2701
+
2702
+ function toFormData(obj, formData) {
2703
+ // eslint-disable-next-line no-param-reassign
2704
+ formData = formData || new FormData();
2705
+
2706
+ var stack = [];
2707
+
2708
+ function convertValue(value) {
2709
+ if (value === null) return '';
2710
+
2711
+ if (utils.isDate(value)) {
2712
+ return value.toISOString();
2713
+ }
2714
+
2715
+ if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
2716
+ return typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
2717
+ }
2718
+
2719
+ return value;
2720
+ }
2721
+
2722
+ function build(data, parentKey) {
2723
+ if (utils.isPlainObject(data) || utils.isArray(data)) {
2724
+ if (stack.indexOf(data) !== -1) {
2725
+ throw Error('Circular reference detected in ' + parentKey);
2726
+ }
2727
+
2728
+ stack.push(data);
2729
+
2730
+ utils.forEach(data, function each(value, key) {
2731
+ if (utils.isUndefined(value)) return;
2732
+ var fullKey = parentKey ? parentKey + '.' + key : key;
2733
+ var arr;
2734
+
2735
+ if (value && !parentKey && typeof value === 'object') {
2736
+ if (utils.endsWith(key, '{}')) {
2737
+ // eslint-disable-next-line no-param-reassign
2738
+ value = JSON.stringify(value);
2739
+ } else if (utils.endsWith(key, '[]') && (arr = utils.toArray(value))) {
2740
+ // eslint-disable-next-line func-names
2741
+ arr.forEach(function(el) {
2742
+ !utils.isUndefined(el) && formData.append(fullKey, convertValue(el));
2743
+ });
2744
+ return;
2745
+ }
2746
+ }
2747
+
2748
+ build(value, fullKey);
2749
+ });
2750
+
2751
+ stack.pop();
2752
+ } else {
2753
+ formData.append(parentKey, convertValue(data));
2754
+ }
2755
+ }
2756
+
2757
+ build(obj);
2758
+
2759
+ return formData;
2760
+ }
2761
+
2762
+ module.exports = toFormData;
2763
+
2764
+
2765
+ /***/ }),
2766
+
2767
+ /***/ 4875:
2768
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2769
+
2770
+ "use strict";
2771
+
2772
+
2773
+ var VERSION = __webpack_require__(7288).version;
2774
+ var AxiosError = __webpack_require__(2648);
2775
+
2776
+ var validators = {};
2777
+
2778
+ // eslint-disable-next-line func-names
2779
+ ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {
2780
+ validators[type] = function validator(thing) {
2781
+ return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
2782
+ };
2783
+ });
2784
+
2785
+ var deprecatedWarnings = {};
2786
+
2787
+ /**
2788
+ * Transitional option validator
2789
+ * @param {function|boolean?} validator - set to false if the transitional option has been removed
2790
+ * @param {string?} version - deprecated version / removed since version
2791
+ * @param {string?} message - some message with additional info
2792
+ * @returns {function}
2793
+ */
2794
+ validators.transitional = function transitional(validator, version, message) {
2795
+ function formatMessage(opt, desc) {
2796
+ return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
2797
+ }
2798
+
2799
+ // eslint-disable-next-line func-names
2800
+ return function(value, opt, opts) {
2801
+ if (validator === false) {
2802
+ throw new AxiosError(
2803
+ formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
2804
+ AxiosError.ERR_DEPRECATED
2805
+ );
2806
+ }
2807
+
2808
+ if (version && !deprecatedWarnings[opt]) {
2809
+ deprecatedWarnings[opt] = true;
2810
+ // eslint-disable-next-line no-console
2811
+ console.warn(
2812
+ formatMessage(
2813
+ opt,
2814
+ ' has been deprecated since v' + version + ' and will be removed in the near future'
2815
+ )
2816
+ );
2817
+ }
2818
+
2819
+ return validator ? validator(value, opt, opts) : true;
2820
+ };
2821
+ };
2822
+
2823
+ /**
2824
+ * Assert object's properties type
2825
+ * @param {object} options
2826
+ * @param {object} schema
2827
+ * @param {boolean?} allowUnknown
2828
+ */
2829
+
2830
+ function assertOptions(options, schema, allowUnknown) {
2831
+ if (typeof options !== 'object') {
2832
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
2833
+ }
2834
+ var keys = Object.keys(options);
2835
+ var i = keys.length;
2836
+ while (i-- > 0) {
2837
+ var opt = keys[i];
2838
+ var validator = schema[opt];
2839
+ if (validator) {
2840
+ var value = options[opt];
2841
+ var result = value === undefined || validator(value, opt, options);
2842
+ if (result !== true) {
2843
+ throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
2844
+ }
2845
+ continue;
2846
+ }
2847
+ if (allowUnknown !== true) {
2848
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
2849
+ }
2850
+ }
2851
+ }
2852
+
2853
+ module.exports = {
2854
+ assertOptions: assertOptions,
2855
+ validators: validators
2856
+ };
2857
+
2858
+
2859
+ /***/ }),
2860
+
2861
+ /***/ 4867:
2862
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2863
+
2864
+ "use strict";
2865
+
2866
+
2867
+ var bind = __webpack_require__(1849);
2868
+
2869
+ // utils is a library of generic helper functions non-specific to axios
2870
+
2871
+ var toString = Object.prototype.toString;
2872
+
2873
+ // eslint-disable-next-line func-names
2874
+ var kindOf = (function(cache) {
2875
+ // eslint-disable-next-line func-names
2876
+ return function(thing) {
2877
+ var str = toString.call(thing);
2878
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
2879
+ };
2880
+ })(Object.create(null));
2881
+
2882
+ function kindOfTest(type) {
2883
+ type = type.toLowerCase();
2884
+ return function isKindOf(thing) {
2885
+ return kindOf(thing) === type;
2886
+ };
2887
+ }
2888
+
2889
+ /**
2890
+ * Determine if a value is an Array
2891
+ *
2892
+ * @param {Object} val The value to test
2893
+ * @returns {boolean} True if value is an Array, otherwise false
2894
+ */
2895
+ function isArray(val) {
2896
+ return Array.isArray(val);
2897
+ }
2898
+
2899
+ /**
2900
+ * Determine if a value is undefined
2901
+ *
2902
+ * @param {Object} val The value to test
2903
+ * @returns {boolean} True if the value is undefined, otherwise false
2904
+ */
2905
+ function isUndefined(val) {
2906
+ return typeof val === 'undefined';
2907
+ }
2908
+
2909
+ /**
2910
+ * Determine if a value is a Buffer
2911
+ *
2912
+ * @param {Object} val The value to test
2913
+ * @returns {boolean} True if value is a Buffer, otherwise false
2914
+ */
2915
+ function isBuffer(val) {
2916
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
2917
+ && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
2918
+ }
2919
+
2920
+ /**
2921
+ * Determine if a value is an ArrayBuffer
2922
+ *
2923
+ * @function
2924
+ * @param {Object} val The value to test
2925
+ * @returns {boolean} True if value is an ArrayBuffer, otherwise false
2926
+ */
2927
+ var isArrayBuffer = kindOfTest('ArrayBuffer');
2928
+
2929
+
2930
+ /**
2931
+ * Determine if a value is a view on an ArrayBuffer
2932
+ *
2933
+ * @param {Object} val The value to test
2934
+ * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
2935
+ */
2936
+ function isArrayBufferView(val) {
2937
+ var result;
2938
+ if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
2939
+ result = ArrayBuffer.isView(val);
2940
+ } else {
2941
+ result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
2942
+ }
2943
+ return result;
2944
+ }
2945
+
2946
+ /**
2947
+ * Determine if a value is a String
2948
+ *
2949
+ * @param {Object} val The value to test
2950
+ * @returns {boolean} True if value is a String, otherwise false
2951
+ */
2952
+ function isString(val) {
2953
+ return typeof val === 'string';
2954
+ }
2955
+
2956
+ /**
2957
+ * Determine if a value is a Number
2958
+ *
2959
+ * @param {Object} val The value to test
2960
+ * @returns {boolean} True if value is a Number, otherwise false
2961
+ */
2962
+ function isNumber(val) {
2963
+ return typeof val === 'number';
2964
+ }
2965
+
2966
+ /**
2967
+ * Determine if a value is an Object
2968
+ *
2969
+ * @param {Object} val The value to test
2970
+ * @returns {boolean} True if value is an Object, otherwise false
2971
+ */
2972
+ function isObject(val) {
2973
+ return val !== null && typeof val === 'object';
2974
+ }
2975
+
2976
+ /**
2977
+ * Determine if a value is a plain Object
2978
+ *
2979
+ * @param {Object} val The value to test
2980
+ * @return {boolean} True if value is a plain Object, otherwise false
2981
+ */
2982
+ function isPlainObject(val) {
2983
+ if (kindOf(val) !== 'object') {
2984
+ return false;
2985
+ }
2986
+
2987
+ var prototype = Object.getPrototypeOf(val);
2988
+ return prototype === null || prototype === Object.prototype;
2989
+ }
2990
+
2991
+ /**
2992
+ * Determine if a value is a Date
2993
+ *
2994
+ * @function
2995
+ * @param {Object} val The value to test
2996
+ * @returns {boolean} True if value is a Date, otherwise false
2997
+ */
2998
+ var isDate = kindOfTest('Date');
2999
+
3000
+ /**
3001
+ * Determine if a value is a File
3002
+ *
3003
+ * @function
3004
+ * @param {Object} val The value to test
3005
+ * @returns {boolean} True if value is a File, otherwise false
3006
+ */
3007
+ var isFile = kindOfTest('File');
3008
+
3009
+ /**
3010
+ * Determine if a value is a Blob
3011
+ *
3012
+ * @function
3013
+ * @param {Object} val The value to test
3014
+ * @returns {boolean} True if value is a Blob, otherwise false
3015
+ */
3016
+ var isBlob = kindOfTest('Blob');
3017
+
3018
+ /**
3019
+ * Determine if a value is a FileList
3020
+ *
3021
+ * @function
3022
+ * @param {Object} val The value to test
3023
+ * @returns {boolean} True if value is a File, otherwise false
3024
+ */
3025
+ var isFileList = kindOfTest('FileList');
3026
+
3027
+ /**
3028
+ * Determine if a value is a Function
3029
+ *
3030
+ * @param {Object} val The value to test
3031
+ * @returns {boolean} True if value is a Function, otherwise false
3032
+ */
3033
+ function isFunction(val) {
3034
+ return toString.call(val) === '[object Function]';
3035
+ }
3036
+
3037
+ /**
3038
+ * Determine if a value is a Stream
3039
+ *
3040
+ * @param {Object} val The value to test
3041
+ * @returns {boolean} True if value is a Stream, otherwise false
3042
+ */
3043
+ function isStream(val) {
3044
+ return isObject(val) && isFunction(val.pipe);
3045
+ }
3046
+
3047
+ /**
3048
+ * Determine if a value is a FormData
3049
+ *
3050
+ * @param {Object} thing The value to test
3051
+ * @returns {boolean} True if value is an FormData, otherwise false
3052
+ */
3053
+ function isFormData(thing) {
3054
+ var pattern = '[object FormData]';
3055
+ return thing && (
3056
+ (typeof FormData === 'function' && thing instanceof FormData) ||
3057
+ toString.call(thing) === pattern ||
3058
+ (isFunction(thing.toString) && thing.toString() === pattern)
3059
+ );
3060
+ }
3061
+
3062
+ /**
3063
+ * Determine if a value is a URLSearchParams object
3064
+ * @function
3065
+ * @param {Object} val The value to test
3066
+ * @returns {boolean} True if value is a URLSearchParams object, otherwise false
3067
+ */
3068
+ var isURLSearchParams = kindOfTest('URLSearchParams');
3069
+
3070
+ /**
3071
+ * Trim excess whitespace off the beginning and end of a string
3072
+ *
3073
+ * @param {String} str The String to trim
3074
+ * @returns {String} The String freed of excess whitespace
3075
+ */
3076
+ function trim(str) {
3077
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, '');
3078
+ }
3079
+
3080
+ /**
3081
+ * Determine if we're running in a standard browser environment
3082
+ *
3083
+ * This allows axios to run in a web worker, and react-native.
3084
+ * Both environments support XMLHttpRequest, but not fully standard globals.
3085
+ *
3086
+ * web workers:
3087
+ * typeof window -> undefined
3088
+ * typeof document -> undefined
3089
+ *
3090
+ * react-native:
3091
+ * navigator.product -> 'ReactNative'
3092
+ * nativescript
3093
+ * navigator.product -> 'NativeScript' or 'NS'
3094
+ */
3095
+ function isStandardBrowserEnv() {
3096
+ if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
3097
+ navigator.product === 'NativeScript' ||
3098
+ navigator.product === 'NS')) {
3099
+ return false;
3100
+ }
3101
+ return (
3102
+ typeof window !== 'undefined' &&
3103
+ typeof document !== 'undefined'
3104
+ );
3105
+ }
3106
+
3107
+ /**
3108
+ * Iterate over an Array or an Object invoking a function for each item.
3109
+ *
3110
+ * If `obj` is an Array callback will be called passing
3111
+ * the value, index, and complete array for each item.
3112
+ *
3113
+ * If 'obj' is an Object callback will be called passing
3114
+ * the value, key, and complete object for each property.
3115
+ *
3116
+ * @param {Object|Array} obj The object to iterate
3117
+ * @param {Function} fn The callback to invoke for each item
3118
+ */
3119
+ function forEach(obj, fn) {
3120
+ // Don't bother if no value provided
3121
+ if (obj === null || typeof obj === 'undefined') {
3122
+ return;
3123
+ }
3124
+
3125
+ // Force an array if not already something iterable
3126
+ if (typeof obj !== 'object') {
3127
+ /*eslint no-param-reassign:0*/
3128
+ obj = [obj];
3129
+ }
3130
+
3131
+ if (isArray(obj)) {
3132
+ // Iterate over array values
3133
+ for (var i = 0, l = obj.length; i < l; i++) {
3134
+ fn.call(null, obj[i], i, obj);
3135
+ }
3136
+ } else {
3137
+ // Iterate over object keys
3138
+ for (var key in obj) {
3139
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
3140
+ fn.call(null, obj[key], key, obj);
3141
+ }
3142
+ }
3143
+ }
3144
+ }
3145
+
3146
+ /**
3147
+ * Accepts varargs expecting each argument to be an object, then
3148
+ * immutably merges the properties of each object and returns result.
3149
+ *
3150
+ * When multiple objects contain the same key the later object in
3151
+ * the arguments list will take precedence.
3152
+ *
3153
+ * Example:
3154
+ *
3155
+ * ```js
3156
+ * var result = merge({foo: 123}, {foo: 456});
3157
+ * console.log(result.foo); // outputs 456
3158
+ * ```
3159
+ *
3160
+ * @param {Object} obj1 Object to merge
3161
+ * @returns {Object} Result of all merge properties
3162
+ */
3163
+ function merge(/* obj1, obj2, obj3, ... */) {
3164
+ var result = {};
3165
+ function assignValue(val, key) {
3166
+ if (isPlainObject(result[key]) && isPlainObject(val)) {
3167
+ result[key] = merge(result[key], val);
3168
+ } else if (isPlainObject(val)) {
3169
+ result[key] = merge({}, val);
3170
+ } else if (isArray(val)) {
3171
+ result[key] = val.slice();
3172
+ } else {
3173
+ result[key] = val;
3174
+ }
3175
+ }
3176
+
3177
+ for (var i = 0, l = arguments.length; i < l; i++) {
3178
+ forEach(arguments[i], assignValue);
3179
+ }
3180
+ return result;
3181
+ }
3182
+
3183
+ /**
3184
+ * Extends object a by mutably adding to it the properties of object b.
3185
+ *
3186
+ * @param {Object} a The object to be extended
3187
+ * @param {Object} b The object to copy properties from
3188
+ * @param {Object} thisArg The object to bind function to
3189
+ * @return {Object} The resulting value of object a
3190
+ */
3191
+ function extend(a, b, thisArg) {
3192
+ forEach(b, function assignValue(val, key) {
3193
+ if (thisArg && typeof val === 'function') {
3194
+ a[key] = bind(val, thisArg);
3195
+ } else {
3196
+ a[key] = val;
3197
+ }
3198
+ });
3199
+ return a;
3200
+ }
3201
+
3202
+ /**
3203
+ * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
3204
+ *
3205
+ * @param {string} content with BOM
3206
+ * @return {string} content value without BOM
3207
+ */
3208
+ function stripBOM(content) {
3209
+ if (content.charCodeAt(0) === 0xFEFF) {
3210
+ content = content.slice(1);
3211
+ }
3212
+ return content;
3213
+ }
3214
+
3215
+ /**
3216
+ * Inherit the prototype methods from one constructor into another
3217
+ * @param {function} constructor
3218
+ * @param {function} superConstructor
3219
+ * @param {object} [props]
3220
+ * @param {object} [descriptors]
3221
+ */
3222
+
3223
+ function inherits(constructor, superConstructor, props, descriptors) {
3224
+ constructor.prototype = Object.create(superConstructor.prototype, descriptors);
3225
+ constructor.prototype.constructor = constructor;
3226
+ props && Object.assign(constructor.prototype, props);
3227
+ }
3228
+
3229
+ /**
3230
+ * Resolve object with deep prototype chain to a flat object
3231
+ * @param {Object} sourceObj source object
3232
+ * @param {Object} [destObj]
3233
+ * @param {Function} [filter]
3234
+ * @returns {Object}
3235
+ */
3236
+
3237
+ function toFlatObject(sourceObj, destObj, filter) {
3238
+ var props;
3239
+ var i;
3240
+ var prop;
3241
+ var merged = {};
3242
+
3243
+ destObj = destObj || {};
3244
+
3245
+ do {
3246
+ props = Object.getOwnPropertyNames(sourceObj);
3247
+ i = props.length;
3248
+ while (i-- > 0) {
3249
+ prop = props[i];
3250
+ if (!merged[prop]) {
3251
+ destObj[prop] = sourceObj[prop];
3252
+ merged[prop] = true;
3253
+ }
3254
+ }
3255
+ sourceObj = Object.getPrototypeOf(sourceObj);
3256
+ } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
3257
+
3258
+ return destObj;
3259
+ }
956
3260
 
957
- const isFunction = function(fn) {
958
- return fn && {}.toString.call(fn) === '[object Function]';
3261
+ /*
3262
+ * determines whether a string ends with the characters of a specified string
3263
+ * @param {String} str
3264
+ * @param {String} searchString
3265
+ * @param {Number} [position= 0]
3266
+ * @returns {boolean}
3267
+ */
3268
+ function endsWith(str, searchString, position) {
3269
+ str = String(str);
3270
+ if (position === undefined || position > str.length) {
3271
+ position = str.length;
3272
+ }
3273
+ position -= searchString.length;
3274
+ var lastIndex = str.indexOf(searchString, position);
3275
+ return lastIndex !== -1 && lastIndex === position;
959
3276
  }
960
3277
 
961
- const base64 = function(s) {
962
- __webpack_require__.g.window = {};
963
- if (window && window.btoa) {
964
- return window.btoa(s);
965
- }
966
- else if (Buffer) {
967
- return Buffer.from(s).toString('base64');
968
- }
3278
+
3279
+ /**
3280
+ * Returns new array from array like object
3281
+ * @param {*} [thing]
3282
+ * @returns {Array}
3283
+ */
3284
+ function toArray(thing) {
3285
+ if (!thing) return null;
3286
+ var i = thing.length;
3287
+ if (isUndefined(i)) return null;
3288
+ var arr = new Array(i);
3289
+ while (i-- > 0) {
3290
+ arr[i] = thing[i];
3291
+ }
3292
+ return arr;
969
3293
  }
970
3294
 
3295
+ // eslint-disable-next-line func-names
3296
+ var isTypedArray = (function(TypedArray) {
3297
+ // eslint-disable-next-line func-names
3298
+ return function(thing) {
3299
+ return TypedArray && thing instanceof TypedArray;
3300
+ };
3301
+ })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));
3302
+
971
3303
  module.exports = {
972
- isFunction,
973
- base64
974
- }
3304
+ isArray: isArray,
3305
+ isArrayBuffer: isArrayBuffer,
3306
+ isBuffer: isBuffer,
3307
+ isFormData: isFormData,
3308
+ isArrayBufferView: isArrayBufferView,
3309
+ isString: isString,
3310
+ isNumber: isNumber,
3311
+ isObject: isObject,
3312
+ isPlainObject: isPlainObject,
3313
+ isUndefined: isUndefined,
3314
+ isDate: isDate,
3315
+ isFile: isFile,
3316
+ isBlob: isBlob,
3317
+ isFunction: isFunction,
3318
+ isStream: isStream,
3319
+ isURLSearchParams: isURLSearchParams,
3320
+ isStandardBrowserEnv: isStandardBrowserEnv,
3321
+ forEach: forEach,
3322
+ merge: merge,
3323
+ extend: extend,
3324
+ trim: trim,
3325
+ stripBOM: stripBOM,
3326
+ inherits: inherits,
3327
+ toFlatObject: toFlatObject,
3328
+ kindOf: kindOf,
3329
+ kindOfTest: kindOfTest,
3330
+ endsWith: endsWith,
3331
+ toArray: toArray,
3332
+ isTypedArray: isTypedArray,
3333
+ isFileList: isFileList
3334
+ };
3335
+
975
3336
 
976
3337
  /***/ }),
977
3338
 
@@ -1758,47 +4119,54 @@ var MeganavContentPlatform = function MeganavContentPlatform(_ref) {
1758
4119
  url: absUrl("/platform")
1759
4120
  }, "Explore how it works")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
1760
4121
  className: "ui-meganav-overline",
1761
- id: "meganav-platform-panel-list-our-features"
1762
- }, "Our features"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
1763
- "aria-labelledby": "meganav-platform-panel-list-our-features"
4122
+ id: "meganav-platform-panel-list-examples"
4123
+ }, "Examples"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
4124
+ "aria-labelledby": "meganav-platform-panel-list-examples"
1764
4125
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
1765
- href: absUrl("/pub-sub-messaging"),
4126
+ href: absUrl("/examples/avatar-stack"),
1766
4127
  className: "group ui-meganav-media"
1767
4128
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1768
4129
  className: "ui-meganav-media-heading"
1769
- }, "Publish/subscribe messaging"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4130
+ }, "Avatar Stack"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1770
4131
  className: "ui-meganav-media-copy"
1771
- }, "Feature-rich pub/sub messaging to power any realtime requirement."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
1772
- href: absUrl("/push-notifications"),
4132
+ }, "See who is connected in a digital space."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4133
+ href: absUrl("/examples/emoji-reactions"),
1773
4134
  className: "ui-meganav-media group"
1774
4135
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1775
4136
  className: "ui-meganav-media-heading"
1776
- }, "Push notifications"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4137
+ }, "Emoji Reactions"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1777
4138
  className: "ui-meganav-media-copy"
1778
- }, "Deliver native notifications at scale with our unified API."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
1779
- href: absUrl("/integrations"),
4139
+ }, "React with an emoji to a message."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4140
+ href: absUrl("/examples/activity-feed"),
1780
4141
  className: "ui-meganav-media group"
1781
4142
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1782
4143
  className: "ui-meganav-media-heading"
1783
- }, "Third-party integrations"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4144
+ }, "Activity Feed"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1784
4145
  className: "ui-meganav-media-copy"
1785
- }, "Integrate and extend Ably with cloud services like AWS Kinesis."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
1786
- href: absUrl("/protocols"),
4146
+ }, "Display a list of user actions in realtime."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4147
+ href: absUrl("/examples/live-charts"),
1787
4148
  className: "ui-meganav-media group"
1788
4149
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1789
4150
  className: "ui-meganav-media-heading"
1790
- }, "Multi-protocol messaging"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4151
+ }, "Live Charts"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1791
4152
  className: "ui-meganav-media-copy"
1792
- }, "We support pub/sub over WebSockets, MQTT, SSE, and more."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
1793
- href: absUrl("/hub"),
4153
+ }, "Visualise live metrics and data in a chart."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4154
+ href: absUrl("/examples/live-cursors"),
1794
4155
  className: "ui-meganav-media group"
1795
4156
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1796
4157
  className: "ui-meganav-media-heading"
1797
- }, "Streaming data sources"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4158
+ }, "Live Cursors"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
1798
4159
  className: "ui-meganav-media-copy"
1799
- }, "Augment your apps with realtime updates like weather or transit.")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
1800
- url: absUrl("/platform")
1801
- }, "Explore all platform features")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
4160
+ }, "Track all cursors in realtime."))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
4161
+ href: absUrl("/examples/typing-indicator"),
4162
+ className: "ui-meganav-media group"
4163
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4164
+ className: "ui-meganav-media-heading"
4165
+ }, "Typing Indicator"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
4166
+ className: "ui-meganav-media-copy"
4167
+ }, "See when a user is typing a message.")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
4168
+ url: absUrl("/examples")
4169
+ }, "Explore all live examples")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", {
1802
4170
  className: "ui-meganav-overline",
1803
4171
  id: "meganav-platform-panel-list-our-technology"
1804
4172
  }, "Our technology"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", {
@@ -2841,7 +5209,7 @@ var MeganavSearchPanel = function MeganavSearchPanel(_ref) {
2841
5209
  "data-id": "meganav-search-input"
2842
5210
  }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MeganavSearchAutocomplete_component_jsx__WEBPACK_IMPORTED_MODULE_4__.default, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", {
2843
5211
  type: "submit",
2844
- className: "ui-btn-secondary ml-8 sm:ml-16 md:ml-24 xl:ml-32"
5212
+ className: "ui-btn-secondary flex-shrink-0 ml-8 sm:ml-16 md:ml-24 xl:ml-32"
2845
5213
  }, "Search")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
2846
5214
  className: "col-span-12"
2847
5215
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MeganavSearchSuggestions_component_jsx__WEBPACK_IMPORTED_MODULE_3__.default, {
@@ -5836,19 +8204,6 @@ return Promise$1;
5836
8204
  //# sourceMappingURL=es6-promise.map
5837
8205
 
5838
8206
 
5839
- /***/ }),
5840
-
5841
- /***/ 4301:
5842
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
5843
-
5844
- // the whatwg-fetch polyfill installs the fetch() function
5845
- // on the global object (window or self)
5846
- //
5847
- // Return that as the export for use in Webpack, Browserify etc.
5848
- __webpack_require__(7147);
5849
- module.exports = self.fetch.bind(self);
5850
-
5851
-
5852
8207
  /***/ }),
5853
8208
 
5854
8209
  /***/ 6808:
@@ -8136,627 +10491,6 @@ var scrollLock = _objectSpread({
8136
10491
  /******/ ])["default"];
8137
10492
  });
8138
10493
 
8139
- /***/ }),
8140
-
8141
- /***/ 7147:
8142
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8143
-
8144
- "use strict";
8145
- __webpack_require__.r(__webpack_exports__);
8146
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8147
- /* harmony export */ "Headers": () => (/* binding */ Headers),
8148
- /* harmony export */ "Request": () => (/* binding */ Request),
8149
- /* harmony export */ "Response": () => (/* binding */ Response),
8150
- /* harmony export */ "DOMException": () => (/* binding */ DOMException),
8151
- /* harmony export */ "fetch": () => (/* binding */ fetch)
8152
- /* harmony export */ });
8153
- var global =
8154
- (typeof globalThis !== 'undefined' && globalThis) ||
8155
- (typeof self !== 'undefined' && self) ||
8156
- (typeof global !== 'undefined' && global)
8157
-
8158
- var support = {
8159
- searchParams: 'URLSearchParams' in global,
8160
- iterable: 'Symbol' in global && 'iterator' in Symbol,
8161
- blob:
8162
- 'FileReader' in global &&
8163
- 'Blob' in global &&
8164
- (function() {
8165
- try {
8166
- new Blob()
8167
- return true
8168
- } catch (e) {
8169
- return false
8170
- }
8171
- })(),
8172
- formData: 'FormData' in global,
8173
- arrayBuffer: 'ArrayBuffer' in global
8174
- }
8175
-
8176
- function isDataView(obj) {
8177
- return obj && DataView.prototype.isPrototypeOf(obj)
8178
- }
8179
-
8180
- if (support.arrayBuffer) {
8181
- var viewClasses = [
8182
- '[object Int8Array]',
8183
- '[object Uint8Array]',
8184
- '[object Uint8ClampedArray]',
8185
- '[object Int16Array]',
8186
- '[object Uint16Array]',
8187
- '[object Int32Array]',
8188
- '[object Uint32Array]',
8189
- '[object Float32Array]',
8190
- '[object Float64Array]'
8191
- ]
8192
-
8193
- var isArrayBufferView =
8194
- ArrayBuffer.isView ||
8195
- function(obj) {
8196
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
8197
- }
8198
- }
8199
-
8200
- function normalizeName(name) {
8201
- if (typeof name !== 'string') {
8202
- name = String(name)
8203
- }
8204
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
8205
- throw new TypeError('Invalid character in header field name: "' + name + '"')
8206
- }
8207
- return name.toLowerCase()
8208
- }
8209
-
8210
- function normalizeValue(value) {
8211
- if (typeof value !== 'string') {
8212
- value = String(value)
8213
- }
8214
- return value
8215
- }
8216
-
8217
- // Build a destructive iterator for the value list
8218
- function iteratorFor(items) {
8219
- var iterator = {
8220
- next: function() {
8221
- var value = items.shift()
8222
- return {done: value === undefined, value: value}
8223
- }
8224
- }
8225
-
8226
- if (support.iterable) {
8227
- iterator[Symbol.iterator] = function() {
8228
- return iterator
8229
- }
8230
- }
8231
-
8232
- return iterator
8233
- }
8234
-
8235
- function Headers(headers) {
8236
- this.map = {}
8237
-
8238
- if (headers instanceof Headers) {
8239
- headers.forEach(function(value, name) {
8240
- this.append(name, value)
8241
- }, this)
8242
- } else if (Array.isArray(headers)) {
8243
- headers.forEach(function(header) {
8244
- this.append(header[0], header[1])
8245
- }, this)
8246
- } else if (headers) {
8247
- Object.getOwnPropertyNames(headers).forEach(function(name) {
8248
- this.append(name, headers[name])
8249
- }, this)
8250
- }
8251
- }
8252
-
8253
- Headers.prototype.append = function(name, value) {
8254
- name = normalizeName(name)
8255
- value = normalizeValue(value)
8256
- var oldValue = this.map[name]
8257
- this.map[name] = oldValue ? oldValue + ', ' + value : value
8258
- }
8259
-
8260
- Headers.prototype['delete'] = function(name) {
8261
- delete this.map[normalizeName(name)]
8262
- }
8263
-
8264
- Headers.prototype.get = function(name) {
8265
- name = normalizeName(name)
8266
- return this.has(name) ? this.map[name] : null
8267
- }
8268
-
8269
- Headers.prototype.has = function(name) {
8270
- return this.map.hasOwnProperty(normalizeName(name))
8271
- }
8272
-
8273
- Headers.prototype.set = function(name, value) {
8274
- this.map[normalizeName(name)] = normalizeValue(value)
8275
- }
8276
-
8277
- Headers.prototype.forEach = function(callback, thisArg) {
8278
- for (var name in this.map) {
8279
- if (this.map.hasOwnProperty(name)) {
8280
- callback.call(thisArg, this.map[name], name, this)
8281
- }
8282
- }
8283
- }
8284
-
8285
- Headers.prototype.keys = function() {
8286
- var items = []
8287
- this.forEach(function(value, name) {
8288
- items.push(name)
8289
- })
8290
- return iteratorFor(items)
8291
- }
8292
-
8293
- Headers.prototype.values = function() {
8294
- var items = []
8295
- this.forEach(function(value) {
8296
- items.push(value)
8297
- })
8298
- return iteratorFor(items)
8299
- }
8300
-
8301
- Headers.prototype.entries = function() {
8302
- var items = []
8303
- this.forEach(function(value, name) {
8304
- items.push([name, value])
8305
- })
8306
- return iteratorFor(items)
8307
- }
8308
-
8309
- if (support.iterable) {
8310
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
8311
- }
8312
-
8313
- function consumed(body) {
8314
- if (body.bodyUsed) {
8315
- return Promise.reject(new TypeError('Already read'))
8316
- }
8317
- body.bodyUsed = true
8318
- }
8319
-
8320
- function fileReaderReady(reader) {
8321
- return new Promise(function(resolve, reject) {
8322
- reader.onload = function() {
8323
- resolve(reader.result)
8324
- }
8325
- reader.onerror = function() {
8326
- reject(reader.error)
8327
- }
8328
- })
8329
- }
8330
-
8331
- function readBlobAsArrayBuffer(blob) {
8332
- var reader = new FileReader()
8333
- var promise = fileReaderReady(reader)
8334
- reader.readAsArrayBuffer(blob)
8335
- return promise
8336
- }
8337
-
8338
- function readBlobAsText(blob) {
8339
- var reader = new FileReader()
8340
- var promise = fileReaderReady(reader)
8341
- reader.readAsText(blob)
8342
- return promise
8343
- }
8344
-
8345
- function readArrayBufferAsText(buf) {
8346
- var view = new Uint8Array(buf)
8347
- var chars = new Array(view.length)
8348
-
8349
- for (var i = 0; i < view.length; i++) {
8350
- chars[i] = String.fromCharCode(view[i])
8351
- }
8352
- return chars.join('')
8353
- }
8354
-
8355
- function bufferClone(buf) {
8356
- if (buf.slice) {
8357
- return buf.slice(0)
8358
- } else {
8359
- var view = new Uint8Array(buf.byteLength)
8360
- view.set(new Uint8Array(buf))
8361
- return view.buffer
8362
- }
8363
- }
8364
-
8365
- function Body() {
8366
- this.bodyUsed = false
8367
-
8368
- this._initBody = function(body) {
8369
- /*
8370
- fetch-mock wraps the Response object in an ES6 Proxy to
8371
- provide useful test harness features such as flush. However, on
8372
- ES5 browsers without fetch or Proxy support pollyfills must be used;
8373
- the proxy-pollyfill is unable to proxy an attribute unless it exists
8374
- on the object before the Proxy is created. This change ensures
8375
- Response.bodyUsed exists on the instance, while maintaining the
8376
- semantic of setting Request.bodyUsed in the constructor before
8377
- _initBody is called.
8378
- */
8379
- this.bodyUsed = this.bodyUsed
8380
- this._bodyInit = body
8381
- if (!body) {
8382
- this._bodyText = ''
8383
- } else if (typeof body === 'string') {
8384
- this._bodyText = body
8385
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
8386
- this._bodyBlob = body
8387
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
8388
- this._bodyFormData = body
8389
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
8390
- this._bodyText = body.toString()
8391
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
8392
- this._bodyArrayBuffer = bufferClone(body.buffer)
8393
- // IE 10-11 can't handle a DataView body.
8394
- this._bodyInit = new Blob([this._bodyArrayBuffer])
8395
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
8396
- this._bodyArrayBuffer = bufferClone(body)
8397
- } else {
8398
- this._bodyText = body = Object.prototype.toString.call(body)
8399
- }
8400
-
8401
- if (!this.headers.get('content-type')) {
8402
- if (typeof body === 'string') {
8403
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
8404
- } else if (this._bodyBlob && this._bodyBlob.type) {
8405
- this.headers.set('content-type', this._bodyBlob.type)
8406
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
8407
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
8408
- }
8409
- }
8410
- }
8411
-
8412
- if (support.blob) {
8413
- this.blob = function() {
8414
- var rejected = consumed(this)
8415
- if (rejected) {
8416
- return rejected
8417
- }
8418
-
8419
- if (this._bodyBlob) {
8420
- return Promise.resolve(this._bodyBlob)
8421
- } else if (this._bodyArrayBuffer) {
8422
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
8423
- } else if (this._bodyFormData) {
8424
- throw new Error('could not read FormData body as blob')
8425
- } else {
8426
- return Promise.resolve(new Blob([this._bodyText]))
8427
- }
8428
- }
8429
-
8430
- this.arrayBuffer = function() {
8431
- if (this._bodyArrayBuffer) {
8432
- var isConsumed = consumed(this)
8433
- if (isConsumed) {
8434
- return isConsumed
8435
- }
8436
- if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
8437
- return Promise.resolve(
8438
- this._bodyArrayBuffer.buffer.slice(
8439
- this._bodyArrayBuffer.byteOffset,
8440
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
8441
- )
8442
- )
8443
- } else {
8444
- return Promise.resolve(this._bodyArrayBuffer)
8445
- }
8446
- } else {
8447
- return this.blob().then(readBlobAsArrayBuffer)
8448
- }
8449
- }
8450
- }
8451
-
8452
- this.text = function() {
8453
- var rejected = consumed(this)
8454
- if (rejected) {
8455
- return rejected
8456
- }
8457
-
8458
- if (this._bodyBlob) {
8459
- return readBlobAsText(this._bodyBlob)
8460
- } else if (this._bodyArrayBuffer) {
8461
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
8462
- } else if (this._bodyFormData) {
8463
- throw new Error('could not read FormData body as text')
8464
- } else {
8465
- return Promise.resolve(this._bodyText)
8466
- }
8467
- }
8468
-
8469
- if (support.formData) {
8470
- this.formData = function() {
8471
- return this.text().then(decode)
8472
- }
8473
- }
8474
-
8475
- this.json = function() {
8476
- return this.text().then(JSON.parse)
8477
- }
8478
-
8479
- return this
8480
- }
8481
-
8482
- // HTTP methods whose capitalization should be normalized
8483
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
8484
-
8485
- function normalizeMethod(method) {
8486
- var upcased = method.toUpperCase()
8487
- return methods.indexOf(upcased) > -1 ? upcased : method
8488
- }
8489
-
8490
- function Request(input, options) {
8491
- if (!(this instanceof Request)) {
8492
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
8493
- }
8494
-
8495
- options = options || {}
8496
- var body = options.body
8497
-
8498
- if (input instanceof Request) {
8499
- if (input.bodyUsed) {
8500
- throw new TypeError('Already read')
8501
- }
8502
- this.url = input.url
8503
- this.credentials = input.credentials
8504
- if (!options.headers) {
8505
- this.headers = new Headers(input.headers)
8506
- }
8507
- this.method = input.method
8508
- this.mode = input.mode
8509
- this.signal = input.signal
8510
- if (!body && input._bodyInit != null) {
8511
- body = input._bodyInit
8512
- input.bodyUsed = true
8513
- }
8514
- } else {
8515
- this.url = String(input)
8516
- }
8517
-
8518
- this.credentials = options.credentials || this.credentials || 'same-origin'
8519
- if (options.headers || !this.headers) {
8520
- this.headers = new Headers(options.headers)
8521
- }
8522
- this.method = normalizeMethod(options.method || this.method || 'GET')
8523
- this.mode = options.mode || this.mode || null
8524
- this.signal = options.signal || this.signal
8525
- this.referrer = null
8526
-
8527
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
8528
- throw new TypeError('Body not allowed for GET or HEAD requests')
8529
- }
8530
- this._initBody(body)
8531
-
8532
- if (this.method === 'GET' || this.method === 'HEAD') {
8533
- if (options.cache === 'no-store' || options.cache === 'no-cache') {
8534
- // Search for a '_' parameter in the query string
8535
- var reParamSearch = /([?&])_=[^&]*/
8536
- if (reParamSearch.test(this.url)) {
8537
- // If it already exists then set the value with the current time
8538
- this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())
8539
- } else {
8540
- // Otherwise add a new '_' parameter to the end with the current time
8541
- var reQueryString = /\?/
8542
- this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()
8543
- }
8544
- }
8545
- }
8546
- }
8547
-
8548
- Request.prototype.clone = function() {
8549
- return new Request(this, {body: this._bodyInit})
8550
- }
8551
-
8552
- function decode(body) {
8553
- var form = new FormData()
8554
- body
8555
- .trim()
8556
- .split('&')
8557
- .forEach(function(bytes) {
8558
- if (bytes) {
8559
- var split = bytes.split('=')
8560
- var name = split.shift().replace(/\+/g, ' ')
8561
- var value = split.join('=').replace(/\+/g, ' ')
8562
- form.append(decodeURIComponent(name), decodeURIComponent(value))
8563
- }
8564
- })
8565
- return form
8566
- }
8567
-
8568
- function parseHeaders(rawHeaders) {
8569
- var headers = new Headers()
8570
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
8571
- // https://tools.ietf.org/html/rfc7230#section-3.2
8572
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
8573
- // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
8574
- // https://github.com/github/fetch/issues/748
8575
- // https://github.com/zloirock/core-js/issues/751
8576
- preProcessedHeaders
8577
- .split('\r')
8578
- .map(function(header) {
8579
- return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
8580
- })
8581
- .forEach(function(line) {
8582
- var parts = line.split(':')
8583
- var key = parts.shift().trim()
8584
- if (key) {
8585
- var value = parts.join(':').trim()
8586
- headers.append(key, value)
8587
- }
8588
- })
8589
- return headers
8590
- }
8591
-
8592
- Body.call(Request.prototype)
8593
-
8594
- function Response(bodyInit, options) {
8595
- if (!(this instanceof Response)) {
8596
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
8597
- }
8598
- if (!options) {
8599
- options = {}
8600
- }
8601
-
8602
- this.type = 'default'
8603
- this.status = options.status === undefined ? 200 : options.status
8604
- this.ok = this.status >= 200 && this.status < 300
8605
- this.statusText = options.statusText === undefined ? '' : '' + options.statusText
8606
- this.headers = new Headers(options.headers)
8607
- this.url = options.url || ''
8608
- this._initBody(bodyInit)
8609
- }
8610
-
8611
- Body.call(Response.prototype)
8612
-
8613
- Response.prototype.clone = function() {
8614
- return new Response(this._bodyInit, {
8615
- status: this.status,
8616
- statusText: this.statusText,
8617
- headers: new Headers(this.headers),
8618
- url: this.url
8619
- })
8620
- }
8621
-
8622
- Response.error = function() {
8623
- var response = new Response(null, {status: 0, statusText: ''})
8624
- response.type = 'error'
8625
- return response
8626
- }
8627
-
8628
- var redirectStatuses = [301, 302, 303, 307, 308]
8629
-
8630
- Response.redirect = function(url, status) {
8631
- if (redirectStatuses.indexOf(status) === -1) {
8632
- throw new RangeError('Invalid status code')
8633
- }
8634
-
8635
- return new Response(null, {status: status, headers: {location: url}})
8636
- }
8637
-
8638
- var DOMException = global.DOMException
8639
- try {
8640
- new DOMException()
8641
- } catch (err) {
8642
- DOMException = function(message, name) {
8643
- this.message = message
8644
- this.name = name
8645
- var error = Error(message)
8646
- this.stack = error.stack
8647
- }
8648
- DOMException.prototype = Object.create(Error.prototype)
8649
- DOMException.prototype.constructor = DOMException
8650
- }
8651
-
8652
- function fetch(input, init) {
8653
- return new Promise(function(resolve, reject) {
8654
- var request = new Request(input, init)
8655
-
8656
- if (request.signal && request.signal.aborted) {
8657
- return reject(new DOMException('Aborted', 'AbortError'))
8658
- }
8659
-
8660
- var xhr = new XMLHttpRequest()
8661
-
8662
- function abortXhr() {
8663
- xhr.abort()
8664
- }
8665
-
8666
- xhr.onload = function() {
8667
- var options = {
8668
- status: xhr.status,
8669
- statusText: xhr.statusText,
8670
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
8671
- }
8672
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
8673
- var body = 'response' in xhr ? xhr.response : xhr.responseText
8674
- setTimeout(function() {
8675
- resolve(new Response(body, options))
8676
- }, 0)
8677
- }
8678
-
8679
- xhr.onerror = function() {
8680
- setTimeout(function() {
8681
- reject(new TypeError('Network request failed'))
8682
- }, 0)
8683
- }
8684
-
8685
- xhr.ontimeout = function() {
8686
- setTimeout(function() {
8687
- reject(new TypeError('Network request failed'))
8688
- }, 0)
8689
- }
8690
-
8691
- xhr.onabort = function() {
8692
- setTimeout(function() {
8693
- reject(new DOMException('Aborted', 'AbortError'))
8694
- }, 0)
8695
- }
8696
-
8697
- function fixUrl(url) {
8698
- try {
8699
- return url === '' && global.location.href ? global.location.href : url
8700
- } catch (e) {
8701
- return url
8702
- }
8703
- }
8704
-
8705
- xhr.open(request.method, fixUrl(request.url), true)
8706
-
8707
- if (request.credentials === 'include') {
8708
- xhr.withCredentials = true
8709
- } else if (request.credentials === 'omit') {
8710
- xhr.withCredentials = false
8711
- }
8712
-
8713
- if ('responseType' in xhr) {
8714
- if (support.blob) {
8715
- xhr.responseType = 'blob'
8716
- } else if (
8717
- support.arrayBuffer &&
8718
- request.headers.get('Content-Type') &&
8719
- request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1
8720
- ) {
8721
- xhr.responseType = 'arraybuffer'
8722
- }
8723
- }
8724
-
8725
- if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {
8726
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
8727
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]))
8728
- })
8729
- } else {
8730
- request.headers.forEach(function(value, name) {
8731
- xhr.setRequestHeader(name, value)
8732
- })
8733
- }
8734
-
8735
- if (request.signal) {
8736
- request.signal.addEventListener('abort', abortXhr)
8737
-
8738
- xhr.onreadystatechange = function() {
8739
- // DONE (success or failure)
8740
- if (xhr.readyState === 4) {
8741
- request.signal.removeEventListener('abort', abortXhr)
8742
- }
8743
- }
8744
- }
8745
-
8746
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
8747
- })
8748
- }
8749
-
8750
- fetch.polyfill = true
8751
-
8752
- if (!global.fetch) {
8753
- global.fetch = fetch
8754
- global.Headers = Headers
8755
- global.Request = Request
8756
- global.Response = Response
8757
- }
8758
-
8759
-
8760
10494
  /***/ }),
8761
10495
 
8762
10496
  /***/ 3379: