| 1 |
/******/ (function(modules) { // webpackBootstrap |
| 2 |
/******/ // The module cache |
| 3 |
/******/ var installedModules = {}; |
| 4 |
/******/ |
| 5 |
/******/ // The require function |
| 6 |
/******/ function __webpack_require__(moduleId) { |
| 7 |
/******/ |
| 8 |
/******/ // Check if module is in cache |
| 9 |
/******/ if(installedModules[moduleId]) { |
| 10 |
/******/ return installedModules[moduleId].exports; |
| 11 |
/******/ } |
| 12 |
/******/ // Create a new module (and put it into the cache) |
| 13 |
/******/ var module = installedModules[moduleId] = { |
| 14 |
/******/ i: moduleId, |
| 15 |
/******/ l: false, |
| 16 |
/******/ exports: {} |
| 17 |
/******/ }; |
| 18 |
/******/ |
| 19 |
/******/ // Execute the module function |
| 20 |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
| 21 |
/******/ |
| 22 |
/******/ // Flag the module as loaded |
| 23 |
/******/ module.l = true; |
| 24 |
/******/ |
| 25 |
/******/ // Return the exports of the module |
| 26 |
/******/ return module.exports; |
| 27 |
/******/ } |
| 28 |
/******/ |
| 29 |
/******/ |
| 30 |
/******/ // expose the modules object (__webpack_modules__) |
| 31 |
/******/ __webpack_require__.m = modules; |
| 32 |
/******/ |
| 33 |
/******/ // expose the module cache |
| 34 |
/******/ __webpack_require__.c = installedModules; |
| 35 |
/******/ |
| 36 |
/******/ // define getter function for harmony exports |
| 37 |
/******/ __webpack_require__.d = function(exports, name, getter) { |
| 38 |
/******/ if(!__webpack_require__.o(exports, name)) { |
| 39 |
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
| 40 |
/******/ } |
| 41 |
/******/ }; |
| 42 |
/******/ |
| 43 |
/******/ // define __esModule on exports |
| 44 |
/******/ __webpack_require__.r = function(exports) { |
| 45 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 46 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 47 |
/******/ } |
| 48 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 49 |
/******/ }; |
| 50 |
/******/ |
| 51 |
/******/ // create a fake namespace object |
| 52 |
/******/ // mode & 1: value is a module id, require it |
| 53 |
/******/ // mode & 2: merge all properties of value into the ns |
| 54 |
/******/ // mode & 4: return value when already ns object |
| 55 |
/******/ // mode & 8|1: behave like require |
| 56 |
/******/ __webpack_require__.t = function(value, mode) { |
| 57 |
/******/ if(mode & 1) value = __webpack_require__(value); |
| 58 |
/******/ if(mode & 8) return value; |
| 59 |
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
| 60 |
/******/ var ns = Object.create(null); |
| 61 |
/******/ __webpack_require__.r(ns); |
| 62 |
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
| 63 |
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
| 64 |
/******/ return ns; |
| 65 |
/******/ }; |
| 66 |
/******/ |
| 67 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
| 68 |
/******/ __webpack_require__.n = function(module) { |
| 69 |
/******/ var getter = module && module.__esModule ? |
| 70 |
/******/ function getDefault() { return module['default']; } : |
| 71 |
/******/ function getModuleExports() { return module; }; |
| 72 |
/******/ __webpack_require__.d(getter, 'a', getter); |
| 73 |
/******/ return getter; |
| 74 |
/******/ }; |
| 75 |
/******/ |
| 76 |
/******/ // Object.prototype.hasOwnProperty.call |
| 77 |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
| 78 |
/******/ |
| 79 |
/******/ // __webpack_public_path__ |
| 80 |
/******/ __webpack_require__.p = ""; |
| 81 |
/******/ |
| 82 |
/******/ |
| 83 |
/******/ // Load entry module and return exports |
| 84 |
/******/ return __webpack_require__(__webpack_require__.s = "./src/assets/js/blocks.js"); |
| 85 |
/******/ }) |
| 86 |
/************************************************************************/ |
| 87 |
/******/ ({ |
| 88 |
|
| 89 |
/***/ "./node_modules/axios/index.js": |
| 90 |
/*!*************************************!*\ |
| 91 |
!*** ./node_modules/axios/index.js ***! |
| 92 |
\*************************************/ |
| 93 |
/*! exports provided: default, Axios, AxiosError, CanceledError, isCancel, CancelToken, VERSION, all, Cancel, isAxiosError, spread, toFormData, AxiosHeaders, HttpStatusCode, formToJSON, getAdapter, mergeConfig */ |
| 94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 95 |
|
| 96 |
"use strict"; |
| 97 |
__webpack_require__.r(__webpack_exports__); |
| 98 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Axios", function() { return Axios; }); |
| 99 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxiosError", function() { return AxiosError; }); |
| 100 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CanceledError", function() { return CanceledError; }); |
| 101 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isCancel", function() { return isCancel; }); |
| 102 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancelToken", function() { return CancelToken; }); |
| 103 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); |
| 104 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return all; }); |
| 105 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cancel", function() { return Cancel; }); |
| 106 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAxiosError", function() { return isAxiosError; }); |
| 107 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spread", function() { return spread; }); |
| 108 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toFormData", function() { return toFormData; }); |
| 109 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AxiosHeaders", function() { return AxiosHeaders; }); |
| 110 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpStatusCode", function() { return HttpStatusCode; }); |
| 111 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formToJSON", function() { return formToJSON; }); |
| 112 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAdapter", function() { return getAdapter; }); |
| 113 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeConfig", function() { return mergeConfig; }); |
| 114 |
/* harmony import */ var _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/axios.js */ "./node_modules/axios/lib/axios.js"); |
| 115 |
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }); |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
// This module is intended to unwrap Axios default export as named. |
| 120 |
// Keep top-level export same with static properties |
| 121 |
// so that it can keep same with es module or cjs |
| 122 |
const { |
| 123 |
Axios, |
| 124 |
AxiosError, |
| 125 |
CanceledError, |
| 126 |
isCancel, |
| 127 |
CancelToken, |
| 128 |
VERSION, |
| 129 |
all, |
| 130 |
Cancel, |
| 131 |
isAxiosError, |
| 132 |
spread, |
| 133 |
toFormData, |
| 134 |
AxiosHeaders, |
| 135 |
HttpStatusCode, |
| 136 |
formToJSON, |
| 137 |
getAdapter, |
| 138 |
mergeConfig |
| 139 |
} = _lib_axios_js__WEBPACK_IMPORTED_MODULE_0__["default"]; |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
/***/ }), |
| 145 |
|
| 146 |
/***/ "./node_modules/axios/lib/adapters/adapters.js": |
| 147 |
/*!*****************************************************!*\ |
| 148 |
!*** ./node_modules/axios/lib/adapters/adapters.js ***! |
| 149 |
\*****************************************************/ |
| 150 |
/*! exports provided: default */ |
| 151 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 152 |
|
| 153 |
"use strict"; |
| 154 |
__webpack_require__.r(__webpack_exports__); |
| 155 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 156 |
/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http.js */ "./node_modules/axios/lib/helpers/null.js"); |
| 157 |
/* harmony import */ var _xhr_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xhr.js */ "./node_modules/axios/lib/adapters/xhr.js"); |
| 158 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
const knownAdapters = { |
| 165 |
http: _http_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
| 166 |
xhr: _xhr_js__WEBPACK_IMPORTED_MODULE_2__["default"] |
| 167 |
} |
| 168 |
|
| 169 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(knownAdapters, (fn, value) => { |
| 170 |
if (fn) { |
| 171 |
try { |
| 172 |
Object.defineProperty(fn, 'name', {value}); |
| 173 |
} catch (e) { |
| 174 |
// eslint-disable-next-line no-empty |
| 175 |
} |
| 176 |
Object.defineProperty(fn, 'adapterName', {value}); |
| 177 |
} |
| 178 |
}); |
| 179 |
|
| 180 |
const renderReason = (reason) => `- ${reason}`; |
| 181 |
|
| 182 |
const isResolvedHandle = (adapter) => _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(adapter) || adapter === null || adapter === false; |
| 183 |
|
| 184 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 185 |
getAdapter: (adapters) => { |
| 186 |
adapters = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(adapters) ? adapters : [adapters]; |
| 187 |
|
| 188 |
const {length} = adapters; |
| 189 |
let nameOrAdapter; |
| 190 |
let adapter; |
| 191 |
|
| 192 |
const rejectedReasons = {}; |
| 193 |
|
| 194 |
for (let i = 0; i < length; i++) { |
| 195 |
nameOrAdapter = adapters[i]; |
| 196 |
let id; |
| 197 |
|
| 198 |
adapter = nameOrAdapter; |
| 199 |
|
| 200 |
if (!isResolvedHandle(nameOrAdapter)) { |
| 201 |
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; |
| 202 |
|
| 203 |
if (adapter === undefined) { |
| 204 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"](`Unknown adapter '${id}'`); |
| 205 |
} |
| 206 |
} |
| 207 |
|
| 208 |
if (adapter) { |
| 209 |
break; |
| 210 |
} |
| 211 |
|
| 212 |
rejectedReasons[id || '#' + i] = adapter; |
| 213 |
} |
| 214 |
|
| 215 |
if (!adapter) { |
| 216 |
|
| 217 |
const reasons = Object.entries(rejectedReasons) |
| 218 |
.map(([id, state]) => `adapter ${id} ` + |
| 219 |
(state === false ? 'is not supported by the environment' : 'is not available in the build') |
| 220 |
); |
| 221 |
|
| 222 |
let s = length ? |
| 223 |
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) : |
| 224 |
'as no adapter specified'; |
| 225 |
|
| 226 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_3__["default"]( |
| 227 |
`There is no suitable adapter to dispatch the request ` + s, |
| 228 |
'ERR_NOT_SUPPORT' |
| 229 |
); |
| 230 |
} |
| 231 |
|
| 232 |
return adapter; |
| 233 |
}, |
| 234 |
adapters: knownAdapters |
| 235 |
}); |
| 236 |
|
| 237 |
|
| 238 |
/***/ }), |
| 239 |
|
| 240 |
/***/ "./node_modules/axios/lib/adapters/xhr.js": |
| 241 |
/*!************************************************!*\ |
| 242 |
!*** ./node_modules/axios/lib/adapters/xhr.js ***! |
| 243 |
\************************************************/ |
| 244 |
/*! exports provided: default */ |
| 245 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 246 |
|
| 247 |
"use strict"; |
| 248 |
__webpack_require__.r(__webpack_exports__); |
| 249 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 250 |
/* harmony import */ var _core_settle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../core/settle.js */ "./node_modules/axios/lib/core/settle.js"); |
| 251 |
/* harmony import */ var _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../helpers/cookies.js */ "./node_modules/axios/lib/helpers/cookies.js"); |
| 252 |
/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); |
| 253 |
/* harmony import */ var _core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); |
| 254 |
/* harmony import */ var _helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../helpers/isURLSameOrigin.js */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); |
| 255 |
/* harmony import */ var _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../defaults/transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); |
| 256 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 257 |
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); |
| 258 |
/* harmony import */ var _helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../helpers/parseProtocol.js */ "./node_modules/axios/lib/helpers/parseProtocol.js"); |
| 259 |
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); |
| 260 |
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 261 |
/* harmony import */ var _helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../helpers/speedometer.js */ "./node_modules/axios/lib/helpers/speedometer.js"); |
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
function progressEventReducer(listener, isDownloadStream) { |
| 279 |
let bytesNotified = 0; |
| 280 |
const _speedometer = Object(_helpers_speedometer_js__WEBPACK_IMPORTED_MODULE_12__["default"])(50, 250); |
| 281 |
|
| 282 |
return e => { |
| 283 |
const loaded = e.loaded; |
| 284 |
const total = e.lengthComputable ? e.total : undefined; |
| 285 |
const progressBytes = loaded - bytesNotified; |
| 286 |
const rate = _speedometer(progressBytes); |
| 287 |
const inRange = loaded <= total; |
| 288 |
|
| 289 |
bytesNotified = loaded; |
| 290 |
|
| 291 |
const data = { |
| 292 |
loaded, |
| 293 |
total, |
| 294 |
progress: total ? (loaded / total) : undefined, |
| 295 |
bytes: progressBytes, |
| 296 |
rate: rate ? rate : undefined, |
| 297 |
estimated: rate && total && inRange ? (total - loaded) / rate : undefined, |
| 298 |
event: e |
| 299 |
}; |
| 300 |
|
| 301 |
data[isDownloadStream ? 'download' : 'upload'] = true; |
| 302 |
|
| 303 |
listener(data); |
| 304 |
}; |
| 305 |
} |
| 306 |
|
| 307 |
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined'; |
| 308 |
|
| 309 |
/* harmony default export */ __webpack_exports__["default"] = (isXHRAdapterSupported && function (config) { |
| 310 |
return new Promise(function dispatchXhrRequest(resolve, reject) { |
| 311 |
let requestData = config.data; |
| 312 |
const requestHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_11__["default"].from(config.headers).normalize(); |
| 313 |
let {responseType, withXSRFToken} = config; |
| 314 |
let onCanceled; |
| 315 |
function done() { |
| 316 |
if (config.cancelToken) { |
| 317 |
config.cancelToken.unsubscribe(onCanceled); |
| 318 |
} |
| 319 |
|
| 320 |
if (config.signal) { |
| 321 |
config.signal.removeEventListener('abort', onCanceled); |
| 322 |
} |
| 323 |
} |
| 324 |
|
| 325 |
let contentType; |
| 326 |
|
| 327 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(requestData)) { |
| 328 |
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].hasStandardBrowserEnv || _platform_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].hasStandardBrowserWebWorkerEnv) { |
| 329 |
requestHeaders.setContentType(false); // Let the browser set it |
| 330 |
} else if ((contentType = requestHeaders.getContentType()) !== false) { |
| 331 |
// fix semicolon duplication issue for ReactNative FormData implementation |
| 332 |
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : []; |
| 333 |
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; ')); |
| 334 |
} |
| 335 |
} |
| 336 |
|
| 337 |
let request = new XMLHttpRequest(); |
| 338 |
|
| 339 |
// HTTP basic authentication |
| 340 |
if (config.auth) { |
| 341 |
const username = config.auth.username || ''; |
| 342 |
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; |
| 343 |
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password)); |
| 344 |
} |
| 345 |
|
| 346 |
const fullPath = Object(_core_buildFullPath_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config.baseURL, config.url); |
| 347 |
|
| 348 |
request.open(config.method.toUpperCase(), Object(_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_3__["default"])(fullPath, config.params, config.paramsSerializer), true); |
| 349 |
|
| 350 |
// Set the request timeout in MS |
| 351 |
request.timeout = config.timeout; |
| 352 |
|
| 353 |
function onloadend() { |
| 354 |
if (!request) { |
| 355 |
return; |
| 356 |
} |
| 357 |
// Prepare the response |
| 358 |
const responseHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_11__["default"].from( |
| 359 |
'getAllResponseHeaders' in request && request.getAllResponseHeaders() |
| 360 |
); |
| 361 |
const responseData = !responseType || responseType === 'text' || responseType === 'json' ? |
| 362 |
request.responseText : request.response; |
| 363 |
const response = { |
| 364 |
data: responseData, |
| 365 |
status: request.status, |
| 366 |
statusText: request.statusText, |
| 367 |
headers: responseHeaders, |
| 368 |
config, |
| 369 |
request |
| 370 |
}; |
| 371 |
|
| 372 |
Object(_core_settle_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function _resolve(value) { |
| 373 |
resolve(value); |
| 374 |
done(); |
| 375 |
}, function _reject(err) { |
| 376 |
reject(err); |
| 377 |
done(); |
| 378 |
}, response); |
| 379 |
|
| 380 |
// Clean up request |
| 381 |
request = null; |
| 382 |
} |
| 383 |
|
| 384 |
if ('onloadend' in request) { |
| 385 |
// Use onloadend if available |
| 386 |
request.onloadend = onloadend; |
| 387 |
} else { |
| 388 |
// Listen for ready state to emulate onloadend |
| 389 |
request.onreadystatechange = function handleLoad() { |
| 390 |
if (!request || request.readyState !== 4) { |
| 391 |
return; |
| 392 |
} |
| 393 |
|
| 394 |
// The request errored out and we didn't get a response, this will be |
| 395 |
// handled by onerror instead |
| 396 |
// With one exception: request that using file: protocol, most browsers |
| 397 |
// will return status as 0 even though it's a successful request |
| 398 |
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { |
| 399 |
return; |
| 400 |
} |
| 401 |
// readystate handler is calling before onerror or ontimeout handlers, |
| 402 |
// so we should call onloadend on the next 'tick' |
| 403 |
setTimeout(onloadend); |
| 404 |
}; |
| 405 |
} |
| 406 |
|
| 407 |
// Handle browser request cancellation (as opposed to a manual cancellation) |
| 408 |
request.onabort = function handleAbort() { |
| 409 |
if (!request) { |
| 410 |
return; |
| 411 |
} |
| 412 |
|
| 413 |
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Request aborted', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, config, request)); |
| 414 |
|
| 415 |
// Clean up request |
| 416 |
request = null; |
| 417 |
}; |
| 418 |
|
| 419 |
// Handle low level network errors |
| 420 |
request.onerror = function handleError() { |
| 421 |
// Real errors are hidden from us by the browser |
| 422 |
// onerror should only fire if it's a network error |
| 423 |
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Network Error', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_NETWORK, config, request)); |
| 424 |
|
| 425 |
// Clean up request |
| 426 |
request = null; |
| 427 |
}; |
| 428 |
|
| 429 |
// Handle timeout |
| 430 |
request.ontimeout = function handleTimeout() { |
| 431 |
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; |
| 432 |
const transitional = config.transitional || _defaults_transitional_js__WEBPACK_IMPORTED_MODULE_6__["default"]; |
| 433 |
if (config.timeoutErrorMessage) { |
| 434 |
timeoutErrorMessage = config.timeoutErrorMessage; |
| 435 |
} |
| 436 |
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]( |
| 437 |
timeoutErrorMessage, |
| 438 |
transitional.clarifyTimeoutError ? _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ETIMEDOUT : _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ECONNABORTED, |
| 439 |
config, |
| 440 |
request)); |
| 441 |
|
| 442 |
// Clean up request |
| 443 |
request = null; |
| 444 |
}; |
| 445 |
|
| 446 |
// Add xsrf header |
| 447 |
// This is only done if running in a standard browser environment. |
| 448 |
// Specifically not if we're in a web worker, or react-native. |
| 449 |
if(_platform_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].hasStandardBrowserEnv) { |
| 450 |
withXSRFToken && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config)); |
| 451 |
|
| 452 |
if (withXSRFToken || (withXSRFToken !== false && Object(_helpers_isURLSameOrigin_js__WEBPACK_IMPORTED_MODULE_5__["default"])(fullPath))) { |
| 453 |
// Add xsrf header |
| 454 |
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && _helpers_cookies_js__WEBPACK_IMPORTED_MODULE_2__["default"].read(config.xsrfCookieName); |
| 455 |
|
| 456 |
if (xsrfValue) { |
| 457 |
requestHeaders.set(config.xsrfHeaderName, xsrfValue); |
| 458 |
} |
| 459 |
} |
| 460 |
} |
| 461 |
|
| 462 |
// Remove Content-Type if data is undefined |
| 463 |
requestData === undefined && requestHeaders.setContentType(null); |
| 464 |
|
| 465 |
// Add headers to the request |
| 466 |
if ('setRequestHeader' in request) { |
| 467 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { |
| 468 |
request.setRequestHeader(key, val); |
| 469 |
}); |
| 470 |
} |
| 471 |
|
| 472 |
// Add withCredentials to request if needed |
| 473 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(config.withCredentials)) { |
| 474 |
request.withCredentials = !!config.withCredentials; |
| 475 |
} |
| 476 |
|
| 477 |
// Add responseType to request if needed |
| 478 |
if (responseType && responseType !== 'json') { |
| 479 |
request.responseType = config.responseType; |
| 480 |
} |
| 481 |
|
| 482 |
// Handle progress if needed |
| 483 |
if (typeof config.onDownloadProgress === 'function') { |
| 484 |
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true)); |
| 485 |
} |
| 486 |
|
| 487 |
// Not all browsers support upload events |
| 488 |
if (typeof config.onUploadProgress === 'function' && request.upload) { |
| 489 |
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress)); |
| 490 |
} |
| 491 |
|
| 492 |
if (config.cancelToken || config.signal) { |
| 493 |
// Handle cancellation |
| 494 |
// eslint-disable-next-line func-names |
| 495 |
onCanceled = cancel => { |
| 496 |
if (!request) { |
| 497 |
return; |
| 498 |
} |
| 499 |
reject(!cancel || cancel.type ? new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_8__["default"](null, config, request) : cancel); |
| 500 |
request.abort(); |
| 501 |
request = null; |
| 502 |
}; |
| 503 |
|
| 504 |
config.cancelToken && config.cancelToken.subscribe(onCanceled); |
| 505 |
if (config.signal) { |
| 506 |
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); |
| 507 |
} |
| 508 |
} |
| 509 |
|
| 510 |
const protocol = Object(_helpers_parseProtocol_js__WEBPACK_IMPORTED_MODULE_9__["default"])(fullPath); |
| 511 |
|
| 512 |
if (protocol && _platform_index_js__WEBPACK_IMPORTED_MODULE_10__["default"].protocols.indexOf(protocol) === -1) { |
| 513 |
reject(new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"]('Unsupported protocol ' + protocol + ':', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_7__["default"].ERR_BAD_REQUEST, config)); |
| 514 |
return; |
| 515 |
} |
| 516 |
|
| 517 |
|
| 518 |
// Send the request |
| 519 |
request.send(requestData || null); |
| 520 |
}); |
| 521 |
}); |
| 522 |
|
| 523 |
|
| 524 |
/***/ }), |
| 525 |
|
| 526 |
/***/ "./node_modules/axios/lib/axios.js": |
| 527 |
/*!*****************************************!*\ |
| 528 |
!*** ./node_modules/axios/lib/axios.js ***! |
| 529 |
\*****************************************/ |
| 530 |
/*! exports provided: default */ |
| 531 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 532 |
|
| 533 |
"use strict"; |
| 534 |
__webpack_require__.r(__webpack_exports__); |
| 535 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "./node_modules/axios/lib/utils.js"); |
| 536 |
/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); |
| 537 |
/* harmony import */ var _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core/Axios.js */ "./node_modules/axios/lib/core/Axios.js"); |
| 538 |
/* harmony import */ var _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./core/mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); |
| 539 |
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); |
| 540 |
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); |
| 541 |
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); |
| 542 |
/* harmony import */ var _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./cancel/CancelToken.js */ "./node_modules/axios/lib/cancel/CancelToken.js"); |
| 543 |
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); |
| 544 |
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./env/data.js */ "./node_modules/axios/lib/env/data.js"); |
| 545 |
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); |
| 546 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 547 |
/* harmony import */ var _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./helpers/spread.js */ "./node_modules/axios/lib/helpers/spread.js"); |
| 548 |
/* harmony import */ var _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/isAxiosError.js */ "./node_modules/axios/lib/helpers/isAxiosError.js"); |
| 549 |
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 550 |
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); |
| 551 |
/* harmony import */ var _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./helpers/HttpStatusCode.js */ "./node_modules/axios/lib/helpers/HttpStatusCode.js"); |
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
|
| 566 |
|
| 567 |
|
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
/** |
| 573 |
* Create an instance of Axios |
| 574 |
* |
| 575 |
* @param {Object} defaultConfig The default config for the instance |
| 576 |
* |
| 577 |
* @returns {Axios} A new instance of Axios |
| 578 |
*/ |
| 579 |
function createInstance(defaultConfig) { |
| 580 |
const context = new _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"](defaultConfig); |
| 581 |
const instance = Object(_helpers_bind_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype.request, context); |
| 582 |
|
| 583 |
// Copy axios.prototype to instance |
| 584 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"].prototype, context, {allOwnKeys: true}); |
| 585 |
|
| 586 |
// Copy context to instance |
| 587 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].extend(instance, context, null, {allOwnKeys: true}); |
| 588 |
|
| 589 |
// Factory for creating new instances |
| 590 |
instance.create = function create(instanceConfig) { |
| 591 |
return createInstance(Object(_core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"])(defaultConfig, instanceConfig)); |
| 592 |
}; |
| 593 |
|
| 594 |
return instance; |
| 595 |
} |
| 596 |
|
| 597 |
// Create the default instance to be exported |
| 598 |
const axios = createInstance(_defaults_index_js__WEBPACK_IMPORTED_MODULE_4__["default"]); |
| 599 |
|
| 600 |
// Expose Axios class to allow class inheritance |
| 601 |
axios.Axios = _core_Axios_js__WEBPACK_IMPORTED_MODULE_2__["default"]; |
| 602 |
|
| 603 |
// Expose Cancel & CancelToken |
| 604 |
axios.CanceledError = _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_6__["default"]; |
| 605 |
axios.CancelToken = _cancel_CancelToken_js__WEBPACK_IMPORTED_MODULE_7__["default"]; |
| 606 |
axios.isCancel = _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_8__["default"]; |
| 607 |
axios.VERSION = _env_data_js__WEBPACK_IMPORTED_MODULE_9__["VERSION"]; |
| 608 |
axios.toFormData = _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_10__["default"]; |
| 609 |
|
| 610 |
// Expose AxiosError class |
| 611 |
axios.AxiosError = _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_11__["default"]; |
| 612 |
|
| 613 |
// alias for CanceledError for backward compatibility |
| 614 |
axios.Cancel = axios.CanceledError; |
| 615 |
|
| 616 |
// Expose all/spread |
| 617 |
axios.all = function all(promises) { |
| 618 |
return Promise.all(promises); |
| 619 |
}; |
| 620 |
|
| 621 |
axios.spread = _helpers_spread_js__WEBPACK_IMPORTED_MODULE_12__["default"]; |
| 622 |
|
| 623 |
// Expose isAxiosError |
| 624 |
axios.isAxiosError = _helpers_isAxiosError_js__WEBPACK_IMPORTED_MODULE_13__["default"]; |
| 625 |
|
| 626 |
// Expose mergeConfig |
| 627 |
axios.mergeConfig = _core_mergeConfig_js__WEBPACK_IMPORTED_MODULE_3__["default"]; |
| 628 |
|
| 629 |
axios.AxiosHeaders = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_14__["default"]; |
| 630 |
|
| 631 |
axios.formToJSON = thing => Object(_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_5__["default"])(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(thing) ? new FormData(thing) : thing); |
| 632 |
|
| 633 |
axios.getAdapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_15__["default"].getAdapter; |
| 634 |
|
| 635 |
axios.HttpStatusCode = _helpers_HttpStatusCode_js__WEBPACK_IMPORTED_MODULE_16__["default"]; |
| 636 |
|
| 637 |
axios.default = axios; |
| 638 |
|
| 639 |
// this module should only have a default export |
| 640 |
/* harmony default export */ __webpack_exports__["default"] = (axios); |
| 641 |
|
| 642 |
|
| 643 |
/***/ }), |
| 644 |
|
| 645 |
/***/ "./node_modules/axios/lib/cancel/CancelToken.js": |
| 646 |
/*!******************************************************!*\ |
| 647 |
!*** ./node_modules/axios/lib/cancel/CancelToken.js ***! |
| 648 |
\******************************************************/ |
| 649 |
/*! exports provided: default */ |
| 650 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 651 |
|
| 652 |
"use strict"; |
| 653 |
__webpack_require__.r(__webpack_exports__); |
| 654 |
/* harmony import */ var _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); |
| 655 |
|
| 656 |
|
| 657 |
|
| 658 |
|
| 659 |
/** |
| 660 |
* A `CancelToken` is an object that can be used to request cancellation of an operation. |
| 661 |
* |
| 662 |
* @param {Function} executor The executor function. |
| 663 |
* |
| 664 |
* @returns {CancelToken} |
| 665 |
*/ |
| 666 |
class CancelToken { |
| 667 |
constructor(executor) { |
| 668 |
if (typeof executor !== 'function') { |
| 669 |
throw new TypeError('executor must be a function.'); |
| 670 |
} |
| 671 |
|
| 672 |
let resolvePromise; |
| 673 |
|
| 674 |
this.promise = new Promise(function promiseExecutor(resolve) { |
| 675 |
resolvePromise = resolve; |
| 676 |
}); |
| 677 |
|
| 678 |
const token = this; |
| 679 |
|
| 680 |
// eslint-disable-next-line func-names |
| 681 |
this.promise.then(cancel => { |
| 682 |
if (!token._listeners) return; |
| 683 |
|
| 684 |
let i = token._listeners.length; |
| 685 |
|
| 686 |
while (i-- > 0) { |
| 687 |
token._listeners[i](cancel); |
| 688 |
} |
| 689 |
token._listeners = null; |
| 690 |
}); |
| 691 |
|
| 692 |
// eslint-disable-next-line func-names |
| 693 |
this.promise.then = onfulfilled => { |
| 694 |
let _resolve; |
| 695 |
// eslint-disable-next-line func-names |
| 696 |
const promise = new Promise(resolve => { |
| 697 |
token.subscribe(resolve); |
| 698 |
_resolve = resolve; |
| 699 |
}).then(onfulfilled); |
| 700 |
|
| 701 |
promise.cancel = function reject() { |
| 702 |
token.unsubscribe(_resolve); |
| 703 |
}; |
| 704 |
|
| 705 |
return promise; |
| 706 |
}; |
| 707 |
|
| 708 |
executor(function cancel(message, config, request) { |
| 709 |
if (token.reason) { |
| 710 |
// Cancellation has already been requested |
| 711 |
return; |
| 712 |
} |
| 713 |
|
| 714 |
token.reason = new _CanceledError_js__WEBPACK_IMPORTED_MODULE_0__["default"](message, config, request); |
| 715 |
resolvePromise(token.reason); |
| 716 |
}); |
| 717 |
} |
| 718 |
|
| 719 |
/** |
| 720 |
* Throws a `CanceledError` if cancellation has been requested. |
| 721 |
*/ |
| 722 |
throwIfRequested() { |
| 723 |
if (this.reason) { |
| 724 |
throw this.reason; |
| 725 |
} |
| 726 |
} |
| 727 |
|
| 728 |
/** |
| 729 |
* Subscribe to the cancel signal |
| 730 |
*/ |
| 731 |
|
| 732 |
subscribe(listener) { |
| 733 |
if (this.reason) { |
| 734 |
listener(this.reason); |
| 735 |
return; |
| 736 |
} |
| 737 |
|
| 738 |
if (this._listeners) { |
| 739 |
this._listeners.push(listener); |
| 740 |
} else { |
| 741 |
this._listeners = [listener]; |
| 742 |
} |
| 743 |
} |
| 744 |
|
| 745 |
/** |
| 746 |
* Unsubscribe from the cancel signal |
| 747 |
*/ |
| 748 |
|
| 749 |
unsubscribe(listener) { |
| 750 |
if (!this._listeners) { |
| 751 |
return; |
| 752 |
} |
| 753 |
const index = this._listeners.indexOf(listener); |
| 754 |
if (index !== -1) { |
| 755 |
this._listeners.splice(index, 1); |
| 756 |
} |
| 757 |
} |
| 758 |
|
| 759 |
/** |
| 760 |
* Returns an object that contains a new `CancelToken` and a function that, when called, |
| 761 |
* cancels the `CancelToken`. |
| 762 |
*/ |
| 763 |
static source() { |
| 764 |
let cancel; |
| 765 |
const token = new CancelToken(function executor(c) { |
| 766 |
cancel = c; |
| 767 |
}); |
| 768 |
return { |
| 769 |
token, |
| 770 |
cancel |
| 771 |
}; |
| 772 |
} |
| 773 |
} |
| 774 |
|
| 775 |
/* harmony default export */ __webpack_exports__["default"] = (CancelToken); |
| 776 |
|
| 777 |
|
| 778 |
/***/ }), |
| 779 |
|
| 780 |
/***/ "./node_modules/axios/lib/cancel/CanceledError.js": |
| 781 |
/*!********************************************************!*\ |
| 782 |
!*** ./node_modules/axios/lib/cancel/CanceledError.js ***! |
| 783 |
\********************************************************/ |
| 784 |
/*! exports provided: default */ |
| 785 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 786 |
|
| 787 |
"use strict"; |
| 788 |
__webpack_require__.r(__webpack_exports__); |
| 789 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 790 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 791 |
|
| 792 |
|
| 793 |
|
| 794 |
|
| 795 |
|
| 796 |
/** |
| 797 |
* A `CanceledError` is an object that is thrown when an operation is canceled. |
| 798 |
* |
| 799 |
* @param {string=} message The message. |
| 800 |
* @param {Object=} config The config. |
| 801 |
* @param {Object=} request The request. |
| 802 |
* |
| 803 |
* @returns {CanceledError} The created error. |
| 804 |
*/ |
| 805 |
function CanceledError(message, config, request) { |
| 806 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 807 |
_core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].call(this, message == null ? 'canceled' : message, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_CANCELED, config, request); |
| 808 |
this.name = 'CanceledError'; |
| 809 |
} |
| 810 |
|
| 811 |
_utils_js__WEBPACK_IMPORTED_MODULE_1__["default"].inherits(CanceledError, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"], { |
| 812 |
__CANCEL__: true |
| 813 |
}); |
| 814 |
|
| 815 |
/* harmony default export */ __webpack_exports__["default"] = (CanceledError); |
| 816 |
|
| 817 |
|
| 818 |
/***/ }), |
| 819 |
|
| 820 |
/***/ "./node_modules/axios/lib/cancel/isCancel.js": |
| 821 |
/*!***************************************************!*\ |
| 822 |
!*** ./node_modules/axios/lib/cancel/isCancel.js ***! |
| 823 |
\***************************************************/ |
| 824 |
/*! exports provided: default */ |
| 825 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 826 |
|
| 827 |
"use strict"; |
| 828 |
__webpack_require__.r(__webpack_exports__); |
| 829 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isCancel; }); |
| 830 |
|
| 831 |
|
| 832 |
function isCancel(value) { |
| 833 |
return !!(value && value.__CANCEL__); |
| 834 |
} |
| 835 |
|
| 836 |
|
| 837 |
/***/ }), |
| 838 |
|
| 839 |
/***/ "./node_modules/axios/lib/core/Axios.js": |
| 840 |
/*!**********************************************!*\ |
| 841 |
!*** ./node_modules/axios/lib/core/Axios.js ***! |
| 842 |
\**********************************************/ |
| 843 |
/*! exports provided: default */ |
| 844 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 845 |
|
| 846 |
"use strict"; |
| 847 |
__webpack_require__.r(__webpack_exports__); |
| 848 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 849 |
/* harmony import */ var _helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/buildURL.js */ "./node_modules/axios/lib/helpers/buildURL.js"); |
| 850 |
/* harmony import */ var _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./InterceptorManager.js */ "./node_modules/axios/lib/core/InterceptorManager.js"); |
| 851 |
/* harmony import */ var _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dispatchRequest.js */ "./node_modules/axios/lib/core/dispatchRequest.js"); |
| 852 |
/* harmony import */ var _mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mergeConfig.js */ "./node_modules/axios/lib/core/mergeConfig.js"); |
| 853 |
/* harmony import */ var _buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./buildFullPath.js */ "./node_modules/axios/lib/core/buildFullPath.js"); |
| 854 |
/* harmony import */ var _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/validator.js */ "./node_modules/axios/lib/helpers/validator.js"); |
| 855 |
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 856 |
|
| 857 |
|
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
|
| 863 |
|
| 864 |
|
| 865 |
|
| 866 |
|
| 867 |
const validators = _helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].validators; |
| 868 |
|
| 869 |
/** |
| 870 |
* Create a new instance of Axios |
| 871 |
* |
| 872 |
* @param {Object} instanceConfig The default config for the instance |
| 873 |
* |
| 874 |
* @return {Axios} A new instance of Axios |
| 875 |
*/ |
| 876 |
class Axios { |
| 877 |
constructor(instanceConfig) { |
| 878 |
this.defaults = instanceConfig; |
| 879 |
this.interceptors = { |
| 880 |
request: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"](), |
| 881 |
response: new _InterceptorManager_js__WEBPACK_IMPORTED_MODULE_2__["default"]() |
| 882 |
}; |
| 883 |
} |
| 884 |
|
| 885 |
/** |
| 886 |
* Dispatch a request |
| 887 |
* |
| 888 |
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) |
| 889 |
* @param {?Object} config |
| 890 |
* |
| 891 |
* @returns {Promise} The Promise to be fulfilled |
| 892 |
*/ |
| 893 |
request(configOrUrl, config) { |
| 894 |
/*eslint no-param-reassign:0*/ |
| 895 |
// Allow for axios('example/url'[, config]) a la fetch API |
| 896 |
if (typeof configOrUrl === 'string') { |
| 897 |
config = config || {}; |
| 898 |
config.url = configOrUrl; |
| 899 |
} else { |
| 900 |
config = configOrUrl || {}; |
| 901 |
} |
| 902 |
|
| 903 |
config = Object(_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config); |
| 904 |
|
| 905 |
const {transitional, paramsSerializer, headers} = config; |
| 906 |
|
| 907 |
if (transitional !== undefined) { |
| 908 |
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(transitional, { |
| 909 |
silentJSONParsing: validators.transitional(validators.boolean), |
| 910 |
forcedJSONParsing: validators.transitional(validators.boolean), |
| 911 |
clarifyTimeoutError: validators.transitional(validators.boolean) |
| 912 |
}, false); |
| 913 |
} |
| 914 |
|
| 915 |
if (paramsSerializer != null) { |
| 916 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(paramsSerializer)) { |
| 917 |
config.paramsSerializer = { |
| 918 |
serialize: paramsSerializer |
| 919 |
} |
| 920 |
} else { |
| 921 |
_helpers_validator_js__WEBPACK_IMPORTED_MODULE_6__["default"].assertOptions(paramsSerializer, { |
| 922 |
encode: validators.function, |
| 923 |
serialize: validators.function |
| 924 |
}, true); |
| 925 |
} |
| 926 |
} |
| 927 |
|
| 928 |
// Set config.method |
| 929 |
config.method = (config.method || this.defaults.method || 'get').toLowerCase(); |
| 930 |
|
| 931 |
// Flatten headers |
| 932 |
let contextHeaders = headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge( |
| 933 |
headers.common, |
| 934 |
headers[config.method] |
| 935 |
); |
| 936 |
|
| 937 |
headers && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach( |
| 938 |
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], |
| 939 |
(method) => { |
| 940 |
delete headers[method]; |
| 941 |
} |
| 942 |
); |
| 943 |
|
| 944 |
config.headers = _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_7__["default"].concat(contextHeaders, headers); |
| 945 |
|
| 946 |
// filter out skipped interceptors |
| 947 |
const requestInterceptorChain = []; |
| 948 |
let synchronousRequestInterceptors = true; |
| 949 |
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { |
| 950 |
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { |
| 951 |
return; |
| 952 |
} |
| 953 |
|
| 954 |
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; |
| 955 |
|
| 956 |
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); |
| 957 |
}); |
| 958 |
|
| 959 |
const responseInterceptorChain = []; |
| 960 |
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { |
| 961 |
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); |
| 962 |
}); |
| 963 |
|
| 964 |
let promise; |
| 965 |
let i = 0; |
| 966 |
let len; |
| 967 |
|
| 968 |
if (!synchronousRequestInterceptors) { |
| 969 |
const chain = [_dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].bind(this), undefined]; |
| 970 |
chain.unshift.apply(chain, requestInterceptorChain); |
| 971 |
chain.push.apply(chain, responseInterceptorChain); |
| 972 |
len = chain.length; |
| 973 |
|
| 974 |
promise = Promise.resolve(config); |
| 975 |
|
| 976 |
while (i < len) { |
| 977 |
promise = promise.then(chain[i++], chain[i++]); |
| 978 |
} |
| 979 |
|
| 980 |
return promise; |
| 981 |
} |
| 982 |
|
| 983 |
len = requestInterceptorChain.length; |
| 984 |
|
| 985 |
let newConfig = config; |
| 986 |
|
| 987 |
i = 0; |
| 988 |
|
| 989 |
while (i < len) { |
| 990 |
const onFulfilled = requestInterceptorChain[i++]; |
| 991 |
const onRejected = requestInterceptorChain[i++]; |
| 992 |
try { |
| 993 |
newConfig = onFulfilled(newConfig); |
| 994 |
} catch (error) { |
| 995 |
onRejected.call(this, error); |
| 996 |
break; |
| 997 |
} |
| 998 |
} |
| 999 |
|
| 1000 |
try { |
| 1001 |
promise = _dispatchRequest_js__WEBPACK_IMPORTED_MODULE_3__["default"].call(this, newConfig); |
| 1002 |
} catch (error) { |
| 1003 |
return Promise.reject(error); |
| 1004 |
} |
| 1005 |
|
| 1006 |
i = 0; |
| 1007 |
len = responseInterceptorChain.length; |
| 1008 |
|
| 1009 |
while (i < len) { |
| 1010 |
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); |
| 1011 |
} |
| 1012 |
|
| 1013 |
return promise; |
| 1014 |
} |
| 1015 |
|
| 1016 |
getUri(config) { |
| 1017 |
config = Object(_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(this.defaults, config); |
| 1018 |
const fullPath = Object(_buildFullPath_js__WEBPACK_IMPORTED_MODULE_5__["default"])(config.baseURL, config.url); |
| 1019 |
return Object(_helpers_buildURL_js__WEBPACK_IMPORTED_MODULE_1__["default"])(fullPath, config.params, config.paramsSerializer); |
| 1020 |
} |
| 1021 |
} |
| 1022 |
|
| 1023 |
// Provide aliases for supported request methods |
| 1024 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { |
| 1025 |
/*eslint func-names:0*/ |
| 1026 |
Axios.prototype[method] = function(url, config) { |
| 1027 |
return this.request(Object(_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, { |
| 1028 |
method, |
| 1029 |
url, |
| 1030 |
data: (config || {}).data |
| 1031 |
})); |
| 1032 |
}; |
| 1033 |
}); |
| 1034 |
|
| 1035 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { |
| 1036 |
/*eslint func-names:0*/ |
| 1037 |
|
| 1038 |
function generateHTTPMethod(isForm) { |
| 1039 |
return function httpMethod(url, data, config) { |
| 1040 |
return this.request(Object(_mergeConfig_js__WEBPACK_IMPORTED_MODULE_4__["default"])(config || {}, { |
| 1041 |
method, |
| 1042 |
headers: isForm ? { |
| 1043 |
'Content-Type': 'multipart/form-data' |
| 1044 |
} : {}, |
| 1045 |
url, |
| 1046 |
data |
| 1047 |
})); |
| 1048 |
}; |
| 1049 |
} |
| 1050 |
|
| 1051 |
Axios.prototype[method] = generateHTTPMethod(); |
| 1052 |
|
| 1053 |
Axios.prototype[method + 'Form'] = generateHTTPMethod(true); |
| 1054 |
}); |
| 1055 |
|
| 1056 |
/* harmony default export */ __webpack_exports__["default"] = (Axios); |
| 1057 |
|
| 1058 |
|
| 1059 |
/***/ }), |
| 1060 |
|
| 1061 |
/***/ "./node_modules/axios/lib/core/AxiosError.js": |
| 1062 |
/*!***************************************************!*\ |
| 1063 |
!*** ./node_modules/axios/lib/core/AxiosError.js ***! |
| 1064 |
\***************************************************/ |
| 1065 |
/*! exports provided: default */ |
| 1066 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1067 |
|
| 1068 |
"use strict"; |
| 1069 |
__webpack_require__.r(__webpack_exports__); |
| 1070 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1071 |
|
| 1072 |
|
| 1073 |
|
| 1074 |
|
| 1075 |
/** |
| 1076 |
* Create an Error with the specified message, config, error code, request and response. |
| 1077 |
* |
| 1078 |
* @param {string} message The error message. |
| 1079 |
* @param {string} [code] The error code (for example, 'ECONNABORTED'). |
| 1080 |
* @param {Object} [config] The config. |
| 1081 |
* @param {Object} [request] The request. |
| 1082 |
* @param {Object} [response] The response. |
| 1083 |
* |
| 1084 |
* @returns {Error} The created error. |
| 1085 |
*/ |
| 1086 |
function AxiosError(message, code, config, request, response) { |
| 1087 |
Error.call(this); |
| 1088 |
|
| 1089 |
if (Error.captureStackTrace) { |
| 1090 |
Error.captureStackTrace(this, this.constructor); |
| 1091 |
} else { |
| 1092 |
this.stack = (new Error()).stack; |
| 1093 |
} |
| 1094 |
|
| 1095 |
this.message = message; |
| 1096 |
this.name = 'AxiosError'; |
| 1097 |
code && (this.code = code); |
| 1098 |
config && (this.config = config); |
| 1099 |
request && (this.request = request); |
| 1100 |
response && (this.response = response); |
| 1101 |
} |
| 1102 |
|
| 1103 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].inherits(AxiosError, Error, { |
| 1104 |
toJSON: function toJSON() { |
| 1105 |
return { |
| 1106 |
// Standard |
| 1107 |
message: this.message, |
| 1108 |
name: this.name, |
| 1109 |
// Microsoft |
| 1110 |
description: this.description, |
| 1111 |
number: this.number, |
| 1112 |
// Mozilla |
| 1113 |
fileName: this.fileName, |
| 1114 |
lineNumber: this.lineNumber, |
| 1115 |
columnNumber: this.columnNumber, |
| 1116 |
stack: this.stack, |
| 1117 |
// Axios |
| 1118 |
config: _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toJSONObject(this.config), |
| 1119 |
code: this.code, |
| 1120 |
status: this.response && this.response.status ? this.response.status : null |
| 1121 |
}; |
| 1122 |
} |
| 1123 |
}); |
| 1124 |
|
| 1125 |
const prototype = AxiosError.prototype; |
| 1126 |
const descriptors = {}; |
| 1127 |
|
| 1128 |
[ |
| 1129 |
'ERR_BAD_OPTION_VALUE', |
| 1130 |
'ERR_BAD_OPTION', |
| 1131 |
'ECONNABORTED', |
| 1132 |
'ETIMEDOUT', |
| 1133 |
'ERR_NETWORK', |
| 1134 |
'ERR_FR_TOO_MANY_REDIRECTS', |
| 1135 |
'ERR_DEPRECATED', |
| 1136 |
'ERR_BAD_RESPONSE', |
| 1137 |
'ERR_BAD_REQUEST', |
| 1138 |
'ERR_CANCELED', |
| 1139 |
'ERR_NOT_SUPPORT', |
| 1140 |
'ERR_INVALID_URL' |
| 1141 |
// eslint-disable-next-line func-names |
| 1142 |
].forEach(code => { |
| 1143 |
descriptors[code] = {value: code}; |
| 1144 |
}); |
| 1145 |
|
| 1146 |
Object.defineProperties(AxiosError, descriptors); |
| 1147 |
Object.defineProperty(prototype, 'isAxiosError', {value: true}); |
| 1148 |
|
| 1149 |
// eslint-disable-next-line func-names |
| 1150 |
AxiosError.from = (error, code, config, request, response, customProps) => { |
| 1151 |
const axiosError = Object.create(prototype); |
| 1152 |
|
| 1153 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(error, axiosError, function filter(obj) { |
| 1154 |
return obj !== Error.prototype; |
| 1155 |
}, prop => { |
| 1156 |
return prop !== 'isAxiosError'; |
| 1157 |
}); |
| 1158 |
|
| 1159 |
AxiosError.call(axiosError, error.message, code, config, request, response); |
| 1160 |
|
| 1161 |
axiosError.cause = error; |
| 1162 |
|
| 1163 |
axiosError.name = error.name; |
| 1164 |
|
| 1165 |
customProps && Object.assign(axiosError, customProps); |
| 1166 |
|
| 1167 |
return axiosError; |
| 1168 |
}; |
| 1169 |
|
| 1170 |
/* harmony default export */ __webpack_exports__["default"] = (AxiosError); |
| 1171 |
|
| 1172 |
|
| 1173 |
/***/ }), |
| 1174 |
|
| 1175 |
/***/ "./node_modules/axios/lib/core/AxiosHeaders.js": |
| 1176 |
/*!*****************************************************!*\ |
| 1177 |
!*** ./node_modules/axios/lib/core/AxiosHeaders.js ***! |
| 1178 |
\*****************************************************/ |
| 1179 |
/*! exports provided: default */ |
| 1180 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1181 |
|
| 1182 |
"use strict"; |
| 1183 |
__webpack_require__.r(__webpack_exports__); |
| 1184 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1185 |
/* harmony import */ var _helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/parseHeaders.js */ "./node_modules/axios/lib/helpers/parseHeaders.js"); |
| 1186 |
|
| 1187 |
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
const $internals = Symbol('internals'); |
| 1192 |
|
| 1193 |
function normalizeHeader(header) { |
| 1194 |
return header && String(header).trim().toLowerCase(); |
| 1195 |
} |
| 1196 |
|
| 1197 |
function normalizeValue(value) { |
| 1198 |
if (value === false || value == null) { |
| 1199 |
return value; |
| 1200 |
} |
| 1201 |
|
| 1202 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.map(normalizeValue) : String(value); |
| 1203 |
} |
| 1204 |
|
| 1205 |
function parseTokens(str) { |
| 1206 |
const tokens = Object.create(null); |
| 1207 |
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; |
| 1208 |
let match; |
| 1209 |
|
| 1210 |
while ((match = tokensRE.exec(str))) { |
| 1211 |
tokens[match[1]] = match[2]; |
| 1212 |
} |
| 1213 |
|
| 1214 |
return tokens; |
| 1215 |
} |
| 1216 |
|
| 1217 |
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); |
| 1218 |
|
| 1219 |
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { |
| 1220 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(filter)) { |
| 1221 |
return filter.call(this, value, header); |
| 1222 |
} |
| 1223 |
|
| 1224 |
if (isHeaderNameFilter) { |
| 1225 |
value = header; |
| 1226 |
} |
| 1227 |
|
| 1228 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(value)) return; |
| 1229 |
|
| 1230 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(filter)) { |
| 1231 |
return value.indexOf(filter) !== -1; |
| 1232 |
} |
| 1233 |
|
| 1234 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(filter)) { |
| 1235 |
return filter.test(value); |
| 1236 |
} |
| 1237 |
} |
| 1238 |
|
| 1239 |
function formatHeader(header) { |
| 1240 |
return header.trim() |
| 1241 |
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { |
| 1242 |
return char.toUpperCase() + str; |
| 1243 |
}); |
| 1244 |
} |
| 1245 |
|
| 1246 |
function buildAccessors(obj, header) { |
| 1247 |
const accessorName = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toCamelCase(' ' + header); |
| 1248 |
|
| 1249 |
['get', 'set', 'has'].forEach(methodName => { |
| 1250 |
Object.defineProperty(obj, methodName + accessorName, { |
| 1251 |
value: function(arg1, arg2, arg3) { |
| 1252 |
return this[methodName].call(this, header, arg1, arg2, arg3); |
| 1253 |
}, |
| 1254 |
configurable: true |
| 1255 |
}); |
| 1256 |
}); |
| 1257 |
} |
| 1258 |
|
| 1259 |
class AxiosHeaders { |
| 1260 |
constructor(headers) { |
| 1261 |
headers && this.set(headers); |
| 1262 |
} |
| 1263 |
|
| 1264 |
set(header, valueOrRewrite, rewrite) { |
| 1265 |
const self = this; |
| 1266 |
|
| 1267 |
function setHeader(_value, _header, _rewrite) { |
| 1268 |
const lHeader = normalizeHeader(_header); |
| 1269 |
|
| 1270 |
if (!lHeader) { |
| 1271 |
throw new Error('header name must be a non-empty string'); |
| 1272 |
} |
| 1273 |
|
| 1274 |
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, lHeader); |
| 1275 |
|
| 1276 |
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) { |
| 1277 |
self[key || _header] = normalizeValue(_value); |
| 1278 |
} |
| 1279 |
} |
| 1280 |
|
| 1281 |
const setHeaders = (headers, _rewrite) => |
| 1282 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); |
| 1283 |
|
| 1284 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(header) || header instanceof this.constructor) { |
| 1285 |
setHeaders(header, valueOrRewrite) |
| 1286 |
} else if(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { |
| 1287 |
setHeaders(Object(_helpers_parseHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"])(header), valueOrRewrite); |
| 1288 |
} else { |
| 1289 |
header != null && setHeader(valueOrRewrite, header, rewrite); |
| 1290 |
} |
| 1291 |
|
| 1292 |
return this; |
| 1293 |
} |
| 1294 |
|
| 1295 |
get(header, parser) { |
| 1296 |
header = normalizeHeader(header); |
| 1297 |
|
| 1298 |
if (header) { |
| 1299 |
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); |
| 1300 |
|
| 1301 |
if (key) { |
| 1302 |
const value = this[key]; |
| 1303 |
|
| 1304 |
if (!parser) { |
| 1305 |
return value; |
| 1306 |
} |
| 1307 |
|
| 1308 |
if (parser === true) { |
| 1309 |
return parseTokens(value); |
| 1310 |
} |
| 1311 |
|
| 1312 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(parser)) { |
| 1313 |
return parser.call(this, value, key); |
| 1314 |
} |
| 1315 |
|
| 1316 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isRegExp(parser)) { |
| 1317 |
return parser.exec(value); |
| 1318 |
} |
| 1319 |
|
| 1320 |
throw new TypeError('parser must be boolean|regexp|function'); |
| 1321 |
} |
| 1322 |
} |
| 1323 |
} |
| 1324 |
|
| 1325 |
has(header, matcher) { |
| 1326 |
header = normalizeHeader(header); |
| 1327 |
|
| 1328 |
if (header) { |
| 1329 |
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(this, header); |
| 1330 |
|
| 1331 |
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher))); |
| 1332 |
} |
| 1333 |
|
| 1334 |
return false; |
| 1335 |
} |
| 1336 |
|
| 1337 |
delete(header, matcher) { |
| 1338 |
const self = this; |
| 1339 |
let deleted = false; |
| 1340 |
|
| 1341 |
function deleteHeader(_header) { |
| 1342 |
_header = normalizeHeader(_header); |
| 1343 |
|
| 1344 |
if (_header) { |
| 1345 |
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(self, _header); |
| 1346 |
|
| 1347 |
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { |
| 1348 |
delete self[key]; |
| 1349 |
|
| 1350 |
deleted = true; |
| 1351 |
} |
| 1352 |
} |
| 1353 |
} |
| 1354 |
|
| 1355 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header)) { |
| 1356 |
header.forEach(deleteHeader); |
| 1357 |
} else { |
| 1358 |
deleteHeader(header); |
| 1359 |
} |
| 1360 |
|
| 1361 |
return deleted; |
| 1362 |
} |
| 1363 |
|
| 1364 |
clear(matcher) { |
| 1365 |
const keys = Object.keys(this); |
| 1366 |
let i = keys.length; |
| 1367 |
let deleted = false; |
| 1368 |
|
| 1369 |
while (i--) { |
| 1370 |
const key = keys[i]; |
| 1371 |
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { |
| 1372 |
delete this[key]; |
| 1373 |
deleted = true; |
| 1374 |
} |
| 1375 |
} |
| 1376 |
|
| 1377 |
return deleted; |
| 1378 |
} |
| 1379 |
|
| 1380 |
normalize(format) { |
| 1381 |
const self = this; |
| 1382 |
const headers = {}; |
| 1383 |
|
| 1384 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { |
| 1385 |
const key = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].findKey(headers, header); |
| 1386 |
|
| 1387 |
if (key) { |
| 1388 |
self[key] = normalizeValue(value); |
| 1389 |
delete self[header]; |
| 1390 |
return; |
| 1391 |
} |
| 1392 |
|
| 1393 |
const normalized = format ? formatHeader(header) : String(header).trim(); |
| 1394 |
|
| 1395 |
if (normalized !== header) { |
| 1396 |
delete self[header]; |
| 1397 |
} |
| 1398 |
|
| 1399 |
self[normalized] = normalizeValue(value); |
| 1400 |
|
| 1401 |
headers[normalized] = true; |
| 1402 |
}); |
| 1403 |
|
| 1404 |
return this; |
| 1405 |
} |
| 1406 |
|
| 1407 |
concat(...targets) { |
| 1408 |
return this.constructor.concat(this, ...targets); |
| 1409 |
} |
| 1410 |
|
| 1411 |
toJSON(asStrings) { |
| 1412 |
const obj = Object.create(null); |
| 1413 |
|
| 1414 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this, (value, header) => { |
| 1415 |
value != null && value !== false && (obj[header] = asStrings && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) ? value.join(', ') : value); |
| 1416 |
}); |
| 1417 |
|
| 1418 |
return obj; |
| 1419 |
} |
| 1420 |
|
| 1421 |
[Symbol.iterator]() { |
| 1422 |
return Object.entries(this.toJSON())[Symbol.iterator](); |
| 1423 |
} |
| 1424 |
|
| 1425 |
toString() { |
| 1426 |
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); |
| 1427 |
} |
| 1428 |
|
| 1429 |
get [Symbol.toStringTag]() { |
| 1430 |
return 'AxiosHeaders'; |
| 1431 |
} |
| 1432 |
|
| 1433 |
static from(thing) { |
| 1434 |
return thing instanceof this ? thing : new this(thing); |
| 1435 |
} |
| 1436 |
|
| 1437 |
static concat(first, ...targets) { |
| 1438 |
const computed = new this(first); |
| 1439 |
|
| 1440 |
targets.forEach((target) => computed.set(target)); |
| 1441 |
|
| 1442 |
return computed; |
| 1443 |
} |
| 1444 |
|
| 1445 |
static accessor(header) { |
| 1446 |
const internals = this[$internals] = (this[$internals] = { |
| 1447 |
accessors: {} |
| 1448 |
}); |
| 1449 |
|
| 1450 |
const accessors = internals.accessors; |
| 1451 |
const prototype = this.prototype; |
| 1452 |
|
| 1453 |
function defineAccessor(_header) { |
| 1454 |
const lHeader = normalizeHeader(_header); |
| 1455 |
|
| 1456 |
if (!accessors[lHeader]) { |
| 1457 |
buildAccessors(prototype, _header); |
| 1458 |
accessors[lHeader] = true; |
| 1459 |
} |
| 1460 |
} |
| 1461 |
|
| 1462 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); |
| 1463 |
|
| 1464 |
return this; |
| 1465 |
} |
| 1466 |
} |
| 1467 |
|
| 1468 |
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']); |
| 1469 |
|
| 1470 |
// reserved names hotfix |
| 1471 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => { |
| 1472 |
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set` |
| 1473 |
return { |
| 1474 |
get: () => value, |
| 1475 |
set(headerValue) { |
| 1476 |
this[mapped] = headerValue; |
| 1477 |
} |
| 1478 |
} |
| 1479 |
}); |
| 1480 |
|
| 1481 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].freezeMethods(AxiosHeaders); |
| 1482 |
|
| 1483 |
/* harmony default export */ __webpack_exports__["default"] = (AxiosHeaders); |
| 1484 |
|
| 1485 |
|
| 1486 |
/***/ }), |
| 1487 |
|
| 1488 |
/***/ "./node_modules/axios/lib/core/InterceptorManager.js": |
| 1489 |
/*!***********************************************************!*\ |
| 1490 |
!*** ./node_modules/axios/lib/core/InterceptorManager.js ***! |
| 1491 |
\***********************************************************/ |
| 1492 |
/*! exports provided: default */ |
| 1493 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1494 |
|
| 1495 |
"use strict"; |
| 1496 |
__webpack_require__.r(__webpack_exports__); |
| 1497 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1498 |
|
| 1499 |
|
| 1500 |
|
| 1501 |
|
| 1502 |
class InterceptorManager { |
| 1503 |
constructor() { |
| 1504 |
this.handlers = []; |
| 1505 |
} |
| 1506 |
|
| 1507 |
/** |
| 1508 |
* Add a new interceptor to the stack |
| 1509 |
* |
| 1510 |
* @param {Function} fulfilled The function to handle `then` for a `Promise` |
| 1511 |
* @param {Function} rejected The function to handle `reject` for a `Promise` |
| 1512 |
* |
| 1513 |
* @return {Number} An ID used to remove interceptor later |
| 1514 |
*/ |
| 1515 |
use(fulfilled, rejected, options) { |
| 1516 |
this.handlers.push({ |
| 1517 |
fulfilled, |
| 1518 |
rejected, |
| 1519 |
synchronous: options ? options.synchronous : false, |
| 1520 |
runWhen: options ? options.runWhen : null |
| 1521 |
}); |
| 1522 |
return this.handlers.length - 1; |
| 1523 |
} |
| 1524 |
|
| 1525 |
/** |
| 1526 |
* Remove an interceptor from the stack |
| 1527 |
* |
| 1528 |
* @param {Number} id The ID that was returned by `use` |
| 1529 |
* |
| 1530 |
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise |
| 1531 |
*/ |
| 1532 |
eject(id) { |
| 1533 |
if (this.handlers[id]) { |
| 1534 |
this.handlers[id] = null; |
| 1535 |
} |
| 1536 |
} |
| 1537 |
|
| 1538 |
/** |
| 1539 |
* Clear all interceptors from the stack |
| 1540 |
* |
| 1541 |
* @returns {void} |
| 1542 |
*/ |
| 1543 |
clear() { |
| 1544 |
if (this.handlers) { |
| 1545 |
this.handlers = []; |
| 1546 |
} |
| 1547 |
} |
| 1548 |
|
| 1549 |
/** |
| 1550 |
* Iterate over all the registered interceptors |
| 1551 |
* |
| 1552 |
* This method is particularly useful for skipping over any |
| 1553 |
* interceptors that may have become `null` calling `eject`. |
| 1554 |
* |
| 1555 |
* @param {Function} fn The function to call for each interceptor |
| 1556 |
* |
| 1557 |
* @returns {void} |
| 1558 |
*/ |
| 1559 |
forEach(fn) { |
| 1560 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(this.handlers, function forEachHandler(h) { |
| 1561 |
if (h !== null) { |
| 1562 |
fn(h); |
| 1563 |
} |
| 1564 |
}); |
| 1565 |
} |
| 1566 |
} |
| 1567 |
|
| 1568 |
/* harmony default export */ __webpack_exports__["default"] = (InterceptorManager); |
| 1569 |
|
| 1570 |
|
| 1571 |
/***/ }), |
| 1572 |
|
| 1573 |
/***/ "./node_modules/axios/lib/core/buildFullPath.js": |
| 1574 |
/*!******************************************************!*\ |
| 1575 |
!*** ./node_modules/axios/lib/core/buildFullPath.js ***! |
| 1576 |
\******************************************************/ |
| 1577 |
/*! exports provided: default */ |
| 1578 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1579 |
|
| 1580 |
"use strict"; |
| 1581 |
__webpack_require__.r(__webpack_exports__); |
| 1582 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildFullPath; }); |
| 1583 |
/* harmony import */ var _helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers/isAbsoluteURL.js */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); |
| 1584 |
/* harmony import */ var _helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/combineURLs.js */ "./node_modules/axios/lib/helpers/combineURLs.js"); |
| 1585 |
|
| 1586 |
|
| 1587 |
|
| 1588 |
|
| 1589 |
|
| 1590 |
/** |
| 1591 |
* Creates a new URL by combining the baseURL with the requestedURL, |
| 1592 |
* only when the requestedURL is not already an absolute URL. |
| 1593 |
* If the requestURL is absolute, this function returns the requestedURL untouched. |
| 1594 |
* |
| 1595 |
* @param {string} baseURL The base URL |
| 1596 |
* @param {string} requestedURL Absolute or relative URL to combine |
| 1597 |
* |
| 1598 |
* @returns {string} The combined full path |
| 1599 |
*/ |
| 1600 |
function buildFullPath(baseURL, requestedURL) { |
| 1601 |
if (baseURL && !Object(_helpers_isAbsoluteURL_js__WEBPACK_IMPORTED_MODULE_0__["default"])(requestedURL)) { |
| 1602 |
return Object(_helpers_combineURLs_js__WEBPACK_IMPORTED_MODULE_1__["default"])(baseURL, requestedURL); |
| 1603 |
} |
| 1604 |
return requestedURL; |
| 1605 |
} |
| 1606 |
|
| 1607 |
|
| 1608 |
/***/ }), |
| 1609 |
|
| 1610 |
/***/ "./node_modules/axios/lib/core/dispatchRequest.js": |
| 1611 |
/*!********************************************************!*\ |
| 1612 |
!*** ./node_modules/axios/lib/core/dispatchRequest.js ***! |
| 1613 |
\********************************************************/ |
| 1614 |
/*! exports provided: default */ |
| 1615 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1616 |
|
| 1617 |
"use strict"; |
| 1618 |
__webpack_require__.r(__webpack_exports__); |
| 1619 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return dispatchRequest; }); |
| 1620 |
/* harmony import */ var _transformData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformData.js */ "./node_modules/axios/lib/core/transformData.js"); |
| 1621 |
/* harmony import */ var _cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cancel/isCancel.js */ "./node_modules/axios/lib/cancel/isCancel.js"); |
| 1622 |
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); |
| 1623 |
/* harmony import */ var _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cancel/CanceledError.js */ "./node_modules/axios/lib/cancel/CanceledError.js"); |
| 1624 |
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 1625 |
/* harmony import */ var _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../adapters/adapters.js */ "./node_modules/axios/lib/adapters/adapters.js"); |
| 1626 |
|
| 1627 |
|
| 1628 |
|
| 1629 |
|
| 1630 |
|
| 1631 |
|
| 1632 |
|
| 1633 |
|
| 1634 |
|
| 1635 |
/** |
| 1636 |
* Throws a `CanceledError` if cancellation has been requested. |
| 1637 |
* |
| 1638 |
* @param {Object} config The config that is to be used for the request |
| 1639 |
* |
| 1640 |
* @returns {void} |
| 1641 |
*/ |
| 1642 |
function throwIfCancellationRequested(config) { |
| 1643 |
if (config.cancelToken) { |
| 1644 |
config.cancelToken.throwIfRequested(); |
| 1645 |
} |
| 1646 |
|
| 1647 |
if (config.signal && config.signal.aborted) { |
| 1648 |
throw new _cancel_CanceledError_js__WEBPACK_IMPORTED_MODULE_3__["default"](null, config); |
| 1649 |
} |
| 1650 |
} |
| 1651 |
|
| 1652 |
/** |
| 1653 |
* Dispatch a request to the server using the configured adapter. |
| 1654 |
* |
| 1655 |
* @param {object} config The config that is to be used for the request |
| 1656 |
* |
| 1657 |
* @returns {Promise} The Promise to be fulfilled |
| 1658 |
*/ |
| 1659 |
function dispatchRequest(config) { |
| 1660 |
throwIfCancellationRequested(config); |
| 1661 |
|
| 1662 |
config.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(config.headers); |
| 1663 |
|
| 1664 |
// Transform request data |
| 1665 |
config.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( |
| 1666 |
config, |
| 1667 |
config.transformRequest |
| 1668 |
); |
| 1669 |
|
| 1670 |
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) { |
| 1671 |
config.headers.setContentType('application/x-www-form-urlencoded', false); |
| 1672 |
} |
| 1673 |
|
| 1674 |
const adapter = _adapters_adapters_js__WEBPACK_IMPORTED_MODULE_5__["default"].getAdapter(config.adapter || _defaults_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].adapter); |
| 1675 |
|
| 1676 |
return adapter(config).then(function onAdapterResolution(response) { |
| 1677 |
throwIfCancellationRequested(config); |
| 1678 |
|
| 1679 |
// Transform response data |
| 1680 |
response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( |
| 1681 |
config, |
| 1682 |
config.transformResponse, |
| 1683 |
response |
| 1684 |
); |
| 1685 |
|
| 1686 |
response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(response.headers); |
| 1687 |
|
| 1688 |
return response; |
| 1689 |
}, function onAdapterRejection(reason) { |
| 1690 |
if (!Object(_cancel_isCancel_js__WEBPACK_IMPORTED_MODULE_1__["default"])(reason)) { |
| 1691 |
throwIfCancellationRequested(config); |
| 1692 |
|
| 1693 |
// Transform response data |
| 1694 |
if (reason && reason.response) { |
| 1695 |
reason.response.data = _transformData_js__WEBPACK_IMPORTED_MODULE_0__["default"].call( |
| 1696 |
config, |
| 1697 |
config.transformResponse, |
| 1698 |
reason.response |
| 1699 |
); |
| 1700 |
reason.response.headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_4__["default"].from(reason.response.headers); |
| 1701 |
} |
| 1702 |
} |
| 1703 |
|
| 1704 |
return Promise.reject(reason); |
| 1705 |
}); |
| 1706 |
} |
| 1707 |
|
| 1708 |
|
| 1709 |
/***/ }), |
| 1710 |
|
| 1711 |
/***/ "./node_modules/axios/lib/core/mergeConfig.js": |
| 1712 |
/*!****************************************************!*\ |
| 1713 |
!*** ./node_modules/axios/lib/core/mergeConfig.js ***! |
| 1714 |
\****************************************************/ |
| 1715 |
/*! exports provided: default */ |
| 1716 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1717 |
|
| 1718 |
"use strict"; |
| 1719 |
__webpack_require__.r(__webpack_exports__); |
| 1720 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return mergeConfig; }); |
| 1721 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1722 |
/* harmony import */ var _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 1723 |
|
| 1724 |
|
| 1725 |
|
| 1726 |
|
| 1727 |
|
| 1728 |
const headersToObject = (thing) => thing instanceof _AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? thing.toJSON() : thing; |
| 1729 |
|
| 1730 |
/** |
| 1731 |
* Config-specific merge-function which creates a new config-object |
| 1732 |
* by merging two configuration objects together. |
| 1733 |
* |
| 1734 |
* @param {Object} config1 |
| 1735 |
* @param {Object} config2 |
| 1736 |
* |
| 1737 |
* @returns {Object} New object resulting from merging config2 to config1 |
| 1738 |
*/ |
| 1739 |
function mergeConfig(config1, config2) { |
| 1740 |
// eslint-disable-next-line no-param-reassign |
| 1741 |
config2 = config2 || {}; |
| 1742 |
const config = {}; |
| 1743 |
|
| 1744 |
function getMergedValue(target, source, caseless) { |
| 1745 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(target) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) { |
| 1746 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge.call({caseless}, target, source); |
| 1747 |
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(source)) { |
| 1748 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].merge({}, source); |
| 1749 |
} else if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(source)) { |
| 1750 |
return source.slice(); |
| 1751 |
} |
| 1752 |
return source; |
| 1753 |
} |
| 1754 |
|
| 1755 |
// eslint-disable-next-line consistent-return |
| 1756 |
function mergeDeepProperties(a, b, caseless) { |
| 1757 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { |
| 1758 |
return getMergedValue(a, b, caseless); |
| 1759 |
} else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) { |
| 1760 |
return getMergedValue(undefined, a, caseless); |
| 1761 |
} |
| 1762 |
} |
| 1763 |
|
| 1764 |
// eslint-disable-next-line consistent-return |
| 1765 |
function valueFromConfig2(a, b) { |
| 1766 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { |
| 1767 |
return getMergedValue(undefined, b); |
| 1768 |
} |
| 1769 |
} |
| 1770 |
|
| 1771 |
// eslint-disable-next-line consistent-return |
| 1772 |
function defaultToConfig2(a, b) { |
| 1773 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(b)) { |
| 1774 |
return getMergedValue(undefined, b); |
| 1775 |
} else if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(a)) { |
| 1776 |
return getMergedValue(undefined, a); |
| 1777 |
} |
| 1778 |
} |
| 1779 |
|
| 1780 |
// eslint-disable-next-line consistent-return |
| 1781 |
function mergeDirectKeys(a, b, prop) { |
| 1782 |
if (prop in config2) { |
| 1783 |
return getMergedValue(a, b); |
| 1784 |
} else if (prop in config1) { |
| 1785 |
return getMergedValue(undefined, a); |
| 1786 |
} |
| 1787 |
} |
| 1788 |
|
| 1789 |
const mergeMap = { |
| 1790 |
url: valueFromConfig2, |
| 1791 |
method: valueFromConfig2, |
| 1792 |
data: valueFromConfig2, |
| 1793 |
baseURL: defaultToConfig2, |
| 1794 |
transformRequest: defaultToConfig2, |
| 1795 |
transformResponse: defaultToConfig2, |
| 1796 |
paramsSerializer: defaultToConfig2, |
| 1797 |
timeout: defaultToConfig2, |
| 1798 |
timeoutMessage: defaultToConfig2, |
| 1799 |
withCredentials: defaultToConfig2, |
| 1800 |
withXSRFToken: defaultToConfig2, |
| 1801 |
adapter: defaultToConfig2, |
| 1802 |
responseType: defaultToConfig2, |
| 1803 |
xsrfCookieName: defaultToConfig2, |
| 1804 |
xsrfHeaderName: defaultToConfig2, |
| 1805 |
onUploadProgress: defaultToConfig2, |
| 1806 |
onDownloadProgress: defaultToConfig2, |
| 1807 |
decompress: defaultToConfig2, |
| 1808 |
maxContentLength: defaultToConfig2, |
| 1809 |
maxBodyLength: defaultToConfig2, |
| 1810 |
beforeRedirect: defaultToConfig2, |
| 1811 |
transport: defaultToConfig2, |
| 1812 |
httpAgent: defaultToConfig2, |
| 1813 |
httpsAgent: defaultToConfig2, |
| 1814 |
cancelToken: defaultToConfig2, |
| 1815 |
socketPath: defaultToConfig2, |
| 1816 |
responseEncoding: defaultToConfig2, |
| 1817 |
validateStatus: mergeDirectKeys, |
| 1818 |
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) |
| 1819 |
}; |
| 1820 |
|
| 1821 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { |
| 1822 |
const merge = mergeMap[prop] || mergeDeepProperties; |
| 1823 |
const configValue = merge(config1[prop], config2[prop], prop); |
| 1824 |
(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); |
| 1825 |
}); |
| 1826 |
|
| 1827 |
return config; |
| 1828 |
} |
| 1829 |
|
| 1830 |
|
| 1831 |
/***/ }), |
| 1832 |
|
| 1833 |
/***/ "./node_modules/axios/lib/core/settle.js": |
| 1834 |
/*!***********************************************!*\ |
| 1835 |
!*** ./node_modules/axios/lib/core/settle.js ***! |
| 1836 |
\***********************************************/ |
| 1837 |
/*! exports provided: default */ |
| 1838 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1839 |
|
| 1840 |
"use strict"; |
| 1841 |
__webpack_require__.r(__webpack_exports__); |
| 1842 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return settle; }); |
| 1843 |
/* harmony import */ var _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 1844 |
|
| 1845 |
|
| 1846 |
|
| 1847 |
|
| 1848 |
/** |
| 1849 |
* Resolve or reject a Promise based on response status. |
| 1850 |
* |
| 1851 |
* @param {Function} resolve A function that resolves the promise. |
| 1852 |
* @param {Function} reject A function that rejects the promise. |
| 1853 |
* @param {object} response The response. |
| 1854 |
* |
| 1855 |
* @returns {object} The response. |
| 1856 |
*/ |
| 1857 |
function settle(resolve, reject, response) { |
| 1858 |
const validateStatus = response.config.validateStatus; |
| 1859 |
if (!response.status || !validateStatus || validateStatus(response.status)) { |
| 1860 |
resolve(response); |
| 1861 |
} else { |
| 1862 |
reject(new _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"]( |
| 1863 |
'Request failed with status code ' + response.status, |
| 1864 |
[_AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_REQUEST, _AxiosError_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], |
| 1865 |
response.config, |
| 1866 |
response.request, |
| 1867 |
response |
| 1868 |
)); |
| 1869 |
} |
| 1870 |
} |
| 1871 |
|
| 1872 |
|
| 1873 |
/***/ }), |
| 1874 |
|
| 1875 |
/***/ "./node_modules/axios/lib/core/transformData.js": |
| 1876 |
/*!******************************************************!*\ |
| 1877 |
!*** ./node_modules/axios/lib/core/transformData.js ***! |
| 1878 |
\******************************************************/ |
| 1879 |
/*! exports provided: default */ |
| 1880 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1881 |
|
| 1882 |
"use strict"; |
| 1883 |
__webpack_require__.r(__webpack_exports__); |
| 1884 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return transformData; }); |
| 1885 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1886 |
/* harmony import */ var _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../defaults/index.js */ "./node_modules/axios/lib/defaults/index.js"); |
| 1887 |
/* harmony import */ var _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/AxiosHeaders.js */ "./node_modules/axios/lib/core/AxiosHeaders.js"); |
| 1888 |
|
| 1889 |
|
| 1890 |
|
| 1891 |
|
| 1892 |
|
| 1893 |
|
| 1894 |
/** |
| 1895 |
* Transform the data for a request or a response |
| 1896 |
* |
| 1897 |
* @param {Array|Function} fns A single function or Array of functions |
| 1898 |
* @param {?Object} response The response object |
| 1899 |
* |
| 1900 |
* @returns {*} The resulting transformed data |
| 1901 |
*/ |
| 1902 |
function transformData(fns, response) { |
| 1903 |
const config = this || _defaults_index_js__WEBPACK_IMPORTED_MODULE_1__["default"]; |
| 1904 |
const context = response || config; |
| 1905 |
const headers = _core_AxiosHeaders_js__WEBPACK_IMPORTED_MODULE_2__["default"].from(context.headers); |
| 1906 |
let data = context.data; |
| 1907 |
|
| 1908 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(fns, function transform(fn) { |
| 1909 |
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined); |
| 1910 |
}); |
| 1911 |
|
| 1912 |
headers.normalize(); |
| 1913 |
|
| 1914 |
return data; |
| 1915 |
} |
| 1916 |
|
| 1917 |
|
| 1918 |
/***/ }), |
| 1919 |
|
| 1920 |
/***/ "./node_modules/axios/lib/defaults/index.js": |
| 1921 |
/*!**************************************************!*\ |
| 1922 |
!*** ./node_modules/axios/lib/defaults/index.js ***! |
| 1923 |
\**************************************************/ |
| 1924 |
/*! exports provided: default */ |
| 1925 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 1926 |
|
| 1927 |
"use strict"; |
| 1928 |
__webpack_require__.r(__webpack_exports__); |
| 1929 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 1930 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 1931 |
/* harmony import */ var _transitional_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transitional.js */ "./node_modules/axios/lib/defaults/transitional.js"); |
| 1932 |
/* harmony import */ var _helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers/toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); |
| 1933 |
/* harmony import */ var _helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers/toURLEncodedForm.js */ "./node_modules/axios/lib/helpers/toURLEncodedForm.js"); |
| 1934 |
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); |
| 1935 |
/* harmony import */ var _helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers/formDataToJSON.js */ "./node_modules/axios/lib/helpers/formDataToJSON.js"); |
| 1936 |
|
| 1937 |
|
| 1938 |
|
| 1939 |
|
| 1940 |
|
| 1941 |
|
| 1942 |
|
| 1943 |
|
| 1944 |
|
| 1945 |
|
| 1946 |
/** |
| 1947 |
* It takes a string, tries to parse it, and if it fails, it returns the stringified version |
| 1948 |
* of the input |
| 1949 |
* |
| 1950 |
* @param {any} rawValue - The value to be stringified. |
| 1951 |
* @param {Function} parser - A function that parses a string into a JavaScript object. |
| 1952 |
* @param {Function} encoder - A function that takes a value and returns a string. |
| 1953 |
* |
| 1954 |
* @returns {string} A stringified version of the rawValue. |
| 1955 |
*/ |
| 1956 |
function stringifySafely(rawValue, parser, encoder) { |
| 1957 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(rawValue)) { |
| 1958 |
try { |
| 1959 |
(parser || JSON.parse)(rawValue); |
| 1960 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].trim(rawValue); |
| 1961 |
} catch (e) { |
| 1962 |
if (e.name !== 'SyntaxError') { |
| 1963 |
throw e; |
| 1964 |
} |
| 1965 |
} |
| 1966 |
} |
| 1967 |
|
| 1968 |
return (encoder || JSON.stringify)(rawValue); |
| 1969 |
} |
| 1970 |
|
| 1971 |
const defaults = { |
| 1972 |
|
| 1973 |
transitional: _transitional_js__WEBPACK_IMPORTED_MODULE_2__["default"], |
| 1974 |
|
| 1975 |
adapter: ['xhr', 'http'], |
| 1976 |
|
| 1977 |
transformRequest: [function transformRequest(data, headers) { |
| 1978 |
const contentType = headers.getContentType() || ''; |
| 1979 |
const hasJSONContentType = contentType.indexOf('application/json') > -1; |
| 1980 |
const isObjectPayload = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(data); |
| 1981 |
|
| 1982 |
if (isObjectPayload && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isHTMLForm(data)) { |
| 1983 |
data = new FormData(data); |
| 1984 |
} |
| 1985 |
|
| 1986 |
const isFormData = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(data); |
| 1987 |
|
| 1988 |
if (isFormData) { |
| 1989 |
if (!hasJSONContentType) { |
| 1990 |
return data; |
| 1991 |
} |
| 1992 |
return hasJSONContentType ? JSON.stringify(Object(_helpers_formDataToJSON_js__WEBPACK_IMPORTED_MODULE_6__["default"])(data)) : data; |
| 1993 |
} |
| 1994 |
|
| 1995 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(data) || |
| 1996 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(data) || |
| 1997 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isStream(data) || |
| 1998 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFile(data) || |
| 1999 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(data) |
| 2000 |
) { |
| 2001 |
return data; |
| 2002 |
} |
| 2003 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBufferView(data)) { |
| 2004 |
return data.buffer; |
| 2005 |
} |
| 2006 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(data)) { |
| 2007 |
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false); |
| 2008 |
return data.toString(); |
| 2009 |
} |
| 2010 |
|
| 2011 |
let isFileList; |
| 2012 |
|
| 2013 |
if (isObjectPayload) { |
| 2014 |
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) { |
| 2015 |
return Object(_helpers_toURLEncodedForm_js__WEBPACK_IMPORTED_MODULE_4__["default"])(data, this.formSerializer).toString(); |
| 2016 |
} |
| 2017 |
|
| 2018 |
if ((isFileList = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) { |
| 2019 |
const _FormData = this.env && this.env.FormData; |
| 2020 |
|
| 2021 |
return Object(_helpers_toFormData_js__WEBPACK_IMPORTED_MODULE_3__["default"])( |
| 2022 |
isFileList ? {'files[]': data} : data, |
| 2023 |
_FormData && new _FormData(), |
| 2024 |
this.formSerializer |
| 2025 |
); |
| 2026 |
} |
| 2027 |
} |
| 2028 |
|
| 2029 |
if (isObjectPayload || hasJSONContentType ) { |
| 2030 |
headers.setContentType('application/json', false); |
| 2031 |
return stringifySafely(data); |
| 2032 |
} |
| 2033 |
|
| 2034 |
return data; |
| 2035 |
}], |
| 2036 |
|
| 2037 |
transformResponse: [function transformResponse(data) { |
| 2038 |
const transitional = this.transitional || defaults.transitional; |
| 2039 |
const forcedJSONParsing = transitional && transitional.forcedJSONParsing; |
| 2040 |
const JSONRequested = this.responseType === 'json'; |
| 2041 |
|
| 2042 |
if (data && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) { |
| 2043 |
const silentJSONParsing = transitional && transitional.silentJSONParsing; |
| 2044 |
const strictJSONParsing = !silentJSONParsing && JSONRequested; |
| 2045 |
|
| 2046 |
try { |
| 2047 |
return JSON.parse(data); |
| 2048 |
} catch (e) { |
| 2049 |
if (strictJSONParsing) { |
| 2050 |
if (e.name === 'SyntaxError') { |
| 2051 |
throw _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].from(e, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_RESPONSE, this, null, this.response); |
| 2052 |
} |
| 2053 |
throw e; |
| 2054 |
} |
| 2055 |
} |
| 2056 |
} |
| 2057 |
|
| 2058 |
return data; |
| 2059 |
}], |
| 2060 |
|
| 2061 |
/** |
| 2062 |
* A timeout in milliseconds to abort a request. If set to 0 (default) a |
| 2063 |
* timeout is not created. |
| 2064 |
*/ |
| 2065 |
timeout: 0, |
| 2066 |
|
| 2067 |
xsrfCookieName: 'XSRF-TOKEN', |
| 2068 |
xsrfHeaderName: 'X-XSRF-TOKEN', |
| 2069 |
|
| 2070 |
maxContentLength: -1, |
| 2071 |
maxBodyLength: -1, |
| 2072 |
|
| 2073 |
env: { |
| 2074 |
FormData: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.FormData, |
| 2075 |
Blob: _platform_index_js__WEBPACK_IMPORTED_MODULE_5__["default"].classes.Blob |
| 2076 |
}, |
| 2077 |
|
| 2078 |
validateStatus: function validateStatus(status) { |
| 2079 |
return status >= 200 && status < 300; |
| 2080 |
}, |
| 2081 |
|
| 2082 |
headers: { |
| 2083 |
common: { |
| 2084 |
'Accept': 'application/json, text/plain, */*', |
| 2085 |
'Content-Type': undefined |
| 2086 |
} |
| 2087 |
} |
| 2088 |
}; |
| 2089 |
|
| 2090 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => { |
| 2091 |
defaults.headers[method] = {}; |
| 2092 |
}); |
| 2093 |
|
| 2094 |
/* harmony default export */ __webpack_exports__["default"] = (defaults); |
| 2095 |
|
| 2096 |
|
| 2097 |
/***/ }), |
| 2098 |
|
| 2099 |
/***/ "./node_modules/axios/lib/defaults/transitional.js": |
| 2100 |
/*!*********************************************************!*\ |
| 2101 |
!*** ./node_modules/axios/lib/defaults/transitional.js ***! |
| 2102 |
\*********************************************************/ |
| 2103 |
/*! exports provided: default */ |
| 2104 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2105 |
|
| 2106 |
"use strict"; |
| 2107 |
__webpack_require__.r(__webpack_exports__); |
| 2108 |
|
| 2109 |
|
| 2110 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 2111 |
silentJSONParsing: true, |
| 2112 |
forcedJSONParsing: true, |
| 2113 |
clarifyTimeoutError: false |
| 2114 |
}); |
| 2115 |
|
| 2116 |
|
| 2117 |
/***/ }), |
| 2118 |
|
| 2119 |
/***/ "./node_modules/axios/lib/env/data.js": |
| 2120 |
/*!********************************************!*\ |
| 2121 |
!*** ./node_modules/axios/lib/env/data.js ***! |
| 2122 |
\********************************************/ |
| 2123 |
/*! exports provided: VERSION */ |
| 2124 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2125 |
|
| 2126 |
"use strict"; |
| 2127 |
__webpack_require__.r(__webpack_exports__); |
| 2128 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); |
| 2129 |
const VERSION = "1.6.2"; |
| 2130 |
|
| 2131 |
/***/ }), |
| 2132 |
|
| 2133 |
/***/ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js": |
| 2134 |
/*!****************************************************************!*\ |
| 2135 |
!*** ./node_modules/axios/lib/helpers/AxiosURLSearchParams.js ***! |
| 2136 |
\****************************************************************/ |
| 2137 |
/*! exports provided: default */ |
| 2138 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2139 |
|
| 2140 |
"use strict"; |
| 2141 |
__webpack_require__.r(__webpack_exports__); |
| 2142 |
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); |
| 2143 |
|
| 2144 |
|
| 2145 |
|
| 2146 |
|
| 2147 |
/** |
| 2148 |
* It encodes a string by replacing all characters that are not in the unreserved set with |
| 2149 |
* their percent-encoded equivalents |
| 2150 |
* |
| 2151 |
* @param {string} str - The string to encode. |
| 2152 |
* |
| 2153 |
* @returns {string} The encoded string. |
| 2154 |
*/ |
| 2155 |
function encode(str) { |
| 2156 |
const charMap = { |
| 2157 |
'!': '%21', |
| 2158 |
"'": '%27', |
| 2159 |
'(': '%28', |
| 2160 |
')': '%29', |
| 2161 |
'~': '%7E', |
| 2162 |
'%20': '+', |
| 2163 |
'%00': '\x00' |
| 2164 |
}; |
| 2165 |
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { |
| 2166 |
return charMap[match]; |
| 2167 |
}); |
| 2168 |
} |
| 2169 |
|
| 2170 |
/** |
| 2171 |
* It takes a params object and converts it to a FormData object |
| 2172 |
* |
| 2173 |
* @param {Object<string, any>} params - The parameters to be converted to a FormData object. |
| 2174 |
* @param {Object<string, any>} options - The options object passed to the Axios constructor. |
| 2175 |
* |
| 2176 |
* @returns {void} |
| 2177 |
*/ |
| 2178 |
function AxiosURLSearchParams(params, options) { |
| 2179 |
this._pairs = []; |
| 2180 |
|
| 2181 |
params && Object(_toFormData_js__WEBPACK_IMPORTED_MODULE_0__["default"])(params, this, options); |
| 2182 |
} |
| 2183 |
|
| 2184 |
const prototype = AxiosURLSearchParams.prototype; |
| 2185 |
|
| 2186 |
prototype.append = function append(name, value) { |
| 2187 |
this._pairs.push([name, value]); |
| 2188 |
}; |
| 2189 |
|
| 2190 |
prototype.toString = function toString(encoder) { |
| 2191 |
const _encode = encoder ? function(value) { |
| 2192 |
return encoder.call(this, value, encode); |
| 2193 |
} : encode; |
| 2194 |
|
| 2195 |
return this._pairs.map(function each(pair) { |
| 2196 |
return _encode(pair[0]) + '=' + _encode(pair[1]); |
| 2197 |
}, '').join('&'); |
| 2198 |
}; |
| 2199 |
|
| 2200 |
/* harmony default export */ __webpack_exports__["default"] = (AxiosURLSearchParams); |
| 2201 |
|
| 2202 |
|
| 2203 |
/***/ }), |
| 2204 |
|
| 2205 |
/***/ "./node_modules/axios/lib/helpers/HttpStatusCode.js": |
| 2206 |
/*!**********************************************************!*\ |
| 2207 |
!*** ./node_modules/axios/lib/helpers/HttpStatusCode.js ***! |
| 2208 |
\**********************************************************/ |
| 2209 |
/*! exports provided: default */ |
| 2210 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2211 |
|
| 2212 |
"use strict"; |
| 2213 |
__webpack_require__.r(__webpack_exports__); |
| 2214 |
const HttpStatusCode = { |
| 2215 |
Continue: 100, |
| 2216 |
SwitchingProtocols: 101, |
| 2217 |
Processing: 102, |
| 2218 |
EarlyHints: 103, |
| 2219 |
Ok: 200, |
| 2220 |
Created: 201, |
| 2221 |
Accepted: 202, |
| 2222 |
NonAuthoritativeInformation: 203, |
| 2223 |
NoContent: 204, |
| 2224 |
ResetContent: 205, |
| 2225 |
PartialContent: 206, |
| 2226 |
MultiStatus: 207, |
| 2227 |
AlreadyReported: 208, |
| 2228 |
ImUsed: 226, |
| 2229 |
MultipleChoices: 300, |
| 2230 |
MovedPermanently: 301, |
| 2231 |
Found: 302, |
| 2232 |
SeeOther: 303, |
| 2233 |
NotModified: 304, |
| 2234 |
UseProxy: 305, |
| 2235 |
Unused: 306, |
| 2236 |
TemporaryRedirect: 307, |
| 2237 |
PermanentRedirect: 308, |
| 2238 |
BadRequest: 400, |
| 2239 |
Unauthorized: 401, |
| 2240 |
PaymentRequired: 402, |
| 2241 |
Forbidden: 403, |
| 2242 |
NotFound: 404, |
| 2243 |
MethodNotAllowed: 405, |
| 2244 |
NotAcceptable: 406, |
| 2245 |
ProxyAuthenticationRequired: 407, |
| 2246 |
RequestTimeout: 408, |
| 2247 |
Conflict: 409, |
| 2248 |
Gone: 410, |
| 2249 |
LengthRequired: 411, |
| 2250 |
PreconditionFailed: 412, |
| 2251 |
PayloadTooLarge: 413, |
| 2252 |
UriTooLong: 414, |
| 2253 |
UnsupportedMediaType: 415, |
| 2254 |
RangeNotSatisfiable: 416, |
| 2255 |
ExpectationFailed: 417, |
| 2256 |
ImATeapot: 418, |
| 2257 |
MisdirectedRequest: 421, |
| 2258 |
UnprocessableEntity: 422, |
| 2259 |
Locked: 423, |
| 2260 |
FailedDependency: 424, |
| 2261 |
TooEarly: 425, |
| 2262 |
UpgradeRequired: 426, |
| 2263 |
PreconditionRequired: 428, |
| 2264 |
TooManyRequests: 429, |
| 2265 |
RequestHeaderFieldsTooLarge: 431, |
| 2266 |
UnavailableForLegalReasons: 451, |
| 2267 |
InternalServerError: 500, |
| 2268 |
NotImplemented: 501, |
| 2269 |
BadGateway: 502, |
| 2270 |
ServiceUnavailable: 503, |
| 2271 |
GatewayTimeout: 504, |
| 2272 |
HttpVersionNotSupported: 505, |
| 2273 |
VariantAlsoNegotiates: 506, |
| 2274 |
InsufficientStorage: 507, |
| 2275 |
LoopDetected: 508, |
| 2276 |
NotExtended: 510, |
| 2277 |
NetworkAuthenticationRequired: 511, |
| 2278 |
}; |
| 2279 |
|
| 2280 |
Object.entries(HttpStatusCode).forEach(([key, value]) => { |
| 2281 |
HttpStatusCode[value] = key; |
| 2282 |
}); |
| 2283 |
|
| 2284 |
/* harmony default export */ __webpack_exports__["default"] = (HttpStatusCode); |
| 2285 |
|
| 2286 |
|
| 2287 |
/***/ }), |
| 2288 |
|
| 2289 |
/***/ "./node_modules/axios/lib/helpers/bind.js": |
| 2290 |
/*!************************************************!*\ |
| 2291 |
!*** ./node_modules/axios/lib/helpers/bind.js ***! |
| 2292 |
\************************************************/ |
| 2293 |
/*! exports provided: default */ |
| 2294 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2295 |
|
| 2296 |
"use strict"; |
| 2297 |
__webpack_require__.r(__webpack_exports__); |
| 2298 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return bind; }); |
| 2299 |
|
| 2300 |
|
| 2301 |
function bind(fn, thisArg) { |
| 2302 |
return function wrap() { |
| 2303 |
return fn.apply(thisArg, arguments); |
| 2304 |
}; |
| 2305 |
} |
| 2306 |
|
| 2307 |
|
| 2308 |
/***/ }), |
| 2309 |
|
| 2310 |
/***/ "./node_modules/axios/lib/helpers/buildURL.js": |
| 2311 |
/*!****************************************************!*\ |
| 2312 |
!*** ./node_modules/axios/lib/helpers/buildURL.js ***! |
| 2313 |
\****************************************************/ |
| 2314 |
/*! exports provided: default */ |
| 2315 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2316 |
|
| 2317 |
"use strict"; |
| 2318 |
__webpack_require__.r(__webpack_exports__); |
| 2319 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return buildURL; }); |
| 2320 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2321 |
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); |
| 2322 |
|
| 2323 |
|
| 2324 |
|
| 2325 |
|
| 2326 |
|
| 2327 |
/** |
| 2328 |
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their |
| 2329 |
* URI encoded counterparts |
| 2330 |
* |
| 2331 |
* @param {string} val The value to be encoded. |
| 2332 |
* |
| 2333 |
* @returns {string} The encoded value. |
| 2334 |
*/ |
| 2335 |
function encode(val) { |
| 2336 |
return encodeURIComponent(val). |
| 2337 |
replace(/%3A/gi, ':'). |
| 2338 |
replace(/%24/g, '$'). |
| 2339 |
replace(/%2C/gi, ','). |
| 2340 |
replace(/%20/g, '+'). |
| 2341 |
replace(/%5B/gi, '['). |
| 2342 |
replace(/%5D/gi, ']'); |
| 2343 |
} |
| 2344 |
|
| 2345 |
/** |
| 2346 |
* Build a URL by appending params to the end |
| 2347 |
* |
| 2348 |
* @param {string} url The base of the url (e.g., http://www.google.com) |
| 2349 |
* @param {object} [params] The params to be appended |
| 2350 |
* @param {?object} options |
| 2351 |
* |
| 2352 |
* @returns {string} The formatted url |
| 2353 |
*/ |
| 2354 |
function buildURL(url, params, options) { |
| 2355 |
/*eslint no-param-reassign:0*/ |
| 2356 |
if (!params) { |
| 2357 |
return url; |
| 2358 |
} |
| 2359 |
|
| 2360 |
const _encode = options && options.encode || encode; |
| 2361 |
|
| 2362 |
const serializeFn = options && options.serialize; |
| 2363 |
|
| 2364 |
let serializedParams; |
| 2365 |
|
| 2366 |
if (serializeFn) { |
| 2367 |
serializedParams = serializeFn(params, options); |
| 2368 |
} else { |
| 2369 |
serializedParams = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isURLSearchParams(params) ? |
| 2370 |
params.toString() : |
| 2371 |
new _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_1__["default"](params, options).toString(_encode); |
| 2372 |
} |
| 2373 |
|
| 2374 |
if (serializedParams) { |
| 2375 |
const hashmarkIndex = url.indexOf("#"); |
| 2376 |
|
| 2377 |
if (hashmarkIndex !== -1) { |
| 2378 |
url = url.slice(0, hashmarkIndex); |
| 2379 |
} |
| 2380 |
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; |
| 2381 |
} |
| 2382 |
|
| 2383 |
return url; |
| 2384 |
} |
| 2385 |
|
| 2386 |
|
| 2387 |
/***/ }), |
| 2388 |
|
| 2389 |
/***/ "./node_modules/axios/lib/helpers/combineURLs.js": |
| 2390 |
/*!*******************************************************!*\ |
| 2391 |
!*** ./node_modules/axios/lib/helpers/combineURLs.js ***! |
| 2392 |
\*******************************************************/ |
| 2393 |
/*! exports provided: default */ |
| 2394 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2395 |
|
| 2396 |
"use strict"; |
| 2397 |
__webpack_require__.r(__webpack_exports__); |
| 2398 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return combineURLs; }); |
| 2399 |
|
| 2400 |
|
| 2401 |
/** |
| 2402 |
* Creates a new URL by combining the specified URLs |
| 2403 |
* |
| 2404 |
* @param {string} baseURL The base URL |
| 2405 |
* @param {string} relativeURL The relative URL |
| 2406 |
* |
| 2407 |
* @returns {string} The combined URL |
| 2408 |
*/ |
| 2409 |
function combineURLs(baseURL, relativeURL) { |
| 2410 |
return relativeURL |
| 2411 |
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') |
| 2412 |
: baseURL; |
| 2413 |
} |
| 2414 |
|
| 2415 |
|
| 2416 |
/***/ }), |
| 2417 |
|
| 2418 |
/***/ "./node_modules/axios/lib/helpers/cookies.js": |
| 2419 |
/*!***************************************************!*\ |
| 2420 |
!*** ./node_modules/axios/lib/helpers/cookies.js ***! |
| 2421 |
\***************************************************/ |
| 2422 |
/*! exports provided: default */ |
| 2423 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2424 |
|
| 2425 |
"use strict"; |
| 2426 |
__webpack_require__.r(__webpack_exports__); |
| 2427 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2428 |
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); |
| 2429 |
|
| 2430 |
|
| 2431 |
|
| 2432 |
/* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hasStandardBrowserEnv ? |
| 2433 |
|
| 2434 |
// Standard browser envs support document.cookie |
| 2435 |
{ |
| 2436 |
write(name, value, expires, path, domain, secure) { |
| 2437 |
const cookie = [name + '=' + encodeURIComponent(value)]; |
| 2438 |
|
| 2439 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString()); |
| 2440 |
|
| 2441 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(path) && cookie.push('path=' + path); |
| 2442 |
|
| 2443 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(domain) && cookie.push('domain=' + domain); |
| 2444 |
|
| 2445 |
secure === true && cookie.push('secure'); |
| 2446 |
|
| 2447 |
document.cookie = cookie.join('; '); |
| 2448 |
}, |
| 2449 |
|
| 2450 |
read(name) { |
| 2451 |
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); |
| 2452 |
return (match ? decodeURIComponent(match[3]) : null); |
| 2453 |
}, |
| 2454 |
|
| 2455 |
remove(name) { |
| 2456 |
this.write(name, '', Date.now() - 86400000); |
| 2457 |
} |
| 2458 |
} |
| 2459 |
|
| 2460 |
: |
| 2461 |
|
| 2462 |
// Non-standard browser env (web workers, react-native) lack needed support. |
| 2463 |
{ |
| 2464 |
write() {}, |
| 2465 |
read() { |
| 2466 |
return null; |
| 2467 |
}, |
| 2468 |
remove() {} |
| 2469 |
}); |
| 2470 |
|
| 2471 |
|
| 2472 |
|
| 2473 |
/***/ }), |
| 2474 |
|
| 2475 |
/***/ "./node_modules/axios/lib/helpers/formDataToJSON.js": |
| 2476 |
/*!**********************************************************!*\ |
| 2477 |
!*** ./node_modules/axios/lib/helpers/formDataToJSON.js ***! |
| 2478 |
\**********************************************************/ |
| 2479 |
/*! exports provided: default */ |
| 2480 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2481 |
|
| 2482 |
"use strict"; |
| 2483 |
__webpack_require__.r(__webpack_exports__); |
| 2484 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2485 |
|
| 2486 |
|
| 2487 |
|
| 2488 |
|
| 2489 |
/** |
| 2490 |
* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] |
| 2491 |
* |
| 2492 |
* @param {string} name - The name of the property to get. |
| 2493 |
* |
| 2494 |
* @returns An array of strings. |
| 2495 |
*/ |
| 2496 |
function parsePropPath(name) { |
| 2497 |
// foo[x][y][z] |
| 2498 |
// foo.x.y.z |
| 2499 |
// foo-x-y-z |
| 2500 |
// foo x y z |
| 2501 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].matchAll(/\w+|\[(\w*)]/g, name).map(match => { |
| 2502 |
return match[0] === '[]' ? '' : match[1] || match[0]; |
| 2503 |
}); |
| 2504 |
} |
| 2505 |
|
| 2506 |
/** |
| 2507 |
* Convert an array to an object. |
| 2508 |
* |
| 2509 |
* @param {Array<any>} arr - The array to convert to an object. |
| 2510 |
* |
| 2511 |
* @returns An object with the same keys and values as the array. |
| 2512 |
*/ |
| 2513 |
function arrayToObject(arr) { |
| 2514 |
const obj = {}; |
| 2515 |
const keys = Object.keys(arr); |
| 2516 |
let i; |
| 2517 |
const len = keys.length; |
| 2518 |
let key; |
| 2519 |
for (i = 0; i < len; i++) { |
| 2520 |
key = keys[i]; |
| 2521 |
obj[key] = arr[key]; |
| 2522 |
} |
| 2523 |
return obj; |
| 2524 |
} |
| 2525 |
|
| 2526 |
/** |
| 2527 |
* It takes a FormData object and returns a JavaScript object |
| 2528 |
* |
| 2529 |
* @param {string} formData The FormData object to convert to JSON. |
| 2530 |
* |
| 2531 |
* @returns {Object<string, any> | null} The converted object. |
| 2532 |
*/ |
| 2533 |
function formDataToJSON(formData) { |
| 2534 |
function buildPath(path, value, target, index) { |
| 2535 |
let name = path[index++]; |
| 2536 |
const isNumericKey = Number.isFinite(+name); |
| 2537 |
const isLast = index >= path.length; |
| 2538 |
name = !name && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target) ? target.length : name; |
| 2539 |
|
| 2540 |
if (isLast) { |
| 2541 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].hasOwnProp(target, name)) { |
| 2542 |
target[name] = [target[name], value]; |
| 2543 |
} else { |
| 2544 |
target[name] = value; |
| 2545 |
} |
| 2546 |
|
| 2547 |
return !isNumericKey; |
| 2548 |
} |
| 2549 |
|
| 2550 |
if (!target[name] || !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(target[name])) { |
| 2551 |
target[name] = []; |
| 2552 |
} |
| 2553 |
|
| 2554 |
const result = buildPath(path, value, target[name], index); |
| 2555 |
|
| 2556 |
if (result && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(target[name])) { |
| 2557 |
target[name] = arrayToObject(target[name]); |
| 2558 |
} |
| 2559 |
|
| 2560 |
return !isNumericKey; |
| 2561 |
} |
| 2562 |
|
| 2563 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFormData(formData) && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(formData.entries)) { |
| 2564 |
const obj = {}; |
| 2565 |
|
| 2566 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEachEntry(formData, (name, value) => { |
| 2567 |
buildPath(parsePropPath(name), value, obj, 0); |
| 2568 |
}); |
| 2569 |
|
| 2570 |
return obj; |
| 2571 |
} |
| 2572 |
|
| 2573 |
return null; |
| 2574 |
} |
| 2575 |
|
| 2576 |
/* harmony default export */ __webpack_exports__["default"] = (formDataToJSON); |
| 2577 |
|
| 2578 |
|
| 2579 |
/***/ }), |
| 2580 |
|
| 2581 |
/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": |
| 2582 |
/*!*********************************************************!*\ |
| 2583 |
!*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! |
| 2584 |
\*********************************************************/ |
| 2585 |
/*! exports provided: default */ |
| 2586 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2587 |
|
| 2588 |
"use strict"; |
| 2589 |
__webpack_require__.r(__webpack_exports__); |
| 2590 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isAbsoluteURL; }); |
| 2591 |
|
| 2592 |
|
| 2593 |
/** |
| 2594 |
* Determines whether the specified URL is absolute |
| 2595 |
* |
| 2596 |
* @param {string} url The URL to test |
| 2597 |
* |
| 2598 |
* @returns {boolean} True if the specified URL is absolute, otherwise false |
| 2599 |
*/ |
| 2600 |
function isAbsoluteURL(url) { |
| 2601 |
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). |
| 2602 |
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed |
| 2603 |
// by any combination of letters, digits, plus, period, or hyphen. |
| 2604 |
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); |
| 2605 |
} |
| 2606 |
|
| 2607 |
|
| 2608 |
/***/ }), |
| 2609 |
|
| 2610 |
/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": |
| 2611 |
/*!********************************************************!*\ |
| 2612 |
!*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! |
| 2613 |
\********************************************************/ |
| 2614 |
/*! exports provided: default */ |
| 2615 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2616 |
|
| 2617 |
"use strict"; |
| 2618 |
__webpack_require__.r(__webpack_exports__); |
| 2619 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isAxiosError; }); |
| 2620 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2621 |
|
| 2622 |
|
| 2623 |
|
| 2624 |
|
| 2625 |
/** |
| 2626 |
* Determines whether the payload is an error thrown by Axios |
| 2627 |
* |
| 2628 |
* @param {*} payload The value to test |
| 2629 |
* |
| 2630 |
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false |
| 2631 |
*/ |
| 2632 |
function isAxiosError(payload) { |
| 2633 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(payload) && (payload.isAxiosError === true); |
| 2634 |
} |
| 2635 |
|
| 2636 |
|
| 2637 |
/***/ }), |
| 2638 |
|
| 2639 |
/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": |
| 2640 |
/*!***********************************************************!*\ |
| 2641 |
!*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! |
| 2642 |
\***********************************************************/ |
| 2643 |
/*! exports provided: default */ |
| 2644 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2645 |
|
| 2646 |
"use strict"; |
| 2647 |
__webpack_require__.r(__webpack_exports__); |
| 2648 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2649 |
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); |
| 2650 |
|
| 2651 |
|
| 2652 |
|
| 2653 |
|
| 2654 |
|
| 2655 |
/* harmony default export */ __webpack_exports__["default"] = (_platform_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].hasStandardBrowserEnv ? |
| 2656 |
|
| 2657 |
// Standard browser envs have full support of the APIs needed to test |
| 2658 |
// whether the request URL is of the same origin as current location. |
| 2659 |
(function standardBrowserEnv() { |
| 2660 |
const msie = /(msie|trident)/i.test(navigator.userAgent); |
| 2661 |
const urlParsingNode = document.createElement('a'); |
| 2662 |
let originURL; |
| 2663 |
|
| 2664 |
/** |
| 2665 |
* Parse a URL to discover its components |
| 2666 |
* |
| 2667 |
* @param {String} url The URL to be parsed |
| 2668 |
* @returns {Object} |
| 2669 |
*/ |
| 2670 |
function resolveURL(url) { |
| 2671 |
let href = url; |
| 2672 |
|
| 2673 |
if (msie) { |
| 2674 |
// IE needs attribute set twice to normalize properties |
| 2675 |
urlParsingNode.setAttribute('href', href); |
| 2676 |
href = urlParsingNode.href; |
| 2677 |
} |
| 2678 |
|
| 2679 |
urlParsingNode.setAttribute('href', href); |
| 2680 |
|
| 2681 |
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 2682 |
return { |
| 2683 |
href: urlParsingNode.href, |
| 2684 |
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 2685 |
host: urlParsingNode.host, |
| 2686 |
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 2687 |
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 2688 |
hostname: urlParsingNode.hostname, |
| 2689 |
port: urlParsingNode.port, |
| 2690 |
pathname: (urlParsingNode.pathname.charAt(0) === '/') ? |
| 2691 |
urlParsingNode.pathname : |
| 2692 |
'/' + urlParsingNode.pathname |
| 2693 |
}; |
| 2694 |
} |
| 2695 |
|
| 2696 |
originURL = resolveURL(window.location.href); |
| 2697 |
|
| 2698 |
/** |
| 2699 |
* Determine if a URL shares the same origin as the current location |
| 2700 |
* |
| 2701 |
* @param {String} requestURL The URL to test |
| 2702 |
* @returns {boolean} True if URL shares the same origin, otherwise false |
| 2703 |
*/ |
| 2704 |
return function isURLSameOrigin(requestURL) { |
| 2705 |
const parsed = (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(requestURL)) ? resolveURL(requestURL) : requestURL; |
| 2706 |
return (parsed.protocol === originURL.protocol && |
| 2707 |
parsed.host === originURL.host); |
| 2708 |
}; |
| 2709 |
})() : |
| 2710 |
|
| 2711 |
// Non standard browser envs (web workers, react-native) lack needed support. |
| 2712 |
(function nonStandardBrowserEnv() { |
| 2713 |
return function isURLSameOrigin() { |
| 2714 |
return true; |
| 2715 |
}; |
| 2716 |
})()); |
| 2717 |
|
| 2718 |
|
| 2719 |
/***/ }), |
| 2720 |
|
| 2721 |
/***/ "./node_modules/axios/lib/helpers/null.js": |
| 2722 |
/*!************************************************!*\ |
| 2723 |
!*** ./node_modules/axios/lib/helpers/null.js ***! |
| 2724 |
\************************************************/ |
| 2725 |
/*! exports provided: default */ |
| 2726 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2727 |
|
| 2728 |
"use strict"; |
| 2729 |
__webpack_require__.r(__webpack_exports__); |
| 2730 |
// eslint-disable-next-line strict |
| 2731 |
/* harmony default export */ __webpack_exports__["default"] = (null); |
| 2732 |
|
| 2733 |
|
| 2734 |
/***/ }), |
| 2735 |
|
| 2736 |
/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": |
| 2737 |
/*!********************************************************!*\ |
| 2738 |
!*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! |
| 2739 |
\********************************************************/ |
| 2740 |
/*! exports provided: default */ |
| 2741 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2742 |
|
| 2743 |
"use strict"; |
| 2744 |
__webpack_require__.r(__webpack_exports__); |
| 2745 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2746 |
|
| 2747 |
|
| 2748 |
|
| 2749 |
|
| 2750 |
// RawAxiosHeaders whose duplicates are ignored by node |
| 2751 |
// c.f. https://nodejs.org/api/http.html#http_message_headers |
| 2752 |
const ignoreDuplicateOf = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toObjectSet([ |
| 2753 |
'age', 'authorization', 'content-length', 'content-type', 'etag', |
| 2754 |
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', |
| 2755 |
'last-modified', 'location', 'max-forwards', 'proxy-authorization', |
| 2756 |
'referer', 'retry-after', 'user-agent' |
| 2757 |
]); |
| 2758 |
|
| 2759 |
/** |
| 2760 |
* Parse headers into an object |
| 2761 |
* |
| 2762 |
* ``` |
| 2763 |
* Date: Wed, 27 Aug 2014 08:58:49 GMT |
| 2764 |
* Content-Type: application/json |
| 2765 |
* Connection: keep-alive |
| 2766 |
* Transfer-Encoding: chunked |
| 2767 |
* ``` |
| 2768 |
* |
| 2769 |
* @param {String} rawHeaders Headers needing to be parsed |
| 2770 |
* |
| 2771 |
* @returns {Object} Headers parsed into an object |
| 2772 |
*/ |
| 2773 |
/* harmony default export */ __webpack_exports__["default"] = (rawHeaders => { |
| 2774 |
const parsed = {}; |
| 2775 |
let key; |
| 2776 |
let val; |
| 2777 |
let i; |
| 2778 |
|
| 2779 |
rawHeaders && rawHeaders.split('\n').forEach(function parser(line) { |
| 2780 |
i = line.indexOf(':'); |
| 2781 |
key = line.substring(0, i).trim().toLowerCase(); |
| 2782 |
val = line.substring(i + 1).trim(); |
| 2783 |
|
| 2784 |
if (!key || (parsed[key] && ignoreDuplicateOf[key])) { |
| 2785 |
return; |
| 2786 |
} |
| 2787 |
|
| 2788 |
if (key === 'set-cookie') { |
| 2789 |
if (parsed[key]) { |
| 2790 |
parsed[key].push(val); |
| 2791 |
} else { |
| 2792 |
parsed[key] = [val]; |
| 2793 |
} |
| 2794 |
} else { |
| 2795 |
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; |
| 2796 |
} |
| 2797 |
}); |
| 2798 |
|
| 2799 |
return parsed; |
| 2800 |
}); |
| 2801 |
|
| 2802 |
|
| 2803 |
/***/ }), |
| 2804 |
|
| 2805 |
/***/ "./node_modules/axios/lib/helpers/parseProtocol.js": |
| 2806 |
/*!*********************************************************!*\ |
| 2807 |
!*** ./node_modules/axios/lib/helpers/parseProtocol.js ***! |
| 2808 |
\*********************************************************/ |
| 2809 |
/*! exports provided: default */ |
| 2810 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2811 |
|
| 2812 |
"use strict"; |
| 2813 |
__webpack_require__.r(__webpack_exports__); |
| 2814 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return parseProtocol; }); |
| 2815 |
|
| 2816 |
|
| 2817 |
function parseProtocol(url) { |
| 2818 |
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); |
| 2819 |
return match && match[1] || ''; |
| 2820 |
} |
| 2821 |
|
| 2822 |
|
| 2823 |
/***/ }), |
| 2824 |
|
| 2825 |
/***/ "./node_modules/axios/lib/helpers/speedometer.js": |
| 2826 |
/*!*******************************************************!*\ |
| 2827 |
!*** ./node_modules/axios/lib/helpers/speedometer.js ***! |
| 2828 |
\*******************************************************/ |
| 2829 |
/*! exports provided: default */ |
| 2830 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2831 |
|
| 2832 |
"use strict"; |
| 2833 |
__webpack_require__.r(__webpack_exports__); |
| 2834 |
|
| 2835 |
|
| 2836 |
/** |
| 2837 |
* Calculate data maxRate |
| 2838 |
* @param {Number} [samplesCount= 10] |
| 2839 |
* @param {Number} [min= 1000] |
| 2840 |
* @returns {Function} |
| 2841 |
*/ |
| 2842 |
function speedometer(samplesCount, min) { |
| 2843 |
samplesCount = samplesCount || 10; |
| 2844 |
const bytes = new Array(samplesCount); |
| 2845 |
const timestamps = new Array(samplesCount); |
| 2846 |
let head = 0; |
| 2847 |
let tail = 0; |
| 2848 |
let firstSampleTS; |
| 2849 |
|
| 2850 |
min = min !== undefined ? min : 1000; |
| 2851 |
|
| 2852 |
return function push(chunkLength) { |
| 2853 |
const now = Date.now(); |
| 2854 |
|
| 2855 |
const startedAt = timestamps[tail]; |
| 2856 |
|
| 2857 |
if (!firstSampleTS) { |
| 2858 |
firstSampleTS = now; |
| 2859 |
} |
| 2860 |
|
| 2861 |
bytes[head] = chunkLength; |
| 2862 |
timestamps[head] = now; |
| 2863 |
|
| 2864 |
let i = tail; |
| 2865 |
let bytesCount = 0; |
| 2866 |
|
| 2867 |
while (i !== head) { |
| 2868 |
bytesCount += bytes[i++]; |
| 2869 |
i = i % samplesCount; |
| 2870 |
} |
| 2871 |
|
| 2872 |
head = (head + 1) % samplesCount; |
| 2873 |
|
| 2874 |
if (head === tail) { |
| 2875 |
tail = (tail + 1) % samplesCount; |
| 2876 |
} |
| 2877 |
|
| 2878 |
if (now - firstSampleTS < min) { |
| 2879 |
return; |
| 2880 |
} |
| 2881 |
|
| 2882 |
const passed = startedAt && now - startedAt; |
| 2883 |
|
| 2884 |
return passed ? Math.round(bytesCount * 1000 / passed) : undefined; |
| 2885 |
}; |
| 2886 |
} |
| 2887 |
|
| 2888 |
/* harmony default export */ __webpack_exports__["default"] = (speedometer); |
| 2889 |
|
| 2890 |
|
| 2891 |
/***/ }), |
| 2892 |
|
| 2893 |
/***/ "./node_modules/axios/lib/helpers/spread.js": |
| 2894 |
/*!**************************************************!*\ |
| 2895 |
!*** ./node_modules/axios/lib/helpers/spread.js ***! |
| 2896 |
\**************************************************/ |
| 2897 |
/*! exports provided: default */ |
| 2898 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2899 |
|
| 2900 |
"use strict"; |
| 2901 |
__webpack_require__.r(__webpack_exports__); |
| 2902 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return spread; }); |
| 2903 |
|
| 2904 |
|
| 2905 |
/** |
| 2906 |
* Syntactic sugar for invoking a function and expanding an array for arguments. |
| 2907 |
* |
| 2908 |
* Common use case would be to use `Function.prototype.apply`. |
| 2909 |
* |
| 2910 |
* ```js |
| 2911 |
* function f(x, y, z) {} |
| 2912 |
* var args = [1, 2, 3]; |
| 2913 |
* f.apply(null, args); |
| 2914 |
* ``` |
| 2915 |
* |
| 2916 |
* With `spread` this example can be re-written. |
| 2917 |
* |
| 2918 |
* ```js |
| 2919 |
* spread(function(x, y, z) {})([1, 2, 3]); |
| 2920 |
* ``` |
| 2921 |
* |
| 2922 |
* @param {Function} callback |
| 2923 |
* |
| 2924 |
* @returns {Function} |
| 2925 |
*/ |
| 2926 |
function spread(callback) { |
| 2927 |
return function wrap(arr) { |
| 2928 |
return callback.apply(null, arr); |
| 2929 |
}; |
| 2930 |
} |
| 2931 |
|
| 2932 |
|
| 2933 |
/***/ }), |
| 2934 |
|
| 2935 |
/***/ "./node_modules/axios/lib/helpers/toFormData.js": |
| 2936 |
/*!******************************************************!*\ |
| 2937 |
!*** ./node_modules/axios/lib/helpers/toFormData.js ***! |
| 2938 |
\******************************************************/ |
| 2939 |
/*! exports provided: default */ |
| 2940 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 2941 |
|
| 2942 |
"use strict"; |
| 2943 |
__webpack_require__.r(__webpack_exports__); |
| 2944 |
/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 2945 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 2946 |
/* harmony import */ var _platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/node/classes/FormData.js */ "./node_modules/axios/lib/helpers/null.js"); |
| 2947 |
|
| 2948 |
|
| 2949 |
|
| 2950 |
|
| 2951 |
// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored |
| 2952 |
|
| 2953 |
|
| 2954 |
/** |
| 2955 |
* Determines if the given thing is a array or js object. |
| 2956 |
* |
| 2957 |
* @param {string} thing - The object or array to be visited. |
| 2958 |
* |
| 2959 |
* @returns {boolean} |
| 2960 |
*/ |
| 2961 |
function isVisitable(thing) { |
| 2962 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isPlainObject(thing) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(thing); |
| 2963 |
} |
| 2964 |
|
| 2965 |
/** |
| 2966 |
* It removes the brackets from the end of a string |
| 2967 |
* |
| 2968 |
* @param {string} key - The key of the parameter. |
| 2969 |
* |
| 2970 |
* @returns {string} the key without the brackets. |
| 2971 |
*/ |
| 2972 |
function removeBrackets(key) { |
| 2973 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]') ? key.slice(0, -2) : key; |
| 2974 |
} |
| 2975 |
|
| 2976 |
/** |
| 2977 |
* It takes a path, a key, and a boolean, and returns a string |
| 2978 |
* |
| 2979 |
* @param {string} path - The path to the current key. |
| 2980 |
* @param {string} key - The key of the current object being iterated over. |
| 2981 |
* @param {string} dots - If true, the key will be rendered with dots instead of brackets. |
| 2982 |
* |
| 2983 |
* @returns {string} The path to the current key. |
| 2984 |
*/ |
| 2985 |
function renderKey(path, key, dots) { |
| 2986 |
if (!path) return key; |
| 2987 |
return path.concat(key).map(function each(token, i) { |
| 2988 |
// eslint-disable-next-line no-param-reassign |
| 2989 |
token = removeBrackets(token); |
| 2990 |
return !dots && i ? '[' + token + ']' : token; |
| 2991 |
}).join(dots ? '.' : ''); |
| 2992 |
} |
| 2993 |
|
| 2994 |
/** |
| 2995 |
* If the array is an array and none of its elements are visitable, then it's a flat array. |
| 2996 |
* |
| 2997 |
* @param {Array<any>} arr - The array to check |
| 2998 |
* |
| 2999 |
* @returns {boolean} |
| 3000 |
*/ |
| 3001 |
function isFlatArray(arr) { |
| 3002 |
return _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(arr) && !arr.some(isVisitable); |
| 3003 |
} |
| 3004 |
|
| 3005 |
const predicates = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"], {}, null, function filter(prop) { |
| 3006 |
return /^is[A-Z]/.test(prop); |
| 3007 |
}); |
| 3008 |
|
| 3009 |
/** |
| 3010 |
* Convert a data object to FormData |
| 3011 |
* |
| 3012 |
* @param {Object} obj |
| 3013 |
* @param {?Object} [formData] |
| 3014 |
* @param {?Object} [options] |
| 3015 |
* @param {Function} [options.visitor] |
| 3016 |
* @param {Boolean} [options.metaTokens = true] |
| 3017 |
* @param {Boolean} [options.dots = false] |
| 3018 |
* @param {?Boolean} [options.indexes = false] |
| 3019 |
* |
| 3020 |
* @returns {Object} |
| 3021 |
**/ |
| 3022 |
|
| 3023 |
/** |
| 3024 |
* It converts an object into a FormData object |
| 3025 |
* |
| 3026 |
* @param {Object<any, any>} obj - The object to convert to form data. |
| 3027 |
* @param {string} formData - The FormData object to append to. |
| 3028 |
* @param {Object<string, any>} options |
| 3029 |
* |
| 3030 |
* @returns |
| 3031 |
*/ |
| 3032 |
function toFormData(obj, formData, options) { |
| 3033 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { |
| 3034 |
throw new TypeError('target must be an object'); |
| 3035 |
} |
| 3036 |
|
| 3037 |
// eslint-disable-next-line no-param-reassign |
| 3038 |
formData = formData || new (_platform_node_classes_FormData_js__WEBPACK_IMPORTED_MODULE_2__["default"] || FormData)(); |
| 3039 |
|
| 3040 |
// eslint-disable-next-line no-param-reassign |
| 3041 |
options = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toFlatObject(options, { |
| 3042 |
metaTokens: true, |
| 3043 |
dots: false, |
| 3044 |
indexes: false |
| 3045 |
}, false, function defined(option, source) { |
| 3046 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 3047 |
return !_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(source[option]); |
| 3048 |
}); |
| 3049 |
|
| 3050 |
const metaTokens = options.metaTokens; |
| 3051 |
// eslint-disable-next-line no-use-before-define |
| 3052 |
const visitor = options.visitor || defaultVisitor; |
| 3053 |
const dots = options.dots; |
| 3054 |
const indexes = options.indexes; |
| 3055 |
const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob; |
| 3056 |
const useBlob = _Blob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isSpecCompliantForm(formData); |
| 3057 |
|
| 3058 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFunction(visitor)) { |
| 3059 |
throw new TypeError('visitor must be a function'); |
| 3060 |
} |
| 3061 |
|
| 3062 |
function convertValue(value) { |
| 3063 |
if (value === null) return ''; |
| 3064 |
|
| 3065 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isDate(value)) { |
| 3066 |
return value.toISOString(); |
| 3067 |
} |
| 3068 |
|
| 3069 |
if (!useBlob && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBlob(value)) { |
| 3070 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Blob is not supported. Use a Buffer instead.'); |
| 3071 |
} |
| 3072 |
|
| 3073 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArrayBuffer(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isTypedArray(value)) { |
| 3074 |
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value); |
| 3075 |
} |
| 3076 |
|
| 3077 |
return value; |
| 3078 |
} |
| 3079 |
|
| 3080 |
/** |
| 3081 |
* Default visitor. |
| 3082 |
* |
| 3083 |
* @param {*} value |
| 3084 |
* @param {String|Number} key |
| 3085 |
* @param {Array<String|Number>} path |
| 3086 |
* @this {FormData} |
| 3087 |
* |
| 3088 |
* @returns {boolean} return true to visit the each prop of the value recursively |
| 3089 |
*/ |
| 3090 |
function defaultVisitor(value, key, path) { |
| 3091 |
let arr = value; |
| 3092 |
|
| 3093 |
if (value && !path && typeof value === 'object') { |
| 3094 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '{}')) { |
| 3095 |
// eslint-disable-next-line no-param-reassign |
| 3096 |
key = metaTokens ? key : key.slice(0, -2); |
| 3097 |
// eslint-disable-next-line no-param-reassign |
| 3098 |
value = JSON.stringify(value); |
| 3099 |
} else if ( |
| 3100 |
(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isArray(value) && isFlatArray(value)) || |
| 3101 |
((_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isFileList(value) || _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].endsWith(key, '[]')) && (arr = _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].toArray(value)) |
| 3102 |
)) { |
| 3103 |
// eslint-disable-next-line no-param-reassign |
| 3104 |
key = removeBrackets(key); |
| 3105 |
|
| 3106 |
arr.forEach(function each(el, index) { |
| 3107 |
!(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && formData.append( |
| 3108 |
// eslint-disable-next-line no-nested-ternary |
| 3109 |
indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'), |
| 3110 |
convertValue(el) |
| 3111 |
); |
| 3112 |
}); |
| 3113 |
return false; |
| 3114 |
} |
| 3115 |
} |
| 3116 |
|
| 3117 |
if (isVisitable(value)) { |
| 3118 |
return true; |
| 3119 |
} |
| 3120 |
|
| 3121 |
formData.append(renderKey(path, key, dots), convertValue(value)); |
| 3122 |
|
| 3123 |
return false; |
| 3124 |
} |
| 3125 |
|
| 3126 |
const stack = []; |
| 3127 |
|
| 3128 |
const exposedHelpers = Object.assign(predicates, { |
| 3129 |
defaultVisitor, |
| 3130 |
convertValue, |
| 3131 |
isVisitable |
| 3132 |
}); |
| 3133 |
|
| 3134 |
function build(value, path) { |
| 3135 |
if (_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(value)) return; |
| 3136 |
|
| 3137 |
if (stack.indexOf(value) !== -1) { |
| 3138 |
throw Error('Circular reference detected in ' + path.join('.')); |
| 3139 |
} |
| 3140 |
|
| 3141 |
stack.push(value); |
| 3142 |
|
| 3143 |
_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].forEach(value, function each(el, key) { |
| 3144 |
const result = !(_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isUndefined(el) || el === null) && visitor.call( |
| 3145 |
formData, el, _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isString(key) ? key.trim() : key, path, exposedHelpers |
| 3146 |
); |
| 3147 |
|
| 3148 |
if (result === true) { |
| 3149 |
build(el, path ? path.concat(key) : [key]); |
| 3150 |
} |
| 3151 |
}); |
| 3152 |
|
| 3153 |
stack.pop(); |
| 3154 |
} |
| 3155 |
|
| 3156 |
if (!_utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isObject(obj)) { |
| 3157 |
throw new TypeError('data must be an object'); |
| 3158 |
} |
| 3159 |
|
| 3160 |
build(obj); |
| 3161 |
|
| 3162 |
return formData; |
| 3163 |
} |
| 3164 |
|
| 3165 |
/* harmony default export */ __webpack_exports__["default"] = (toFormData); |
| 3166 |
|
| 3167 |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node-libs-browser/node_modules/buffer/index.js */ "./node_modules/node-libs-browser/node_modules/buffer/index.js").Buffer)) |
| 3168 |
|
| 3169 |
/***/ }), |
| 3170 |
|
| 3171 |
/***/ "./node_modules/axios/lib/helpers/toURLEncodedForm.js": |
| 3172 |
/*!************************************************************!*\ |
| 3173 |
!*** ./node_modules/axios/lib/helpers/toURLEncodedForm.js ***! |
| 3174 |
\************************************************************/ |
| 3175 |
/*! exports provided: default */ |
| 3176 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3177 |
|
| 3178 |
"use strict"; |
| 3179 |
__webpack_require__.r(__webpack_exports__); |
| 3180 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return toURLEncodedForm; }); |
| 3181 |
/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils.js */ "./node_modules/axios/lib/utils.js"); |
| 3182 |
/* harmony import */ var _toFormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toFormData.js */ "./node_modules/axios/lib/helpers/toFormData.js"); |
| 3183 |
/* harmony import */ var _platform_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform/index.js */ "./node_modules/axios/lib/platform/index.js"); |
| 3184 |
|
| 3185 |
|
| 3186 |
|
| 3187 |
|
| 3188 |
|
| 3189 |
|
| 3190 |
function toURLEncodedForm(data, options) { |
| 3191 |
return Object(_toFormData_js__WEBPACK_IMPORTED_MODULE_1__["default"])(data, new _platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].classes.URLSearchParams(), Object.assign({ |
| 3192 |
visitor: function(value, key, path, helpers) { |
| 3193 |
if (_platform_index_js__WEBPACK_IMPORTED_MODULE_2__["default"].isNode && _utils_js__WEBPACK_IMPORTED_MODULE_0__["default"].isBuffer(value)) { |
| 3194 |
this.append(key, value.toString('base64')); |
| 3195 |
return false; |
| 3196 |
} |
| 3197 |
|
| 3198 |
return helpers.defaultVisitor.apply(this, arguments); |
| 3199 |
} |
| 3200 |
}, options)); |
| 3201 |
} |
| 3202 |
|
| 3203 |
|
| 3204 |
/***/ }), |
| 3205 |
|
| 3206 |
/***/ "./node_modules/axios/lib/helpers/validator.js": |
| 3207 |
/*!*****************************************************!*\ |
| 3208 |
!*** ./node_modules/axios/lib/helpers/validator.js ***! |
| 3209 |
\*****************************************************/ |
| 3210 |
/*! exports provided: default */ |
| 3211 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3212 |
|
| 3213 |
"use strict"; |
| 3214 |
__webpack_require__.r(__webpack_exports__); |
| 3215 |
/* harmony import */ var _env_data_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env/data.js */ "./node_modules/axios/lib/env/data.js"); |
| 3216 |
/* harmony import */ var _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/AxiosError.js */ "./node_modules/axios/lib/core/AxiosError.js"); |
| 3217 |
|
| 3218 |
|
| 3219 |
|
| 3220 |
|
| 3221 |
|
| 3222 |
const validators = {}; |
| 3223 |
|
| 3224 |
// eslint-disable-next-line func-names |
| 3225 |
['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => { |
| 3226 |
validators[type] = function validator(thing) { |
| 3227 |
return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; |
| 3228 |
}; |
| 3229 |
}); |
| 3230 |
|
| 3231 |
const deprecatedWarnings = {}; |
| 3232 |
|
| 3233 |
/** |
| 3234 |
* Transitional option validator |
| 3235 |
* |
| 3236 |
* @param {function|boolean?} validator - set to false if the transitional option has been removed |
| 3237 |
* @param {string?} version - deprecated version / removed since version |
| 3238 |
* @param {string?} message - some message with additional info |
| 3239 |
* |
| 3240 |
* @returns {function} |
| 3241 |
*/ |
| 3242 |
validators.transitional = function transitional(validator, version, message) { |
| 3243 |
function formatMessage(opt, desc) { |
| 3244 |
return '[Axios v' + _env_data_js__WEBPACK_IMPORTED_MODULE_0__["VERSION"] + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); |
| 3245 |
} |
| 3246 |
|
| 3247 |
// eslint-disable-next-line func-names |
| 3248 |
return (value, opt, opts) => { |
| 3249 |
if (validator === false) { |
| 3250 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]( |
| 3251 |
formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')), |
| 3252 |
_core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_DEPRECATED |
| 3253 |
); |
| 3254 |
} |
| 3255 |
|
| 3256 |
if (version && !deprecatedWarnings[opt]) { |
| 3257 |
deprecatedWarnings[opt] = true; |
| 3258 |
// eslint-disable-next-line no-console |
| 3259 |
console.warn( |
| 3260 |
formatMessage( |
| 3261 |
opt, |
| 3262 |
' has been deprecated since v' + version + ' and will be removed in the near future' |
| 3263 |
) |
| 3264 |
); |
| 3265 |
} |
| 3266 |
|
| 3267 |
return validator ? validator(value, opt, opts) : true; |
| 3268 |
}; |
| 3269 |
}; |
| 3270 |
|
| 3271 |
/** |
| 3272 |
* Assert object's properties type |
| 3273 |
* |
| 3274 |
* @param {object} options |
| 3275 |
* @param {object} schema |
| 3276 |
* @param {boolean?} allowUnknown |
| 3277 |
* |
| 3278 |
* @returns {object} |
| 3279 |
*/ |
| 3280 |
|
| 3281 |
function assertOptions(options, schema, allowUnknown) { |
| 3282 |
if (typeof options !== 'object') { |
| 3283 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('options must be an object', _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); |
| 3284 |
} |
| 3285 |
const keys = Object.keys(options); |
| 3286 |
let i = keys.length; |
| 3287 |
while (i-- > 0) { |
| 3288 |
const opt = keys[i]; |
| 3289 |
const validator = schema[opt]; |
| 3290 |
if (validator) { |
| 3291 |
const value = options[opt]; |
| 3292 |
const result = value === undefined || validator(value, opt, options); |
| 3293 |
if (result !== true) { |
| 3294 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('option ' + opt + ' must be ' + result, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION_VALUE); |
| 3295 |
} |
| 3296 |
continue; |
| 3297 |
} |
| 3298 |
if (allowUnknown !== true) { |
| 3299 |
throw new _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"]('Unknown option ' + opt, _core_AxiosError_js__WEBPACK_IMPORTED_MODULE_1__["default"].ERR_BAD_OPTION); |
| 3300 |
} |
| 3301 |
} |
| 3302 |
} |
| 3303 |
|
| 3304 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 3305 |
assertOptions, |
| 3306 |
validators |
| 3307 |
}); |
| 3308 |
|
| 3309 |
|
| 3310 |
/***/ }), |
| 3311 |
|
| 3312 |
/***/ "./node_modules/axios/lib/platform/browser/classes/Blob.js": |
| 3313 |
/*!*****************************************************************!*\ |
| 3314 |
!*** ./node_modules/axios/lib/platform/browser/classes/Blob.js ***! |
| 3315 |
\*****************************************************************/ |
| 3316 |
/*! exports provided: default */ |
| 3317 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3318 |
|
| 3319 |
"use strict"; |
| 3320 |
__webpack_require__.r(__webpack_exports__); |
| 3321 |
|
| 3322 |
|
| 3323 |
/* harmony default export */ __webpack_exports__["default"] = (typeof Blob !== 'undefined' ? Blob : null); |
| 3324 |
|
| 3325 |
|
| 3326 |
/***/ }), |
| 3327 |
|
| 3328 |
/***/ "./node_modules/axios/lib/platform/browser/classes/FormData.js": |
| 3329 |
/*!*********************************************************************!*\ |
| 3330 |
!*** ./node_modules/axios/lib/platform/browser/classes/FormData.js ***! |
| 3331 |
\*********************************************************************/ |
| 3332 |
/*! exports provided: default */ |
| 3333 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3334 |
|
| 3335 |
"use strict"; |
| 3336 |
__webpack_require__.r(__webpack_exports__); |
| 3337 |
|
| 3338 |
|
| 3339 |
/* harmony default export */ __webpack_exports__["default"] = (typeof FormData !== 'undefined' ? FormData : null); |
| 3340 |
|
| 3341 |
|
| 3342 |
/***/ }), |
| 3343 |
|
| 3344 |
/***/ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js": |
| 3345 |
/*!****************************************************************************!*\ |
| 3346 |
!*** ./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js ***! |
| 3347 |
\****************************************************************************/ |
| 3348 |
/*! exports provided: default */ |
| 3349 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3350 |
|
| 3351 |
"use strict"; |
| 3352 |
__webpack_require__.r(__webpack_exports__); |
| 3353 |
/* harmony import */ var _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../helpers/AxiosURLSearchParams.js */ "./node_modules/axios/lib/helpers/AxiosURLSearchParams.js"); |
| 3354 |
|
| 3355 |
|
| 3356 |
|
| 3357 |
/* harmony default export */ __webpack_exports__["default"] = (typeof URLSearchParams !== 'undefined' ? URLSearchParams : _helpers_AxiosURLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"]); |
| 3358 |
|
| 3359 |
|
| 3360 |
/***/ }), |
| 3361 |
|
| 3362 |
/***/ "./node_modules/axios/lib/platform/browser/index.js": |
| 3363 |
/*!**********************************************************!*\ |
| 3364 |
!*** ./node_modules/axios/lib/platform/browser/index.js ***! |
| 3365 |
\**********************************************************/ |
| 3366 |
/*! exports provided: default */ |
| 3367 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3368 |
|
| 3369 |
"use strict"; |
| 3370 |
__webpack_require__.r(__webpack_exports__); |
| 3371 |
/* harmony import */ var _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./classes/URLSearchParams.js */ "./node_modules/axios/lib/platform/browser/classes/URLSearchParams.js"); |
| 3372 |
/* harmony import */ var _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./classes/FormData.js */ "./node_modules/axios/lib/platform/browser/classes/FormData.js"); |
| 3373 |
/* harmony import */ var _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./classes/Blob.js */ "./node_modules/axios/lib/platform/browser/classes/Blob.js"); |
| 3374 |
|
| 3375 |
|
| 3376 |
|
| 3377 |
|
| 3378 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 3379 |
isBrowser: true, |
| 3380 |
classes: { |
| 3381 |
URLSearchParams: _classes_URLSearchParams_js__WEBPACK_IMPORTED_MODULE_0__["default"], |
| 3382 |
FormData: _classes_FormData_js__WEBPACK_IMPORTED_MODULE_1__["default"], |
| 3383 |
Blob: _classes_Blob_js__WEBPACK_IMPORTED_MODULE_2__["default"] |
| 3384 |
}, |
| 3385 |
protocols: ['http', 'https', 'file', 'blob', 'url', 'data'] |
| 3386 |
}); |
| 3387 |
|
| 3388 |
|
| 3389 |
/***/ }), |
| 3390 |
|
| 3391 |
/***/ "./node_modules/axios/lib/platform/common/utils.js": |
| 3392 |
/*!*********************************************************!*\ |
| 3393 |
!*** ./node_modules/axios/lib/platform/common/utils.js ***! |
| 3394 |
\*********************************************************/ |
| 3395 |
/*! exports provided: hasBrowserEnv, hasStandardBrowserWebWorkerEnv, hasStandardBrowserEnv */ |
| 3396 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3397 |
|
| 3398 |
"use strict"; |
| 3399 |
__webpack_require__.r(__webpack_exports__); |
| 3400 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasBrowserEnv", function() { return hasBrowserEnv; }); |
| 3401 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasStandardBrowserWebWorkerEnv", function() { return hasStandardBrowserWebWorkerEnv; }); |
| 3402 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasStandardBrowserEnv", function() { return hasStandardBrowserEnv; }); |
| 3403 |
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined'; |
| 3404 |
|
| 3405 |
/** |
| 3406 |
* Determine if we're running in a standard browser environment |
| 3407 |
* |
| 3408 |
* This allows axios to run in a web worker, and react-native. |
| 3409 |
* Both environments support XMLHttpRequest, but not fully standard globals. |
| 3410 |
* |
| 3411 |
* web workers: |
| 3412 |
* typeof window -> undefined |
| 3413 |
* typeof document -> undefined |
| 3414 |
* |
| 3415 |
* react-native: |
| 3416 |
* navigator.product -> 'ReactNative' |
| 3417 |
* nativescript |
| 3418 |
* navigator.product -> 'NativeScript' or 'NS' |
| 3419 |
* |
| 3420 |
* @returns {boolean} |
| 3421 |
*/ |
| 3422 |
const hasStandardBrowserEnv = ( |
| 3423 |
(product) => { |
| 3424 |
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0 |
| 3425 |
})(typeof navigator !== 'undefined' && navigator.product); |
| 3426 |
|
| 3427 |
/** |
| 3428 |
* Determine if we're running in a standard browser webWorker environment |
| 3429 |
* |
| 3430 |
* Although the `isStandardBrowserEnv` method indicates that |
| 3431 |
* `allows axios to run in a web worker`, the WebWorker will still be |
| 3432 |
* filtered out due to its judgment standard |
| 3433 |
* `typeof window !== 'undefined' && typeof document !== 'undefined'`. |
| 3434 |
* This leads to a problem when axios post `FormData` in webWorker |
| 3435 |
*/ |
| 3436 |
const hasStandardBrowserWebWorkerEnv = (() => { |
| 3437 |
return ( |
| 3438 |
typeof WorkerGlobalScope !== 'undefined' && |
| 3439 |
// eslint-disable-next-line no-undef |
| 3440 |
self instanceof WorkerGlobalScope && |
| 3441 |
typeof self.importScripts === 'function' |
| 3442 |
); |
| 3443 |
})(); |
| 3444 |
|
| 3445 |
|
| 3446 |
|
| 3447 |
|
| 3448 |
/***/ }), |
| 3449 |
|
| 3450 |
/***/ "./node_modules/axios/lib/platform/index.js": |
| 3451 |
/*!**************************************************!*\ |
| 3452 |
!*** ./node_modules/axios/lib/platform/index.js ***! |
| 3453 |
\**************************************************/ |
| 3454 |
/*! exports provided: default */ |
| 3455 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3456 |
|
| 3457 |
"use strict"; |
| 3458 |
__webpack_require__.r(__webpack_exports__); |
| 3459 |
/* harmony import */ var _node_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node/index.js */ "./node_modules/axios/lib/platform/browser/index.js"); |
| 3460 |
/* harmony import */ var _common_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/utils.js */ "./node_modules/axios/lib/platform/common/utils.js"); |
| 3461 |
|
| 3462 |
|
| 3463 |
|
| 3464 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 3465 |
..._common_utils_js__WEBPACK_IMPORTED_MODULE_1__, |
| 3466 |
..._node_index_js__WEBPACK_IMPORTED_MODULE_0__["default"] |
| 3467 |
}); |
| 3468 |
|
| 3469 |
|
| 3470 |
/***/ }), |
| 3471 |
|
| 3472 |
/***/ "./node_modules/axios/lib/utils.js": |
| 3473 |
/*!*****************************************!*\ |
| 3474 |
!*** ./node_modules/axios/lib/utils.js ***! |
| 3475 |
\*****************************************/ |
| 3476 |
/*! exports provided: default */ |
| 3477 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 3478 |
|
| 3479 |
"use strict"; |
| 3480 |
__webpack_require__.r(__webpack_exports__); |
| 3481 |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/bind.js */ "./node_modules/axios/lib/helpers/bind.js"); |
| 3482 |
|
| 3483 |
|
| 3484 |
|
| 3485 |
|
| 3486 |
// utils is a library of generic helper functions non-specific to axios |
| 3487 |
|
| 3488 |
const {toString} = Object.prototype; |
| 3489 |
const {getPrototypeOf} = Object; |
| 3490 |
|
| 3491 |
const kindOf = (cache => thing => { |
| 3492 |
const str = toString.call(thing); |
| 3493 |
return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); |
| 3494 |
})(Object.create(null)); |
| 3495 |
|
| 3496 |
const kindOfTest = (type) => { |
| 3497 |
type = type.toLowerCase(); |
| 3498 |
return (thing) => kindOf(thing) === type |
| 3499 |
} |
| 3500 |
|
| 3501 |
const typeOfTest = type => thing => typeof thing === type; |
| 3502 |
|
| 3503 |
/** |
| 3504 |
* Determine if a value is an Array |
| 3505 |
* |
| 3506 |
* @param {Object} val The value to test |
| 3507 |
* |
| 3508 |
* @returns {boolean} True if value is an Array, otherwise false |
| 3509 |
*/ |
| 3510 |
const {isArray} = Array; |
| 3511 |
|
| 3512 |
/** |
| 3513 |
* Determine if a value is undefined |
| 3514 |
* |
| 3515 |
* @param {*} val The value to test |
| 3516 |
* |
| 3517 |
* @returns {boolean} True if the value is undefined, otherwise false |
| 3518 |
*/ |
| 3519 |
const isUndefined = typeOfTest('undefined'); |
| 3520 |
|
| 3521 |
/** |
| 3522 |
* Determine if a value is a Buffer |
| 3523 |
* |
| 3524 |
* @param {*} val The value to test |
| 3525 |
* |
| 3526 |
* @returns {boolean} True if value is a Buffer, otherwise false |
| 3527 |
*/ |
| 3528 |
function isBuffer(val) { |
| 3529 |
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) |
| 3530 |
&& isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); |
| 3531 |
} |
| 3532 |
|
| 3533 |
/** |
| 3534 |
* Determine if a value is an ArrayBuffer |
| 3535 |
* |
| 3536 |
* @param {*} val The value to test |
| 3537 |
* |
| 3538 |
* @returns {boolean} True if value is an ArrayBuffer, otherwise false |
| 3539 |
*/ |
| 3540 |
const isArrayBuffer = kindOfTest('ArrayBuffer'); |
| 3541 |
|
| 3542 |
|
| 3543 |
/** |
| 3544 |
* Determine if a value is a view on an ArrayBuffer |
| 3545 |
* |
| 3546 |
* @param {*} val The value to test |
| 3547 |
* |
| 3548 |
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false |
| 3549 |
*/ |
| 3550 |
function isArrayBufferView(val) { |
| 3551 |
let result; |
| 3552 |
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { |
| 3553 |
result = ArrayBuffer.isView(val); |
| 3554 |
} else { |
| 3555 |
result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); |
| 3556 |
} |
| 3557 |
return result; |
| 3558 |
} |
| 3559 |
|
| 3560 |
/** |
| 3561 |
* Determine if a value is a String |
| 3562 |
* |
| 3563 |
* @param {*} val The value to test |
| 3564 |
* |
| 3565 |
* @returns {boolean} True if value is a String, otherwise false |
| 3566 |
*/ |
| 3567 |
const isString = typeOfTest('string'); |
| 3568 |
|
| 3569 |
/** |
| 3570 |
* Determine if a value is a Function |
| 3571 |
* |
| 3572 |
* @param {*} val The value to test |
| 3573 |
* @returns {boolean} True if value is a Function, otherwise false |
| 3574 |
*/ |
| 3575 |
const isFunction = typeOfTest('function'); |
| 3576 |
|
| 3577 |
/** |
| 3578 |
* Determine if a value is a Number |
| 3579 |
* |
| 3580 |
* @param {*} val The value to test |
| 3581 |
* |
| 3582 |
* @returns {boolean} True if value is a Number, otherwise false |
| 3583 |
*/ |
| 3584 |
const isNumber = typeOfTest('number'); |
| 3585 |
|
| 3586 |
/** |
| 3587 |
* Determine if a value is an Object |
| 3588 |
* |
| 3589 |
* @param {*} thing The value to test |
| 3590 |
* |
| 3591 |
* @returns {boolean} True if value is an Object, otherwise false |
| 3592 |
*/ |
| 3593 |
const isObject = (thing) => thing !== null && typeof thing === 'object'; |
| 3594 |
|
| 3595 |
/** |
| 3596 |
* Determine if a value is a Boolean |
| 3597 |
* |
| 3598 |
* @param {*} thing The value to test |
| 3599 |
* @returns {boolean} True if value is a Boolean, otherwise false |
| 3600 |
*/ |
| 3601 |
const isBoolean = thing => thing === true || thing === false; |
| 3602 |
|
| 3603 |
/** |
| 3604 |
* Determine if a value is a plain Object |
| 3605 |
* |
| 3606 |
* @param {*} val The value to test |
| 3607 |
* |
| 3608 |
* @returns {boolean} True if value is a plain Object, otherwise false |
| 3609 |
*/ |
| 3610 |
const isPlainObject = (val) => { |
| 3611 |
if (kindOf(val) !== 'object') { |
| 3612 |
return false; |
| 3613 |
} |
| 3614 |
|
| 3615 |
const prototype = getPrototypeOf(val); |
| 3616 |
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); |
| 3617 |
} |
| 3618 |
|
| 3619 |
/** |
| 3620 |
* Determine if a value is a Date |
| 3621 |
* |
| 3622 |
* @param {*} val The value to test |
| 3623 |
* |
| 3624 |
* @returns {boolean} True if value is a Date, otherwise false |
| 3625 |
*/ |
| 3626 |
const isDate = kindOfTest('Date'); |
| 3627 |
|
| 3628 |
/** |
| 3629 |
* Determine if a value is a File |
| 3630 |
* |
| 3631 |
* @param {*} val The value to test |
| 3632 |
* |
| 3633 |
* @returns {boolean} True if value is a File, otherwise false |
| 3634 |
*/ |
| 3635 |
const isFile = kindOfTest('File'); |
| 3636 |
|
| 3637 |
/** |
| 3638 |
* Determine if a value is a Blob |
| 3639 |
* |
| 3640 |
* @param {*} val The value to test |
| 3641 |
* |
| 3642 |
* @returns {boolean} True if value is a Blob, otherwise false |
| 3643 |
*/ |
| 3644 |
const isBlob = kindOfTest('Blob'); |
| 3645 |
|
| 3646 |
/** |
| 3647 |
* Determine if a value is a FileList |
| 3648 |
* |
| 3649 |
* @param {*} val The value to test |
| 3650 |
* |
| 3651 |
* @returns {boolean} True if value is a File, otherwise false |
| 3652 |
*/ |
| 3653 |
const isFileList = kindOfTest('FileList'); |
| 3654 |
|
| 3655 |
/** |
| 3656 |
* Determine if a value is a Stream |
| 3657 |
* |
| 3658 |
* @param {*} val The value to test |
| 3659 |
* |
| 3660 |
* @returns {boolean} True if value is a Stream, otherwise false |
| 3661 |
*/ |
| 3662 |
const isStream = (val) => isObject(val) && isFunction(val.pipe); |
| 3663 |
|
| 3664 |
/** |
| 3665 |
* Determine if a value is a FormData |
| 3666 |
* |
| 3667 |
* @param {*} thing The value to test |
| 3668 |
* |
| 3669 |
* @returns {boolean} True if value is an FormData, otherwise false |
| 3670 |
*/ |
| 3671 |
const isFormData = (thing) => { |
| 3672 |
let kind; |
| 3673 |
return thing && ( |
| 3674 |
(typeof FormData === 'function' && thing instanceof FormData) || ( |
| 3675 |
isFunction(thing.append) && ( |
| 3676 |
(kind = kindOf(thing)) === 'formdata' || |
| 3677 |
// detect form-data instance |
| 3678 |
(kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') |
| 3679 |
) |
| 3680 |
) |
| 3681 |
) |
| 3682 |
} |
| 3683 |
|
| 3684 |
/** |
| 3685 |
* Determine if a value is a URLSearchParams object |
| 3686 |
* |
| 3687 |
* @param {*} val The value to test |
| 3688 |
* |
| 3689 |
* @returns {boolean} True if value is a URLSearchParams object, otherwise false |
| 3690 |
*/ |
| 3691 |
const isURLSearchParams = kindOfTest('URLSearchParams'); |
| 3692 |
|
| 3693 |
/** |
| 3694 |
* Trim excess whitespace off the beginning and end of a string |
| 3695 |
* |
| 3696 |
* @param {String} str The String to trim |
| 3697 |
* |
| 3698 |
* @returns {String} The String freed of excess whitespace |
| 3699 |
*/ |
| 3700 |
const trim = (str) => str.trim ? |
| 3701 |
str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); |
| 3702 |
|
| 3703 |
/** |
| 3704 |
* Iterate over an Array or an Object invoking a function for each item. |
| 3705 |
* |
| 3706 |
* If `obj` is an Array callback will be called passing |
| 3707 |
* the value, index, and complete array for each item. |
| 3708 |
* |
| 3709 |
* If 'obj' is an Object callback will be called passing |
| 3710 |
* the value, key, and complete object for each property. |
| 3711 |
* |
| 3712 |
* @param {Object|Array} obj The object to iterate |
| 3713 |
* @param {Function} fn The callback to invoke for each item |
| 3714 |
* |
| 3715 |
* @param {Boolean} [allOwnKeys = false] |
| 3716 |
* @returns {any} |
| 3717 |
*/ |
| 3718 |
function forEach(obj, fn, {allOwnKeys = false} = {}) { |
| 3719 |
// Don't bother if no value provided |
| 3720 |
if (obj === null || typeof obj === 'undefined') { |
| 3721 |
return; |
| 3722 |
} |
| 3723 |
|
| 3724 |
let i; |
| 3725 |
let l; |
| 3726 |
|
| 3727 |
// Force an array if not already something iterable |
| 3728 |
if (typeof obj !== 'object') { |
| 3729 |
/*eslint no-param-reassign:0*/ |
| 3730 |
obj = [obj]; |
| 3731 |
} |
| 3732 |
|
| 3733 |
if (isArray(obj)) { |
| 3734 |
// Iterate over array values |
| 3735 |
for (i = 0, l = obj.length; i < l; i++) { |
| 3736 |
fn.call(null, obj[i], i, obj); |
| 3737 |
} |
| 3738 |
} else { |
| 3739 |
// Iterate over object keys |
| 3740 |
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); |
| 3741 |
const len = keys.length; |
| 3742 |
let key; |
| 3743 |
|
| 3744 |
for (i = 0; i < len; i++) { |
| 3745 |
key = keys[i]; |
| 3746 |
fn.call(null, obj[key], key, obj); |
| 3747 |
} |
| 3748 |
} |
| 3749 |
} |
| 3750 |
|
| 3751 |
function findKey(obj, key) { |
| 3752 |
key = key.toLowerCase(); |
| 3753 |
const keys = Object.keys(obj); |
| 3754 |
let i = keys.length; |
| 3755 |
let _key; |
| 3756 |
while (i-- > 0) { |
| 3757 |
_key = keys[i]; |
| 3758 |
if (key === _key.toLowerCase()) { |
| 3759 |
return _key; |
| 3760 |
} |
| 3761 |
} |
| 3762 |
return null; |
| 3763 |
} |
| 3764 |
|
| 3765 |
const _global = (() => { |
| 3766 |
/*eslint no-undef:0*/ |
| 3767 |
if (typeof globalThis !== "undefined") return globalThis; |
| 3768 |
return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : global) |
| 3769 |
})(); |
| 3770 |
|
| 3771 |
const isContextDefined = (context) => !isUndefined(context) && context !== _global; |
| 3772 |
|
| 3773 |
/** |
| 3774 |
* Accepts varargs expecting each argument to be an object, then |
| 3775 |
* immutably merges the properties of each object and returns result. |
| 3776 |
* |
| 3777 |
* When multiple objects contain the same key the later object in |
| 3778 |
* the arguments list will take precedence. |
| 3779 |
* |
| 3780 |
* Example: |
| 3781 |
* |
| 3782 |
* ```js |
| 3783 |
* var result = merge({foo: 123}, {foo: 456}); |
| 3784 |
* console.log(result.foo); // outputs 456 |
| 3785 |
* ``` |
| 3786 |
* |
| 3787 |
* @param {Object} obj1 Object to merge |
| 3788 |
* |
| 3789 |
* @returns {Object} Result of all merge properties |
| 3790 |
*/ |
| 3791 |
function merge(/* obj1, obj2, obj3, ... */) { |
| 3792 |
const {caseless} = isContextDefined(this) && this || {}; |
| 3793 |
const result = {}; |
| 3794 |
const assignValue = (val, key) => { |
| 3795 |
const targetKey = caseless && findKey(result, key) || key; |
| 3796 |
if (isPlainObject(result[targetKey]) && isPlainObject(val)) { |
| 3797 |
result[targetKey] = merge(result[targetKey], val); |
| 3798 |
} else if (isPlainObject(val)) { |
| 3799 |
result[targetKey] = merge({}, val); |
| 3800 |
} else if (isArray(val)) { |
| 3801 |
result[targetKey] = val.slice(); |
| 3802 |
} else { |
| 3803 |
result[targetKey] = val; |
| 3804 |
} |
| 3805 |
} |
| 3806 |
|
| 3807 |
for (let i = 0, l = arguments.length; i < l; i++) { |
| 3808 |
arguments[i] && forEach(arguments[i], assignValue); |
| 3809 |
} |
| 3810 |
return result; |
| 3811 |
} |
| 3812 |
|
| 3813 |
/** |
| 3814 |
* Extends object a by mutably adding to it the properties of object b. |
| 3815 |
* |
| 3816 |
* @param {Object} a The object to be extended |
| 3817 |
* @param {Object} b The object to copy properties from |
| 3818 |
* @param {Object} thisArg The object to bind function to |
| 3819 |
* |
| 3820 |
* @param {Boolean} [allOwnKeys] |
| 3821 |
* @returns {Object} The resulting value of object a |
| 3822 |
*/ |
| 3823 |
const extend = (a, b, thisArg, {allOwnKeys}= {}) => { |
| 3824 |
forEach(b, (val, key) => { |
| 3825 |
if (thisArg && isFunction(val)) { |
| 3826 |
a[key] = Object(_helpers_bind_js__WEBPACK_IMPORTED_MODULE_0__["default"])(val, thisArg); |
| 3827 |
} else { |
| 3828 |
a[key] = val; |
| 3829 |
} |
| 3830 |
}, {allOwnKeys}); |
| 3831 |
return a; |
| 3832 |
} |
| 3833 |
|
| 3834 |
/** |
| 3835 |
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) |
| 3836 |
* |
| 3837 |
* @param {string} content with BOM |
| 3838 |
* |
| 3839 |
* @returns {string} content value without BOM |
| 3840 |
*/ |
| 3841 |
const stripBOM = (content) => { |
| 3842 |
if (content.charCodeAt(0) === 0xFEFF) { |
| 3843 |
content = content.slice(1); |
| 3844 |
} |
| 3845 |
return content; |
| 3846 |
} |
| 3847 |
|
| 3848 |
/** |
| 3849 |
* Inherit the prototype methods from one constructor into another |
| 3850 |
* @param {function} constructor |
| 3851 |
* @param {function} superConstructor |
| 3852 |
* @param {object} [props] |
| 3853 |
* @param {object} [descriptors] |
| 3854 |
* |
| 3855 |
* @returns {void} |
| 3856 |
*/ |
| 3857 |
const inherits = (constructor, superConstructor, props, descriptors) => { |
| 3858 |
constructor.prototype = Object.create(superConstructor.prototype, descriptors); |
| 3859 |
constructor.prototype.constructor = constructor; |
| 3860 |
Object.defineProperty(constructor, 'super', { |
| 3861 |
value: superConstructor.prototype |
| 3862 |
}); |
| 3863 |
props && Object.assign(constructor.prototype, props); |
| 3864 |
} |
| 3865 |
|
| 3866 |
/** |
| 3867 |
* Resolve object with deep prototype chain to a flat object |
| 3868 |
* @param {Object} sourceObj source object |
| 3869 |
* @param {Object} [destObj] |
| 3870 |
* @param {Function|Boolean} [filter] |
| 3871 |
* @param {Function} [propFilter] |
| 3872 |
* |
| 3873 |
* @returns {Object} |
| 3874 |
*/ |
| 3875 |
const toFlatObject = (sourceObj, destObj, filter, propFilter) => { |
| 3876 |
let props; |
| 3877 |
let i; |
| 3878 |
let prop; |
| 3879 |
const merged = {}; |
| 3880 |
|
| 3881 |
destObj = destObj || {}; |
| 3882 |
// eslint-disable-next-line no-eq-null,eqeqeq |
| 3883 |
if (sourceObj == null) return destObj; |
| 3884 |
|
| 3885 |
do { |
| 3886 |
props = Object.getOwnPropertyNames(sourceObj); |
| 3887 |
i = props.length; |
| 3888 |
while (i-- > 0) { |
| 3889 |
prop = props[i]; |
| 3890 |
if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { |
| 3891 |
destObj[prop] = sourceObj[prop]; |
| 3892 |
merged[prop] = true; |
| 3893 |
} |
| 3894 |
} |
| 3895 |
sourceObj = filter !== false && getPrototypeOf(sourceObj); |
| 3896 |
} while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype); |
| 3897 |
|
| 3898 |
return destObj; |
| 3899 |
} |
| 3900 |
|
| 3901 |
/** |
| 3902 |
* Determines whether a string ends with the characters of a specified string |
| 3903 |
* |
| 3904 |
* @param {String} str |
| 3905 |
* @param {String} searchString |
| 3906 |
* @param {Number} [position= 0] |
| 3907 |
* |
| 3908 |
* @returns {boolean} |
| 3909 |
*/ |
| 3910 |
const endsWith = (str, searchString, position) => { |
| 3911 |
str = String(str); |
| 3912 |
if (position === undefined || position > str.length) { |
| 3913 |
position = str.length; |
| 3914 |
} |
| 3915 |
position -= searchString.length; |
| 3916 |
const lastIndex = str.indexOf(searchString, position); |
| 3917 |
return lastIndex !== -1 && lastIndex === position; |
| 3918 |
} |
| 3919 |
|
| 3920 |
|
| 3921 |
/** |
| 3922 |
* Returns new array from array like object or null if failed |
| 3923 |
* |
| 3924 |
* @param {*} [thing] |
| 3925 |
* |
| 3926 |
* @returns {?Array} |
| 3927 |
*/ |
| 3928 |
const toArray = (thing) => { |
| 3929 |
if (!thing) return null; |
| 3930 |
if (isArray(thing)) return thing; |
| 3931 |
let i = thing.length; |
| 3932 |
if (!isNumber(i)) return null; |
| 3933 |
const arr = new Array(i); |
| 3934 |
while (i-- > 0) { |
| 3935 |
arr[i] = thing[i]; |
| 3936 |
} |
| 3937 |
return arr; |
| 3938 |
} |
| 3939 |
|
| 3940 |
/** |
| 3941 |
* Checking if the Uint8Array exists and if it does, it returns a function that checks if the |
| 3942 |
* thing passed in is an instance of Uint8Array |
| 3943 |
* |
| 3944 |
* @param {TypedArray} |
| 3945 |
* |
| 3946 |
* @returns {Array} |
| 3947 |
*/ |
| 3948 |
// eslint-disable-next-line func-names |
| 3949 |
const isTypedArray = (TypedArray => { |
| 3950 |
// eslint-disable-next-line func-names |
| 3951 |
return thing => { |
| 3952 |
return TypedArray && thing instanceof TypedArray; |
| 3953 |
}; |
| 3954 |
})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array)); |
| 3955 |
|
| 3956 |
/** |
| 3957 |
* For each entry in the object, call the function with the key and value. |
| 3958 |
* |
| 3959 |
* @param {Object<any, any>} obj - The object to iterate over. |
| 3960 |
* @param {Function} fn - The function to call for each entry. |
| 3961 |
* |
| 3962 |
* @returns {void} |
| 3963 |
*/ |
| 3964 |
const forEachEntry = (obj, fn) => { |
| 3965 |
const generator = obj && obj[Symbol.iterator]; |
| 3966 |
|
| 3967 |
const iterator = generator.call(obj); |
| 3968 |
|
| 3969 |
let result; |
| 3970 |
|
| 3971 |
while ((result = iterator.next()) && !result.done) { |
| 3972 |
const pair = result.value; |
| 3973 |
fn.call(obj, pair[0], pair[1]); |
| 3974 |
} |
| 3975 |
} |
| 3976 |
|
| 3977 |
/** |
| 3978 |
* It takes a regular expression and a string, and returns an array of all the matches |
| 3979 |
* |
| 3980 |
* @param {string} regExp - The regular expression to match against. |
| 3981 |
* @param {string} str - The string to search. |
| 3982 |
* |
| 3983 |
* @returns {Array<boolean>} |
| 3984 |
*/ |
| 3985 |
const matchAll = (regExp, str) => { |
| 3986 |
let matches; |
| 3987 |
const arr = []; |
| 3988 |
|
| 3989 |
while ((matches = regExp.exec(str)) !== null) { |
| 3990 |
arr.push(matches); |
| 3991 |
} |
| 3992 |
|
| 3993 |
return arr; |
| 3994 |
} |
| 3995 |
|
| 3996 |
/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */ |
| 3997 |
const isHTMLForm = kindOfTest('HTMLFormElement'); |
| 3998 |
|
| 3999 |
const toCamelCase = str => { |
| 4000 |
return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, |
| 4001 |
function replacer(m, p1, p2) { |
| 4002 |
return p1.toUpperCase() + p2; |
| 4003 |
} |
| 4004 |
); |
| 4005 |
}; |
| 4006 |
|
| 4007 |
/* Creating a function that will check if an object has a property. */ |
| 4008 |
const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype); |
| 4009 |
|
| 4010 |
/** |
| 4011 |
* Determine if a value is a RegExp object |
| 4012 |
* |
| 4013 |
* @param {*} val The value to test |
| 4014 |
* |
| 4015 |
* @returns {boolean} True if value is a RegExp object, otherwise false |
| 4016 |
*/ |
| 4017 |
const isRegExp = kindOfTest('RegExp'); |
| 4018 |
|
| 4019 |
const reduceDescriptors = (obj, reducer) => { |
| 4020 |
const descriptors = Object.getOwnPropertyDescriptors(obj); |
| 4021 |
const reducedDescriptors = {}; |
| 4022 |
|
| 4023 |
forEach(descriptors, (descriptor, name) => { |
| 4024 |
let ret; |
| 4025 |
if ((ret = reducer(descriptor, name, obj)) !== false) { |
| 4026 |
reducedDescriptors[name] = ret || descriptor; |
| 4027 |
} |
| 4028 |
}); |
| 4029 |
|
| 4030 |
Object.defineProperties(obj, reducedDescriptors); |
| 4031 |
} |
| 4032 |
|
| 4033 |
/** |
| 4034 |
* Makes all methods read-only |
| 4035 |
* @param {Object} obj |
| 4036 |
*/ |
| 4037 |
|
| 4038 |
const freezeMethods = (obj) => { |
| 4039 |
reduceDescriptors(obj, (descriptor, name) => { |
| 4040 |
// skip restricted props in strict mode |
| 4041 |
if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) { |
| 4042 |
return false; |
| 4043 |
} |
| 4044 |
|
| 4045 |
const value = obj[name]; |
| 4046 |
|
| 4047 |
if (!isFunction(value)) return; |
| 4048 |
|
| 4049 |
descriptor.enumerable = false; |
| 4050 |
|
| 4051 |
if ('writable' in descriptor) { |
| 4052 |
descriptor.writable = false; |
| 4053 |
return; |
| 4054 |
} |
| 4055 |
|
| 4056 |
if (!descriptor.set) { |
| 4057 |
descriptor.set = () => { |
| 4058 |
throw Error('Can not rewrite read-only method \'' + name + '\''); |
| 4059 |
}; |
| 4060 |
} |
| 4061 |
}); |
| 4062 |
} |
| 4063 |
|
| 4064 |
const toObjectSet = (arrayOrString, delimiter) => { |
| 4065 |
const obj = {}; |
| 4066 |
|
| 4067 |
const define = (arr) => { |
| 4068 |
arr.forEach(value => { |
| 4069 |
obj[value] = true; |
| 4070 |
}); |
| 4071 |
} |
| 4072 |
|
| 4073 |
isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); |
| 4074 |
|
| 4075 |
return obj; |
| 4076 |
} |
| 4077 |
|
| 4078 |
const noop = () => {} |
| 4079 |
|
| 4080 |
const toFiniteNumber = (value, defaultValue) => { |
| 4081 |
value = +value; |
| 4082 |
return Number.isFinite(value) ? value : defaultValue; |
| 4083 |
} |
| 4084 |
|
| 4085 |
const ALPHA = 'abcdefghijklmnopqrstuvwxyz' |
| 4086 |
|
| 4087 |
const DIGIT = '0123456789'; |
| 4088 |
|
| 4089 |
const ALPHABET = { |
| 4090 |
DIGIT, |
| 4091 |
ALPHA, |
| 4092 |
ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT |
| 4093 |
} |
| 4094 |
|
| 4095 |
const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { |
| 4096 |
let str = ''; |
| 4097 |
const {length} = alphabet; |
| 4098 |
while (size--) { |
| 4099 |
str += alphabet[Math.random() * length|0] |
| 4100 |
} |
| 4101 |
|
| 4102 |
return str; |
| 4103 |
} |
| 4104 |
|
| 4105 |
/** |
| 4106 |
* If the thing is a FormData object, return true, otherwise return false. |
| 4107 |
* |
| 4108 |
* @param {unknown} thing - The thing to check. |
| 4109 |
* |
| 4110 |
* @returns {boolean} |
| 4111 |
*/ |
| 4112 |
function isSpecCompliantForm(thing) { |
| 4113 |
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); |
| 4114 |
} |
| 4115 |
|
| 4116 |
const toJSONObject = (obj) => { |
| 4117 |
const stack = new Array(10); |
| 4118 |
|
| 4119 |
const visit = (source, i) => { |
| 4120 |
|
| 4121 |
if (isObject(source)) { |
| 4122 |
if (stack.indexOf(source) >= 0) { |
| 4123 |
return; |
| 4124 |
} |
| 4125 |
|
| 4126 |
if(!('toJSON' in source)) { |
| 4127 |
stack[i] = source; |
| 4128 |
const target = isArray(source) ? [] : {}; |
| 4129 |
|
| 4130 |
forEach(source, (value, key) => { |
| 4131 |
const reducedValue = visit(value, i + 1); |
| 4132 |
!isUndefined(reducedValue) && (target[key] = reducedValue); |
| 4133 |
}); |
| 4134 |
|
| 4135 |
stack[i] = undefined; |
| 4136 |
|
| 4137 |
return target; |
| 4138 |
} |
| 4139 |
} |
| 4140 |
|
| 4141 |
return source; |
| 4142 |
} |
| 4143 |
|
| 4144 |
return visit(obj, 0); |
| 4145 |
} |
| 4146 |
|
| 4147 |
const isAsyncFn = kindOfTest('AsyncFunction'); |
| 4148 |
|
| 4149 |
const isThenable = (thing) => |
| 4150 |
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); |
| 4151 |
|
| 4152 |
/* harmony default export */ __webpack_exports__["default"] = ({ |
| 4153 |
isArray, |
| 4154 |
isArrayBuffer, |
| 4155 |
isBuffer, |
| 4156 |
isFormData, |
| 4157 |
isArrayBufferView, |
| 4158 |
isString, |
| 4159 |
isNumber, |
| 4160 |
isBoolean, |
| 4161 |
isObject, |
| 4162 |
isPlainObject, |
| 4163 |
isUndefined, |
| 4164 |
isDate, |
| 4165 |
isFile, |
| 4166 |
isBlob, |
| 4167 |
isRegExp, |
| 4168 |
isFunction, |
| 4169 |
isStream, |
| 4170 |
isURLSearchParams, |
| 4171 |
isTypedArray, |
| 4172 |
isFileList, |
| 4173 |
forEach, |
| 4174 |
merge, |
| 4175 |
extend, |
| 4176 |
trim, |
| 4177 |
stripBOM, |
| 4178 |
inherits, |
| 4179 |
toFlatObject, |
| 4180 |
kindOf, |
| 4181 |
kindOfTest, |
| 4182 |
endsWith, |
| 4183 |
toArray, |
| 4184 |
forEachEntry, |
| 4185 |
matchAll, |
| 4186 |
isHTMLForm, |
| 4187 |
hasOwnProperty, |
| 4188 |
hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection |
| 4189 |
reduceDescriptors, |
| 4190 |
freezeMethods, |
| 4191 |
toObjectSet, |
| 4192 |
toCamelCase, |
| 4193 |
noop, |
| 4194 |
toFiniteNumber, |
| 4195 |
findKey, |
| 4196 |
global: _global, |
| 4197 |
isContextDefined, |
| 4198 |
ALPHABET, |
| 4199 |
generateString, |
| 4200 |
isSpecCompliantForm, |
| 4201 |
toJSONObject, |
| 4202 |
isAsyncFn, |
| 4203 |
isThenable |
| 4204 |
}); |
| 4205 |
|
| 4206 |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) |
| 4207 |
|
| 4208 |
/***/ }), |
| 4209 |
|
| 4210 |
/***/ "./node_modules/base64-js/index.js": |
| 4211 |
/*!*****************************************!*\ |
| 4212 |
!*** ./node_modules/base64-js/index.js ***! |
| 4213 |
\*****************************************/ |
| 4214 |
/*! no static exports found */ |
| 4215 |
/***/ (function(module, exports, __webpack_require__) { |
| 4216 |
|
| 4217 |
"use strict"; |
| 4218 |
|
| 4219 |
|
| 4220 |
exports.byteLength = byteLength |
| 4221 |
exports.toByteArray = toByteArray |
| 4222 |
exports.fromByteArray = fromByteArray |
| 4223 |
|
| 4224 |
var lookup = [] |
| 4225 |
var revLookup = [] |
| 4226 |
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array |
| 4227 |
|
| 4228 |
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' |
| 4229 |
for (var i = 0, len = code.length; i < len; ++i) { |
| 4230 |
lookup[i] = code[i] |
| 4231 |
revLookup[code.charCodeAt(i)] = i |
| 4232 |
} |
| 4233 |
|
| 4234 |
// Support decoding URL-safe base64 strings, as Node.js does. |
| 4235 |
// See: https://en.wikipedia.org/wiki/Base64#URL_applications |
| 4236 |
revLookup['-'.charCodeAt(0)] = 62 |
| 4237 |
revLookup['_'.charCodeAt(0)] = 63 |
| 4238 |
|
| 4239 |
function getLens (b64) { |
| 4240 |
var len = b64.length |
| 4241 |
|
| 4242 |
if (len % 4 > 0) { |
| 4243 |
throw new Error('Invalid string. Length must be a multiple of 4') |
| 4244 |
} |
| 4245 |
|
| 4246 |
// Trim off extra bytes after placeholder bytes are found |
| 4247 |
// See: https://github.com/beatgammit/base64-js/issues/42 |
| 4248 |
var validLen = b64.indexOf('=') |
| 4249 |
if (validLen === -1) validLen = len |
| 4250 |
|
| 4251 |
var placeHoldersLen = validLen === len |
| 4252 |
? 0 |
| 4253 |
: 4 - (validLen % 4) |
| 4254 |
|
| 4255 |
return [validLen, placeHoldersLen] |
| 4256 |
} |
| 4257 |
|
| 4258 |
// base64 is 4/3 + up to two characters of the original data |
| 4259 |
function byteLength (b64) { |
| 4260 |
var lens = getLens(b64) |
| 4261 |
var validLen = lens[0] |
| 4262 |
var placeHoldersLen = lens[1] |
| 4263 |
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen |
| 4264 |
} |
| 4265 |
|
| 4266 |
function _byteLength (b64, validLen, placeHoldersLen) { |
| 4267 |
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen |
| 4268 |
} |
| 4269 |
|
| 4270 |
function toByteArray (b64) { |
| 4271 |
var tmp |
| 4272 |
var lens = getLens(b64) |
| 4273 |
var validLen = lens[0] |
| 4274 |
var placeHoldersLen = lens[1] |
| 4275 |
|
| 4276 |
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) |
| 4277 |
|
| 4278 |
var curByte = 0 |
| 4279 |
|
| 4280 |
// if there are placeholders, only get up to the last complete 4 chars |
| 4281 |
var len = placeHoldersLen > 0 |
| 4282 |
? validLen - 4 |
| 4283 |
: validLen |
| 4284 |
|
| 4285 |
var i |
| 4286 |
for (i = 0; i < len; i += 4) { |
| 4287 |
tmp = |
| 4288 |
(revLookup[b64.charCodeAt(i)] << 18) | |
| 4289 |
(revLookup[b64.charCodeAt(i + 1)] << 12) | |
| 4290 |
(revLookup[b64.charCodeAt(i + 2)] << 6) | |
| 4291 |
revLookup[b64.charCodeAt(i + 3)] |
| 4292 |
arr[curByte++] = (tmp >> 16) & 0xFF |
| 4293 |
arr[curByte++] = (tmp >> 8) & 0xFF |
| 4294 |
arr[curByte++] = tmp & 0xFF |
| 4295 |
} |
| 4296 |
|
| 4297 |
if (placeHoldersLen === 2) { |
| 4298 |
tmp = |
| 4299 |
(revLookup[b64.charCodeAt(i)] << 2) | |
| 4300 |
(revLookup[b64.charCodeAt(i + 1)] >> 4) |
| 4301 |
arr[curByte++] = tmp & 0xFF |
| 4302 |
} |
| 4303 |
|
| 4304 |
if (placeHoldersLen === 1) { |
| 4305 |
tmp = |
| 4306 |
(revLookup[b64.charCodeAt(i)] << 10) | |
| 4307 |
(revLookup[b64.charCodeAt(i + 1)] << 4) | |
| 4308 |
(revLookup[b64.charCodeAt(i + 2)] >> 2) |
| 4309 |
arr[curByte++] = (tmp >> 8) & 0xFF |
| 4310 |
arr[curByte++] = tmp & 0xFF |
| 4311 |
} |
| 4312 |
|
| 4313 |
return arr |
| 4314 |
} |
| 4315 |
|
| 4316 |
function tripletToBase64 (num) { |
| 4317 |
return lookup[num >> 18 & 0x3F] + |
| 4318 |
lookup[num >> 12 & 0x3F] + |
| 4319 |
lookup[num >> 6 & 0x3F] + |
| 4320 |
lookup[num & 0x3F] |
| 4321 |
} |
| 4322 |
|
| 4323 |
function encodeChunk (uint8, start, end) { |
| 4324 |
var tmp |
| 4325 |
var output = [] |
| 4326 |
for (var i = start; i < end; i += 3) { |
| 4327 |
tmp = |
| 4328 |
((uint8[i] << 16) & 0xFF0000) + |
| 4329 |
((uint8[i + 1] << 8) & 0xFF00) + |
| 4330 |
(uint8[i + 2] & 0xFF) |
| 4331 |
output.push(tripletToBase64(tmp)) |
| 4332 |
} |
| 4333 |
return output.join('') |
| 4334 |
} |
| 4335 |
|
| 4336 |
function fromByteArray (uint8) { |
| 4337 |
var tmp |
| 4338 |
var len = uint8.length |
| 4339 |
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes |
| 4340 |
var parts = [] |
| 4341 |
var maxChunkLength = 16383 // must be multiple of 3 |
| 4342 |
|
| 4343 |
// go through the array every three bytes, we'll deal with trailing stuff later |
| 4344 |
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { |
| 4345 |
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) |
| 4346 |
} |
| 4347 |
|
| 4348 |
// pad the end with zeros, but make sure to not forget the extra bytes |
| 4349 |
if (extraBytes === 1) { |
| 4350 |
tmp = uint8[len - 1] |
| 4351 |
parts.push( |
| 4352 |
lookup[tmp >> 2] + |
| 4353 |
lookup[(tmp << 4) & 0x3F] + |
| 4354 |
'==' |
| 4355 |
) |
| 4356 |
} else if (extraBytes === 2) { |
| 4357 |
tmp = (uint8[len - 2] << 8) + uint8[len - 1] |
| 4358 |
parts.push( |
| 4359 |
lookup[tmp >> 10] + |
| 4360 |
lookup[(tmp >> 4) & 0x3F] + |
| 4361 |
lookup[(tmp << 2) & 0x3F] + |
| 4362 |
'=' |
| 4363 |
) |
| 4364 |
} |
| 4365 |
|
| 4366 |
return parts.join('') |
| 4367 |
} |
| 4368 |
|
| 4369 |
|
| 4370 |
/***/ }), |
| 4371 |
|
| 4372 |
/***/ "./node_modules/ieee754/index.js": |
| 4373 |
/*!***************************************!*\ |
| 4374 |
!*** ./node_modules/ieee754/index.js ***! |
| 4375 |
\***************************************/ |
| 4376 |
/*! no static exports found */ |
| 4377 |
/***/ (function(module, exports) { |
| 4378 |
|
| 4379 |
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ |
| 4380 |
exports.read = function (buffer, offset, isLE, mLen, nBytes) { |
| 4381 |
var e, m |
| 4382 |
var eLen = (nBytes * 8) - mLen - 1 |
| 4383 |
var eMax = (1 << eLen) - 1 |
| 4384 |
var eBias = eMax >> 1 |
| 4385 |
var nBits = -7 |
| 4386 |
var i = isLE ? (nBytes - 1) : 0 |
| 4387 |
var d = isLE ? -1 : 1 |
| 4388 |
var s = buffer[offset + i] |
| 4389 |
|
| 4390 |
i += d |
| 4391 |
|
| 4392 |
e = s & ((1 << (-nBits)) - 1) |
| 4393 |
s >>= (-nBits) |
| 4394 |
nBits += eLen |
| 4395 |
for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} |
| 4396 |
|
| 4397 |
m = e & ((1 << (-nBits)) - 1) |
| 4398 |
e >>= (-nBits) |
| 4399 |
nBits += mLen |
| 4400 |
for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} |
| 4401 |
|
| 4402 |
if (e === 0) { |
| 4403 |
e = 1 - eBias |
| 4404 |
} else if (e === eMax) { |
| 4405 |
return m ? NaN : ((s ? -1 : 1) * Infinity) |
| 4406 |
} else { |
| 4407 |
m = m + Math.pow(2, mLen) |
| 4408 |
e = e - eBias |
| 4409 |
} |
| 4410 |
return (s ? -1 : 1) * m * Math.pow(2, e - mLen) |
| 4411 |
} |
| 4412 |
|
| 4413 |
exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { |
| 4414 |
var e, m, c |
| 4415 |
var eLen = (nBytes * 8) - mLen - 1 |
| 4416 |
var eMax = (1 << eLen) - 1 |
| 4417 |
var eBias = eMax >> 1 |
| 4418 |
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) |
| 4419 |
var i = isLE ? 0 : (nBytes - 1) |
| 4420 |
var d = isLE ? 1 : -1 |
| 4421 |
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 |
| 4422 |
|
| 4423 |
value = Math.abs(value) |
| 4424 |
|
| 4425 |
if (isNaN(value) || value === Infinity) { |
| 4426 |
m = isNaN(value) ? 1 : 0 |
| 4427 |
e = eMax |
| 4428 |
} else { |
| 4429 |
e = Math.floor(Math.log(value) / Math.LN2) |
| 4430 |
if (value * (c = Math.pow(2, -e)) < 1) { |
| 4431 |
e-- |
| 4432 |
c *= 2 |
| 4433 |
} |
| 4434 |
if (e + eBias >= 1) { |
| 4435 |
value += rt / c |
| 4436 |
} else { |
| 4437 |
value += rt * Math.pow(2, 1 - eBias) |
| 4438 |
} |
| 4439 |
if (value * c >= 2) { |
| 4440 |
e++ |
| 4441 |
c /= 2 |
| 4442 |
} |
| 4443 |
|
| 4444 |
if (e + eBias >= eMax) { |
| 4445 |
m = 0 |
| 4446 |
e = eMax |
| 4447 |
} else if (e + eBias >= 1) { |
| 4448 |
m = ((value * c) - 1) * Math.pow(2, mLen) |
| 4449 |
e = e + eBias |
| 4450 |
} else { |
| 4451 |
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) |
| 4452 |
e = 0 |
| 4453 |
} |
| 4454 |
} |
| 4455 |
|
| 4456 |
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} |
| 4457 |
|
| 4458 |
e = (e << mLen) | m |
| 4459 |
eLen += mLen |
| 4460 |
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} |
| 4461 |
|
| 4462 |
buffer[offset + i - d] |= s * 128 |
| 4463 |
} |
| 4464 |
|
| 4465 |
|
| 4466 |
/***/ }), |
| 4467 |
|
| 4468 |
/***/ "./node_modules/node-libs-browser/node_modules/buffer/index.js": |
| 4469 |
/*!*********************************************************************!*\ |
| 4470 |
!*** ./node_modules/node-libs-browser/node_modules/buffer/index.js ***! |
| 4471 |
\*********************************************************************/ |
| 4472 |
/*! no static exports found */ |
| 4473 |
/***/ (function(module, exports, __webpack_require__) { |
| 4474 |
|
| 4475 |
"use strict"; |
| 4476 |
/* WEBPACK VAR INJECTION */(function(global) {/*! |
| 4477 |
* The buffer module from node.js, for the browser. |
| 4478 |
* |
| 4479 |
* @author Feross Aboukhadijeh <http://feross.org> |
| 4480 |
* @license MIT |
| 4481 |
*/ |
| 4482 |
/* eslint-disable no-proto */ |
| 4483 |
|
| 4484 |
|
| 4485 |
|
| 4486 |
var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js") |
| 4487 |
var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js") |
| 4488 |
var isArray = __webpack_require__(/*! isarray */ "./node_modules/node-libs-browser/node_modules/isarray/index.js") |
| 4489 |
|
| 4490 |
exports.Buffer = Buffer |
| 4491 |
exports.SlowBuffer = SlowBuffer |
| 4492 |
exports.INSPECT_MAX_BYTES = 50 |
| 4493 |
|
| 4494 |
/** |
| 4495 |
* If `Buffer.TYPED_ARRAY_SUPPORT`: |
| 4496 |
* === true Use Uint8Array implementation (fastest) |
| 4497 |
* === false Use Object implementation (most compatible, even IE6) |
| 4498 |
* |
| 4499 |
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, |
| 4500 |
* Opera 11.6+, iOS 4.2+. |
| 4501 |
* |
| 4502 |
* Due to various browser bugs, sometimes the Object implementation will be used even |
| 4503 |
* when the browser supports typed arrays. |
| 4504 |
* |
| 4505 |
* Note: |
| 4506 |
* |
| 4507 |
* - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, |
| 4508 |
* See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. |
| 4509 |
* |
| 4510 |
* - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. |
| 4511 |
* |
| 4512 |
* - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of |
| 4513 |
* incorrect length in some situations. |
| 4514 |
|
| 4515 |
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they |
| 4516 |
* get the Object implementation, which is slower but behaves correctly. |
| 4517 |
*/ |
| 4518 |
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined |
| 4519 |
? global.TYPED_ARRAY_SUPPORT |
| 4520 |
: typedArraySupport() |
| 4521 |
|
| 4522 |
/* |
| 4523 |
* Export kMaxLength after typed array support is determined. |
| 4524 |
*/ |
| 4525 |
exports.kMaxLength = kMaxLength() |
| 4526 |
|
| 4527 |
function typedArraySupport () { |
| 4528 |
try { |
| 4529 |
var arr = new Uint8Array(1) |
| 4530 |
arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} |
| 4531 |
return arr.foo() === 42 && // typed array instances can be augmented |
| 4532 |
typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` |
| 4533 |
arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` |
| 4534 |
} catch (e) { |
| 4535 |
return false |
| 4536 |
} |
| 4537 |
} |
| 4538 |
|
| 4539 |
function kMaxLength () { |
| 4540 |
return Buffer.TYPED_ARRAY_SUPPORT |
| 4541 |
? 0x7fffffff |
| 4542 |
: 0x3fffffff |
| 4543 |
} |
| 4544 |
|
| 4545 |
function createBuffer (that, length) { |
| 4546 |
if (kMaxLength() < length) { |
| 4547 |
throw new RangeError('Invalid typed array length') |
| 4548 |
} |
| 4549 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 4550 |
// Return an augmented `Uint8Array` instance, for best performance |
| 4551 |
that = new Uint8Array(length) |
| 4552 |
that.__proto__ = Buffer.prototype |
| 4553 |
} else { |
| 4554 |
// Fallback: Return an object instance of the Buffer class |
| 4555 |
if (that === null) { |
| 4556 |
that = new Buffer(length) |
| 4557 |
} |
| 4558 |
that.length = length |
| 4559 |
} |
| 4560 |
|
| 4561 |
return that |
| 4562 |
} |
| 4563 |
|
| 4564 |
/** |
| 4565 |
* The Buffer constructor returns instances of `Uint8Array` that have their |
| 4566 |
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of |
| 4567 |
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods |
| 4568 |
* and the `Uint8Array` methods. Square bracket notation works as expected -- it |
| 4569 |
* returns a single octet. |
| 4570 |
* |
| 4571 |
* The `Uint8Array` prototype remains unmodified. |
| 4572 |
*/ |
| 4573 |
|
| 4574 |
function Buffer (arg, encodingOrOffset, length) { |
| 4575 |
if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { |
| 4576 |
return new Buffer(arg, encodingOrOffset, length) |
| 4577 |
} |
| 4578 |
|
| 4579 |
// Common case. |
| 4580 |
if (typeof arg === 'number') { |
| 4581 |
if (typeof encodingOrOffset === 'string') { |
| 4582 |
throw new Error( |
| 4583 |
'If encoding is specified then the first argument must be a string' |
| 4584 |
) |
| 4585 |
} |
| 4586 |
return allocUnsafe(this, arg) |
| 4587 |
} |
| 4588 |
return from(this, arg, encodingOrOffset, length) |
| 4589 |
} |
| 4590 |
|
| 4591 |
Buffer.poolSize = 8192 // not used by this implementation |
| 4592 |
|
| 4593 |
// TODO: Legacy, not needed anymore. Remove in next major version. |
| 4594 |
Buffer._augment = function (arr) { |
| 4595 |
arr.__proto__ = Buffer.prototype |
| 4596 |
return arr |
| 4597 |
} |
| 4598 |
|
| 4599 |
function from (that, value, encodingOrOffset, length) { |
| 4600 |
if (typeof value === 'number') { |
| 4601 |
throw new TypeError('"value" argument must not be a number') |
| 4602 |
} |
| 4603 |
|
| 4604 |
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { |
| 4605 |
return fromArrayBuffer(that, value, encodingOrOffset, length) |
| 4606 |
} |
| 4607 |
|
| 4608 |
if (typeof value === 'string') { |
| 4609 |
return fromString(that, value, encodingOrOffset) |
| 4610 |
} |
| 4611 |
|
| 4612 |
return fromObject(that, value) |
| 4613 |
} |
| 4614 |
|
| 4615 |
/** |
| 4616 |
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError |
| 4617 |
* if value is a number. |
| 4618 |
* Buffer.from(str[, encoding]) |
| 4619 |
* Buffer.from(array) |
| 4620 |
* Buffer.from(buffer) |
| 4621 |
* Buffer.from(arrayBuffer[, byteOffset[, length]]) |
| 4622 |
**/ |
| 4623 |
Buffer.from = function (value, encodingOrOffset, length) { |
| 4624 |
return from(null, value, encodingOrOffset, length) |
| 4625 |
} |
| 4626 |
|
| 4627 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 4628 |
Buffer.prototype.__proto__ = Uint8Array.prototype |
| 4629 |
Buffer.__proto__ = Uint8Array |
| 4630 |
if (typeof Symbol !== 'undefined' && Symbol.species && |
| 4631 |
Buffer[Symbol.species] === Buffer) { |
| 4632 |
// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 |
| 4633 |
Object.defineProperty(Buffer, Symbol.species, { |
| 4634 |
value: null, |
| 4635 |
configurable: true |
| 4636 |
}) |
| 4637 |
} |
| 4638 |
} |
| 4639 |
|
| 4640 |
function assertSize (size) { |
| 4641 |
if (typeof size !== 'number') { |
| 4642 |
throw new TypeError('"size" argument must be a number') |
| 4643 |
} else if (size < 0) { |
| 4644 |
throw new RangeError('"size" argument must not be negative') |
| 4645 |
} |
| 4646 |
} |
| 4647 |
|
| 4648 |
function alloc (that, size, fill, encoding) { |
| 4649 |
assertSize(size) |
| 4650 |
if (size <= 0) { |
| 4651 |
return createBuffer(that, size) |
| 4652 |
} |
| 4653 |
if (fill !== undefined) { |
| 4654 |
// Only pay attention to encoding if it's a string. This |
| 4655 |
// prevents accidentally sending in a number that would |
| 4656 |
// be interpretted as a start offset. |
| 4657 |
return typeof encoding === 'string' |
| 4658 |
? createBuffer(that, size).fill(fill, encoding) |
| 4659 |
: createBuffer(that, size).fill(fill) |
| 4660 |
} |
| 4661 |
return createBuffer(that, size) |
| 4662 |
} |
| 4663 |
|
| 4664 |
/** |
| 4665 |
* Creates a new filled Buffer instance. |
| 4666 |
* alloc(size[, fill[, encoding]]) |
| 4667 |
**/ |
| 4668 |
Buffer.alloc = function (size, fill, encoding) { |
| 4669 |
return alloc(null, size, fill, encoding) |
| 4670 |
} |
| 4671 |
|
| 4672 |
function allocUnsafe (that, size) { |
| 4673 |
assertSize(size) |
| 4674 |
that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) |
| 4675 |
if (!Buffer.TYPED_ARRAY_SUPPORT) { |
| 4676 |
for (var i = 0; i < size; ++i) { |
| 4677 |
that[i] = 0 |
| 4678 |
} |
| 4679 |
} |
| 4680 |
return that |
| 4681 |
} |
| 4682 |
|
| 4683 |
/** |
| 4684 |
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. |
| 4685 |
* */ |
| 4686 |
Buffer.allocUnsafe = function (size) { |
| 4687 |
return allocUnsafe(null, size) |
| 4688 |
} |
| 4689 |
/** |
| 4690 |
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. |
| 4691 |
*/ |
| 4692 |
Buffer.allocUnsafeSlow = function (size) { |
| 4693 |
return allocUnsafe(null, size) |
| 4694 |
} |
| 4695 |
|
| 4696 |
function fromString (that, string, encoding) { |
| 4697 |
if (typeof encoding !== 'string' || encoding === '') { |
| 4698 |
encoding = 'utf8' |
| 4699 |
} |
| 4700 |
|
| 4701 |
if (!Buffer.isEncoding(encoding)) { |
| 4702 |
throw new TypeError('"encoding" must be a valid string encoding') |
| 4703 |
} |
| 4704 |
|
| 4705 |
var length = byteLength(string, encoding) | 0 |
| 4706 |
that = createBuffer(that, length) |
| 4707 |
|
| 4708 |
var actual = that.write(string, encoding) |
| 4709 |
|
| 4710 |
if (actual !== length) { |
| 4711 |
// Writing a hex string, for example, that contains invalid characters will |
| 4712 |
// cause everything after the first invalid character to be ignored. (e.g. |
| 4713 |
// 'abxxcd' will be treated as 'ab') |
| 4714 |
that = that.slice(0, actual) |
| 4715 |
} |
| 4716 |
|
| 4717 |
return that |
| 4718 |
} |
| 4719 |
|
| 4720 |
function fromArrayLike (that, array) { |
| 4721 |
var length = array.length < 0 ? 0 : checked(array.length) | 0 |
| 4722 |
that = createBuffer(that, length) |
| 4723 |
for (var i = 0; i < length; i += 1) { |
| 4724 |
that[i] = array[i] & 255 |
| 4725 |
} |
| 4726 |
return that |
| 4727 |
} |
| 4728 |
|
| 4729 |
function fromArrayBuffer (that, array, byteOffset, length) { |
| 4730 |
array.byteLength // this throws if `array` is not a valid ArrayBuffer |
| 4731 |
|
| 4732 |
if (byteOffset < 0 || array.byteLength < byteOffset) { |
| 4733 |
throw new RangeError('\'offset\' is out of bounds') |
| 4734 |
} |
| 4735 |
|
| 4736 |
if (array.byteLength < byteOffset + (length || 0)) { |
| 4737 |
throw new RangeError('\'length\' is out of bounds') |
| 4738 |
} |
| 4739 |
|
| 4740 |
if (byteOffset === undefined && length === undefined) { |
| 4741 |
array = new Uint8Array(array) |
| 4742 |
} else if (length === undefined) { |
| 4743 |
array = new Uint8Array(array, byteOffset) |
| 4744 |
} else { |
| 4745 |
array = new Uint8Array(array, byteOffset, length) |
| 4746 |
} |
| 4747 |
|
| 4748 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 4749 |
// Return an augmented `Uint8Array` instance, for best performance |
| 4750 |
that = array |
| 4751 |
that.__proto__ = Buffer.prototype |
| 4752 |
} else { |
| 4753 |
// Fallback: Return an object instance of the Buffer class |
| 4754 |
that = fromArrayLike(that, array) |
| 4755 |
} |
| 4756 |
return that |
| 4757 |
} |
| 4758 |
|
| 4759 |
function fromObject (that, obj) { |
| 4760 |
if (Buffer.isBuffer(obj)) { |
| 4761 |
var len = checked(obj.length) | 0 |
| 4762 |
that = createBuffer(that, len) |
| 4763 |
|
| 4764 |
if (that.length === 0) { |
| 4765 |
return that |
| 4766 |
} |
| 4767 |
|
| 4768 |
obj.copy(that, 0, 0, len) |
| 4769 |
return that |
| 4770 |
} |
| 4771 |
|
| 4772 |
if (obj) { |
| 4773 |
if ((typeof ArrayBuffer !== 'undefined' && |
| 4774 |
obj.buffer instanceof ArrayBuffer) || 'length' in obj) { |
| 4775 |
if (typeof obj.length !== 'number' || isnan(obj.length)) { |
| 4776 |
return createBuffer(that, 0) |
| 4777 |
} |
| 4778 |
return fromArrayLike(that, obj) |
| 4779 |
} |
| 4780 |
|
| 4781 |
if (obj.type === 'Buffer' && isArray(obj.data)) { |
| 4782 |
return fromArrayLike(that, obj.data) |
| 4783 |
} |
| 4784 |
} |
| 4785 |
|
| 4786 |
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') |
| 4787 |
} |
| 4788 |
|
| 4789 |
function checked (length) { |
| 4790 |
// Note: cannot use `length < kMaxLength()` here because that fails when |
| 4791 |
// length is NaN (which is otherwise coerced to zero.) |
| 4792 |
if (length >= kMaxLength()) { |
| 4793 |
throw new RangeError('Attempt to allocate Buffer larger than maximum ' + |
| 4794 |
'size: 0x' + kMaxLength().toString(16) + ' bytes') |
| 4795 |
} |
| 4796 |
return length | 0 |
| 4797 |
} |
| 4798 |
|
| 4799 |
function SlowBuffer (length) { |
| 4800 |
if (+length != length) { // eslint-disable-line eqeqeq |
| 4801 |
length = 0 |
| 4802 |
} |
| 4803 |
return Buffer.alloc(+length) |
| 4804 |
} |
| 4805 |
|
| 4806 |
Buffer.isBuffer = function isBuffer (b) { |
| 4807 |
return !!(b != null && b._isBuffer) |
| 4808 |
} |
| 4809 |
|
| 4810 |
Buffer.compare = function compare (a, b) { |
| 4811 |
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { |
| 4812 |
throw new TypeError('Arguments must be Buffers') |
| 4813 |
} |
| 4814 |
|
| 4815 |
if (a === b) return 0 |
| 4816 |
|
| 4817 |
var x = a.length |
| 4818 |
var y = b.length |
| 4819 |
|
| 4820 |
for (var i = 0, len = Math.min(x, y); i < len; ++i) { |
| 4821 |
if (a[i] !== b[i]) { |
| 4822 |
x = a[i] |
| 4823 |
y = b[i] |
| 4824 |
break |
| 4825 |
} |
| 4826 |
} |
| 4827 |
|
| 4828 |
if (x < y) return -1 |
| 4829 |
if (y < x) return 1 |
| 4830 |
return 0 |
| 4831 |
} |
| 4832 |
|
| 4833 |
Buffer.isEncoding = function isEncoding (encoding) { |
| 4834 |
switch (String(encoding).toLowerCase()) { |
| 4835 |
case 'hex': |
| 4836 |
case 'utf8': |
| 4837 |
case 'utf-8': |
| 4838 |
case 'ascii': |
| 4839 |
case 'latin1': |
| 4840 |
case 'binary': |
| 4841 |
case 'base64': |
| 4842 |
case 'ucs2': |
| 4843 |
case 'ucs-2': |
| 4844 |
case 'utf16le': |
| 4845 |
case 'utf-16le': |
| 4846 |
return true |
| 4847 |
default: |
| 4848 |
return false |
| 4849 |
} |
| 4850 |
} |
| 4851 |
|
| 4852 |
Buffer.concat = function concat (list, length) { |
| 4853 |
if (!isArray(list)) { |
| 4854 |
throw new TypeError('"list" argument must be an Array of Buffers') |
| 4855 |
} |
| 4856 |
|
| 4857 |
if (list.length === 0) { |
| 4858 |
return Buffer.alloc(0) |
| 4859 |
} |
| 4860 |
|
| 4861 |
var i |
| 4862 |
if (length === undefined) { |
| 4863 |
length = 0 |
| 4864 |
for (i = 0; i < list.length; ++i) { |
| 4865 |
length += list[i].length |
| 4866 |
} |
| 4867 |
} |
| 4868 |
|
| 4869 |
var buffer = Buffer.allocUnsafe(length) |
| 4870 |
var pos = 0 |
| 4871 |
for (i = 0; i < list.length; ++i) { |
| 4872 |
var buf = list[i] |
| 4873 |
if (!Buffer.isBuffer(buf)) { |
| 4874 |
throw new TypeError('"list" argument must be an Array of Buffers') |
| 4875 |
} |
| 4876 |
buf.copy(buffer, pos) |
| 4877 |
pos += buf.length |
| 4878 |
} |
| 4879 |
return buffer |
| 4880 |
} |
| 4881 |
|
| 4882 |
function byteLength (string, encoding) { |
| 4883 |
if (Buffer.isBuffer(string)) { |
| 4884 |
return string.length |
| 4885 |
} |
| 4886 |
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && |
| 4887 |
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { |
| 4888 |
return string.byteLength |
| 4889 |
} |
| 4890 |
if (typeof string !== 'string') { |
| 4891 |
string = '' + string |
| 4892 |
} |
| 4893 |
|
| 4894 |
var len = string.length |
| 4895 |
if (len === 0) return 0 |
| 4896 |
|
| 4897 |
// Use a for loop to avoid recursion |
| 4898 |
var loweredCase = false |
| 4899 |
for (;;) { |
| 4900 |
switch (encoding) { |
| 4901 |
case 'ascii': |
| 4902 |
case 'latin1': |
| 4903 |
case 'binary': |
| 4904 |
return len |
| 4905 |
case 'utf8': |
| 4906 |
case 'utf-8': |
| 4907 |
case undefined: |
| 4908 |
return utf8ToBytes(string).length |
| 4909 |
case 'ucs2': |
| 4910 |
case 'ucs-2': |
| 4911 |
case 'utf16le': |
| 4912 |
case 'utf-16le': |
| 4913 |
return len * 2 |
| 4914 |
case 'hex': |
| 4915 |
return len >>> 1 |
| 4916 |
case 'base64': |
| 4917 |
return base64ToBytes(string).length |
| 4918 |
default: |
| 4919 |
if (loweredCase) return utf8ToBytes(string).length // assume utf8 |
| 4920 |
encoding = ('' + encoding).toLowerCase() |
| 4921 |
loweredCase = true |
| 4922 |
} |
| 4923 |
} |
| 4924 |
} |
| 4925 |
Buffer.byteLength = byteLength |
| 4926 |
|
| 4927 |
function slowToString (encoding, start, end) { |
| 4928 |
var loweredCase = false |
| 4929 |
|
| 4930 |
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only |
| 4931 |
// property of a typed array. |
| 4932 |
|
| 4933 |
// This behaves neither like String nor Uint8Array in that we set start/end |
| 4934 |
// to their upper/lower bounds if the value passed is out of range. |
| 4935 |
// undefined is handled specially as per ECMA-262 6th Edition, |
| 4936 |
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. |
| 4937 |
if (start === undefined || start < 0) { |
| 4938 |
start = 0 |
| 4939 |
} |
| 4940 |
// Return early if start > this.length. Done here to prevent potential uint32 |
| 4941 |
// coercion fail below. |
| 4942 |
if (start > this.length) { |
| 4943 |
return '' |
| 4944 |
} |
| 4945 |
|
| 4946 |
if (end === undefined || end > this.length) { |
| 4947 |
end = this.length |
| 4948 |
} |
| 4949 |
|
| 4950 |
if (end <= 0) { |
| 4951 |
return '' |
| 4952 |
} |
| 4953 |
|
| 4954 |
// Force coersion to uint32. This will also coerce falsey/NaN values to 0. |
| 4955 |
end >>>= 0 |
| 4956 |
start >>>= 0 |
| 4957 |
|
| 4958 |
if (end <= start) { |
| 4959 |
return '' |
| 4960 |
} |
| 4961 |
|
| 4962 |
if (!encoding) encoding = 'utf8' |
| 4963 |
|
| 4964 |
while (true) { |
| 4965 |
switch (encoding) { |
| 4966 |
case 'hex': |
| 4967 |
return hexSlice(this, start, end) |
| 4968 |
|
| 4969 |
case 'utf8': |
| 4970 |
case 'utf-8': |
| 4971 |
return utf8Slice(this, start, end) |
| 4972 |
|
| 4973 |
case 'ascii': |
| 4974 |
return asciiSlice(this, start, end) |
| 4975 |
|
| 4976 |
case 'latin1': |
| 4977 |
case 'binary': |
| 4978 |
return latin1Slice(this, start, end) |
| 4979 |
|
| 4980 |
case 'base64': |
| 4981 |
return base64Slice(this, start, end) |
| 4982 |
|
| 4983 |
case 'ucs2': |
| 4984 |
case 'ucs-2': |
| 4985 |
case 'utf16le': |
| 4986 |
case 'utf-16le': |
| 4987 |
return utf16leSlice(this, start, end) |
| 4988 |
|
| 4989 |
default: |
| 4990 |
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) |
| 4991 |
encoding = (encoding + '').toLowerCase() |
| 4992 |
loweredCase = true |
| 4993 |
} |
| 4994 |
} |
| 4995 |
} |
| 4996 |
|
| 4997 |
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect |
| 4998 |
// Buffer instances. |
| 4999 |
Buffer.prototype._isBuffer = true |
| 5000 |
|
| 5001 |
function swap (b, n, m) { |
| 5002 |
var i = b[n] |
| 5003 |
b[n] = b[m] |
| 5004 |
b[m] = i |
| 5005 |
} |
| 5006 |
|
| 5007 |
Buffer.prototype.swap16 = function swap16 () { |
| 5008 |
var len = this.length |
| 5009 |
if (len % 2 !== 0) { |
| 5010 |
throw new RangeError('Buffer size must be a multiple of 16-bits') |
| 5011 |
} |
| 5012 |
for (var i = 0; i < len; i += 2) { |
| 5013 |
swap(this, i, i + 1) |
| 5014 |
} |
| 5015 |
return this |
| 5016 |
} |
| 5017 |
|
| 5018 |
Buffer.prototype.swap32 = function swap32 () { |
| 5019 |
var len = this.length |
| 5020 |
if (len % 4 !== 0) { |
| 5021 |
throw new RangeError('Buffer size must be a multiple of 32-bits') |
| 5022 |
} |
| 5023 |
for (var i = 0; i < len; i += 4) { |
| 5024 |
swap(this, i, i + 3) |
| 5025 |
swap(this, i + 1, i + 2) |
| 5026 |
} |
| 5027 |
return this |
| 5028 |
} |
| 5029 |
|
| 5030 |
Buffer.prototype.swap64 = function swap64 () { |
| 5031 |
var len = this.length |
| 5032 |
if (len % 8 !== 0) { |
| 5033 |
throw new RangeError('Buffer size must be a multiple of 64-bits') |
| 5034 |
} |
| 5035 |
for (var i = 0; i < len; i += 8) { |
| 5036 |
swap(this, i, i + 7) |
| 5037 |
swap(this, i + 1, i + 6) |
| 5038 |
swap(this, i + 2, i + 5) |
| 5039 |
swap(this, i + 3, i + 4) |
| 5040 |
} |
| 5041 |
return this |
| 5042 |
} |
| 5043 |
|
| 5044 |
Buffer.prototype.toString = function toString () { |
| 5045 |
var length = this.length | 0 |
| 5046 |
if (length === 0) return '' |
| 5047 |
if (arguments.length === 0) return utf8Slice(this, 0, length) |
| 5048 |
return slowToString.apply(this, arguments) |
| 5049 |
} |
| 5050 |
|
| 5051 |
Buffer.prototype.equals = function equals (b) { |
| 5052 |
if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') |
| 5053 |
if (this === b) return true |
| 5054 |
return Buffer.compare(this, b) === 0 |
| 5055 |
} |
| 5056 |
|
| 5057 |
Buffer.prototype.inspect = function inspect () { |
| 5058 |
var str = '' |
| 5059 |
var max = exports.INSPECT_MAX_BYTES |
| 5060 |
if (this.length > 0) { |
| 5061 |
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') |
| 5062 |
if (this.length > max) str += ' ... ' |
| 5063 |
} |
| 5064 |
return '<Buffer ' + str + '>' |
| 5065 |
} |
| 5066 |
|
| 5067 |
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { |
| 5068 |
if (!Buffer.isBuffer(target)) { |
| 5069 |
throw new TypeError('Argument must be a Buffer') |
| 5070 |
} |
| 5071 |
|
| 5072 |
if (start === undefined) { |
| 5073 |
start = 0 |
| 5074 |
} |
| 5075 |
if (end === undefined) { |
| 5076 |
end = target ? target.length : 0 |
| 5077 |
} |
| 5078 |
if (thisStart === undefined) { |
| 5079 |
thisStart = 0 |
| 5080 |
} |
| 5081 |
if (thisEnd === undefined) { |
| 5082 |
thisEnd = this.length |
| 5083 |
} |
| 5084 |
|
| 5085 |
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { |
| 5086 |
throw new RangeError('out of range index') |
| 5087 |
} |
| 5088 |
|
| 5089 |
if (thisStart >= thisEnd && start >= end) { |
| 5090 |
return 0 |
| 5091 |
} |
| 5092 |
if (thisStart >= thisEnd) { |
| 5093 |
return -1 |
| 5094 |
} |
| 5095 |
if (start >= end) { |
| 5096 |
return 1 |
| 5097 |
} |
| 5098 |
|
| 5099 |
start >>>= 0 |
| 5100 |
end >>>= 0 |
| 5101 |
thisStart >>>= 0 |
| 5102 |
thisEnd >>>= 0 |
| 5103 |
|
| 5104 |
if (this === target) return 0 |
| 5105 |
|
| 5106 |
var x = thisEnd - thisStart |
| 5107 |
var y = end - start |
| 5108 |
var len = Math.min(x, y) |
| 5109 |
|
| 5110 |
var thisCopy = this.slice(thisStart, thisEnd) |
| 5111 |
var targetCopy = target.slice(start, end) |
| 5112 |
|
| 5113 |
for (var i = 0; i < len; ++i) { |
| 5114 |
if (thisCopy[i] !== targetCopy[i]) { |
| 5115 |
x = thisCopy[i] |
| 5116 |
y = targetCopy[i] |
| 5117 |
break |
| 5118 |
} |
| 5119 |
} |
| 5120 |
|
| 5121 |
if (x < y) return -1 |
| 5122 |
if (y < x) return 1 |
| 5123 |
return 0 |
| 5124 |
} |
| 5125 |
|
| 5126 |
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, |
| 5127 |
// OR the last index of `val` in `buffer` at offset <= `byteOffset`. |
| 5128 |
// |
| 5129 |
// Arguments: |
| 5130 |
// - buffer - a Buffer to search |
| 5131 |
// - val - a string, Buffer, or number |
| 5132 |
// - byteOffset - an index into `buffer`; will be clamped to an int32 |
| 5133 |
// - encoding - an optional encoding, relevant is val is a string |
| 5134 |
// - dir - true for indexOf, false for lastIndexOf |
| 5135 |
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { |
| 5136 |
// Empty buffer means no match |
| 5137 |
if (buffer.length === 0) return -1 |
| 5138 |
|
| 5139 |
// Normalize byteOffset |
| 5140 |
if (typeof byteOffset === 'string') { |
| 5141 |
encoding = byteOffset |
| 5142 |
byteOffset = 0 |
| 5143 |
} else if (byteOffset > 0x7fffffff) { |
| 5144 |
byteOffset = 0x7fffffff |
| 5145 |
} else if (byteOffset < -0x80000000) { |
| 5146 |
byteOffset = -0x80000000 |
| 5147 |
} |
| 5148 |
byteOffset = +byteOffset // Coerce to Number. |
| 5149 |
if (isNaN(byteOffset)) { |
| 5150 |
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer |
| 5151 |
byteOffset = dir ? 0 : (buffer.length - 1) |
| 5152 |
} |
| 5153 |
|
| 5154 |
// Normalize byteOffset: negative offsets start from the end of the buffer |
| 5155 |
if (byteOffset < 0) byteOffset = buffer.length + byteOffset |
| 5156 |
if (byteOffset >= buffer.length) { |
| 5157 |
if (dir) return -1 |
| 5158 |
else byteOffset = buffer.length - 1 |
| 5159 |
} else if (byteOffset < 0) { |
| 5160 |
if (dir) byteOffset = 0 |
| 5161 |
else return -1 |
| 5162 |
} |
| 5163 |
|
| 5164 |
// Normalize val |
| 5165 |
if (typeof val === 'string') { |
| 5166 |
val = Buffer.from(val, encoding) |
| 5167 |
} |
| 5168 |
|
| 5169 |
// Finally, search either indexOf (if dir is true) or lastIndexOf |
| 5170 |
if (Buffer.isBuffer(val)) { |
| 5171 |
// Special case: looking for empty string/buffer always fails |
| 5172 |
if (val.length === 0) { |
| 5173 |
return -1 |
| 5174 |
} |
| 5175 |
return arrayIndexOf(buffer, val, byteOffset, encoding, dir) |
| 5176 |
} else if (typeof val === 'number') { |
| 5177 |
val = val & 0xFF // Search for a byte value [0-255] |
| 5178 |
if (Buffer.TYPED_ARRAY_SUPPORT && |
| 5179 |
typeof Uint8Array.prototype.indexOf === 'function') { |
| 5180 |
if (dir) { |
| 5181 |
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) |
| 5182 |
} else { |
| 5183 |
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) |
| 5184 |
} |
| 5185 |
} |
| 5186 |
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) |
| 5187 |
} |
| 5188 |
|
| 5189 |
throw new TypeError('val must be string, number or Buffer') |
| 5190 |
} |
| 5191 |
|
| 5192 |
function arrayIndexOf (arr, val, byteOffset, encoding, dir) { |
| 5193 |
var indexSize = 1 |
| 5194 |
var arrLength = arr.length |
| 5195 |
var valLength = val.length |
| 5196 |
|
| 5197 |
if (encoding !== undefined) { |
| 5198 |
encoding = String(encoding).toLowerCase() |
| 5199 |
if (encoding === 'ucs2' || encoding === 'ucs-2' || |
| 5200 |
encoding === 'utf16le' || encoding === 'utf-16le') { |
| 5201 |
if (arr.length < 2 || val.length < 2) { |
| 5202 |
return -1 |
| 5203 |
} |
| 5204 |
indexSize = 2 |
| 5205 |
arrLength /= 2 |
| 5206 |
valLength /= 2 |
| 5207 |
byteOffset /= 2 |
| 5208 |
} |
| 5209 |
} |
| 5210 |
|
| 5211 |
function read (buf, i) { |
| 5212 |
if (indexSize === 1) { |
| 5213 |
return buf[i] |
| 5214 |
} else { |
| 5215 |
return buf.readUInt16BE(i * indexSize) |
| 5216 |
} |
| 5217 |
} |
| 5218 |
|
| 5219 |
var i |
| 5220 |
if (dir) { |
| 5221 |
var foundIndex = -1 |
| 5222 |
for (i = byteOffset; i < arrLength; i++) { |
| 5223 |
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { |
| 5224 |
if (foundIndex === -1) foundIndex = i |
| 5225 |
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize |
| 5226 |
} else { |
| 5227 |
if (foundIndex !== -1) i -= i - foundIndex |
| 5228 |
foundIndex = -1 |
| 5229 |
} |
| 5230 |
} |
| 5231 |
} else { |
| 5232 |
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength |
| 5233 |
for (i = byteOffset; i >= 0; i--) { |
| 5234 |
var found = true |
| 5235 |
for (var j = 0; j < valLength; j++) { |
| 5236 |
if (read(arr, i + j) !== read(val, j)) { |
| 5237 |
found = false |
| 5238 |
break |
| 5239 |
} |
| 5240 |
} |
| 5241 |
if (found) return i |
| 5242 |
} |
| 5243 |
} |
| 5244 |
|
| 5245 |
return -1 |
| 5246 |
} |
| 5247 |
|
| 5248 |
Buffer.prototype.includes = function includes (val, byteOffset, encoding) { |
| 5249 |
return this.indexOf(val, byteOffset, encoding) !== -1 |
| 5250 |
} |
| 5251 |
|
| 5252 |
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { |
| 5253 |
return bidirectionalIndexOf(this, val, byteOffset, encoding, true) |
| 5254 |
} |
| 5255 |
|
| 5256 |
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { |
| 5257 |
return bidirectionalIndexOf(this, val, byteOffset, encoding, false) |
| 5258 |
} |
| 5259 |
|
| 5260 |
function hexWrite (buf, string, offset, length) { |
| 5261 |
offset = Number(offset) || 0 |
| 5262 |
var remaining = buf.length - offset |
| 5263 |
if (!length) { |
| 5264 |
length = remaining |
| 5265 |
} else { |
| 5266 |
length = Number(length) |
| 5267 |
if (length > remaining) { |
| 5268 |
length = remaining |
| 5269 |
} |
| 5270 |
} |
| 5271 |
|
| 5272 |
// must be an even number of digits |
| 5273 |
var strLen = string.length |
| 5274 |
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') |
| 5275 |
|
| 5276 |
if (length > strLen / 2) { |
| 5277 |
length = strLen / 2 |
| 5278 |
} |
| 5279 |
for (var i = 0; i < length; ++i) { |
| 5280 |
var parsed = parseInt(string.substr(i * 2, 2), 16) |
| 5281 |
if (isNaN(parsed)) return i |
| 5282 |
buf[offset + i] = parsed |
| 5283 |
} |
| 5284 |
return i |
| 5285 |
} |
| 5286 |
|
| 5287 |
function utf8Write (buf, string, offset, length) { |
| 5288 |
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) |
| 5289 |
} |
| 5290 |
|
| 5291 |
function asciiWrite (buf, string, offset, length) { |
| 5292 |
return blitBuffer(asciiToBytes(string), buf, offset, length) |
| 5293 |
} |
| 5294 |
|
| 5295 |
function latin1Write (buf, string, offset, length) { |
| 5296 |
return asciiWrite(buf, string, offset, length) |
| 5297 |
} |
| 5298 |
|
| 5299 |
function base64Write (buf, string, offset, length) { |
| 5300 |
return blitBuffer(base64ToBytes(string), buf, offset, length) |
| 5301 |
} |
| 5302 |
|
| 5303 |
function ucs2Write (buf, string, offset, length) { |
| 5304 |
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) |
| 5305 |
} |
| 5306 |
|
| 5307 |
Buffer.prototype.write = function write (string, offset, length, encoding) { |
| 5308 |
// Buffer#write(string) |
| 5309 |
if (offset === undefined) { |
| 5310 |
encoding = 'utf8' |
| 5311 |
length = this.length |
| 5312 |
offset = 0 |
| 5313 |
// Buffer#write(string, encoding) |
| 5314 |
} else if (length === undefined && typeof offset === 'string') { |
| 5315 |
encoding = offset |
| 5316 |
length = this.length |
| 5317 |
offset = 0 |
| 5318 |
// Buffer#write(string, offset[, length][, encoding]) |
| 5319 |
} else if (isFinite(offset)) { |
| 5320 |
offset = offset | 0 |
| 5321 |
if (isFinite(length)) { |
| 5322 |
length = length | 0 |
| 5323 |
if (encoding === undefined) encoding = 'utf8' |
| 5324 |
} else { |
| 5325 |
encoding = length |
| 5326 |
length = undefined |
| 5327 |
} |
| 5328 |
// legacy write(string, encoding, offset, length) - remove in v0.13 |
| 5329 |
} else { |
| 5330 |
throw new Error( |
| 5331 |
'Buffer.write(string, encoding, offset[, length]) is no longer supported' |
| 5332 |
) |
| 5333 |
} |
| 5334 |
|
| 5335 |
var remaining = this.length - offset |
| 5336 |
if (length === undefined || length > remaining) length = remaining |
| 5337 |
|
| 5338 |
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { |
| 5339 |
throw new RangeError('Attempt to write outside buffer bounds') |
| 5340 |
} |
| 5341 |
|
| 5342 |
if (!encoding) encoding = 'utf8' |
| 5343 |
|
| 5344 |
var loweredCase = false |
| 5345 |
for (;;) { |
| 5346 |
switch (encoding) { |
| 5347 |
case 'hex': |
| 5348 |
return hexWrite(this, string, offset, length) |
| 5349 |
|
| 5350 |
case 'utf8': |
| 5351 |
case 'utf-8': |
| 5352 |
return utf8Write(this, string, offset, length) |
| 5353 |
|
| 5354 |
case 'ascii': |
| 5355 |
return asciiWrite(this, string, offset, length) |
| 5356 |
|
| 5357 |
case 'latin1': |
| 5358 |
case 'binary': |
| 5359 |
return latin1Write(this, string, offset, length) |
| 5360 |
|
| 5361 |
case 'base64': |
| 5362 |
// Warning: maxLength not taken into account in base64Write |
| 5363 |
return base64Write(this, string, offset, length) |
| 5364 |
|
| 5365 |
case 'ucs2': |
| 5366 |
case 'ucs-2': |
| 5367 |
case 'utf16le': |
| 5368 |
case 'utf-16le': |
| 5369 |
return ucs2Write(this, string, offset, length) |
| 5370 |
|
| 5371 |
default: |
| 5372 |
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) |
| 5373 |
encoding = ('' + encoding).toLowerCase() |
| 5374 |
loweredCase = true |
| 5375 |
} |
| 5376 |
} |
| 5377 |
} |
| 5378 |
|
| 5379 |
Buffer.prototype.toJSON = function toJSON () { |
| 5380 |
return { |
| 5381 |
type: 'Buffer', |
| 5382 |
data: Array.prototype.slice.call(this._arr || this, 0) |
| 5383 |
} |
| 5384 |
} |
| 5385 |
|
| 5386 |
function base64Slice (buf, start, end) { |
| 5387 |
if (start === 0 && end === buf.length) { |
| 5388 |
return base64.fromByteArray(buf) |
| 5389 |
} else { |
| 5390 |
return base64.fromByteArray(buf.slice(start, end)) |
| 5391 |
} |
| 5392 |
} |
| 5393 |
|
| 5394 |
function utf8Slice (buf, start, end) { |
| 5395 |
end = Math.min(buf.length, end) |
| 5396 |
var res = [] |
| 5397 |
|
| 5398 |
var i = start |
| 5399 |
while (i < end) { |
| 5400 |
var firstByte = buf[i] |
| 5401 |
var codePoint = null |
| 5402 |
var bytesPerSequence = (firstByte > 0xEF) ? 4 |
| 5403 |
: (firstByte > 0xDF) ? 3 |
| 5404 |
: (firstByte > 0xBF) ? 2 |
| 5405 |
: 1 |
| 5406 |
|
| 5407 |
if (i + bytesPerSequence <= end) { |
| 5408 |
var secondByte, thirdByte, fourthByte, tempCodePoint |
| 5409 |
|
| 5410 |
switch (bytesPerSequence) { |
| 5411 |
case 1: |
| 5412 |
if (firstByte < 0x80) { |
| 5413 |
codePoint = firstByte |
| 5414 |
} |
| 5415 |
break |
| 5416 |
case 2: |
| 5417 |
secondByte = buf[i + 1] |
| 5418 |
if ((secondByte & 0xC0) === 0x80) { |
| 5419 |
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) |
| 5420 |
if (tempCodePoint > 0x7F) { |
| 5421 |
codePoint = tempCodePoint |
| 5422 |
} |
| 5423 |
} |
| 5424 |
break |
| 5425 |
case 3: |
| 5426 |
secondByte = buf[i + 1] |
| 5427 |
thirdByte = buf[i + 2] |
| 5428 |
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { |
| 5429 |
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) |
| 5430 |
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { |
| 5431 |
codePoint = tempCodePoint |
| 5432 |
} |
| 5433 |
} |
| 5434 |
break |
| 5435 |
case 4: |
| 5436 |
secondByte = buf[i + 1] |
| 5437 |
thirdByte = buf[i + 2] |
| 5438 |
fourthByte = buf[i + 3] |
| 5439 |
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { |
| 5440 |
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) |
| 5441 |
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { |
| 5442 |
codePoint = tempCodePoint |
| 5443 |
} |
| 5444 |
} |
| 5445 |
} |
| 5446 |
} |
| 5447 |
|
| 5448 |
if (codePoint === null) { |
| 5449 |
// we did not generate a valid codePoint so insert a |
| 5450 |
// replacement char (U+FFFD) and advance only 1 byte |
| 5451 |
codePoint = 0xFFFD |
| 5452 |
bytesPerSequence = 1 |
| 5453 |
} else if (codePoint > 0xFFFF) { |
| 5454 |
// encode to utf16 (surrogate pair dance) |
| 5455 |
codePoint -= 0x10000 |
| 5456 |
res.push(codePoint >>> 10 & 0x3FF | 0xD800) |
| 5457 |
codePoint = 0xDC00 | codePoint & 0x3FF |
| 5458 |
} |
| 5459 |
|
| 5460 |
res.push(codePoint) |
| 5461 |
i += bytesPerSequence |
| 5462 |
} |
| 5463 |
|
| 5464 |
return decodeCodePointsArray(res) |
| 5465 |
} |
| 5466 |
|
| 5467 |
// Based on http://stackoverflow.com/a/22747272/680742, the browser with |
| 5468 |
// the lowest limit is Chrome, with 0x10000 args. |
| 5469 |
// We go 1 magnitude less, for safety |
| 5470 |
var MAX_ARGUMENTS_LENGTH = 0x1000 |
| 5471 |
|
| 5472 |
function decodeCodePointsArray (codePoints) { |
| 5473 |
var len = codePoints.length |
| 5474 |
if (len <= MAX_ARGUMENTS_LENGTH) { |
| 5475 |
return String.fromCharCode.apply(String, codePoints) // avoid extra slice() |
| 5476 |
} |
| 5477 |
|
| 5478 |
// Decode in chunks to avoid "call stack size exceeded". |
| 5479 |
var res = '' |
| 5480 |
var i = 0 |
| 5481 |
while (i < len) { |
| 5482 |
res += String.fromCharCode.apply( |
| 5483 |
String, |
| 5484 |
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) |
| 5485 |
) |
| 5486 |
} |
| 5487 |
return res |
| 5488 |
} |
| 5489 |
|
| 5490 |
function asciiSlice (buf, start, end) { |
| 5491 |
var ret = '' |
| 5492 |
end = Math.min(buf.length, end) |
| 5493 |
|
| 5494 |
for (var i = start; i < end; ++i) { |
| 5495 |
ret += String.fromCharCode(buf[i] & 0x7F) |
| 5496 |
} |
| 5497 |
return ret |
| 5498 |
} |
| 5499 |
|
| 5500 |
function latin1Slice (buf, start, end) { |
| 5501 |
var ret = '' |
| 5502 |
end = Math.min(buf.length, end) |
| 5503 |
|
| 5504 |
for (var i = start; i < end; ++i) { |
| 5505 |
ret += String.fromCharCode(buf[i]) |
| 5506 |
} |
| 5507 |
return ret |
| 5508 |
} |
| 5509 |
|
| 5510 |
function hexSlice (buf, start, end) { |
| 5511 |
var len = buf.length |
| 5512 |
|
| 5513 |
if (!start || start < 0) start = 0 |
| 5514 |
if (!end || end < 0 || end > len) end = len |
| 5515 |
|
| 5516 |
var out = '' |
| 5517 |
for (var i = start; i < end; ++i) { |
| 5518 |
out += toHex(buf[i]) |
| 5519 |
} |
| 5520 |
return out |
| 5521 |
} |
| 5522 |
|
| 5523 |
function utf16leSlice (buf, start, end) { |
| 5524 |
var bytes = buf.slice(start, end) |
| 5525 |
var res = '' |
| 5526 |
for (var i = 0; i < bytes.length; i += 2) { |
| 5527 |
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) |
| 5528 |
} |
| 5529 |
return res |
| 5530 |
} |
| 5531 |
|
| 5532 |
Buffer.prototype.slice = function slice (start, end) { |
| 5533 |
var len = this.length |
| 5534 |
start = ~~start |
| 5535 |
end = end === undefined ? len : ~~end |
| 5536 |
|
| 5537 |
if (start < 0) { |
| 5538 |
start += len |
| 5539 |
if (start < 0) start = 0 |
| 5540 |
} else if (start > len) { |
| 5541 |
start = len |
| 5542 |
} |
| 5543 |
|
| 5544 |
if (end < 0) { |
| 5545 |
end += len |
| 5546 |
if (end < 0) end = 0 |
| 5547 |
} else if (end > len) { |
| 5548 |
end = len |
| 5549 |
} |
| 5550 |
|
| 5551 |
if (end < start) end = start |
| 5552 |
|
| 5553 |
var newBuf |
| 5554 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5555 |
newBuf = this.subarray(start, end) |
| 5556 |
newBuf.__proto__ = Buffer.prototype |
| 5557 |
} else { |
| 5558 |
var sliceLen = end - start |
| 5559 |
newBuf = new Buffer(sliceLen, undefined) |
| 5560 |
for (var i = 0; i < sliceLen; ++i) { |
| 5561 |
newBuf[i] = this[i + start] |
| 5562 |
} |
| 5563 |
} |
| 5564 |
|
| 5565 |
return newBuf |
| 5566 |
} |
| 5567 |
|
| 5568 |
/* |
| 5569 |
* Need to make sure that buffer isn't trying to write out of bounds. |
| 5570 |
*/ |
| 5571 |
function checkOffset (offset, ext, length) { |
| 5572 |
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') |
| 5573 |
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') |
| 5574 |
} |
| 5575 |
|
| 5576 |
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { |
| 5577 |
offset = offset | 0 |
| 5578 |
byteLength = byteLength | 0 |
| 5579 |
if (!noAssert) checkOffset(offset, byteLength, this.length) |
| 5580 |
|
| 5581 |
var val = this[offset] |
| 5582 |
var mul = 1 |
| 5583 |
var i = 0 |
| 5584 |
while (++i < byteLength && (mul *= 0x100)) { |
| 5585 |
val += this[offset + i] * mul |
| 5586 |
} |
| 5587 |
|
| 5588 |
return val |
| 5589 |
} |
| 5590 |
|
| 5591 |
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { |
| 5592 |
offset = offset | 0 |
| 5593 |
byteLength = byteLength | 0 |
| 5594 |
if (!noAssert) { |
| 5595 |
checkOffset(offset, byteLength, this.length) |
| 5596 |
} |
| 5597 |
|
| 5598 |
var val = this[offset + --byteLength] |
| 5599 |
var mul = 1 |
| 5600 |
while (byteLength > 0 && (mul *= 0x100)) { |
| 5601 |
val += this[offset + --byteLength] * mul |
| 5602 |
} |
| 5603 |
|
| 5604 |
return val |
| 5605 |
} |
| 5606 |
|
| 5607 |
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { |
| 5608 |
if (!noAssert) checkOffset(offset, 1, this.length) |
| 5609 |
return this[offset] |
| 5610 |
} |
| 5611 |
|
| 5612 |
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { |
| 5613 |
if (!noAssert) checkOffset(offset, 2, this.length) |
| 5614 |
return this[offset] | (this[offset + 1] << 8) |
| 5615 |
} |
| 5616 |
|
| 5617 |
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { |
| 5618 |
if (!noAssert) checkOffset(offset, 2, this.length) |
| 5619 |
return (this[offset] << 8) | this[offset + 1] |
| 5620 |
} |
| 5621 |
|
| 5622 |
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { |
| 5623 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5624 |
|
| 5625 |
return ((this[offset]) | |
| 5626 |
(this[offset + 1] << 8) | |
| 5627 |
(this[offset + 2] << 16)) + |
| 5628 |
(this[offset + 3] * 0x1000000) |
| 5629 |
} |
| 5630 |
|
| 5631 |
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { |
| 5632 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5633 |
|
| 5634 |
return (this[offset] * 0x1000000) + |
| 5635 |
((this[offset + 1] << 16) | |
| 5636 |
(this[offset + 2] << 8) | |
| 5637 |
this[offset + 3]) |
| 5638 |
} |
| 5639 |
|
| 5640 |
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { |
| 5641 |
offset = offset | 0 |
| 5642 |
byteLength = byteLength | 0 |
| 5643 |
if (!noAssert) checkOffset(offset, byteLength, this.length) |
| 5644 |
|
| 5645 |
var val = this[offset] |
| 5646 |
var mul = 1 |
| 5647 |
var i = 0 |
| 5648 |
while (++i < byteLength && (mul *= 0x100)) { |
| 5649 |
val += this[offset + i] * mul |
| 5650 |
} |
| 5651 |
mul *= 0x80 |
| 5652 |
|
| 5653 |
if (val >= mul) val -= Math.pow(2, 8 * byteLength) |
| 5654 |
|
| 5655 |
return val |
| 5656 |
} |
| 5657 |
|
| 5658 |
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { |
| 5659 |
offset = offset | 0 |
| 5660 |
byteLength = byteLength | 0 |
| 5661 |
if (!noAssert) checkOffset(offset, byteLength, this.length) |
| 5662 |
|
| 5663 |
var i = byteLength |
| 5664 |
var mul = 1 |
| 5665 |
var val = this[offset + --i] |
| 5666 |
while (i > 0 && (mul *= 0x100)) { |
| 5667 |
val += this[offset + --i] * mul |
| 5668 |
} |
| 5669 |
mul *= 0x80 |
| 5670 |
|
| 5671 |
if (val >= mul) val -= Math.pow(2, 8 * byteLength) |
| 5672 |
|
| 5673 |
return val |
| 5674 |
} |
| 5675 |
|
| 5676 |
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { |
| 5677 |
if (!noAssert) checkOffset(offset, 1, this.length) |
| 5678 |
if (!(this[offset] & 0x80)) return (this[offset]) |
| 5679 |
return ((0xff - this[offset] + 1) * -1) |
| 5680 |
} |
| 5681 |
|
| 5682 |
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { |
| 5683 |
if (!noAssert) checkOffset(offset, 2, this.length) |
| 5684 |
var val = this[offset] | (this[offset + 1] << 8) |
| 5685 |
return (val & 0x8000) ? val | 0xFFFF0000 : val |
| 5686 |
} |
| 5687 |
|
| 5688 |
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { |
| 5689 |
if (!noAssert) checkOffset(offset, 2, this.length) |
| 5690 |
var val = this[offset + 1] | (this[offset] << 8) |
| 5691 |
return (val & 0x8000) ? val | 0xFFFF0000 : val |
| 5692 |
} |
| 5693 |
|
| 5694 |
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { |
| 5695 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5696 |
|
| 5697 |
return (this[offset]) | |
| 5698 |
(this[offset + 1] << 8) | |
| 5699 |
(this[offset + 2] << 16) | |
| 5700 |
(this[offset + 3] << 24) |
| 5701 |
} |
| 5702 |
|
| 5703 |
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { |
| 5704 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5705 |
|
| 5706 |
return (this[offset] << 24) | |
| 5707 |
(this[offset + 1] << 16) | |
| 5708 |
(this[offset + 2] << 8) | |
| 5709 |
(this[offset + 3]) |
| 5710 |
} |
| 5711 |
|
| 5712 |
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { |
| 5713 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5714 |
return ieee754.read(this, offset, true, 23, 4) |
| 5715 |
} |
| 5716 |
|
| 5717 |
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { |
| 5718 |
if (!noAssert) checkOffset(offset, 4, this.length) |
| 5719 |
return ieee754.read(this, offset, false, 23, 4) |
| 5720 |
} |
| 5721 |
|
| 5722 |
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { |
| 5723 |
if (!noAssert) checkOffset(offset, 8, this.length) |
| 5724 |
return ieee754.read(this, offset, true, 52, 8) |
| 5725 |
} |
| 5726 |
|
| 5727 |
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { |
| 5728 |
if (!noAssert) checkOffset(offset, 8, this.length) |
| 5729 |
return ieee754.read(this, offset, false, 52, 8) |
| 5730 |
} |
| 5731 |
|
| 5732 |
function checkInt (buf, value, offset, ext, max, min) { |
| 5733 |
if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') |
| 5734 |
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') |
| 5735 |
if (offset + ext > buf.length) throw new RangeError('Index out of range') |
| 5736 |
} |
| 5737 |
|
| 5738 |
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { |
| 5739 |
value = +value |
| 5740 |
offset = offset | 0 |
| 5741 |
byteLength = byteLength | 0 |
| 5742 |
if (!noAssert) { |
| 5743 |
var maxBytes = Math.pow(2, 8 * byteLength) - 1 |
| 5744 |
checkInt(this, value, offset, byteLength, maxBytes, 0) |
| 5745 |
} |
| 5746 |
|
| 5747 |
var mul = 1 |
| 5748 |
var i = 0 |
| 5749 |
this[offset] = value & 0xFF |
| 5750 |
while (++i < byteLength && (mul *= 0x100)) { |
| 5751 |
this[offset + i] = (value / mul) & 0xFF |
| 5752 |
} |
| 5753 |
|
| 5754 |
return offset + byteLength |
| 5755 |
} |
| 5756 |
|
| 5757 |
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { |
| 5758 |
value = +value |
| 5759 |
offset = offset | 0 |
| 5760 |
byteLength = byteLength | 0 |
| 5761 |
if (!noAssert) { |
| 5762 |
var maxBytes = Math.pow(2, 8 * byteLength) - 1 |
| 5763 |
checkInt(this, value, offset, byteLength, maxBytes, 0) |
| 5764 |
} |
| 5765 |
|
| 5766 |
var i = byteLength - 1 |
| 5767 |
var mul = 1 |
| 5768 |
this[offset + i] = value & 0xFF |
| 5769 |
while (--i >= 0 && (mul *= 0x100)) { |
| 5770 |
this[offset + i] = (value / mul) & 0xFF |
| 5771 |
} |
| 5772 |
|
| 5773 |
return offset + byteLength |
| 5774 |
} |
| 5775 |
|
| 5776 |
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { |
| 5777 |
value = +value |
| 5778 |
offset = offset | 0 |
| 5779 |
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) |
| 5780 |
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) |
| 5781 |
this[offset] = (value & 0xff) |
| 5782 |
return offset + 1 |
| 5783 |
} |
| 5784 |
|
| 5785 |
function objectWriteUInt16 (buf, value, offset, littleEndian) { |
| 5786 |
if (value < 0) value = 0xffff + value + 1 |
| 5787 |
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { |
| 5788 |
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> |
| 5789 |
(littleEndian ? i : 1 - i) * 8 |
| 5790 |
} |
| 5791 |
} |
| 5792 |
|
| 5793 |
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { |
| 5794 |
value = +value |
| 5795 |
offset = offset | 0 |
| 5796 |
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) |
| 5797 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5798 |
this[offset] = (value & 0xff) |
| 5799 |
this[offset + 1] = (value >>> 8) |
| 5800 |
} else { |
| 5801 |
objectWriteUInt16(this, value, offset, true) |
| 5802 |
} |
| 5803 |
return offset + 2 |
| 5804 |
} |
| 5805 |
|
| 5806 |
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { |
| 5807 |
value = +value |
| 5808 |
offset = offset | 0 |
| 5809 |
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) |
| 5810 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5811 |
this[offset] = (value >>> 8) |
| 5812 |
this[offset + 1] = (value & 0xff) |
| 5813 |
} else { |
| 5814 |
objectWriteUInt16(this, value, offset, false) |
| 5815 |
} |
| 5816 |
return offset + 2 |
| 5817 |
} |
| 5818 |
|
| 5819 |
function objectWriteUInt32 (buf, value, offset, littleEndian) { |
| 5820 |
if (value < 0) value = 0xffffffff + value + 1 |
| 5821 |
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { |
| 5822 |
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff |
| 5823 |
} |
| 5824 |
} |
| 5825 |
|
| 5826 |
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { |
| 5827 |
value = +value |
| 5828 |
offset = offset | 0 |
| 5829 |
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) |
| 5830 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5831 |
this[offset + 3] = (value >>> 24) |
| 5832 |
this[offset + 2] = (value >>> 16) |
| 5833 |
this[offset + 1] = (value >>> 8) |
| 5834 |
this[offset] = (value & 0xff) |
| 5835 |
} else { |
| 5836 |
objectWriteUInt32(this, value, offset, true) |
| 5837 |
} |
| 5838 |
return offset + 4 |
| 5839 |
} |
| 5840 |
|
| 5841 |
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { |
| 5842 |
value = +value |
| 5843 |
offset = offset | 0 |
| 5844 |
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) |
| 5845 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5846 |
this[offset] = (value >>> 24) |
| 5847 |
this[offset + 1] = (value >>> 16) |
| 5848 |
this[offset + 2] = (value >>> 8) |
| 5849 |
this[offset + 3] = (value & 0xff) |
| 5850 |
} else { |
| 5851 |
objectWriteUInt32(this, value, offset, false) |
| 5852 |
} |
| 5853 |
return offset + 4 |
| 5854 |
} |
| 5855 |
|
| 5856 |
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { |
| 5857 |
value = +value |
| 5858 |
offset = offset | 0 |
| 5859 |
if (!noAssert) { |
| 5860 |
var limit = Math.pow(2, 8 * byteLength - 1) |
| 5861 |
|
| 5862 |
checkInt(this, value, offset, byteLength, limit - 1, -limit) |
| 5863 |
} |
| 5864 |
|
| 5865 |
var i = 0 |
| 5866 |
var mul = 1 |
| 5867 |
var sub = 0 |
| 5868 |
this[offset] = value & 0xFF |
| 5869 |
while (++i < byteLength && (mul *= 0x100)) { |
| 5870 |
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { |
| 5871 |
sub = 1 |
| 5872 |
} |
| 5873 |
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF |
| 5874 |
} |
| 5875 |
|
| 5876 |
return offset + byteLength |
| 5877 |
} |
| 5878 |
|
| 5879 |
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { |
| 5880 |
value = +value |
| 5881 |
offset = offset | 0 |
| 5882 |
if (!noAssert) { |
| 5883 |
var limit = Math.pow(2, 8 * byteLength - 1) |
| 5884 |
|
| 5885 |
checkInt(this, value, offset, byteLength, limit - 1, -limit) |
| 5886 |
} |
| 5887 |
|
| 5888 |
var i = byteLength - 1 |
| 5889 |
var mul = 1 |
| 5890 |
var sub = 0 |
| 5891 |
this[offset + i] = value & 0xFF |
| 5892 |
while (--i >= 0 && (mul *= 0x100)) { |
| 5893 |
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { |
| 5894 |
sub = 1 |
| 5895 |
} |
| 5896 |
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF |
| 5897 |
} |
| 5898 |
|
| 5899 |
return offset + byteLength |
| 5900 |
} |
| 5901 |
|
| 5902 |
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { |
| 5903 |
value = +value |
| 5904 |
offset = offset | 0 |
| 5905 |
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) |
| 5906 |
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) |
| 5907 |
if (value < 0) value = 0xff + value + 1 |
| 5908 |
this[offset] = (value & 0xff) |
| 5909 |
return offset + 1 |
| 5910 |
} |
| 5911 |
|
| 5912 |
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { |
| 5913 |
value = +value |
| 5914 |
offset = offset | 0 |
| 5915 |
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) |
| 5916 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5917 |
this[offset] = (value & 0xff) |
| 5918 |
this[offset + 1] = (value >>> 8) |
| 5919 |
} else { |
| 5920 |
objectWriteUInt16(this, value, offset, true) |
| 5921 |
} |
| 5922 |
return offset + 2 |
| 5923 |
} |
| 5924 |
|
| 5925 |
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { |
| 5926 |
value = +value |
| 5927 |
offset = offset | 0 |
| 5928 |
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) |
| 5929 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5930 |
this[offset] = (value >>> 8) |
| 5931 |
this[offset + 1] = (value & 0xff) |
| 5932 |
} else { |
| 5933 |
objectWriteUInt16(this, value, offset, false) |
| 5934 |
} |
| 5935 |
return offset + 2 |
| 5936 |
} |
| 5937 |
|
| 5938 |
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { |
| 5939 |
value = +value |
| 5940 |
offset = offset | 0 |
| 5941 |
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) |
| 5942 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5943 |
this[offset] = (value & 0xff) |
| 5944 |
this[offset + 1] = (value >>> 8) |
| 5945 |
this[offset + 2] = (value >>> 16) |
| 5946 |
this[offset + 3] = (value >>> 24) |
| 5947 |
} else { |
| 5948 |
objectWriteUInt32(this, value, offset, true) |
| 5949 |
} |
| 5950 |
return offset + 4 |
| 5951 |
} |
| 5952 |
|
| 5953 |
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { |
| 5954 |
value = +value |
| 5955 |
offset = offset | 0 |
| 5956 |
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) |
| 5957 |
if (value < 0) value = 0xffffffff + value + 1 |
| 5958 |
if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 5959 |
this[offset] = (value >>> 24) |
| 5960 |
this[offset + 1] = (value >>> 16) |
| 5961 |
this[offset + 2] = (value >>> 8) |
| 5962 |
this[offset + 3] = (value & 0xff) |
| 5963 |
} else { |
| 5964 |
objectWriteUInt32(this, value, offset, false) |
| 5965 |
} |
| 5966 |
return offset + 4 |
| 5967 |
} |
| 5968 |
|
| 5969 |
function checkIEEE754 (buf, value, offset, ext, max, min) { |
| 5970 |
if (offset + ext > buf.length) throw new RangeError('Index out of range') |
| 5971 |
if (offset < 0) throw new RangeError('Index out of range') |
| 5972 |
} |
| 5973 |
|
| 5974 |
function writeFloat (buf, value, offset, littleEndian, noAssert) { |
| 5975 |
if (!noAssert) { |
| 5976 |
checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) |
| 5977 |
} |
| 5978 |
ieee754.write(buf, value, offset, littleEndian, 23, 4) |
| 5979 |
return offset + 4 |
| 5980 |
} |
| 5981 |
|
| 5982 |
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { |
| 5983 |
return writeFloat(this, value, offset, true, noAssert) |
| 5984 |
} |
| 5985 |
|
| 5986 |
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { |
| 5987 |
return writeFloat(this, value, offset, false, noAssert) |
| 5988 |
} |
| 5989 |
|
| 5990 |
function writeDouble (buf, value, offset, littleEndian, noAssert) { |
| 5991 |
if (!noAssert) { |
| 5992 |
checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) |
| 5993 |
} |
| 5994 |
ieee754.write(buf, value, offset, littleEndian, 52, 8) |
| 5995 |
return offset + 8 |
| 5996 |
} |
| 5997 |
|
| 5998 |
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { |
| 5999 |
return writeDouble(this, value, offset, true, noAssert) |
| 6000 |
} |
| 6001 |
|
| 6002 |
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { |
| 6003 |
return writeDouble(this, value, offset, false, noAssert) |
| 6004 |
} |
| 6005 |
|
| 6006 |
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) |
| 6007 |
Buffer.prototype.copy = function copy (target, targetStart, start, end) { |
| 6008 |
if (!start) start = 0 |
| 6009 |
if (!end && end !== 0) end = this.length |
| 6010 |
if (targetStart >= target.length) targetStart = target.length |
| 6011 |
if (!targetStart) targetStart = 0 |
| 6012 |
if (end > 0 && end < start) end = start |
| 6013 |
|
| 6014 |
// Copy 0 bytes; we're done |
| 6015 |
if (end === start) return 0 |
| 6016 |
if (target.length === 0 || this.length === 0) return 0 |
| 6017 |
|
| 6018 |
// Fatal error conditions |
| 6019 |
if (targetStart < 0) { |
| 6020 |
throw new RangeError('targetStart out of bounds') |
| 6021 |
} |
| 6022 |
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') |
| 6023 |
if (end < 0) throw new RangeError('sourceEnd out of bounds') |
| 6024 |
|
| 6025 |
// Are we oob? |
| 6026 |
if (end > this.length) end = this.length |
| 6027 |
if (target.length - targetStart < end - start) { |
| 6028 |
end = target.length - targetStart + start |
| 6029 |
} |
| 6030 |
|
| 6031 |
var len = end - start |
| 6032 |
var i |
| 6033 |
|
| 6034 |
if (this === target && start < targetStart && targetStart < end) { |
| 6035 |
// descending copy from end |
| 6036 |
for (i = len - 1; i >= 0; --i) { |
| 6037 |
target[i + targetStart] = this[i + start] |
| 6038 |
} |
| 6039 |
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { |
| 6040 |
// ascending copy from start |
| 6041 |
for (i = 0; i < len; ++i) { |
| 6042 |
target[i + targetStart] = this[i + start] |
| 6043 |
} |
| 6044 |
} else { |
| 6045 |
Uint8Array.prototype.set.call( |
| 6046 |
target, |
| 6047 |
this.subarray(start, start + len), |
| 6048 |
targetStart |
| 6049 |
) |
| 6050 |
} |
| 6051 |
|
| 6052 |
return len |
| 6053 |
} |
| 6054 |
|
| 6055 |
// Usage: |
| 6056 |
// buffer.fill(number[, offset[, end]]) |
| 6057 |
// buffer.fill(buffer[, offset[, end]]) |
| 6058 |
// buffer.fill(string[, offset[, end]][, encoding]) |
| 6059 |
Buffer.prototype.fill = function fill (val, start, end, encoding) { |
| 6060 |
// Handle string cases: |
| 6061 |
if (typeof val === 'string') { |
| 6062 |
if (typeof start === 'string') { |
| 6063 |
encoding = start |
| 6064 |
start = 0 |
| 6065 |
end = this.length |
| 6066 |
} else if (typeof end === 'string') { |
| 6067 |
encoding = end |
| 6068 |
end = this.length |
| 6069 |
} |
| 6070 |
if (val.length === 1) { |
| 6071 |
var code = val.charCodeAt(0) |
| 6072 |
if (code < 256) { |
| 6073 |
val = code |
| 6074 |
} |
| 6075 |
} |
| 6076 |
if (encoding !== undefined && typeof encoding !== 'string') { |
| 6077 |
throw new TypeError('encoding must be a string') |
| 6078 |
} |
| 6079 |
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { |
| 6080 |
throw new TypeError('Unknown encoding: ' + encoding) |
| 6081 |
} |
| 6082 |
} else if (typeof val === 'number') { |
| 6083 |
val = val & 255 |
| 6084 |
} |
| 6085 |
|
| 6086 |
// Invalid ranges are not set to a default, so can range check early. |
| 6087 |
if (start < 0 || this.length < start || this.length < end) { |
| 6088 |
throw new RangeError('Out of range index') |
| 6089 |
} |
| 6090 |
|
| 6091 |
if (end <= start) { |
| 6092 |
return this |
| 6093 |
} |
| 6094 |
|
| 6095 |
start = start >>> 0 |
| 6096 |
end = end === undefined ? this.length : end >>> 0 |
| 6097 |
|
| 6098 |
if (!val) val = 0 |
| 6099 |
|
| 6100 |
var i |
| 6101 |
if (typeof val === 'number') { |
| 6102 |
for (i = start; i < end; ++i) { |
| 6103 |
this[i] = val |
| 6104 |
} |
| 6105 |
} else { |
| 6106 |
var bytes = Buffer.isBuffer(val) |
| 6107 |
? val |
| 6108 |
: utf8ToBytes(new Buffer(val, encoding).toString()) |
| 6109 |
var len = bytes.length |
| 6110 |
for (i = 0; i < end - start; ++i) { |
| 6111 |
this[i + start] = bytes[i % len] |
| 6112 |
} |
| 6113 |
} |
| 6114 |
|
| 6115 |
return this |
| 6116 |
} |
| 6117 |
|
| 6118 |
// HELPER FUNCTIONS |
| 6119 |
// ================ |
| 6120 |
|
| 6121 |
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g |
| 6122 |
|
| 6123 |
function base64clean (str) { |
| 6124 |
// Node strips out invalid characters like \n and \t from the string, base64-js does not |
| 6125 |
str = stringtrim(str).replace(INVALID_BASE64_RE, '') |
| 6126 |
// Node converts strings with length < 2 to '' |
| 6127 |
if (str.length < 2) return '' |
| 6128 |
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not |
| 6129 |
while (str.length % 4 !== 0) { |
| 6130 |
str = str + '=' |
| 6131 |
} |
| 6132 |
return str |
| 6133 |
} |
| 6134 |
|
| 6135 |
function stringtrim (str) { |
| 6136 |
if (str.trim) return str.trim() |
| 6137 |
return str.replace(/^\s+|\s+$/g, '') |
| 6138 |
} |
| 6139 |
|
| 6140 |
function toHex (n) { |
| 6141 |
if (n < 16) return '0' + n.toString(16) |
| 6142 |
return n.toString(16) |
| 6143 |
} |
| 6144 |
|
| 6145 |
function utf8ToBytes (string, units) { |
| 6146 |
units = units || Infinity |
| 6147 |
var codePoint |
| 6148 |
var length = string.length |
| 6149 |
var leadSurrogate = null |
| 6150 |
var bytes = [] |
| 6151 |
|
| 6152 |
for (var i = 0; i < length; ++i) { |
| 6153 |
codePoint = string.charCodeAt(i) |
| 6154 |
|
| 6155 |
// is surrogate component |
| 6156 |
if (codePoint > 0xD7FF && codePoint < 0xE000) { |
| 6157 |
// last char was a lead |
| 6158 |
if (!leadSurrogate) { |
| 6159 |
// no lead yet |
| 6160 |
if (codePoint > 0xDBFF) { |
| 6161 |
// unexpected trail |
| 6162 |
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| 6163 |
continue |
| 6164 |
} else if (i + 1 === length) { |
| 6165 |
// unpaired lead |
| 6166 |
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| 6167 |
continue |
| 6168 |
} |
| 6169 |
|
| 6170 |
// valid lead |
| 6171 |
leadSurrogate = codePoint |
| 6172 |
|
| 6173 |
continue |
| 6174 |
} |
| 6175 |
|
| 6176 |
// 2 leads in a row |
| 6177 |
if (codePoint < 0xDC00) { |
| 6178 |
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| 6179 |
leadSurrogate = codePoint |
| 6180 |
continue |
| 6181 |
} |
| 6182 |
|
| 6183 |
// valid surrogate pair |
| 6184 |
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 |
| 6185 |
} else if (leadSurrogate) { |
| 6186 |
// valid bmp char, but last char was a lead |
| 6187 |
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) |
| 6188 |
} |
| 6189 |
|
| 6190 |
leadSurrogate = null |
| 6191 |
|
| 6192 |
// encode utf8 |
| 6193 |
if (codePoint < 0x80) { |
| 6194 |
if ((units -= 1) < 0) break |
| 6195 |
bytes.push(codePoint) |
| 6196 |
} else if (codePoint < 0x800) { |
| 6197 |
if ((units -= 2) < 0) break |
| 6198 |
bytes.push( |
| 6199 |
codePoint >> 0x6 | 0xC0, |
| 6200 |
codePoint & 0x3F | 0x80 |
| 6201 |
) |
| 6202 |
} else if (codePoint < 0x10000) { |
| 6203 |
if ((units -= 3) < 0) break |
| 6204 |
bytes.push( |
| 6205 |
codePoint >> 0xC | 0xE0, |
| 6206 |
codePoint >> 0x6 & 0x3F | 0x80, |
| 6207 |
codePoint & 0x3F | 0x80 |
| 6208 |
) |
| 6209 |
} else if (codePoint < 0x110000) { |
| 6210 |
if ((units -= 4) < 0) break |
| 6211 |
bytes.push( |
| 6212 |
codePoint >> 0x12 | 0xF0, |
| 6213 |
codePoint >> 0xC & 0x3F | 0x80, |
| 6214 |
codePoint >> 0x6 & 0x3F | 0x80, |
| 6215 |
codePoint & 0x3F | 0x80 |
| 6216 |
) |
| 6217 |
} else { |
| 6218 |
throw new Error('Invalid code point') |
| 6219 |
} |
| 6220 |
} |
| 6221 |
|
| 6222 |
return bytes |
| 6223 |
} |
| 6224 |
|
| 6225 |
function asciiToBytes (str) { |
| 6226 |
var byteArray = [] |
| 6227 |
for (var i = 0; i < str.length; ++i) { |
| 6228 |
// Node's code seems to be doing this and not & 0x7F.. |
| 6229 |
byteArray.push(str.charCodeAt(i) & 0xFF) |
| 6230 |
} |
| 6231 |
return byteArray |
| 6232 |
} |
| 6233 |
|
| 6234 |
function utf16leToBytes (str, units) { |
| 6235 |
var c, hi, lo |
| 6236 |
var byteArray = [] |
| 6237 |
for (var i = 0; i < str.length; ++i) { |
| 6238 |
if ((units -= 2) < 0) break |
| 6239 |
|
| 6240 |
c = str.charCodeAt(i) |
| 6241 |
hi = c >> 8 |
| 6242 |
lo = c % 256 |
| 6243 |
byteArray.push(lo) |
| 6244 |
byteArray.push(hi) |
| 6245 |
} |
| 6246 |
|
| 6247 |
return byteArray |
| 6248 |
} |
| 6249 |
|
| 6250 |
function base64ToBytes (str) { |
| 6251 |
return base64.toByteArray(base64clean(str)) |
| 6252 |
} |
| 6253 |
|
| 6254 |
function blitBuffer (src, dst, offset, length) { |
| 6255 |
for (var i = 0; i < length; ++i) { |
| 6256 |
if ((i + offset >= dst.length) || (i >= src.length)) break |
| 6257 |
dst[i + offset] = src[i] |
| 6258 |
} |
| 6259 |
return i |
| 6260 |
} |
| 6261 |
|
| 6262 |
function isnan (val) { |
| 6263 |
return val !== val // eslint-disable-line no-self-compare |
| 6264 |
} |
| 6265 |
|
| 6266 |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) |
| 6267 |
|
| 6268 |
/***/ }), |
| 6269 |
|
| 6270 |
/***/ "./node_modules/node-libs-browser/node_modules/isarray/index.js": |
| 6271 |
/*!**********************************************************************!*\ |
| 6272 |
!*** ./node_modules/node-libs-browser/node_modules/isarray/index.js ***! |
| 6273 |
\**********************************************************************/ |
| 6274 |
/*! no static exports found */ |
| 6275 |
/***/ (function(module, exports) { |
| 6276 |
|
| 6277 |
var toString = {}.toString; |
| 6278 |
|
| 6279 |
module.exports = Array.isArray || function (arr) { |
| 6280 |
return toString.call(arr) == '[object Array]'; |
| 6281 |
}; |
| 6282 |
|
| 6283 |
|
| 6284 |
/***/ }), |
| 6285 |
|
| 6286 |
/***/ "./node_modules/object-assign/index.js": |
| 6287 |
/*!*********************************************!*\ |
| 6288 |
!*** ./node_modules/object-assign/index.js ***! |
| 6289 |
\*********************************************/ |
| 6290 |
/*! no static exports found */ |
| 6291 |
/***/ (function(module, exports, __webpack_require__) { |
| 6292 |
|
| 6293 |
"use strict"; |
| 6294 |
/* |
| 6295 |
object-assign |
| 6296 |
(c) Sindre Sorhus |
| 6297 |
@license MIT |
| 6298 |
*/ |
| 6299 |
|
| 6300 |
|
| 6301 |
/* eslint-disable no-unused-vars */ |
| 6302 |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
| 6303 |
var hasOwnProperty = Object.prototype.hasOwnProperty; |
| 6304 |
var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
| 6305 |
|
| 6306 |
function toObject(val) { |
| 6307 |
if (val === null || val === undefined) { |
| 6308 |
throw new TypeError('Object.assign cannot be called with null or undefined'); |
| 6309 |
} |
| 6310 |
|
| 6311 |
return Object(val); |
| 6312 |
} |
| 6313 |
|
| 6314 |
function shouldUseNative() { |
| 6315 |
try { |
| 6316 |
if (!Object.assign) { |
| 6317 |
return false; |
| 6318 |
} |
| 6319 |
|
| 6320 |
// Detect buggy property enumeration order in older V8 versions. |
| 6321 |
|
| 6322 |
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 |
| 6323 |
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers |
| 6324 |
test1[5] = 'de'; |
| 6325 |
if (Object.getOwnPropertyNames(test1)[0] === '5') { |
| 6326 |
return false; |
| 6327 |
} |
| 6328 |
|
| 6329 |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 6330 |
var test2 = {}; |
| 6331 |
for (var i = 0; i < 10; i++) { |
| 6332 |
test2['_' + String.fromCharCode(i)] = i; |
| 6333 |
} |
| 6334 |
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { |
| 6335 |
return test2[n]; |
| 6336 |
}); |
| 6337 |
if (order2.join('') !== '0123456789') { |
| 6338 |
return false; |
| 6339 |
} |
| 6340 |
|
| 6341 |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 6342 |
var test3 = {}; |
| 6343 |
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { |
| 6344 |
test3[letter] = letter; |
| 6345 |
}); |
| 6346 |
if (Object.keys(Object.assign({}, test3)).join('') !== |
| 6347 |
'abcdefghijklmnopqrst') { |
| 6348 |
return false; |
| 6349 |
} |
| 6350 |
|
| 6351 |
return true; |
| 6352 |
} catch (err) { |
| 6353 |
// We don't expect any of the above to throw, but better to be safe. |
| 6354 |
return false; |
| 6355 |
} |
| 6356 |
} |
| 6357 |
|
| 6358 |
module.exports = shouldUseNative() ? Object.assign : function (target, source) { |
| 6359 |
var from; |
| 6360 |
var to = toObject(target); |
| 6361 |
var symbols; |
| 6362 |
|
| 6363 |
for (var s = 1; s < arguments.length; s++) { |
| 6364 |
from = Object(arguments[s]); |
| 6365 |
|
| 6366 |
for (var key in from) { |
| 6367 |
if (hasOwnProperty.call(from, key)) { |
| 6368 |
to[key] = from[key]; |
| 6369 |
} |
| 6370 |
} |
| 6371 |
|
| 6372 |
if (getOwnPropertySymbols) { |
| 6373 |
symbols = getOwnPropertySymbols(from); |
| 6374 |
for (var i = 0; i < symbols.length; i++) { |
| 6375 |
if (propIsEnumerable.call(from, symbols[i])) { |
| 6376 |
to[symbols[i]] = from[symbols[i]]; |
| 6377 |
} |
| 6378 |
} |
| 6379 |
} |
| 6380 |
} |
| 6381 |
|
| 6382 |
return to; |
| 6383 |
}; |
| 6384 |
|
| 6385 |
|
| 6386 |
/***/ }), |
| 6387 |
|
| 6388 |
/***/ "./node_modules/prop-types/checkPropTypes.js": |
| 6389 |
/*!***************************************************!*\ |
| 6390 |
!*** ./node_modules/prop-types/checkPropTypes.js ***! |
| 6391 |
\***************************************************/ |
| 6392 |
/*! no static exports found */ |
| 6393 |
/***/ (function(module, exports, __webpack_require__) { |
| 6394 |
|
| 6395 |
"use strict"; |
| 6396 |
/** |
| 6397 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 6398 |
* |
| 6399 |
* This source code is licensed under the MIT license found in the |
| 6400 |
* LICENSE file in the root directory of this source tree. |
| 6401 |
*/ |
| 6402 |
|
| 6403 |
|
| 6404 |
|
| 6405 |
var printWarning = function() {}; |
| 6406 |
|
| 6407 |
if (true) { |
| 6408 |
var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); |
| 6409 |
var loggedTypeFailures = {}; |
| 6410 |
var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); |
| 6411 |
|
| 6412 |
printWarning = function(text) { |
| 6413 |
var message = 'Warning: ' + text; |
| 6414 |
if (typeof console !== 'undefined') { |
| 6415 |
console.error(message); |
| 6416 |
} |
| 6417 |
try { |
| 6418 |
// --- Welcome to debugging React --- |
| 6419 |
// This error was thrown as a convenience so that you can use this stack |
| 6420 |
// to find the callsite that caused this warning to fire. |
| 6421 |
throw new Error(message); |
| 6422 |
} catch (x) { /**/ } |
| 6423 |
}; |
| 6424 |
} |
| 6425 |
|
| 6426 |
/** |
| 6427 |
* Assert that the values match with the type specs. |
| 6428 |
* Error messages are memorized and will only be shown once. |
| 6429 |
* |
| 6430 |
* @param {object} typeSpecs Map of name to a ReactPropType |
| 6431 |
* @param {object} values Runtime values that need to be type-checked |
| 6432 |
* @param {string} location e.g. "prop", "context", "child context" |
| 6433 |
* @param {string} componentName Name of the component for error messages. |
| 6434 |
* @param {?Function} getStack Returns the component stack. |
| 6435 |
* @private |
| 6436 |
*/ |
| 6437 |
function checkPropTypes(typeSpecs, values, location, componentName, getStack) { |
| 6438 |
if (true) { |
| 6439 |
for (var typeSpecName in typeSpecs) { |
| 6440 |
if (has(typeSpecs, typeSpecName)) { |
| 6441 |
var error; |
| 6442 |
// Prop type validation may throw. In case they do, we don't want to |
| 6443 |
// fail the render phase where it didn't fail before. So we log it. |
| 6444 |
// After these have been cleaned up, we'll let them throw. |
| 6445 |
try { |
| 6446 |
// This is intentionally an invariant that gets caught. It's the same |
| 6447 |
// behavior as without this statement except with a better message. |
| 6448 |
if (typeof typeSpecs[typeSpecName] !== 'function') { |
| 6449 |
var err = Error( |
| 6450 |
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + |
| 6451 |
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + |
| 6452 |
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' |
| 6453 |
); |
| 6454 |
err.name = 'Invariant Violation'; |
| 6455 |
throw err; |
| 6456 |
} |
| 6457 |
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); |
| 6458 |
} catch (ex) { |
| 6459 |
error = ex; |
| 6460 |
} |
| 6461 |
if (error && !(error instanceof Error)) { |
| 6462 |
printWarning( |
| 6463 |
(componentName || 'React class') + ': type specification of ' + |
| 6464 |
location + ' `' + typeSpecName + '` is invalid; the type checker ' + |
| 6465 |
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + |
| 6466 |
'You may have forgotten to pass an argument to the type checker ' + |
| 6467 |
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + |
| 6468 |
'shape all require an argument).' |
| 6469 |
); |
| 6470 |
} |
| 6471 |
if (error instanceof Error && !(error.message in loggedTypeFailures)) { |
| 6472 |
// Only monitor this failure once because there tends to be a lot of the |
| 6473 |
// same error. |
| 6474 |
loggedTypeFailures[error.message] = true; |
| 6475 |
|
| 6476 |
var stack = getStack ? getStack() : ''; |
| 6477 |
|
| 6478 |
printWarning( |
| 6479 |
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') |
| 6480 |
); |
| 6481 |
} |
| 6482 |
} |
| 6483 |
} |
| 6484 |
} |
| 6485 |
} |
| 6486 |
|
| 6487 |
/** |
| 6488 |
* Resets warning cache when testing. |
| 6489 |
* |
| 6490 |
* @private |
| 6491 |
*/ |
| 6492 |
checkPropTypes.resetWarningCache = function() { |
| 6493 |
if (true) { |
| 6494 |
loggedTypeFailures = {}; |
| 6495 |
} |
| 6496 |
} |
| 6497 |
|
| 6498 |
module.exports = checkPropTypes; |
| 6499 |
|
| 6500 |
|
| 6501 |
/***/ }), |
| 6502 |
|
| 6503 |
/***/ "./node_modules/prop-types/factoryWithTypeCheckers.js": |
| 6504 |
/*!************************************************************!*\ |
| 6505 |
!*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***! |
| 6506 |
\************************************************************/ |
| 6507 |
/*! no static exports found */ |
| 6508 |
/***/ (function(module, exports, __webpack_require__) { |
| 6509 |
|
| 6510 |
"use strict"; |
| 6511 |
/** |
| 6512 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 6513 |
* |
| 6514 |
* This source code is licensed under the MIT license found in the |
| 6515 |
* LICENSE file in the root directory of this source tree. |
| 6516 |
*/ |
| 6517 |
|
| 6518 |
|
| 6519 |
|
| 6520 |
var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); |
| 6521 |
var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); |
| 6522 |
|
| 6523 |
var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js"); |
| 6524 |
var has = __webpack_require__(/*! ./lib/has */ "./node_modules/prop-types/lib/has.js"); |
| 6525 |
var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js"); |
| 6526 |
|
| 6527 |
var printWarning = function() {}; |
| 6528 |
|
| 6529 |
if (true) { |
| 6530 |
printWarning = function(text) { |
| 6531 |
var message = 'Warning: ' + text; |
| 6532 |
if (typeof console !== 'undefined') { |
| 6533 |
console.error(message); |
| 6534 |
} |
| 6535 |
try { |
| 6536 |
// --- Welcome to debugging React --- |
| 6537 |
// This error was thrown as a convenience so that you can use this stack |
| 6538 |
// to find the callsite that caused this warning to fire. |
| 6539 |
throw new Error(message); |
| 6540 |
} catch (x) {} |
| 6541 |
}; |
| 6542 |
} |
| 6543 |
|
| 6544 |
function emptyFunctionThatReturnsNull() { |
| 6545 |
return null; |
| 6546 |
} |
| 6547 |
|
| 6548 |
module.exports = function(isValidElement, throwOnDirectAccess) { |
| 6549 |
/* global Symbol */ |
| 6550 |
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; |
| 6551 |
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. |
| 6552 |
|
| 6553 |
/** |
| 6554 |
* Returns the iterator method function contained on the iterable object. |
| 6555 |
* |
| 6556 |
* Be sure to invoke the function with the iterable as context: |
| 6557 |
* |
| 6558 |
* var iteratorFn = getIteratorFn(myIterable); |
| 6559 |
* if (iteratorFn) { |
| 6560 |
* var iterator = iteratorFn.call(myIterable); |
| 6561 |
* ... |
| 6562 |
* } |
| 6563 |
* |
| 6564 |
* @param {?object} maybeIterable |
| 6565 |
* @return {?function} |
| 6566 |
*/ |
| 6567 |
function getIteratorFn(maybeIterable) { |
| 6568 |
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); |
| 6569 |
if (typeof iteratorFn === 'function') { |
| 6570 |
return iteratorFn; |
| 6571 |
} |
| 6572 |
} |
| 6573 |
|
| 6574 |
/** |
| 6575 |
* Collection of methods that allow declaration and validation of props that are |
| 6576 |
* supplied to React components. Example usage: |
| 6577 |
* |
| 6578 |
* var Props = require('ReactPropTypes'); |
| 6579 |
* var MyArticle = React.createClass({ |
| 6580 |
* propTypes: { |
| 6581 |
* // An optional string prop named "description". |
| 6582 |
* description: Props.string, |
| 6583 |
* |
| 6584 |
* // A required enum prop named "category". |
| 6585 |
* category: Props.oneOf(['News','Photos']).isRequired, |
| 6586 |
* |
| 6587 |
* // A prop named "dialog" that requires an instance of Dialog. |
| 6588 |
* dialog: Props.instanceOf(Dialog).isRequired |
| 6589 |
* }, |
| 6590 |
* render: function() { ... } |
| 6591 |
* }); |
| 6592 |
* |
| 6593 |
* A more formal specification of how these methods are used: |
| 6594 |
* |
| 6595 |
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) |
| 6596 |
* decl := ReactPropTypes.{type}(.isRequired)? |
| 6597 |
* |
| 6598 |
* Each and every declaration produces a function with the same signature. This |
| 6599 |
* allows the creation of custom validation functions. For example: |
| 6600 |
* |
| 6601 |
* var MyLink = React.createClass({ |
| 6602 |
* propTypes: { |
| 6603 |
* // An optional string or URI prop named "href". |
| 6604 |
* href: function(props, propName, componentName) { |
| 6605 |
* var propValue = props[propName]; |
| 6606 |
* if (propValue != null && typeof propValue !== 'string' && |
| 6607 |
* !(propValue instanceof URI)) { |
| 6608 |
* return new Error( |
| 6609 |
* 'Expected a string or an URI for ' + propName + ' in ' + |
| 6610 |
* componentName |
| 6611 |
* ); |
| 6612 |
* } |
| 6613 |
* } |
| 6614 |
* }, |
| 6615 |
* render: function() {...} |
| 6616 |
* }); |
| 6617 |
* |
| 6618 |
* @internal |
| 6619 |
*/ |
| 6620 |
|
| 6621 |
var ANONYMOUS = '<<anonymous>>'; |
| 6622 |
|
| 6623 |
// Important! |
| 6624 |
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`. |
| 6625 |
var ReactPropTypes = { |
| 6626 |
array: createPrimitiveTypeChecker('array'), |
| 6627 |
bigint: createPrimitiveTypeChecker('bigint'), |
| 6628 |
bool: createPrimitiveTypeChecker('boolean'), |
| 6629 |
func: createPrimitiveTypeChecker('function'), |
| 6630 |
number: createPrimitiveTypeChecker('number'), |
| 6631 |
object: createPrimitiveTypeChecker('object'), |
| 6632 |
string: createPrimitiveTypeChecker('string'), |
| 6633 |
symbol: createPrimitiveTypeChecker('symbol'), |
| 6634 |
|
| 6635 |
any: createAnyTypeChecker(), |
| 6636 |
arrayOf: createArrayOfTypeChecker, |
| 6637 |
element: createElementTypeChecker(), |
| 6638 |
elementType: createElementTypeTypeChecker(), |
| 6639 |
instanceOf: createInstanceTypeChecker, |
| 6640 |
node: createNodeChecker(), |
| 6641 |
objectOf: createObjectOfTypeChecker, |
| 6642 |
oneOf: createEnumTypeChecker, |
| 6643 |
oneOfType: createUnionTypeChecker, |
| 6644 |
shape: createShapeTypeChecker, |
| 6645 |
exact: createStrictShapeTypeChecker, |
| 6646 |
}; |
| 6647 |
|
| 6648 |
/** |
| 6649 |
* inlined Object.is polyfill to avoid requiring consumers ship their own |
| 6650 |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
| 6651 |
*/ |
| 6652 |
/*eslint-disable no-self-compare*/ |
| 6653 |
function is(x, y) { |
| 6654 |
// SameValue algorithm |
| 6655 |
if (x === y) { |
| 6656 |
// Steps 1-5, 7-10 |
| 6657 |
// Steps 6.b-6.e: +0 != -0 |
| 6658 |
return x !== 0 || 1 / x === 1 / y; |
| 6659 |
} else { |
| 6660 |
// Step 6.a: NaN == NaN |
| 6661 |
return x !== x && y !== y; |
| 6662 |
} |
| 6663 |
} |
| 6664 |
/*eslint-enable no-self-compare*/ |
| 6665 |
|
| 6666 |
/** |
| 6667 |
* We use an Error-like object for backward compatibility as people may call |
| 6668 |
* PropTypes directly and inspect their output. However, we don't use real |
| 6669 |
* Errors anymore. We don't inspect their stack anyway, and creating them |
| 6670 |
* is prohibitively expensive if they are created too often, such as what |
| 6671 |
* happens in oneOfType() for any type before the one that matched. |
| 6672 |
*/ |
| 6673 |
function PropTypeError(message, data) { |
| 6674 |
this.message = message; |
| 6675 |
this.data = data && typeof data === 'object' ? data: {}; |
| 6676 |
this.stack = ''; |
| 6677 |
} |
| 6678 |
// Make `instanceof Error` still work for returned errors. |
| 6679 |
PropTypeError.prototype = Error.prototype; |
| 6680 |
|
| 6681 |
function createChainableTypeChecker(validate) { |
| 6682 |
if (true) { |
| 6683 |
var manualPropTypeCallCache = {}; |
| 6684 |
var manualPropTypeWarningCount = 0; |
| 6685 |
} |
| 6686 |
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { |
| 6687 |
componentName = componentName || ANONYMOUS; |
| 6688 |
propFullName = propFullName || propName; |
| 6689 |
|
| 6690 |
if (secret !== ReactPropTypesSecret) { |
| 6691 |
if (throwOnDirectAccess) { |
| 6692 |
// New behavior only for users of `prop-types` package |
| 6693 |
var err = new Error( |
| 6694 |
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + |
| 6695 |
'Use `PropTypes.checkPropTypes()` to call them. ' + |
| 6696 |
'Read more at http://fb.me/use-check-prop-types' |
| 6697 |
); |
| 6698 |
err.name = 'Invariant Violation'; |
| 6699 |
throw err; |
| 6700 |
} else if ( true && typeof console !== 'undefined') { |
| 6701 |
// Old behavior for people using React.PropTypes |
| 6702 |
var cacheKey = componentName + ':' + propName; |
| 6703 |
if ( |
| 6704 |
!manualPropTypeCallCache[cacheKey] && |
| 6705 |
// Avoid spamming the console because they are often not actionable except for lib authors |
| 6706 |
manualPropTypeWarningCount < 3 |
| 6707 |
) { |
| 6708 |
printWarning( |
| 6709 |
'You are manually calling a React.PropTypes validation ' + |
| 6710 |
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + |
| 6711 |
'and will throw in the standalone `prop-types` package. ' + |
| 6712 |
'You may be seeing this warning due to a third-party PropTypes ' + |
| 6713 |
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' |
| 6714 |
); |
| 6715 |
manualPropTypeCallCache[cacheKey] = true; |
| 6716 |
manualPropTypeWarningCount++; |
| 6717 |
} |
| 6718 |
} |
| 6719 |
} |
| 6720 |
if (props[propName] == null) { |
| 6721 |
if (isRequired) { |
| 6722 |
if (props[propName] === null) { |
| 6723 |
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); |
| 6724 |
} |
| 6725 |
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); |
| 6726 |
} |
| 6727 |
return null; |
| 6728 |
} else { |
| 6729 |
return validate(props, propName, componentName, location, propFullName); |
| 6730 |
} |
| 6731 |
} |
| 6732 |
|
| 6733 |
var chainedCheckType = checkType.bind(null, false); |
| 6734 |
chainedCheckType.isRequired = checkType.bind(null, true); |
| 6735 |
|
| 6736 |
return chainedCheckType; |
| 6737 |
} |
| 6738 |
|
| 6739 |
function createPrimitiveTypeChecker(expectedType) { |
| 6740 |
function validate(props, propName, componentName, location, propFullName, secret) { |
| 6741 |
var propValue = props[propName]; |
| 6742 |
var propType = getPropType(propValue); |
| 6743 |
if (propType !== expectedType) { |
| 6744 |
// `propValue` being instance of, say, date/regexp, pass the 'object' |
| 6745 |
// check, but we can offer a more precise error message here rather than |
| 6746 |
// 'of type `object`'. |
| 6747 |
var preciseType = getPreciseType(propValue); |
| 6748 |
|
| 6749 |
return new PropTypeError( |
| 6750 |
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), |
| 6751 |
{expectedType: expectedType} |
| 6752 |
); |
| 6753 |
} |
| 6754 |
return null; |
| 6755 |
} |
| 6756 |
return createChainableTypeChecker(validate); |
| 6757 |
} |
| 6758 |
|
| 6759 |
function createAnyTypeChecker() { |
| 6760 |
return createChainableTypeChecker(emptyFunctionThatReturnsNull); |
| 6761 |
} |
| 6762 |
|
| 6763 |
function createArrayOfTypeChecker(typeChecker) { |
| 6764 |
function validate(props, propName, componentName, location, propFullName) { |
| 6765 |
if (typeof typeChecker !== 'function') { |
| 6766 |
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); |
| 6767 |
} |
| 6768 |
var propValue = props[propName]; |
| 6769 |
if (!Array.isArray(propValue)) { |
| 6770 |
var propType = getPropType(propValue); |
| 6771 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); |
| 6772 |
} |
| 6773 |
for (var i = 0; i < propValue.length; i++) { |
| 6774 |
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); |
| 6775 |
if (error instanceof Error) { |
| 6776 |
return error; |
| 6777 |
} |
| 6778 |
} |
| 6779 |
return null; |
| 6780 |
} |
| 6781 |
return createChainableTypeChecker(validate); |
| 6782 |
} |
| 6783 |
|
| 6784 |
function createElementTypeChecker() { |
| 6785 |
function validate(props, propName, componentName, location, propFullName) { |
| 6786 |
var propValue = props[propName]; |
| 6787 |
if (!isValidElement(propValue)) { |
| 6788 |
var propType = getPropType(propValue); |
| 6789 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); |
| 6790 |
} |
| 6791 |
return null; |
| 6792 |
} |
| 6793 |
return createChainableTypeChecker(validate); |
| 6794 |
} |
| 6795 |
|
| 6796 |
function createElementTypeTypeChecker() { |
| 6797 |
function validate(props, propName, componentName, location, propFullName) { |
| 6798 |
var propValue = props[propName]; |
| 6799 |
if (!ReactIs.isValidElementType(propValue)) { |
| 6800 |
var propType = getPropType(propValue); |
| 6801 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); |
| 6802 |
} |
| 6803 |
return null; |
| 6804 |
} |
| 6805 |
return createChainableTypeChecker(validate); |
| 6806 |
} |
| 6807 |
|
| 6808 |
function createInstanceTypeChecker(expectedClass) { |
| 6809 |
function validate(props, propName, componentName, location, propFullName) { |
| 6810 |
if (!(props[propName] instanceof expectedClass)) { |
| 6811 |
var expectedClassName = expectedClass.name || ANONYMOUS; |
| 6812 |
var actualClassName = getClassName(props[propName]); |
| 6813 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); |
| 6814 |
} |
| 6815 |
return null; |
| 6816 |
} |
| 6817 |
return createChainableTypeChecker(validate); |
| 6818 |
} |
| 6819 |
|
| 6820 |
function createEnumTypeChecker(expectedValues) { |
| 6821 |
if (!Array.isArray(expectedValues)) { |
| 6822 |
if (true) { |
| 6823 |
if (arguments.length > 1) { |
| 6824 |
printWarning( |
| 6825 |
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + |
| 6826 |
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' |
| 6827 |
); |
| 6828 |
} else { |
| 6829 |
printWarning('Invalid argument supplied to oneOf, expected an array.'); |
| 6830 |
} |
| 6831 |
} |
| 6832 |
return emptyFunctionThatReturnsNull; |
| 6833 |
} |
| 6834 |
|
| 6835 |
function validate(props, propName, componentName, location, propFullName) { |
| 6836 |
var propValue = props[propName]; |
| 6837 |
for (var i = 0; i < expectedValues.length; i++) { |
| 6838 |
if (is(propValue, expectedValues[i])) { |
| 6839 |
return null; |
| 6840 |
} |
| 6841 |
} |
| 6842 |
|
| 6843 |
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { |
| 6844 |
var type = getPreciseType(value); |
| 6845 |
if (type === 'symbol') { |
| 6846 |
return String(value); |
| 6847 |
} |
| 6848 |
return value; |
| 6849 |
}); |
| 6850 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); |
| 6851 |
} |
| 6852 |
return createChainableTypeChecker(validate); |
| 6853 |
} |
| 6854 |
|
| 6855 |
function createObjectOfTypeChecker(typeChecker) { |
| 6856 |
function validate(props, propName, componentName, location, propFullName) { |
| 6857 |
if (typeof typeChecker !== 'function') { |
| 6858 |
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); |
| 6859 |
} |
| 6860 |
var propValue = props[propName]; |
| 6861 |
var propType = getPropType(propValue); |
| 6862 |
if (propType !== 'object') { |
| 6863 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); |
| 6864 |
} |
| 6865 |
for (var key in propValue) { |
| 6866 |
if (has(propValue, key)) { |
| 6867 |
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 6868 |
if (error instanceof Error) { |
| 6869 |
return error; |
| 6870 |
} |
| 6871 |
} |
| 6872 |
} |
| 6873 |
return null; |
| 6874 |
} |
| 6875 |
return createChainableTypeChecker(validate); |
| 6876 |
} |
| 6877 |
|
| 6878 |
function createUnionTypeChecker(arrayOfTypeCheckers) { |
| 6879 |
if (!Array.isArray(arrayOfTypeCheckers)) { |
| 6880 |
true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; |
| 6881 |
return emptyFunctionThatReturnsNull; |
| 6882 |
} |
| 6883 |
|
| 6884 |
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 6885 |
var checker = arrayOfTypeCheckers[i]; |
| 6886 |
if (typeof checker !== 'function') { |
| 6887 |
printWarning( |
| 6888 |
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + |
| 6889 |
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' |
| 6890 |
); |
| 6891 |
return emptyFunctionThatReturnsNull; |
| 6892 |
} |
| 6893 |
} |
| 6894 |
|
| 6895 |
function validate(props, propName, componentName, location, propFullName) { |
| 6896 |
var expectedTypes = []; |
| 6897 |
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 6898 |
var checker = arrayOfTypeCheckers[i]; |
| 6899 |
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); |
| 6900 |
if (checkerResult == null) { |
| 6901 |
return null; |
| 6902 |
} |
| 6903 |
if (checkerResult.data && has(checkerResult.data, 'expectedType')) { |
| 6904 |
expectedTypes.push(checkerResult.data.expectedType); |
| 6905 |
} |
| 6906 |
} |
| 6907 |
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; |
| 6908 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); |
| 6909 |
} |
| 6910 |
return createChainableTypeChecker(validate); |
| 6911 |
} |
| 6912 |
|
| 6913 |
function createNodeChecker() { |
| 6914 |
function validate(props, propName, componentName, location, propFullName) { |
| 6915 |
if (!isNode(props[propName])) { |
| 6916 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); |
| 6917 |
} |
| 6918 |
return null; |
| 6919 |
} |
| 6920 |
return createChainableTypeChecker(validate); |
| 6921 |
} |
| 6922 |
|
| 6923 |
function invalidValidatorError(componentName, location, propFullName, key, type) { |
| 6924 |
return new PropTypeError( |
| 6925 |
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + |
| 6926 |
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' |
| 6927 |
); |
| 6928 |
} |
| 6929 |
|
| 6930 |
function createShapeTypeChecker(shapeTypes) { |
| 6931 |
function validate(props, propName, componentName, location, propFullName) { |
| 6932 |
var propValue = props[propName]; |
| 6933 |
var propType = getPropType(propValue); |
| 6934 |
if (propType !== 'object') { |
| 6935 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); |
| 6936 |
} |
| 6937 |
for (var key in shapeTypes) { |
| 6938 |
var checker = shapeTypes[key]; |
| 6939 |
if (typeof checker !== 'function') { |
| 6940 |
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 6941 |
} |
| 6942 |
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 6943 |
if (error) { |
| 6944 |
return error; |
| 6945 |
} |
| 6946 |
} |
| 6947 |
return null; |
| 6948 |
} |
| 6949 |
return createChainableTypeChecker(validate); |
| 6950 |
} |
| 6951 |
|
| 6952 |
function createStrictShapeTypeChecker(shapeTypes) { |
| 6953 |
function validate(props, propName, componentName, location, propFullName) { |
| 6954 |
var propValue = props[propName]; |
| 6955 |
var propType = getPropType(propValue); |
| 6956 |
if (propType !== 'object') { |
| 6957 |
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); |
| 6958 |
} |
| 6959 |
// We need to check all keys in case some are required but missing from props. |
| 6960 |
var allKeys = assign({}, props[propName], shapeTypes); |
| 6961 |
for (var key in allKeys) { |
| 6962 |
var checker = shapeTypes[key]; |
| 6963 |
if (has(shapeTypes, key) && typeof checker !== 'function') { |
| 6964 |
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 6965 |
} |
| 6966 |
if (!checker) { |
| 6967 |
return new PropTypeError( |
| 6968 |
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + |
| 6969 |
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') + |
| 6970 |
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') |
| 6971 |
); |
| 6972 |
} |
| 6973 |
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 6974 |
if (error) { |
| 6975 |
return error; |
| 6976 |
} |
| 6977 |
} |
| 6978 |
return null; |
| 6979 |
} |
| 6980 |
|
| 6981 |
return createChainableTypeChecker(validate); |
| 6982 |
} |
| 6983 |
|
| 6984 |
function isNode(propValue) { |
| 6985 |
switch (typeof propValue) { |
| 6986 |
case 'number': |
| 6987 |
case 'string': |
| 6988 |
case 'undefined': |
| 6989 |
return true; |
| 6990 |
case 'boolean': |
| 6991 |
return !propValue; |
| 6992 |
case 'object': |
| 6993 |
if (Array.isArray(propValue)) { |
| 6994 |
return propValue.every(isNode); |
| 6995 |
} |
| 6996 |
if (propValue === null || isValidElement(propValue)) { |
| 6997 |
return true; |
| 6998 |
} |
| 6999 |
|
| 7000 |
var iteratorFn = getIteratorFn(propValue); |
| 7001 |
if (iteratorFn) { |
| 7002 |
var iterator = iteratorFn.call(propValue); |
| 7003 |
var step; |
| 7004 |
if (iteratorFn !== propValue.entries) { |
| 7005 |
while (!(step = iterator.next()).done) { |
| 7006 |
if (!isNode(step.value)) { |
| 7007 |
return false; |
| 7008 |
} |
| 7009 |
} |
| 7010 |
} else { |
| 7011 |
// Iterator will provide entry [k,v] tuples rather than values. |
| 7012 |
while (!(step = iterator.next()).done) { |
| 7013 |
var entry = step.value; |
| 7014 |
if (entry) { |
| 7015 |
if (!isNode(entry[1])) { |
| 7016 |
return false; |
| 7017 |
} |
| 7018 |
} |
| 7019 |
} |
| 7020 |
} |
| 7021 |
} else { |
| 7022 |
return false; |
| 7023 |
} |
| 7024 |
|
| 7025 |
return true; |
| 7026 |
default: |
| 7027 |
return false; |
| 7028 |
} |
| 7029 |
} |
| 7030 |
|
| 7031 |
function isSymbol(propType, propValue) { |
| 7032 |
// Native Symbol. |
| 7033 |
if (propType === 'symbol') { |
| 7034 |
return true; |
| 7035 |
} |
| 7036 |
|
| 7037 |
// falsy value can't be a Symbol |
| 7038 |
if (!propValue) { |
| 7039 |
return false; |
| 7040 |
} |
| 7041 |
|
| 7042 |
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' |
| 7043 |
if (propValue['@@toStringTag'] === 'Symbol') { |
| 7044 |
return true; |
| 7045 |
} |
| 7046 |
|
| 7047 |
// Fallback for non-spec compliant Symbols which are polyfilled. |
| 7048 |
if (typeof Symbol === 'function' && propValue instanceof Symbol) { |
| 7049 |
return true; |
| 7050 |
} |
| 7051 |
|
| 7052 |
return false; |
| 7053 |
} |
| 7054 |
|
| 7055 |
// Equivalent of `typeof` but with special handling for array and regexp. |
| 7056 |
function getPropType(propValue) { |
| 7057 |
var propType = typeof propValue; |
| 7058 |
if (Array.isArray(propValue)) { |
| 7059 |
return 'array'; |
| 7060 |
} |
| 7061 |
if (propValue instanceof RegExp) { |
| 7062 |
// Old webkits (at least until Android 4.0) return 'function' rather than |
| 7063 |
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/ |
| 7064 |
// passes PropTypes.object. |
| 7065 |
return 'object'; |
| 7066 |
} |
| 7067 |
if (isSymbol(propType, propValue)) { |
| 7068 |
return 'symbol'; |
| 7069 |
} |
| 7070 |
return propType; |
| 7071 |
} |
| 7072 |
|
| 7073 |
// This handles more types than `getPropType`. Only used for error messages. |
| 7074 |
// See `createPrimitiveTypeChecker`. |
| 7075 |
function getPreciseType(propValue) { |
| 7076 |
if (typeof propValue === 'undefined' || propValue === null) { |
| 7077 |
return '' + propValue; |
| 7078 |
} |
| 7079 |
var propType = getPropType(propValue); |
| 7080 |
if (propType === 'object') { |
| 7081 |
if (propValue instanceof Date) { |
| 7082 |
return 'date'; |
| 7083 |
} else if (propValue instanceof RegExp) { |
| 7084 |
return 'regexp'; |
| 7085 |
} |
| 7086 |
} |
| 7087 |
return propType; |
| 7088 |
} |
| 7089 |
|
| 7090 |
// Returns a string that is postfixed to a warning about an invalid type. |
| 7091 |
// For example, "undefined" or "of type array" |
| 7092 |
function getPostfixForTypeWarning(value) { |
| 7093 |
var type = getPreciseType(value); |
| 7094 |
switch (type) { |
| 7095 |
case 'array': |
| 7096 |
case 'object': |
| 7097 |
return 'an ' + type; |
| 7098 |
case 'boolean': |
| 7099 |
case 'date': |
| 7100 |
case 'regexp': |
| 7101 |
return 'a ' + type; |
| 7102 |
default: |
| 7103 |
return type; |
| 7104 |
} |
| 7105 |
} |
| 7106 |
|
| 7107 |
// Returns class name of the object, if any. |
| 7108 |
function getClassName(propValue) { |
| 7109 |
if (!propValue.constructor || !propValue.constructor.name) { |
| 7110 |
return ANONYMOUS; |
| 7111 |
} |
| 7112 |
return propValue.constructor.name; |
| 7113 |
} |
| 7114 |
|
| 7115 |
ReactPropTypes.checkPropTypes = checkPropTypes; |
| 7116 |
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; |
| 7117 |
ReactPropTypes.PropTypes = ReactPropTypes; |
| 7118 |
|
| 7119 |
return ReactPropTypes; |
| 7120 |
}; |
| 7121 |
|
| 7122 |
|
| 7123 |
/***/ }), |
| 7124 |
|
| 7125 |
/***/ "./node_modules/prop-types/index.js": |
| 7126 |
/*!******************************************!*\ |
| 7127 |
!*** ./node_modules/prop-types/index.js ***! |
| 7128 |
\******************************************/ |
| 7129 |
/*! no static exports found */ |
| 7130 |
/***/ (function(module, exports, __webpack_require__) { |
| 7131 |
|
| 7132 |
/** |
| 7133 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 7134 |
* |
| 7135 |
* This source code is licensed under the MIT license found in the |
| 7136 |
* LICENSE file in the root directory of this source tree. |
| 7137 |
*/ |
| 7138 |
|
| 7139 |
if (true) { |
| 7140 |
var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js"); |
| 7141 |
|
| 7142 |
// By explicitly using `prop-types` you are opting into new development behavior. |
| 7143 |
// http://fb.me/prop-types-in-prod |
| 7144 |
var throwOnDirectAccess = true; |
| 7145 |
module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); |
| 7146 |
} else {} |
| 7147 |
|
| 7148 |
|
| 7149 |
/***/ }), |
| 7150 |
|
| 7151 |
/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": |
| 7152 |
/*!*************************************************************!*\ |
| 7153 |
!*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! |
| 7154 |
\*************************************************************/ |
| 7155 |
/*! no static exports found */ |
| 7156 |
/***/ (function(module, exports, __webpack_require__) { |
| 7157 |
|
| 7158 |
"use strict"; |
| 7159 |
/** |
| 7160 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 7161 |
* |
| 7162 |
* This source code is licensed under the MIT license found in the |
| 7163 |
* LICENSE file in the root directory of this source tree. |
| 7164 |
*/ |
| 7165 |
|
| 7166 |
|
| 7167 |
|
| 7168 |
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; |
| 7169 |
|
| 7170 |
module.exports = ReactPropTypesSecret; |
| 7171 |
|
| 7172 |
|
| 7173 |
/***/ }), |
| 7174 |
|
| 7175 |
/***/ "./node_modules/prop-types/lib/has.js": |
| 7176 |
/*!********************************************!*\ |
| 7177 |
!*** ./node_modules/prop-types/lib/has.js ***! |
| 7178 |
\********************************************/ |
| 7179 |
/*! no static exports found */ |
| 7180 |
/***/ (function(module, exports) { |
| 7181 |
|
| 7182 |
module.exports = Function.call.bind(Object.prototype.hasOwnProperty); |
| 7183 |
|
| 7184 |
|
| 7185 |
/***/ }), |
| 7186 |
|
| 7187 |
/***/ "./node_modules/react-fast-compare/index.js": |
| 7188 |
/*!**************************************************!*\ |
| 7189 |
!*** ./node_modules/react-fast-compare/index.js ***! |
| 7190 |
\**************************************************/ |
| 7191 |
/*! no static exports found */ |
| 7192 |
/***/ (function(module, exports) { |
| 7193 |
|
| 7194 |
/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */ |
| 7195 |
|
| 7196 |
var hasElementType = typeof Element !== 'undefined'; |
| 7197 |
var hasMap = typeof Map === 'function'; |
| 7198 |
var hasSet = typeof Set === 'function'; |
| 7199 |
var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView; |
| 7200 |
|
| 7201 |
// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js |
| 7202 |
|
| 7203 |
function equal(a, b) { |
| 7204 |
// START: fast-deep-equal es6/index.js 3.1.3 |
| 7205 |
if (a === b) return true; |
| 7206 |
|
| 7207 |
if (a && b && typeof a == 'object' && typeof b == 'object') { |
| 7208 |
if (a.constructor !== b.constructor) return false; |
| 7209 |
|
| 7210 |
var length, i, keys; |
| 7211 |
if (Array.isArray(a)) { |
| 7212 |
length = a.length; |
| 7213 |
if (length != b.length) return false; |
| 7214 |
for (i = length; i-- !== 0;) |
| 7215 |
if (!equal(a[i], b[i])) return false; |
| 7216 |
return true; |
| 7217 |
} |
| 7218 |
|
| 7219 |
// START: Modifications: |
| 7220 |
// 1. Extra `has<Type> &&` helpers in initial condition allow es6 code |
| 7221 |
// to co-exist with es5. |
| 7222 |
// 2. Replace `for of` with es5 compliant iteration using `for`. |
| 7223 |
// Basically, take: |
| 7224 |
// |
| 7225 |
// ```js |
| 7226 |
// for (i of a.entries()) |
| 7227 |
// if (!b.has(i[0])) return false; |
| 7228 |
// ``` |
| 7229 |
// |
| 7230 |
// ... and convert to: |
| 7231 |
// |
| 7232 |
// ```js |
| 7233 |
// it = a.entries(); |
| 7234 |
// while (!(i = it.next()).done) |
| 7235 |
// if (!b.has(i.value[0])) return false; |
| 7236 |
// ``` |
| 7237 |
// |
| 7238 |
// **Note**: `i` access switches to `i.value`. |
| 7239 |
var it; |
| 7240 |
if (hasMap && (a instanceof Map) && (b instanceof Map)) { |
| 7241 |
if (a.size !== b.size) return false; |
| 7242 |
it = a.entries(); |
| 7243 |
while (!(i = it.next()).done) |
| 7244 |
if (!b.has(i.value[0])) return false; |
| 7245 |
it = a.entries(); |
| 7246 |
while (!(i = it.next()).done) |
| 7247 |
if (!equal(i.value[1], b.get(i.value[0]))) return false; |
| 7248 |
return true; |
| 7249 |
} |
| 7250 |
|
| 7251 |
if (hasSet && (a instanceof Set) && (b instanceof Set)) { |
| 7252 |
if (a.size !== b.size) return false; |
| 7253 |
it = a.entries(); |
| 7254 |
while (!(i = it.next()).done) |
| 7255 |
if (!b.has(i.value[0])) return false; |
| 7256 |
return true; |
| 7257 |
} |
| 7258 |
// END: Modifications |
| 7259 |
|
| 7260 |
if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { |
| 7261 |
length = a.length; |
| 7262 |
if (length != b.length) return false; |
| 7263 |
for (i = length; i-- !== 0;) |
| 7264 |
if (a[i] !== b[i]) return false; |
| 7265 |
return true; |
| 7266 |
} |
| 7267 |
|
| 7268 |
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; |
| 7269 |
// START: Modifications: |
| 7270 |
// Apply guards for `Object.create(null)` handling. See: |
| 7271 |
// - https://github.com/FormidableLabs/react-fast-compare/issues/64 |
| 7272 |
// - https://github.com/epoberezkin/fast-deep-equal/issues/49 |
| 7273 |
if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf(); |
| 7274 |
if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString(); |
| 7275 |
// END: Modifications |
| 7276 |
|
| 7277 |
keys = Object.keys(a); |
| 7278 |
length = keys.length; |
| 7279 |
if (length !== Object.keys(b).length) return false; |
| 7280 |
|
| 7281 |
for (i = length; i-- !== 0;) |
| 7282 |
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; |
| 7283 |
// END: fast-deep-equal |
| 7284 |
|
| 7285 |
// START: react-fast-compare |
| 7286 |
// custom handling for DOM elements |
| 7287 |
if (hasElementType && a instanceof Element) return false; |
| 7288 |
|
| 7289 |
// custom handling for React/Preact |
| 7290 |
for (i = length; i-- !== 0;) { |
| 7291 |
if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) { |
| 7292 |
// React-specific: avoid traversing React elements' _owner |
| 7293 |
// Preact-specific: avoid traversing Preact elements' __v and __o |
| 7294 |
// __v = $_original / $_vnode |
| 7295 |
// __o = $_owner |
| 7296 |
// These properties contain circular references and are not needed when |
| 7297 |
// comparing the actual elements (and not their owners) |
| 7298 |
// .$$typeof and ._store on just reasonable markers of elements |
| 7299 |
|
| 7300 |
continue; |
| 7301 |
} |
| 7302 |
|
| 7303 |
// all other properties should be traversed as usual |
| 7304 |
if (!equal(a[keys[i]], b[keys[i]])) return false; |
| 7305 |
} |
| 7306 |
// END: react-fast-compare |
| 7307 |
|
| 7308 |
// START: fast-deep-equal |
| 7309 |
return true; |
| 7310 |
} |
| 7311 |
|
| 7312 |
return a !== a && b !== b; |
| 7313 |
} |
| 7314 |
// end fast-deep-equal |
| 7315 |
|
| 7316 |
module.exports = function isEqual(a, b) { |
| 7317 |
try { |
| 7318 |
return equal(a, b); |
| 7319 |
} catch (error) { |
| 7320 |
if (((error.message || '').match(/stack|recursion/i))) { |
| 7321 |
// warn on circular references, don't crash |
| 7322 |
// browsers give this different errors name and messages: |
| 7323 |
// chrome/safari: "RangeError", "Maximum call stack size exceeded" |
| 7324 |
// firefox: "InternalError", too much recursion" |
| 7325 |
// edge: "Error", "Out of stack space" |
| 7326 |
console.warn('react-fast-compare cannot handle circular refs'); |
| 7327 |
return false; |
| 7328 |
} |
| 7329 |
// some other error. we should definitely know about these |
| 7330 |
throw error; |
| 7331 |
} |
| 7332 |
}; |
| 7333 |
|
| 7334 |
|
| 7335 |
/***/ }), |
| 7336 |
|
| 7337 |
/***/ "./node_modules/react-helmet/es/Helmet.js": |
| 7338 |
/*!************************************************!*\ |
| 7339 |
!*** ./node_modules/react-helmet/es/Helmet.js ***! |
| 7340 |
\************************************************/ |
| 7341 |
/*! exports provided: default, Helmet */ |
| 7342 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 7343 |
|
| 7344 |
"use strict"; |
| 7345 |
__webpack_require__.r(__webpack_exports__); |
| 7346 |
/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Helmet", function() { return HelmetExport; }); |
| 7347 |
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); |
| 7348 |
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__); |
| 7349 |
/* harmony import */ var react_side_effect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-side-effect */ "./node_modules/react-side-effect/lib/index.js"); |
| 7350 |
/* harmony import */ var react_side_effect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_side_effect__WEBPACK_IMPORTED_MODULE_1__); |
| 7351 |
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-fast-compare */ "./node_modules/react-fast-compare/index.js"); |
| 7352 |
/* harmony import */ var react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_fast_compare__WEBPACK_IMPORTED_MODULE_2__); |
| 7353 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "react"); |
| 7354 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); |
| 7355 |
/* harmony import */ var object_assign__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js"); |
| 7356 |
/* harmony import */ var object_assign__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(object_assign__WEBPACK_IMPORTED_MODULE_4__); |
| 7357 |
|
| 7358 |
|
| 7359 |
|
| 7360 |
|
| 7361 |
|
| 7362 |
|
| 7363 |
var ATTRIBUTE_NAMES = { |
| 7364 |
BODY: "bodyAttributes", |
| 7365 |
HTML: "htmlAttributes", |
| 7366 |
TITLE: "titleAttributes" |
| 7367 |
}; |
| 7368 |
|
| 7369 |
var TAG_NAMES = { |
| 7370 |
BASE: "base", |
| 7371 |
BODY: "body", |
| 7372 |
HEAD: "head", |
| 7373 |
HTML: "html", |
| 7374 |
LINK: "link", |
| 7375 |
META: "meta", |
| 7376 |
NOSCRIPT: "noscript", |
| 7377 |
SCRIPT: "script", |
| 7378 |
STYLE: "style", |
| 7379 |
TITLE: "title" |
| 7380 |
}; |
| 7381 |
|
| 7382 |
var VALID_TAG_NAMES = Object.keys(TAG_NAMES).map(function (name) { |
| 7383 |
return TAG_NAMES[name]; |
| 7384 |
}); |
| 7385 |
|
| 7386 |
var TAG_PROPERTIES = { |
| 7387 |
CHARSET: "charset", |
| 7388 |
CSS_TEXT: "cssText", |
| 7389 |
HREF: "href", |
| 7390 |
HTTPEQUIV: "http-equiv", |
| 7391 |
INNER_HTML: "innerHTML", |
| 7392 |
ITEM_PROP: "itemprop", |
| 7393 |
NAME: "name", |
| 7394 |
PROPERTY: "property", |
| 7395 |
REL: "rel", |
| 7396 |
SRC: "src", |
| 7397 |
TARGET: "target" |
| 7398 |
}; |
| 7399 |
|
| 7400 |
var REACT_TAG_MAP = { |
| 7401 |
accesskey: "accessKey", |
| 7402 |
charset: "charSet", |
| 7403 |
class: "className", |
| 7404 |
contenteditable: "contentEditable", |
| 7405 |
contextmenu: "contextMenu", |
| 7406 |
"http-equiv": "httpEquiv", |
| 7407 |
itemprop: "itemProp", |
| 7408 |
tabindex: "tabIndex" |
| 7409 |
}; |
| 7410 |
|
| 7411 |
var HELMET_PROPS = { |
| 7412 |
DEFAULT_TITLE: "defaultTitle", |
| 7413 |
DEFER: "defer", |
| 7414 |
ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters", |
| 7415 |
ON_CHANGE_CLIENT_STATE: "onChangeClientState", |
| 7416 |
TITLE_TEMPLATE: "titleTemplate" |
| 7417 |
}; |
| 7418 |
|
| 7419 |
var HTML_TAG_MAP = Object.keys(REACT_TAG_MAP).reduce(function (obj, key) { |
| 7420 |
obj[REACT_TAG_MAP[key]] = key; |
| 7421 |
return obj; |
| 7422 |
}, {}); |
| 7423 |
|
| 7424 |
var SELF_CLOSING_TAGS = [TAG_NAMES.NOSCRIPT, TAG_NAMES.SCRIPT, TAG_NAMES.STYLE]; |
| 7425 |
|
| 7426 |
var HELMET_ATTRIBUTE = "data-react-helmet"; |
| 7427 |
|
| 7428 |
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { |
| 7429 |
return typeof obj; |
| 7430 |
} : function (obj) { |
| 7431 |
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
| 7432 |
}; |
| 7433 |
|
| 7434 |
var classCallCheck = function (instance, Constructor) { |
| 7435 |
if (!(instance instanceof Constructor)) { |
| 7436 |
throw new TypeError("Cannot call a class as a function"); |
| 7437 |
} |
| 7438 |
}; |
| 7439 |
|
| 7440 |
var createClass = function () { |
| 7441 |
function defineProperties(target, props) { |
| 7442 |
for (var i = 0; i < props.length; i++) { |
| 7443 |
var descriptor = props[i]; |
| 7444 |
descriptor.enumerable = descriptor.enumerable || false; |
| 7445 |
descriptor.configurable = true; |
| 7446 |
if ("value" in descriptor) descriptor.writable = true; |
| 7447 |
Object.defineProperty(target, descriptor.key, descriptor); |
| 7448 |
} |
| 7449 |
} |
| 7450 |
|
| 7451 |
return function (Constructor, protoProps, staticProps) { |
| 7452 |
if (protoProps) defineProperties(Constructor.prototype, protoProps); |
| 7453 |
if (staticProps) defineProperties(Constructor, staticProps); |
| 7454 |
return Constructor; |
| 7455 |
}; |
| 7456 |
}(); |
| 7457 |
|
| 7458 |
var _extends = Object.assign || function (target) { |
| 7459 |
for (var i = 1; i < arguments.length; i++) { |
| 7460 |
var source = arguments[i]; |
| 7461 |
|
| 7462 |
for (var key in source) { |
| 7463 |
if (Object.prototype.hasOwnProperty.call(source, key)) { |
| 7464 |
target[key] = source[key]; |
| 7465 |
} |
| 7466 |
} |
| 7467 |
} |
| 7468 |
|
| 7469 |
return target; |
| 7470 |
}; |
| 7471 |
|
| 7472 |
var inherits = function (subClass, superClass) { |
| 7473 |
if (typeof superClass !== "function" && superClass !== null) { |
| 7474 |
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); |
| 7475 |
} |
| 7476 |
|
| 7477 |
subClass.prototype = Object.create(superClass && superClass.prototype, { |
| 7478 |
constructor: { |
| 7479 |
value: subClass, |
| 7480 |
enumerable: false, |
| 7481 |
writable: true, |
| 7482 |
configurable: true |
| 7483 |
} |
| 7484 |
}); |
| 7485 |
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; |
| 7486 |
}; |
| 7487 |
|
| 7488 |
var objectWithoutProperties = function (obj, keys) { |
| 7489 |
var target = {}; |
| 7490 |
|
| 7491 |
for (var i in obj) { |
| 7492 |
if (keys.indexOf(i) >= 0) continue; |
| 7493 |
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; |
| 7494 |
target[i] = obj[i]; |
| 7495 |
} |
| 7496 |
|
| 7497 |
return target; |
| 7498 |
}; |
| 7499 |
|
| 7500 |
var possibleConstructorReturn = function (self, call) { |
| 7501 |
if (!self) { |
| 7502 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 7503 |
} |
| 7504 |
|
| 7505 |
return call && (typeof call === "object" || typeof call === "function") ? call : self; |
| 7506 |
}; |
| 7507 |
|
| 7508 |
var encodeSpecialCharacters = function encodeSpecialCharacters(str) { |
| 7509 |
var encode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; |
| 7510 |
|
| 7511 |
if (encode === false) { |
| 7512 |
return String(str); |
| 7513 |
} |
| 7514 |
|
| 7515 |
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"); |
| 7516 |
}; |
| 7517 |
|
| 7518 |
var getTitleFromPropsList = function getTitleFromPropsList(propsList) { |
| 7519 |
var innermostTitle = getInnermostProperty(propsList, TAG_NAMES.TITLE); |
| 7520 |
var innermostTemplate = getInnermostProperty(propsList, HELMET_PROPS.TITLE_TEMPLATE); |
| 7521 |
|
| 7522 |
if (innermostTemplate && innermostTitle) { |
| 7523 |
// use function arg to avoid need to escape $ characters |
| 7524 |
return innermostTemplate.replace(/%s/g, function () { |
| 7525 |
return Array.isArray(innermostTitle) ? innermostTitle.join("") : innermostTitle; |
| 7526 |
}); |
| 7527 |
} |
| 7528 |
|
| 7529 |
var innermostDefaultTitle = getInnermostProperty(propsList, HELMET_PROPS.DEFAULT_TITLE); |
| 7530 |
|
| 7531 |
return innermostTitle || innermostDefaultTitle || undefined; |
| 7532 |
}; |
| 7533 |
|
| 7534 |
var getOnChangeClientState = function getOnChangeClientState(propsList) { |
| 7535 |
return getInnermostProperty(propsList, HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || function () {}; |
| 7536 |
}; |
| 7537 |
|
| 7538 |
var getAttributesFromPropsList = function getAttributesFromPropsList(tagType, propsList) { |
| 7539 |
return propsList.filter(function (props) { |
| 7540 |
return typeof props[tagType] !== "undefined"; |
| 7541 |
}).map(function (props) { |
| 7542 |
return props[tagType]; |
| 7543 |
}).reduce(function (tagAttrs, current) { |
| 7544 |
return _extends({}, tagAttrs, current); |
| 7545 |
}, {}); |
| 7546 |
}; |
| 7547 |
|
| 7548 |
var getBaseTagFromPropsList = function getBaseTagFromPropsList(primaryAttributes, propsList) { |
| 7549 |
return propsList.filter(function (props) { |
| 7550 |
return typeof props[TAG_NAMES.BASE] !== "undefined"; |
| 7551 |
}).map(function (props) { |
| 7552 |
return props[TAG_NAMES.BASE]; |
| 7553 |
}).reverse().reduce(function (innermostBaseTag, tag) { |
| 7554 |
if (!innermostBaseTag.length) { |
| 7555 |
var keys = Object.keys(tag); |
| 7556 |
|
| 7557 |
for (var i = 0; i < keys.length; i++) { |
| 7558 |
var attributeKey = keys[i]; |
| 7559 |
var lowerCaseAttributeKey = attributeKey.toLowerCase(); |
| 7560 |
|
| 7561 |
if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) { |
| 7562 |
return innermostBaseTag.concat(tag); |
| 7563 |
} |
| 7564 |
} |
| 7565 |
} |
| 7566 |
|
| 7567 |
return innermostBaseTag; |
| 7568 |
}, []); |
| 7569 |
}; |
| 7570 |
|
| 7571 |
var getTagsFromPropsList = function getTagsFromPropsList(tagName, primaryAttributes, propsList) { |
| 7572 |
// Calculate list of tags, giving priority innermost component (end of the propslist) |
| 7573 |
var approvedSeenTags = {}; |
| 7574 |
|
| 7575 |
return propsList.filter(function (props) { |
| 7576 |
if (Array.isArray(props[tagName])) { |
| 7577 |
return true; |
| 7578 |
} |
| 7579 |
if (typeof props[tagName] !== "undefined") { |
| 7580 |
warn("Helmet: " + tagName + " should be of type \"Array\". Instead found type \"" + _typeof(props[tagName]) + "\""); |
| 7581 |
} |
| 7582 |
return false; |
| 7583 |
}).map(function (props) { |
| 7584 |
return props[tagName]; |
| 7585 |
}).reverse().reduce(function (approvedTags, instanceTags) { |
| 7586 |
var instanceSeenTags = {}; |
| 7587 |
|
| 7588 |
instanceTags.filter(function (tag) { |
| 7589 |
var primaryAttributeKey = void 0; |
| 7590 |
var keys = Object.keys(tag); |
| 7591 |
for (var i = 0; i < keys.length; i++) { |
| 7592 |
var attributeKey = keys[i]; |
| 7593 |
var lowerCaseAttributeKey = attributeKey.toLowerCase(); |
| 7594 |
|
| 7595 |
// Special rule with link tags, since rel and href are both primary tags, rel takes priority |
| 7596 |
if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) { |
| 7597 |
primaryAttributeKey = lowerCaseAttributeKey; |
| 7598 |
} |
| 7599 |
// Special case for innerHTML which doesn't work lowercased |
| 7600 |
if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === TAG_PROPERTIES.INNER_HTML || attributeKey === TAG_PROPERTIES.CSS_TEXT || attributeKey === TAG_PROPERTIES.ITEM_PROP)) { |
| 7601 |
primaryAttributeKey = attributeKey; |
| 7602 |
} |
| 7603 |
} |
| 7604 |
|
| 7605 |
if (!primaryAttributeKey || !tag[primaryAttributeKey]) { |
| 7606 |
return false; |
| 7607 |
} |
| 7608 |
|
| 7609 |
var value = tag[primaryAttributeKey].toLowerCase(); |
| 7610 |
|
| 7611 |
if (!approvedSeenTags[primaryAttributeKey]) { |
| 7612 |
approvedSeenTags[primaryAttributeKey] = {}; |
| 7613 |
} |
| 7614 |
|
| 7615 |
if (!instanceSeenTags[primaryAttributeKey]) { |
| 7616 |
instanceSeenTags[primaryAttributeKey] = {}; |
| 7617 |
} |
| 7618 |
|
| 7619 |
if (!approvedSeenTags[primaryAttributeKey][value]) { |
| 7620 |
instanceSeenTags[primaryAttributeKey][value] = true; |
| 7621 |
return true; |
| 7622 |
} |
| 7623 |
|
| 7624 |
return false; |
| 7625 |
}).reverse().forEach(function (tag) { |
| 7626 |
return approvedTags.push(tag); |
| 7627 |
}); |
| 7628 |
|
| 7629 |
// Update seen tags with tags from this instance |
| 7630 |
var keys = Object.keys(instanceSeenTags); |
| 7631 |
for (var i = 0; i < keys.length; i++) { |
| 7632 |
var attributeKey = keys[i]; |
| 7633 |
var tagUnion = object_assign__WEBPACK_IMPORTED_MODULE_4___default()({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]); |
| 7634 |
|
| 7635 |
approvedSeenTags[attributeKey] = tagUnion; |
| 7636 |
} |
| 7637 |
|
| 7638 |
return approvedTags; |
| 7639 |
}, []).reverse(); |
| 7640 |
}; |
| 7641 |
|
| 7642 |
var getInnermostProperty = function getInnermostProperty(propsList, property) { |
| 7643 |
for (var i = propsList.length - 1; i >= 0; i--) { |
| 7644 |
var props = propsList[i]; |
| 7645 |
|
| 7646 |
if (props.hasOwnProperty(property)) { |
| 7647 |
return props[property]; |
| 7648 |
} |
| 7649 |
} |
| 7650 |
|
| 7651 |
return null; |
| 7652 |
}; |
| 7653 |
|
| 7654 |
var reducePropsToState = function reducePropsToState(propsList) { |
| 7655 |
return { |
| 7656 |
baseTag: getBaseTagFromPropsList([TAG_PROPERTIES.HREF, TAG_PROPERTIES.TARGET], propsList), |
| 7657 |
bodyAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.BODY, propsList), |
| 7658 |
defer: getInnermostProperty(propsList, HELMET_PROPS.DEFER), |
| 7659 |
encode: getInnermostProperty(propsList, HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS), |
| 7660 |
htmlAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.HTML, propsList), |
| 7661 |
linkTags: getTagsFromPropsList(TAG_NAMES.LINK, [TAG_PROPERTIES.REL, TAG_PROPERTIES.HREF], propsList), |
| 7662 |
metaTags: getTagsFromPropsList(TAG_NAMES.META, [TAG_PROPERTIES.NAME, TAG_PROPERTIES.CHARSET, TAG_PROPERTIES.HTTPEQUIV, TAG_PROPERTIES.PROPERTY, TAG_PROPERTIES.ITEM_PROP], propsList), |
| 7663 |
noscriptTags: getTagsFromPropsList(TAG_NAMES.NOSCRIPT, [TAG_PROPERTIES.INNER_HTML], propsList), |
| 7664 |
onChangeClientState: getOnChangeClientState(propsList), |
| 7665 |
scriptTags: getTagsFromPropsList(TAG_NAMES.SCRIPT, [TAG_PROPERTIES.SRC, TAG_PROPERTIES.INNER_HTML], propsList), |
| 7666 |
styleTags: getTagsFromPropsList(TAG_NAMES.STYLE, [TAG_PROPERTIES.CSS_TEXT], propsList), |
| 7667 |
title: getTitleFromPropsList(propsList), |
| 7668 |
titleAttributes: getAttributesFromPropsList(ATTRIBUTE_NAMES.TITLE, propsList) |
| 7669 |
}; |
| 7670 |
}; |
| 7671 |
|
| 7672 |
var rafPolyfill = function () { |
| 7673 |
var clock = Date.now(); |
| 7674 |
|
| 7675 |
return function (callback) { |
| 7676 |
var currentTime = Date.now(); |
| 7677 |
|
| 7678 |
if (currentTime - clock > 16) { |
| 7679 |
clock = currentTime; |
| 7680 |
callback(currentTime); |
| 7681 |
} else { |
| 7682 |
setTimeout(function () { |
| 7683 |
rafPolyfill(callback); |
| 7684 |
}, 0); |
| 7685 |
} |
| 7686 |
}; |
| 7687 |
}(); |
| 7688 |
|
| 7689 |
var cafPolyfill = function cafPolyfill(id) { |
| 7690 |
return clearTimeout(id); |
| 7691 |
}; |
| 7692 |
|
| 7693 |
var requestAnimationFrame = typeof window !== "undefined" ? window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || rafPolyfill : global.requestAnimationFrame || rafPolyfill; |
| 7694 |
|
| 7695 |
var cancelAnimationFrame = typeof window !== "undefined" ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || cafPolyfill : global.cancelAnimationFrame || cafPolyfill; |
| 7696 |
|
| 7697 |
var warn = function warn(msg) { |
| 7698 |
return console && typeof console.warn === "function" && console.warn(msg); |
| 7699 |
}; |
| 7700 |
|
| 7701 |
var _helmetCallback = null; |
| 7702 |
|
| 7703 |
var handleClientStateChange = function handleClientStateChange(newState) { |
| 7704 |
if (_helmetCallback) { |
| 7705 |
cancelAnimationFrame(_helmetCallback); |
| 7706 |
} |
| 7707 |
|
| 7708 |
if (newState.defer) { |
| 7709 |
_helmetCallback = requestAnimationFrame(function () { |
| 7710 |
commitTagChanges(newState, function () { |
| 7711 |
_helmetCallback = null; |
| 7712 |
}); |
| 7713 |
}); |
| 7714 |
} else { |
| 7715 |
commitTagChanges(newState); |
| 7716 |
_helmetCallback = null; |
| 7717 |
} |
| 7718 |
}; |
| 7719 |
|
| 7720 |
var commitTagChanges = function commitTagChanges(newState, cb) { |
| 7721 |
var baseTag = newState.baseTag, |
| 7722 |
bodyAttributes = newState.bodyAttributes, |
| 7723 |
htmlAttributes = newState.htmlAttributes, |
| 7724 |
linkTags = newState.linkTags, |
| 7725 |
metaTags = newState.metaTags, |
| 7726 |
noscriptTags = newState.noscriptTags, |
| 7727 |
onChangeClientState = newState.onChangeClientState, |
| 7728 |
scriptTags = newState.scriptTags, |
| 7729 |
styleTags = newState.styleTags, |
| 7730 |
title = newState.title, |
| 7731 |
titleAttributes = newState.titleAttributes; |
| 7732 |
|
| 7733 |
updateAttributes(TAG_NAMES.BODY, bodyAttributes); |
| 7734 |
updateAttributes(TAG_NAMES.HTML, htmlAttributes); |
| 7735 |
|
| 7736 |
updateTitle(title, titleAttributes); |
| 7737 |
|
| 7738 |
var tagUpdates = { |
| 7739 |
baseTag: updateTags(TAG_NAMES.BASE, baseTag), |
| 7740 |
linkTags: updateTags(TAG_NAMES.LINK, linkTags), |
| 7741 |
metaTags: updateTags(TAG_NAMES.META, metaTags), |
| 7742 |
noscriptTags: updateTags(TAG_NAMES.NOSCRIPT, noscriptTags), |
| 7743 |
scriptTags: updateTags(TAG_NAMES.SCRIPT, scriptTags), |
| 7744 |
styleTags: updateTags(TAG_NAMES.STYLE, styleTags) |
| 7745 |
}; |
| 7746 |
|
| 7747 |
var addedTags = {}; |
| 7748 |
var removedTags = {}; |
| 7749 |
|
| 7750 |
Object.keys(tagUpdates).forEach(function (tagType) { |
| 7751 |
var _tagUpdates$tagType = tagUpdates[tagType], |
| 7752 |
newTags = _tagUpdates$tagType.newTags, |
| 7753 |
oldTags = _tagUpdates$tagType.oldTags; |
| 7754 |
|
| 7755 |
|
| 7756 |
if (newTags.length) { |
| 7757 |
addedTags[tagType] = newTags; |
| 7758 |
} |
| 7759 |
if (oldTags.length) { |
| 7760 |
removedTags[tagType] = tagUpdates[tagType].oldTags; |
| 7761 |
} |
| 7762 |
}); |
| 7763 |
|
| 7764 |
cb && cb(); |
| 7765 |
|
| 7766 |
onChangeClientState(newState, addedTags, removedTags); |
| 7767 |
}; |
| 7768 |
|
| 7769 |
var flattenArray = function flattenArray(possibleArray) { |
| 7770 |
return Array.isArray(possibleArray) ? possibleArray.join("") : possibleArray; |
| 7771 |
}; |
| 7772 |
|
| 7773 |
var updateTitle = function updateTitle(title, attributes) { |
| 7774 |
if (typeof title !== "undefined" && document.title !== title) { |
| 7775 |
document.title = flattenArray(title); |
| 7776 |
} |
| 7777 |
|
| 7778 |
updateAttributes(TAG_NAMES.TITLE, attributes); |
| 7779 |
}; |
| 7780 |
|
| 7781 |
var updateAttributes = function updateAttributes(tagName, attributes) { |
| 7782 |
var elementTag = document.getElementsByTagName(tagName)[0]; |
| 7783 |
|
| 7784 |
if (!elementTag) { |
| 7785 |
return; |
| 7786 |
} |
| 7787 |
|
| 7788 |
var helmetAttributeString = elementTag.getAttribute(HELMET_ATTRIBUTE); |
| 7789 |
var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : []; |
| 7790 |
var attributesToRemove = [].concat(helmetAttributes); |
| 7791 |
var attributeKeys = Object.keys(attributes); |
| 7792 |
|
| 7793 |
for (var i = 0; i < attributeKeys.length; i++) { |
| 7794 |
var attribute = attributeKeys[i]; |
| 7795 |
var value = attributes[attribute] || ""; |
| 7796 |
|
| 7797 |
if (elementTag.getAttribute(attribute) !== value) { |
| 7798 |
elementTag.setAttribute(attribute, value); |
| 7799 |
} |
| 7800 |
|
| 7801 |
if (helmetAttributes.indexOf(attribute) === -1) { |
| 7802 |
helmetAttributes.push(attribute); |
| 7803 |
} |
| 7804 |
|
| 7805 |
var indexToSave = attributesToRemove.indexOf(attribute); |
| 7806 |
if (indexToSave !== -1) { |
| 7807 |
attributesToRemove.splice(indexToSave, 1); |
| 7808 |
} |
| 7809 |
} |
| 7810 |
|
| 7811 |
for (var _i = attributesToRemove.length - 1; _i >= 0; _i--) { |
| 7812 |
elementTag.removeAttribute(attributesToRemove[_i]); |
| 7813 |
} |
| 7814 |
|
| 7815 |
if (helmetAttributes.length === attributesToRemove.length) { |
| 7816 |
elementTag.removeAttribute(HELMET_ATTRIBUTE); |
| 7817 |
} else if (elementTag.getAttribute(HELMET_ATTRIBUTE) !== attributeKeys.join(",")) { |
| 7818 |
elementTag.setAttribute(HELMET_ATTRIBUTE, attributeKeys.join(",")); |
| 7819 |
} |
| 7820 |
}; |
| 7821 |
|
| 7822 |
var updateTags = function updateTags(type, tags) { |
| 7823 |
var headElement = document.head || document.querySelector(TAG_NAMES.HEAD); |
| 7824 |
var tagNodes = headElement.querySelectorAll(type + "[" + HELMET_ATTRIBUTE + "]"); |
| 7825 |
var oldTags = Array.prototype.slice.call(tagNodes); |
| 7826 |
var newTags = []; |
| 7827 |
var indexToDelete = void 0; |
| 7828 |
|
| 7829 |
if (tags && tags.length) { |
| 7830 |
tags.forEach(function (tag) { |
| 7831 |
var newElement = document.createElement(type); |
| 7832 |
|
| 7833 |
for (var attribute in tag) { |
| 7834 |
if (tag.hasOwnProperty(attribute)) { |
| 7835 |
if (attribute === TAG_PROPERTIES.INNER_HTML) { |
| 7836 |
newElement.innerHTML = tag.innerHTML; |
| 7837 |
} else if (attribute === TAG_PROPERTIES.CSS_TEXT) { |
| 7838 |
if (newElement.styleSheet) { |
| 7839 |
newElement.styleSheet.cssText = tag.cssText; |
| 7840 |
} else { |
| 7841 |
newElement.appendChild(document.createTextNode(tag.cssText)); |
| 7842 |
} |
| 7843 |
} else { |
| 7844 |
var value = typeof tag[attribute] === "undefined" ? "" : tag[attribute]; |
| 7845 |
newElement.setAttribute(attribute, value); |
| 7846 |
} |
| 7847 |
} |
| 7848 |
} |
| 7849 |
|
| 7850 |
newElement.setAttribute(HELMET_ATTRIBUTE, "true"); |
| 7851 |
|
| 7852 |
// Remove a duplicate tag from domTagstoRemove, so it isn't cleared. |
| 7853 |
if (oldTags.some(function (existingTag, index) { |
| 7854 |
indexToDelete = index; |
| 7855 |
return newElement.isEqualNode(existingTag); |
| 7856 |
})) { |
| 7857 |
oldTags.splice(indexToDelete, 1); |
| 7858 |
} else { |
| 7859 |
newTags.push(newElement); |
| 7860 |
} |
| 7861 |
}); |
| 7862 |
} |
| 7863 |
|
| 7864 |
oldTags.forEach(function (tag) { |
| 7865 |
return tag.parentNode.removeChild(tag); |
| 7866 |
}); |
| 7867 |
newTags.forEach(function (tag) { |
| 7868 |
return headElement.appendChild(tag); |
| 7869 |
}); |
| 7870 |
|
| 7871 |
return { |
| 7872 |
oldTags: oldTags, |
| 7873 |
newTags: newTags |
| 7874 |
}; |
| 7875 |
}; |
| 7876 |
|
| 7877 |
var generateElementAttributesAsString = function generateElementAttributesAsString(attributes) { |
| 7878 |
return Object.keys(attributes).reduce(function (str, key) { |
| 7879 |
var attr = typeof attributes[key] !== "undefined" ? key + "=\"" + attributes[key] + "\"" : "" + key; |
| 7880 |
return str ? str + " " + attr : attr; |
| 7881 |
}, ""); |
| 7882 |
}; |
| 7883 |
|
| 7884 |
var generateTitleAsString = function generateTitleAsString(type, title, attributes, encode) { |
| 7885 |
var attributeString = generateElementAttributesAsString(attributes); |
| 7886 |
var flattenedTitle = flattenArray(title); |
| 7887 |
return attributeString ? "<" + type + " " + HELMET_ATTRIBUTE + "=\"true\" " + attributeString + ">" + encodeSpecialCharacters(flattenedTitle, encode) + "</" + type + ">" : "<" + type + " " + HELMET_ATTRIBUTE + "=\"true\">" + encodeSpecialCharacters(flattenedTitle, encode) + "</" + type + ">"; |
| 7888 |
}; |
| 7889 |
|
| 7890 |
var generateTagsAsString = function generateTagsAsString(type, tags, encode) { |
| 7891 |
return tags.reduce(function (str, tag) { |
| 7892 |
var attributeHtml = Object.keys(tag).filter(function (attribute) { |
| 7893 |
return !(attribute === TAG_PROPERTIES.INNER_HTML || attribute === TAG_PROPERTIES.CSS_TEXT); |
| 7894 |
}).reduce(function (string, attribute) { |
| 7895 |
var attr = typeof tag[attribute] === "undefined" ? attribute : attribute + "=\"" + encodeSpecialCharacters(tag[attribute], encode) + "\""; |
| 7896 |
return string ? string + " " + attr : attr; |
| 7897 |
}, ""); |
| 7898 |
|
| 7899 |
var tagContent = tag.innerHTML || tag.cssText || ""; |
| 7900 |
|
| 7901 |
var isSelfClosing = SELF_CLOSING_TAGS.indexOf(type) === -1; |
| 7902 |
|
| 7903 |
return str + "<" + type + " " + HELMET_ATTRIBUTE + "=\"true\" " + attributeHtml + (isSelfClosing ? "/>" : ">" + tagContent + "</" + type + ">"); |
| 7904 |
}, ""); |
| 7905 |
}; |
| 7906 |
|
| 7907 |
var convertElementAttributestoReactProps = function convertElementAttributestoReactProps(attributes) { |
| 7908 |
var initProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 7909 |
|
| 7910 |
return Object.keys(attributes).reduce(function (obj, key) { |
| 7911 |
obj[REACT_TAG_MAP[key] || key] = attributes[key]; |
| 7912 |
return obj; |
| 7913 |
}, initProps); |
| 7914 |
}; |
| 7915 |
|
| 7916 |
var convertReactPropstoHtmlAttributes = function convertReactPropstoHtmlAttributes(props) { |
| 7917 |
var initAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; |
| 7918 |
|
| 7919 |
return Object.keys(props).reduce(function (obj, key) { |
| 7920 |
obj[HTML_TAG_MAP[key] || key] = props[key]; |
| 7921 |
return obj; |
| 7922 |
}, initAttributes); |
| 7923 |
}; |
| 7924 |
|
| 7925 |
var generateTitleAsReactComponent = function generateTitleAsReactComponent(type, title, attributes) { |
| 7926 |
var _initProps; |
| 7927 |
|
| 7928 |
// assigning into an array to define toString function on it |
| 7929 |
var initProps = (_initProps = { |
| 7930 |
key: title |
| 7931 |
}, _initProps[HELMET_ATTRIBUTE] = true, _initProps); |
| 7932 |
var props = convertElementAttributestoReactProps(attributes, initProps); |
| 7933 |
|
| 7934 |
return [react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(TAG_NAMES.TITLE, props, title)]; |
| 7935 |
}; |
| 7936 |
|
| 7937 |
var generateTagsAsReactComponent = function generateTagsAsReactComponent(type, tags) { |
| 7938 |
return tags.map(function (tag, i) { |
| 7939 |
var _mappedTag; |
| 7940 |
|
| 7941 |
var mappedTag = (_mappedTag = { |
| 7942 |
key: i |
| 7943 |
}, _mappedTag[HELMET_ATTRIBUTE] = true, _mappedTag); |
| 7944 |
|
| 7945 |
Object.keys(tag).forEach(function (attribute) { |
| 7946 |
var mappedAttribute = REACT_TAG_MAP[attribute] || attribute; |
| 7947 |
|
| 7948 |
if (mappedAttribute === TAG_PROPERTIES.INNER_HTML || mappedAttribute === TAG_PROPERTIES.CSS_TEXT) { |
| 7949 |
var content = tag.innerHTML || tag.cssText; |
| 7950 |
mappedTag.dangerouslySetInnerHTML = { __html: content }; |
| 7951 |
} else { |
| 7952 |
mappedTag[mappedAttribute] = tag[attribute]; |
| 7953 |
} |
| 7954 |
}); |
| 7955 |
|
| 7956 |
return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(type, mappedTag); |
| 7957 |
}); |
| 7958 |
}; |
| 7959 |
|
| 7960 |
var getMethodsForTag = function getMethodsForTag(type, tags, encode) { |
| 7961 |
switch (type) { |
| 7962 |
case TAG_NAMES.TITLE: |
| 7963 |
return { |
| 7964 |
toComponent: function toComponent() { |
| 7965 |
return generateTitleAsReactComponent(type, tags.title, tags.titleAttributes, encode); |
| 7966 |
}, |
| 7967 |
toString: function toString() { |
| 7968 |
return generateTitleAsString(type, tags.title, tags.titleAttributes, encode); |
| 7969 |
} |
| 7970 |
}; |
| 7971 |
case ATTRIBUTE_NAMES.BODY: |
| 7972 |
case ATTRIBUTE_NAMES.HTML: |
| 7973 |
return { |
| 7974 |
toComponent: function toComponent() { |
| 7975 |
return convertElementAttributestoReactProps(tags); |
| 7976 |
}, |
| 7977 |
toString: function toString() { |
| 7978 |
return generateElementAttributesAsString(tags); |
| 7979 |
} |
| 7980 |
}; |
| 7981 |
default: |
| 7982 |
return { |
| 7983 |
toComponent: function toComponent() { |
| 7984 |
return generateTagsAsReactComponent(type, tags); |
| 7985 |
}, |
| 7986 |
toString: function toString() { |
| 7987 |
return generateTagsAsString(type, tags, encode); |
| 7988 |
} |
| 7989 |
}; |
| 7990 |
} |
| 7991 |
}; |
| 7992 |
|
| 7993 |
var mapStateOnServer = function mapStateOnServer(_ref) { |
| 7994 |
var baseTag = _ref.baseTag, |
| 7995 |
bodyAttributes = _ref.bodyAttributes, |
| 7996 |
encode = _ref.encode, |
| 7997 |
htmlAttributes = _ref.htmlAttributes, |
| 7998 |
linkTags = _ref.linkTags, |
| 7999 |
metaTags = _ref.metaTags, |
| 8000 |
noscriptTags = _ref.noscriptTags, |
| 8001 |
scriptTags = _ref.scriptTags, |
| 8002 |
styleTags = _ref.styleTags, |
| 8003 |
_ref$title = _ref.title, |
| 8004 |
title = _ref$title === undefined ? "" : _ref$title, |
| 8005 |
titleAttributes = _ref.titleAttributes; |
| 8006 |
return { |
| 8007 |
base: getMethodsForTag(TAG_NAMES.BASE, baseTag, encode), |
| 8008 |
bodyAttributes: getMethodsForTag(ATTRIBUTE_NAMES.BODY, bodyAttributes, encode), |
| 8009 |
htmlAttributes: getMethodsForTag(ATTRIBUTE_NAMES.HTML, htmlAttributes, encode), |
| 8010 |
link: getMethodsForTag(TAG_NAMES.LINK, linkTags, encode), |
| 8011 |
meta: getMethodsForTag(TAG_NAMES.META, metaTags, encode), |
| 8012 |
noscript: getMethodsForTag(TAG_NAMES.NOSCRIPT, noscriptTags, encode), |
| 8013 |
script: getMethodsForTag(TAG_NAMES.SCRIPT, scriptTags, encode), |
| 8014 |
style: getMethodsForTag(TAG_NAMES.STYLE, styleTags, encode), |
| 8015 |
title: getMethodsForTag(TAG_NAMES.TITLE, { title: title, titleAttributes: titleAttributes }, encode) |
| 8016 |
}; |
| 8017 |
}; |
| 8018 |
|
| 8019 |
var Helmet = function Helmet(Component) { |
| 8020 |
var _class, _temp; |
| 8021 |
|
| 8022 |
return _temp = _class = function (_React$Component) { |
| 8023 |
inherits(HelmetWrapper, _React$Component); |
| 8024 |
|
| 8025 |
function HelmetWrapper() { |
| 8026 |
classCallCheck(this, HelmetWrapper); |
| 8027 |
return possibleConstructorReturn(this, _React$Component.apply(this, arguments)); |
| 8028 |
} |
| 8029 |
|
| 8030 |
HelmetWrapper.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) { |
| 8031 |
return !react_fast_compare__WEBPACK_IMPORTED_MODULE_2___default()(this.props, nextProps); |
| 8032 |
}; |
| 8033 |
|
| 8034 |
HelmetWrapper.prototype.mapNestedChildrenToProps = function mapNestedChildrenToProps(child, nestedChildren) { |
| 8035 |
if (!nestedChildren) { |
| 8036 |
return null; |
| 8037 |
} |
| 8038 |
|
| 8039 |
switch (child.type) { |
| 8040 |
case TAG_NAMES.SCRIPT: |
| 8041 |
case TAG_NAMES.NOSCRIPT: |
| 8042 |
return { |
| 8043 |
innerHTML: nestedChildren |
| 8044 |
}; |
| 8045 |
|
| 8046 |
case TAG_NAMES.STYLE: |
| 8047 |
return { |
| 8048 |
cssText: nestedChildren |
| 8049 |
}; |
| 8050 |
} |
| 8051 |
|
| 8052 |
throw new Error("<" + child.type + " /> elements are self-closing and can not contain children. Refer to our API for more information."); |
| 8053 |
}; |
| 8054 |
|
| 8055 |
HelmetWrapper.prototype.flattenArrayTypeChildren = function flattenArrayTypeChildren(_ref) { |
| 8056 |
var _babelHelpers$extends; |
| 8057 |
|
| 8058 |
var child = _ref.child, |
| 8059 |
arrayTypeChildren = _ref.arrayTypeChildren, |
| 8060 |
newChildProps = _ref.newChildProps, |
| 8061 |
nestedChildren = _ref.nestedChildren; |
| 8062 |
|
| 8063 |
return _extends({}, arrayTypeChildren, (_babelHelpers$extends = {}, _babelHelpers$extends[child.type] = [].concat(arrayTypeChildren[child.type] || [], [_extends({}, newChildProps, this.mapNestedChildrenToProps(child, nestedChildren))]), _babelHelpers$extends)); |
| 8064 |
}; |
| 8065 |
|
| 8066 |
HelmetWrapper.prototype.mapObjectTypeChildren = function mapObjectTypeChildren(_ref2) { |
| 8067 |
var _babelHelpers$extends2, _babelHelpers$extends3; |
| 8068 |
|
| 8069 |
var child = _ref2.child, |
| 8070 |
newProps = _ref2.newProps, |
| 8071 |
newChildProps = _ref2.newChildProps, |
| 8072 |
nestedChildren = _ref2.nestedChildren; |
| 8073 |
|
| 8074 |
switch (child.type) { |
| 8075 |
case TAG_NAMES.TITLE: |
| 8076 |
return _extends({}, newProps, (_babelHelpers$extends2 = {}, _babelHelpers$extends2[child.type] = nestedChildren, _babelHelpers$extends2.titleAttributes = _extends({}, newChildProps), _babelHelpers$extends2)); |
| 8077 |
|
| 8078 |
case TAG_NAMES.BODY: |
| 8079 |
return _extends({}, newProps, { |
| 8080 |
bodyAttributes: _extends({}, newChildProps) |
| 8081 |
}); |
| 8082 |
|
| 8083 |
case TAG_NAMES.HTML: |
| 8084 |
return _extends({}, newProps, { |
| 8085 |
htmlAttributes: _extends({}, newChildProps) |
| 8086 |
}); |
| 8087 |
} |
| 8088 |
|
| 8089 |
return _extends({}, newProps, (_babelHelpers$extends3 = {}, _babelHelpers$extends3[child.type] = _extends({}, newChildProps), _babelHelpers$extends3)); |
| 8090 |
}; |
| 8091 |
|
| 8092 |
HelmetWrapper.prototype.mapArrayTypeChildrenToProps = function mapArrayTypeChildrenToProps(arrayTypeChildren, newProps) { |
| 8093 |
var newFlattenedProps = _extends({}, newProps); |
| 8094 |
|
| 8095 |
Object.keys(arrayTypeChildren).forEach(function (arrayChildName) { |
| 8096 |
var _babelHelpers$extends4; |
| 8097 |
|
| 8098 |
newFlattenedProps = _extends({}, newFlattenedProps, (_babelHelpers$extends4 = {}, _babelHelpers$extends4[arrayChildName] = arrayTypeChildren[arrayChildName], _babelHelpers$extends4)); |
| 8099 |
}); |
| 8100 |
|
| 8101 |
return newFlattenedProps; |
| 8102 |
}; |
| 8103 |
|
| 8104 |
HelmetWrapper.prototype.warnOnInvalidChildren = function warnOnInvalidChildren(child, nestedChildren) { |
| 8105 |
if (true) { |
| 8106 |
if (!VALID_TAG_NAMES.some(function (name) { |
| 8107 |
return child.type === name; |
| 8108 |
})) { |
| 8109 |
if (typeof child.type === "function") { |
| 8110 |
return warn("You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information."); |
| 8111 |
} |
| 8112 |
|
| 8113 |
return warn("Only elements types " + VALID_TAG_NAMES.join(", ") + " are allowed. Helmet does not support rendering <" + child.type + "> elements. Refer to our API for more information."); |
| 8114 |
} |
| 8115 |
|
| 8116 |
if (nestedChildren && typeof nestedChildren !== "string" && (!Array.isArray(nestedChildren) || nestedChildren.some(function (nestedChild) { |
| 8117 |
return typeof nestedChild !== "string"; |
| 8118 |
}))) { |
| 8119 |
throw new Error("Helmet expects a string as a child of <" + child.type + ">. Did you forget to wrap your children in braces? ( <" + child.type + ">{``}</" + child.type + "> ) Refer to our API for more information."); |
| 8120 |
} |
| 8121 |
} |
| 8122 |
|
| 8123 |
return true; |
| 8124 |
}; |
| 8125 |
|
| 8126 |
HelmetWrapper.prototype.mapChildrenToProps = function mapChildrenToProps(children, newProps) { |
| 8127 |
var _this2 = this; |
| 8128 |
|
| 8129 |
var arrayTypeChildren = {}; |
| 8130 |
|
| 8131 |
react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.forEach(children, function (child) { |
| 8132 |
if (!child || !child.props) { |
| 8133 |
return; |
| 8134 |
} |
| 8135 |
|
| 8136 |
var _child$props = child.props, |
| 8137 |
nestedChildren = _child$props.children, |
| 8138 |
childProps = objectWithoutProperties(_child$props, ["children"]); |
| 8139 |
|
| 8140 |
var newChildProps = convertReactPropstoHtmlAttributes(childProps); |
| 8141 |
|
| 8142 |
_this2.warnOnInvalidChildren(child, nestedChildren); |
| 8143 |
|
| 8144 |
switch (child.type) { |
| 8145 |
case TAG_NAMES.LINK: |
| 8146 |
case TAG_NAMES.META: |
| 8147 |
case TAG_NAMES.NOSCRIPT: |
| 8148 |
case TAG_NAMES.SCRIPT: |
| 8149 |
case TAG_NAMES.STYLE: |
| 8150 |
arrayTypeChildren = _this2.flattenArrayTypeChildren({ |
| 8151 |
child: child, |
| 8152 |
arrayTypeChildren: arrayTypeChildren, |
| 8153 |
newChildProps: newChildProps, |
| 8154 |
nestedChildren: nestedChildren |
| 8155 |
}); |
| 8156 |
break; |
| 8157 |
|
| 8158 |
default: |
| 8159 |
newProps = _this2.mapObjectTypeChildren({ |
| 8160 |
child: child, |
| 8161 |
newProps: newProps, |
| 8162 |
newChildProps: newChildProps, |
| 8163 |
nestedChildren: nestedChildren |
| 8164 |
}); |
| 8165 |
break; |
| 8166 |
} |
| 8167 |
}); |
| 8168 |
|
| 8169 |
newProps = this.mapArrayTypeChildrenToProps(arrayTypeChildren, newProps); |
| 8170 |
return newProps; |
| 8171 |
}; |
| 8172 |
|
| 8173 |
HelmetWrapper.prototype.render = function render() { |
| 8174 |
var _props = this.props, |
| 8175 |
children = _props.children, |
| 8176 |
props = objectWithoutProperties(_props, ["children"]); |
| 8177 |
|
| 8178 |
var newProps = _extends({}, props); |
| 8179 |
|
| 8180 |
if (children) { |
| 8181 |
newProps = this.mapChildrenToProps(children, newProps); |
| 8182 |
} |
| 8183 |
|
| 8184 |
return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, newProps); |
| 8185 |
}; |
| 8186 |
|
| 8187 |
createClass(HelmetWrapper, null, [{ |
| 8188 |
key: "canUseDOM", |
| 8189 |
|
| 8190 |
|
| 8191 |
// Component.peek comes from react-side-effect: |
| 8192 |
// For testing, you may use a static peek() method available on the returned component. |
| 8193 |
// It lets you get the current state without resetting the mounted instance stack. |
| 8194 |
// Don’t use it for anything other than testing. |
| 8195 |
|
| 8196 |
set: function set$$1(canUseDOM) { |
| 8197 |
Component.canUseDOM = canUseDOM; |
| 8198 |
} |
| 8199 |
}]); |
| 8200 |
return HelmetWrapper; |
| 8201 |
}(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component), _class.propTypes = { |
| 8202 |
base: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, |
| 8203 |
bodyAttributes: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, |
| 8204 |
children: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.node]), |
| 8205 |
defaultTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, |
| 8206 |
defer: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, |
| 8207 |
encodeSpecialCharacters: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.bool, |
| 8208 |
htmlAttributes: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, |
| 8209 |
link: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object), |
| 8210 |
meta: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object), |
| 8211 |
noscript: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object), |
| 8212 |
onChangeClientState: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.func, |
| 8213 |
script: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object), |
| 8214 |
style: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object), |
| 8215 |
title: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, |
| 8216 |
titleAttributes: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.object, |
| 8217 |
titleTemplate: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string |
| 8218 |
}, _class.defaultProps = { |
| 8219 |
defer: true, |
| 8220 |
encodeSpecialCharacters: true |
| 8221 |
}, _class.peek = Component.peek, _class.rewind = function () { |
| 8222 |
var mappedState = Component.rewind(); |
| 8223 |
if (!mappedState) { |
| 8224 |
// provide fallback if mappedState is undefined |
| 8225 |
mappedState = mapStateOnServer({ |
| 8226 |
baseTag: [], |
| 8227 |
bodyAttributes: {}, |
| 8228 |
encodeSpecialCharacters: true, |
| 8229 |
htmlAttributes: {}, |
| 8230 |
linkTags: [], |
| 8231 |
metaTags: [], |
| 8232 |
noscriptTags: [], |
| 8233 |
scriptTags: [], |
| 8234 |
styleTags: [], |
| 8235 |
title: "", |
| 8236 |
titleAttributes: {} |
| 8237 |
}); |
| 8238 |
} |
| 8239 |
|
| 8240 |
return mappedState; |
| 8241 |
}, _temp; |
| 8242 |
}; |
| 8243 |
|
| 8244 |
var NullComponent = function NullComponent() { |
| 8245 |
return null; |
| 8246 |
}; |
| 8247 |
|
| 8248 |
var HelmetSideEffects = react_side_effect__WEBPACK_IMPORTED_MODULE_1___default()(reducePropsToState, handleClientStateChange, mapStateOnServer)(NullComponent); |
| 8249 |
|
| 8250 |
var HelmetExport = Helmet(HelmetSideEffects); |
| 8251 |
HelmetExport.renderStatic = HelmetExport.rewind; |
| 8252 |
|
| 8253 |
/* harmony default export */ __webpack_exports__["default"] = (HelmetExport); |
| 8254 |
|
| 8255 |
|
| 8256 |
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) |
| 8257 |
|
| 8258 |
/***/ }), |
| 8259 |
|
| 8260 |
/***/ "./node_modules/react-is/cjs/react-is.development.js": |
| 8261 |
/*!***********************************************************!*\ |
| 8262 |
!*** ./node_modules/react-is/cjs/react-is.development.js ***! |
| 8263 |
\***********************************************************/ |
| 8264 |
/*! no static exports found */ |
| 8265 |
/***/ (function(module, exports, __webpack_require__) { |
| 8266 |
|
| 8267 |
"use strict"; |
| 8268 |
/** @license React v16.13.1 |
| 8269 |
* react-is.development.js |
| 8270 |
* |
| 8271 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 8272 |
* |
| 8273 |
* This source code is licensed under the MIT license found in the |
| 8274 |
* LICENSE file in the root directory of this source tree. |
| 8275 |
*/ |
| 8276 |
|
| 8277 |
|
| 8278 |
|
| 8279 |
|
| 8280 |
|
| 8281 |
if (true) { |
| 8282 |
(function() { |
| 8283 |
'use strict'; |
| 8284 |
|
| 8285 |
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol |
| 8286 |
// nor polyfill, then a plain number is used for performance. |
| 8287 |
var hasSymbol = typeof Symbol === 'function' && Symbol.for; |
| 8288 |
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; |
| 8289 |
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; |
| 8290 |
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; |
| 8291 |
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; |
| 8292 |
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; |
| 8293 |
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; |
| 8294 |
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary |
| 8295 |
// (unstable) APIs that have been removed. Can we remove the symbols? |
| 8296 |
|
| 8297 |
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; |
| 8298 |
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; |
| 8299 |
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; |
| 8300 |
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; |
| 8301 |
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; |
| 8302 |
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; |
| 8303 |
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; |
| 8304 |
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; |
| 8305 |
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; |
| 8306 |
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; |
| 8307 |
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; |
| 8308 |
|
| 8309 |
function isValidElementType(type) { |
| 8310 |
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. |
| 8311 |
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); |
| 8312 |
} |
| 8313 |
|
| 8314 |
function typeOf(object) { |
| 8315 |
if (typeof object === 'object' && object !== null) { |
| 8316 |
var $$typeof = object.$$typeof; |
| 8317 |
|
| 8318 |
switch ($$typeof) { |
| 8319 |
case REACT_ELEMENT_TYPE: |
| 8320 |
var type = object.type; |
| 8321 |
|
| 8322 |
switch (type) { |
| 8323 |
case REACT_ASYNC_MODE_TYPE: |
| 8324 |
case REACT_CONCURRENT_MODE_TYPE: |
| 8325 |
case REACT_FRAGMENT_TYPE: |
| 8326 |
case REACT_PROFILER_TYPE: |
| 8327 |
case REACT_STRICT_MODE_TYPE: |
| 8328 |
case REACT_SUSPENSE_TYPE: |
| 8329 |
return type; |
| 8330 |
|
| 8331 |
default: |
| 8332 |
var $$typeofType = type && type.$$typeof; |
| 8333 |
|
| 8334 |
switch ($$typeofType) { |
| 8335 |
case REACT_CONTEXT_TYPE: |
| 8336 |
case REACT_FORWARD_REF_TYPE: |
| 8337 |
case REACT_LAZY_TYPE: |
| 8338 |
case REACT_MEMO_TYPE: |
| 8339 |
case REACT_PROVIDER_TYPE: |
| 8340 |
return $$typeofType; |
| 8341 |
|
| 8342 |
default: |
| 8343 |
return $$typeof; |
| 8344 |
} |
| 8345 |
|
| 8346 |
} |
| 8347 |
|
| 8348 |
case REACT_PORTAL_TYPE: |
| 8349 |
return $$typeof; |
| 8350 |
} |
| 8351 |
} |
| 8352 |
|
| 8353 |
return undefined; |
| 8354 |
} // AsyncMode is deprecated along with isAsyncMode |
| 8355 |
|
| 8356 |
var AsyncMode = REACT_ASYNC_MODE_TYPE; |
| 8357 |
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; |
| 8358 |
var ContextConsumer = REACT_CONTEXT_TYPE; |
| 8359 |
var ContextProvider = REACT_PROVIDER_TYPE; |
| 8360 |
var Element = REACT_ELEMENT_TYPE; |
| 8361 |
var ForwardRef = REACT_FORWARD_REF_TYPE; |
| 8362 |
var Fragment = REACT_FRAGMENT_TYPE; |
| 8363 |
var Lazy = REACT_LAZY_TYPE; |
| 8364 |
var Memo = REACT_MEMO_TYPE; |
| 8365 |
var Portal = REACT_PORTAL_TYPE; |
| 8366 |
var Profiler = REACT_PROFILER_TYPE; |
| 8367 |
var StrictMode = REACT_STRICT_MODE_TYPE; |
| 8368 |
var Suspense = REACT_SUSPENSE_TYPE; |
| 8369 |
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated |
| 8370 |
|
| 8371 |
function isAsyncMode(object) { |
| 8372 |
{ |
| 8373 |
if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
| 8374 |
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint |
| 8375 |
|
| 8376 |
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); |
| 8377 |
} |
| 8378 |
} |
| 8379 |
|
| 8380 |
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; |
| 8381 |
} |
| 8382 |
function isConcurrentMode(object) { |
| 8383 |
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; |
| 8384 |
} |
| 8385 |
function isContextConsumer(object) { |
| 8386 |
return typeOf(object) === REACT_CONTEXT_TYPE; |
| 8387 |
} |
| 8388 |
function isContextProvider(object) { |
| 8389 |
return typeOf(object) === REACT_PROVIDER_TYPE; |
| 8390 |
} |
| 8391 |
function isElement(object) { |
| 8392 |
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 8393 |
} |
| 8394 |
function isForwardRef(object) { |
| 8395 |
return typeOf(object) === REACT_FORWARD_REF_TYPE; |
| 8396 |
} |
| 8397 |
function isFragment(object) { |
| 8398 |
return typeOf(object) === REACT_FRAGMENT_TYPE; |
| 8399 |
} |
| 8400 |
function isLazy(object) { |
| 8401 |
return typeOf(object) === REACT_LAZY_TYPE; |
| 8402 |
} |
| 8403 |
function isMemo(object) { |
| 8404 |
return typeOf(object) === REACT_MEMO_TYPE; |
| 8405 |
} |
| 8406 |
function isPortal(object) { |
| 8407 |
return typeOf(object) === REACT_PORTAL_TYPE; |
| 8408 |
} |
| 8409 |
function isProfiler(object) { |
| 8410 |
return typeOf(object) === REACT_PROFILER_TYPE; |
| 8411 |
} |
| 8412 |
function isStrictMode(object) { |
| 8413 |
return typeOf(object) === REACT_STRICT_MODE_TYPE; |
| 8414 |
} |
| 8415 |
function isSuspense(object) { |
| 8416 |
return typeOf(object) === REACT_SUSPENSE_TYPE; |
| 8417 |
} |
| 8418 |
|
| 8419 |
exports.AsyncMode = AsyncMode; |
| 8420 |
exports.ConcurrentMode = ConcurrentMode; |
| 8421 |
exports.ContextConsumer = ContextConsumer; |
| 8422 |
exports.ContextProvider = ContextProvider; |
| 8423 |
exports.Element = Element; |
| 8424 |
exports.ForwardRef = ForwardRef; |
| 8425 |
exports.Fragment = Fragment; |
| 8426 |
exports.Lazy = Lazy; |
| 8427 |
exports.Memo = Memo; |
| 8428 |
exports.Portal = Portal; |
| 8429 |
exports.Profiler = Profiler; |
| 8430 |
exports.StrictMode = StrictMode; |
| 8431 |
exports.Suspense = Suspense; |
| 8432 |
exports.isAsyncMode = isAsyncMode; |
| 8433 |
exports.isConcurrentMode = isConcurrentMode; |
| 8434 |
exports.isContextConsumer = isContextConsumer; |
| 8435 |
exports.isContextProvider = isContextProvider; |
| 8436 |
exports.isElement = isElement; |
| 8437 |
exports.isForwardRef = isForwardRef; |
| 8438 |
exports.isFragment = isFragment; |
| 8439 |
exports.isLazy = isLazy; |
| 8440 |
exports.isMemo = isMemo; |
| 8441 |
exports.isPortal = isPortal; |
| 8442 |
exports.isProfiler = isProfiler; |
| 8443 |
exports.isStrictMode = isStrictMode; |
| 8444 |
exports.isSuspense = isSuspense; |
| 8445 |
exports.isValidElementType = isValidElementType; |
| 8446 |
exports.typeOf = typeOf; |
| 8447 |
})(); |
| 8448 |
} |
| 8449 |
|
| 8450 |
|
| 8451 |
/***/ }), |
| 8452 |
|
| 8453 |
/***/ "./node_modules/react-is/index.js": |
| 8454 |
/*!****************************************!*\ |
| 8455 |
!*** ./node_modules/react-is/index.js ***! |
| 8456 |
\****************************************/ |
| 8457 |
/*! no static exports found */ |
| 8458 |
/***/ (function(module, exports, __webpack_require__) { |
| 8459 |
|
| 8460 |
"use strict"; |
| 8461 |
|
| 8462 |
|
| 8463 |
if (false) {} else { |
| 8464 |
module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js"); |
| 8465 |
} |
| 8466 |
|
| 8467 |
|
| 8468 |
/***/ }), |
| 8469 |
|
| 8470 |
/***/ "./node_modules/react-side-effect/lib/index.js": |
| 8471 |
/*!*****************************************************!*\ |
| 8472 |
!*** ./node_modules/react-side-effect/lib/index.js ***! |
| 8473 |
\*****************************************************/ |
| 8474 |
/*! no static exports found */ |
| 8475 |
/***/ (function(module, exports, __webpack_require__) { |
| 8476 |
|
| 8477 |
"use strict"; |
| 8478 |
|
| 8479 |
|
| 8480 |
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } |
| 8481 |
|
| 8482 |
var React = __webpack_require__(/*! react */ "react"); |
| 8483 |
var React__default = _interopDefault(React); |
| 8484 |
|
| 8485 |
function _defineProperty(obj, key, value) { |
| 8486 |
if (key in obj) { |
| 8487 |
Object.defineProperty(obj, key, { |
| 8488 |
value: value, |
| 8489 |
enumerable: true, |
| 8490 |
configurable: true, |
| 8491 |
writable: true |
| 8492 |
}); |
| 8493 |
} else { |
| 8494 |
obj[key] = value; |
| 8495 |
} |
| 8496 |
|
| 8497 |
return obj; |
| 8498 |
} |
| 8499 |
|
| 8500 |
function _inheritsLoose(subClass, superClass) { |
| 8501 |
subClass.prototype = Object.create(superClass.prototype); |
| 8502 |
subClass.prototype.constructor = subClass; |
| 8503 |
subClass.__proto__ = superClass; |
| 8504 |
} |
| 8505 |
|
| 8506 |
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); |
| 8507 |
function withSideEffect(reducePropsToState, handleStateChangeOnClient, mapStateOnServer) { |
| 8508 |
if (typeof reducePropsToState !== 'function') { |
| 8509 |
throw new Error('Expected reducePropsToState to be a function.'); |
| 8510 |
} |
| 8511 |
|
| 8512 |
if (typeof handleStateChangeOnClient !== 'function') { |
| 8513 |
throw new Error('Expected handleStateChangeOnClient to be a function.'); |
| 8514 |
} |
| 8515 |
|
| 8516 |
if (typeof mapStateOnServer !== 'undefined' && typeof mapStateOnServer !== 'function') { |
| 8517 |
throw new Error('Expected mapStateOnServer to either be undefined or a function.'); |
| 8518 |
} |
| 8519 |
|
| 8520 |
function getDisplayName(WrappedComponent) { |
| 8521 |
return WrappedComponent.displayName || WrappedComponent.name || 'Component'; |
| 8522 |
} |
| 8523 |
|
| 8524 |
return function wrap(WrappedComponent) { |
| 8525 |
if (typeof WrappedComponent !== 'function') { |
| 8526 |
throw new Error('Expected WrappedComponent to be a React component.'); |
| 8527 |
} |
| 8528 |
|
| 8529 |
var mountedInstances = []; |
| 8530 |
var state; |
| 8531 |
|
| 8532 |
function emitChange() { |
| 8533 |
state = reducePropsToState(mountedInstances.map(function (instance) { |
| 8534 |
return instance.props; |
| 8535 |
})); |
| 8536 |
|
| 8537 |
if (SideEffect.canUseDOM) { |
| 8538 |
handleStateChangeOnClient(state); |
| 8539 |
} else if (mapStateOnServer) { |
| 8540 |
state = mapStateOnServer(state); |
| 8541 |
} |
| 8542 |
} |
| 8543 |
|
| 8544 |
var SideEffect = |
| 8545 |
/*#__PURE__*/ |
| 8546 |
function (_PureComponent) { |
| 8547 |
_inheritsLoose(SideEffect, _PureComponent); |
| 8548 |
|
| 8549 |
function SideEffect() { |
| 8550 |
return _PureComponent.apply(this, arguments) || this; |
| 8551 |
} |
| 8552 |
|
| 8553 |
// Try to use displayName of wrapped component |
| 8554 |
// Expose canUseDOM so tests can monkeypatch it |
| 8555 |
SideEffect.peek = function peek() { |
| 8556 |
return state; |
| 8557 |
}; |
| 8558 |
|
| 8559 |
SideEffect.rewind = function rewind() { |
| 8560 |
if (SideEffect.canUseDOM) { |
| 8561 |
throw new Error('You may only call rewind() on the server. Call peek() to read the current state.'); |
| 8562 |
} |
| 8563 |
|
| 8564 |
var recordedState = state; |
| 8565 |
state = undefined; |
| 8566 |
mountedInstances = []; |
| 8567 |
return recordedState; |
| 8568 |
}; |
| 8569 |
|
| 8570 |
var _proto = SideEffect.prototype; |
| 8571 |
|
| 8572 |
_proto.UNSAFE_componentWillMount = function UNSAFE_componentWillMount() { |
| 8573 |
mountedInstances.push(this); |
| 8574 |
emitChange(); |
| 8575 |
}; |
| 8576 |
|
| 8577 |
_proto.componentDidUpdate = function componentDidUpdate() { |
| 8578 |
emitChange(); |
| 8579 |
}; |
| 8580 |
|
| 8581 |
_proto.componentWillUnmount = function componentWillUnmount() { |
| 8582 |
var index = mountedInstances.indexOf(this); |
| 8583 |
mountedInstances.splice(index, 1); |
| 8584 |
emitChange(); |
| 8585 |
}; |
| 8586 |
|
| 8587 |
_proto.render = function render() { |
| 8588 |
return React__default.createElement(WrappedComponent, this.props); |
| 8589 |
}; |
| 8590 |
|
| 8591 |
return SideEffect; |
| 8592 |
}(React.PureComponent); |
| 8593 |
|
| 8594 |
_defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")"); |
| 8595 |
|
| 8596 |
_defineProperty(SideEffect, "canUseDOM", canUseDOM); |
| 8597 |
|
| 8598 |
return SideEffect; |
| 8599 |
}; |
| 8600 |
} |
| 8601 |
|
| 8602 |
module.exports = withSideEffect; |
| 8603 |
|
| 8604 |
|
| 8605 |
/***/ }), |
| 8606 |
|
| 8607 |
/***/ "./node_modules/webpack/buildin/global.js": |
| 8608 |
/*!***********************************!*\ |
| 8609 |
!*** (webpack)/buildin/global.js ***! |
| 8610 |
\***********************************/ |
| 8611 |
/*! no static exports found */ |
| 8612 |
/***/ (function(module, exports) { |
| 8613 |
|
| 8614 |
var g; |
| 8615 |
|
| 8616 |
// This works in non-strict mode |
| 8617 |
g = (function() { |
| 8618 |
return this; |
| 8619 |
})(); |
| 8620 |
|
| 8621 |
try { |
| 8622 |
// This works if eval is allowed (see CSP) |
| 8623 |
g = g || new Function("return this")(); |
| 8624 |
} catch (e) { |
| 8625 |
// This works if the window reference is available |
| 8626 |
if (typeof window === "object") g = window; |
| 8627 |
} |
| 8628 |
|
| 8629 |
// g can still be undefined, but nothing to do about it... |
| 8630 |
// We return undefined, instead of nothing here, so it's |
| 8631 |
// easier to handle this case. if(!global) { ...} |
| 8632 |
|
| 8633 |
module.exports = g; |
| 8634 |
|
| 8635 |
|
| 8636 |
/***/ }), |
| 8637 |
|
| 8638 |
/***/ "./src/assets/js/Helpers.js": |
| 8639 |
/*!**********************************!*\ |
| 8640 |
!*** ./src/assets/js/Helpers.js ***! |
| 8641 |
\**********************************/ |
| 8642 |
/*! exports provided: useFetch, raiseError, generateOptions, paymentResult, clearUpCopyAndPay */ |
| 8643 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 8644 |
|
| 8645 |
"use strict"; |
| 8646 |
__webpack_require__.r(__webpack_exports__); |
| 8647 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useFetch", function() { return useFetch; }); |
| 8648 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "raiseError", function() { return raiseError; }); |
| 8649 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generateOptions", function() { return generateOptions; }); |
| 8650 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "paymentResult", function() { return paymentResult; }); |
| 8651 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearUpCopyAndPay", function() { return clearUpCopyAndPay; }); |
| 8652 |
/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); |
| 8653 |
/* harmony import */ var _dispatcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dispatcher */ "./src/assets/js/dispatcher.js"); |
| 8654 |
|
| 8655 |
|
| 8656 |
const useFetch = url => { |
| 8657 |
const content_type = url == "hyperpay_process_checkout" ? "application/x-www-form-urlencoded" : "multipart/form-data"; |
| 8658 |
const instance = axios__WEBPACK_IMPORTED_MODULE_0__["default"].create({ |
| 8659 |
baseURL: `/?wc-ajax=${url}`, |
| 8660 |
withCredentials: true, |
| 8661 |
headers: { |
| 8662 |
"Content-Type": content_type |
| 8663 |
} |
| 8664 |
}); |
| 8665 |
return instance; |
| 8666 |
}; |
| 8667 |
const raiseError = (props, message = null, Json = true) => { |
| 8668 |
if (Json) { |
| 8669 |
props.onError(message !== null && message !== void 0 ? message : "could not create order"); |
| 8670 |
} else { |
| 8671 |
const container = document.querySelector('.wc-block-components-notices'); |
| 8672 |
container.innerHTML = message; |
| 8673 |
} |
| 8674 |
return { |
| 8675 |
status: "ABORT" |
| 8676 |
}; |
| 8677 |
}; |
| 8678 |
|
| 8679 |
/** |
| 8680 |
* |
| 8681 |
* @param {dispatcher} dispatcher |
| 8682 |
* @param {string} checkoutId |
| 8683 |
* @param {object} shippingMethod |
| 8684 |
* @returns |
| 8685 |
*/ |
| 8686 |
const generateOptions = (props, shippingMethod, checkoutId) => { |
| 8687 |
var _props$billing$cartTo, _ref; |
| 8688 |
return { |
| 8689 |
applePay: { |
| 8690 |
version: "3", |
| 8691 |
buttonType: props.setting.extraScriptData.action_type, |
| 8692 |
buttonStyle: props.setting.extraScriptData.action_style, |
| 8693 |
requiredBillingContactFields: ['postalAddress', 'email', "phone"], |
| 8694 |
requiredShippingContactFields: ['postalAddress', 'email', "phone"], |
| 8695 |
currencyCode: props.billing.currency.code, |
| 8696 |
onCancel: props.onClose, |
| 8697 |
total: { |
| 8698 |
label: "By HyperPay", |
| 8699 |
amount: ((_props$billing$cartTo = props.billing.cartTotal.value) !== null && _props$billing$cartTo !== void 0 ? _props$billing$cartTo : 0) / ((_ref = 10 ** props.billing.currency.minorUnit) !== null && _ref !== void 0 ? _ref : 0) |
| 8700 |
}, |
| 8701 |
onShippingMethodSelected: async function (shipping_method) { |
| 8702 |
return Object(_dispatcher__WEBPACK_IMPORTED_MODULE_1__["updateShippingMethod"])(props, shippingMethod, shipping_method); |
| 8703 |
}, |
| 8704 |
onPaymentAuthorized: async function (payment) { |
| 8705 |
return Object(_dispatcher__WEBPACK_IMPORTED_MODULE_1__["paymentAuthorized"])(props, shippingMethod, payment, checkoutId); |
| 8706 |
}, |
| 8707 |
onShippingContactSelected: async function (shippingContact) { |
| 8708 |
return Object(_dispatcher__WEBPACK_IMPORTED_MODULE_1__["updateContact"])(props, shippingContact); |
| 8709 |
} |
| 8710 |
} |
| 8711 |
}; |
| 8712 |
}; |
| 8713 |
const paymentResult = (props, response) => { |
| 8714 |
if (response.data.result != "success") return raiseError(props, response.data.result); |
| 8715 |
return { |
| 8716 |
newTotal: response.data.total, |
| 8717 |
newLineItems: response.data.displayItems, |
| 8718 |
newShippingMethods: response.data.shipping_options |
| 8719 |
}; |
| 8720 |
}; |
| 8721 |
const clearUpCopyAndPay = () => { |
| 8722 |
if (window.wpwl !== undefined && window.wpwl.unload !== undefined) { |
| 8723 |
window.wpwl.unload(); |
| 8724 |
document.querySelectorAll("script").forEach(i => { |
| 8725 |
if (i.src.includes('static.min.js') || i.src.includes('paymentWidgets.js')) { |
| 8726 |
i.remove(); |
| 8727 |
} |
| 8728 |
}); |
| 8729 |
} |
| 8730 |
}; |
| 8731 |
|
| 8732 |
/***/ }), |
| 8733 |
|
| 8734 |
/***/ "./src/assets/js/applePay.jsx": |
| 8735 |
/*!************************************!*\ |
| 8736 |
!*** ./src/assets/js/applePay.jsx ***! |
| 8737 |
\************************************/ |
| 8738 |
/*! exports provided: default */ |
| 8739 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 8740 |
|
| 8741 |
"use strict"; |
| 8742 |
__webpack_require__.r(__webpack_exports__); |
| 8743 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 8744 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 8745 |
/* harmony import */ var react_helmet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-helmet */ "./node_modules/react-helmet/es/Helmet.js"); |
| 8746 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react"); |
| 8747 |
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__); |
| 8748 |
/* harmony import */ var _Helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Helpers */ "./src/assets/js/Helpers.js"); |
| 8749 |
|
| 8750 |
|
| 8751 |
|
| 8752 |
|
| 8753 |
const ApplePay = React.memo(props => { |
| 8754 |
const [checkoutId, setCheckoutId] = Object(react__WEBPACK_IMPORTED_MODULE_2__["useState"])(null); |
| 8755 |
const shippingMethod = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(null); |
| 8756 |
Object(react__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(() => { |
| 8757 |
Object(_Helpers__WEBPACK_IMPORTED_MODULE_3__["useFetch"])("hyperpay_prepare_checkout").get("").then(res => { |
| 8758 |
setCheckoutId(res.data); |
| 8759 |
window.wpwlOptions = Object(_Helpers__WEBPACK_IMPORTED_MODULE_3__["generateOptions"])(props, shippingMethod, res.data); |
| 8760 |
}); |
| 8761 |
return Object(_Helpers__WEBPACK_IMPORTED_MODULE_3__["clearUpCopyAndPay"])(); |
| 8762 |
}, []); |
| 8763 |
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, checkoutId && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("form", { |
| 8764 |
action: "", |
| 8765 |
className: "paymentWidgets", |
| 8766 |
"data-brands": props.setting.brands |
| 8767 |
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(react_helmet__WEBPACK_IMPORTED_MODULE_1__["Helmet"], null, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("script", { |
| 8768 |
src: `https://eu-test.oppwa.com/v1/paymentWidgets.js?checkoutId=${checkoutId}` |
| 8769 |
})))); |
| 8770 |
}, () => true); |
| 8771 |
/* harmony default export */ __webpack_exports__["default"] = (ApplePay); |
| 8772 |
|
| 8773 |
/***/ }), |
| 8774 |
|
| 8775 |
/***/ "./src/assets/js/blocks.js": |
| 8776 |
/*!*********************************!*\ |
| 8777 |
!*** ./src/assets/js/blocks.js ***! |
| 8778 |
\*********************************/ |
| 8779 |
/*! no exports provided */ |
| 8780 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 8781 |
|
| 8782 |
"use strict"; |
| 8783 |
__webpack_require__.r(__webpack_exports__); |
| 8784 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 8785 |
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); |
| 8786 |
/* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/blocks-registry */ "@woocommerce/blocks-registry"); |
| 8787 |
/* harmony import */ var _woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_1__); |
| 8788 |
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); |
| 8789 |
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__); |
| 8790 |
/* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 8791 |
/* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__); |
| 8792 |
/* harmony import */ var _applePay_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./applePay.jsx */ "./src/assets/js/applePay.jsx"); |
| 8793 |
/* harmony import */ var _Helpers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Helpers.js */ "./src/assets/js/Helpers.js"); |
| 8794 |
|
| 8795 |
|
| 8796 |
|
| 8797 |
|
| 8798 |
|
| 8799 |
|
| 8800 |
let cache = {}; |
| 8801 |
const settings = Object(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_3__["getSetting"])('hyperpay_blocks_data', {}); |
| 8802 |
|
| 8803 |
/** |
| 8804 |
* Label component |
| 8805 |
* |
| 8806 |
* @param {*} props Props from payment API. |
| 8807 |
*/ |
| 8808 |
const Label = props => { |
| 8809 |
const { |
| 8810 |
PaymentMethodLabel, |
| 8811 |
PaymentMethodIcons |
| 8812 |
} = props.components; |
| 8813 |
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { |
| 8814 |
style: { |
| 8815 |
display: 'flex', |
| 8816 |
justifyContent: 'space-between', |
| 8817 |
width: "100%", |
| 8818 |
paddingRight: 5, |
| 8819 |
paddingLeft: 5 |
| 8820 |
} |
| 8821 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PaymentMethodLabel, { |
| 8822 |
text: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__["decodeEntities"])(props.setting.title) |
| 8823 |
}), Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PaymentMethodIcons, { |
| 8824 |
icons: props.setting.icon.map((brand, index) => ({ |
| 8825 |
id: props.setting.title + index, |
| 8826 |
src: brand |
| 8827 |
})) |
| 8828 |
})); |
| 8829 |
}; |
| 8830 |
const Content = props => { |
| 8831 |
const { |
| 8832 |
PaymentMethodLabel |
| 8833 |
} = props.components; |
| 8834 |
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, props.setting.description && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { |
| 8835 |
style: { |
| 8836 |
display: 'flex', |
| 8837 |
justifyContent: 'space-between', |
| 8838 |
width: "100%", |
| 8839 |
paddingRight: 5, |
| 8840 |
paddingLeft: 5 |
| 8841 |
} |
| 8842 |
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(PaymentMethodLabel, { |
| 8843 |
text: props.setting.description |
| 8844 |
}))); |
| 8845 |
}; |
| 8846 |
const memoizedCanMakePayment = async (data, setting) => { |
| 8847 |
let fetching = false; |
| 8848 |
let country = data.billingAddress.country; |
| 8849 |
let currency_code = data.cartTotals.currency_code; |
| 8850 |
let total_price = data.cartTotals.total_price; |
| 8851 |
let key = `${setting.name}_${country}_${currency_code}_${total_price}`; |
| 8852 |
if (key in cache) { |
| 8853 |
return cache[key]; |
| 8854 |
} else if (fetching) { |
| 8855 |
return; |
| 8856 |
} else { |
| 8857 |
fetching = true; |
| 8858 |
let res = await Object(_Helpers_js__WEBPACK_IMPORTED_MODULE_5__["useFetch"])("hyperpay_can_make_payment&payment_method=" + setting.name).post("", data); |
| 8859 |
setting.description = res.data.description; |
| 8860 |
cache[key] = res.data.canMakePayment; |
| 8861 |
return cache[key]; |
| 8862 |
} |
| 8863 |
}; |
| 8864 |
settings.blocks.forEach(setting => { |
| 8865 |
let gateWay = { |
| 8866 |
name: setting.name, |
| 8867 |
label: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Label, { |
| 8868 |
setting: setting |
| 8869 |
}), |
| 8870 |
content: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(Content, { |
| 8871 |
setting: setting |
| 8872 |
}), |
| 8873 |
edit: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", null, Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__["decodeEntities"])(setting.description)), |
| 8874 |
canMakePayment: async data => { |
| 8875 |
if (setting.isDynamicCheck) { |
| 8876 |
return memoizedCanMakePayment(data, setting); |
| 8877 |
} |
| 8878 |
return true; |
| 8879 |
}, |
| 8880 |
ariaLabel: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__["decodeEntities"])(setting.title), |
| 8881 |
supports: { |
| 8882 |
features: setting.supports |
| 8883 |
} |
| 8884 |
}; |
| 8885 |
Object(_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_1__["registerPaymentMethod"])(gateWay); |
| 8886 |
}); |
| 8887 |
settings.express.forEach(setting => { |
| 8888 |
const gateWay = { |
| 8889 |
name: setting.name, |
| 8890 |
content: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_applePay_jsx__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 8891 |
setting: setting |
| 8892 |
}), |
| 8893 |
edit: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("img", { |
| 8894 |
style: { |
| 8895 |
maxHeight: 50, |
| 8896 |
maxWidth: 238 |
| 8897 |
}, |
| 8898 |
src: setting.action_button |
| 8899 |
}), |
| 8900 |
canMakePayment: () => !!window.ApplePaySession, |
| 8901 |
ariaLabel: Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__["decodeEntities"])(setting.title), |
| 8902 |
paymentMethodId: setting.name, |
| 8903 |
supports: { |
| 8904 |
features: settings.supports |
| 8905 |
} |
| 8906 |
}; |
| 8907 |
Object(_woocommerce_blocks_registry__WEBPACK_IMPORTED_MODULE_1__["registerExpressPaymentMethod"])(gateWay); |
| 8908 |
}); |
| 8909 |
|
| 8910 |
/***/ }), |
| 8911 |
|
| 8912 |
/***/ "./src/assets/js/dispatcher.js": |
| 8913 |
/*!*************************************!*\ |
| 8914 |
!*** ./src/assets/js/dispatcher.js ***! |
| 8915 |
\*************************************/ |
| 8916 |
/*! exports provided: updateContact, updateShippingMethod, paymentAuthorized */ |
| 8917 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
| 8918 |
|
| 8919 |
"use strict"; |
| 8920 |
__webpack_require__.r(__webpack_exports__); |
| 8921 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateContact", function() { return updateContact; }); |
| 8922 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateShippingMethod", function() { return updateShippingMethod; }); |
| 8923 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "paymentAuthorized", function() { return paymentAuthorized; }); |
| 8924 |
/* harmony import */ var _Helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Helpers */ "./src/assets/js/Helpers.js"); |
| 8925 |
|
| 8926 |
const updateContact = async (props, shippingContact) => { |
| 8927 |
return Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["useFetch"])("hyperpay_update_checkout").post("", shippingContact).then(response => Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["paymentResult"])(props, response)).catch(err => Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["raiseError"])(err.response.data)); |
| 8928 |
}; |
| 8929 |
const updateShippingMethod = async (props, shippingMethod, shipping_method) => { |
| 8930 |
const data = { |
| 8931 |
shipping_method: shipping_method.identifier, |
| 8932 |
is_product_page: false |
| 8933 |
}; |
| 8934 |
shippingMethod.current = shipping_method; |
| 8935 |
return Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["useFetch"])("hyperpay_update_method").post("", data).then(response => Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["paymentResult"])(props, response)).catch(err => Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["raiseError"])(err, err.response)); |
| 8936 |
}; |
| 8937 |
const paymentAuthorized = async (props, shippingMethod, payment, checkoutId) => { |
| 8938 |
var _payment$billingConta, _payment$shippingCont; |
| 8939 |
const data = { |
| 8940 |
_wpnonce: props.settings.nonce, |
| 8941 |
checkoutId: checkoutId, |
| 8942 |
payment_method: props.settings.name, |
| 8943 |
create_account: false, |
| 8944 |
billing_first_name: payment.billingContact.givenName, |
| 8945 |
billing_last_name: payment.billingContact.familyName, |
| 8946 |
billing_email: payment.shippingContact.emailAddress, |
| 8947 |
billing_phone: payment.shippingContact.phoneNumber, |
| 8948 |
billing_country: payment.billingContact.countryCode, |
| 8949 |
billing_address_1: payment.billingContact.addressLines[0], |
| 8950 |
billing_address_2: (_payment$billingConta = payment.billingContact.addressLines[1]) !== null && _payment$billingConta !== void 0 ? _payment$billingConta : null, |
| 8951 |
billing_city: payment.billingContact.locality, |
| 8952 |
billing_state: payment.billingContact.administrativeArea ? payment.billingContact.administrativeArea : payment.billingContact.locality, |
| 8953 |
billing_postcode: payment.billingContact.postalCode, |
| 8954 |
shipping_first_name: payment.shippingContact.givenName, |
| 8955 |
shipping_last_name: payment.shippingContact.familyName, |
| 8956 |
shipping_company: '', |
| 8957 |
shipping_country: payment.shippingContact.countryCode, |
| 8958 |
shipping_address_1: payment.shippingContact.addressLines[0], |
| 8959 |
shipping_address_2: (_payment$shippingCont = payment.shippingContact.addressLines[1]) !== null && _payment$shippingCont !== void 0 ? _payment$shippingCont : null, |
| 8960 |
shipping_city: payment.shippingContact.locality, |
| 8961 |
shipping_state: payment.shippingContact.administrativeArea ? payment.shippingContact.administrativeArea : payment.shippingContact.locality, |
| 8962 |
shipping_postcode: payment.shippingContact.postalCode, |
| 8963 |
shipping_method: shippingMethod.current.identifier, |
| 8964 |
order_comments: '', |
| 8965 |
ship_to_different_address: 1, |
| 8966 |
terms: 1 |
| 8967 |
}; |
| 8968 |
return Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["useFetch"])("hyperpay_process_checkout").post('', data).then(res => { |
| 8969 |
if (res.data.result != "SUCCESS") { |
| 8970 |
return Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["raiseError"])(props, res.data.messages, false); |
| 8971 |
} |
| 8972 |
return { |
| 8973 |
status: "SUCCESS" |
| 8974 |
}; |
| 8975 |
}).catch(err => Object(_Helpers__WEBPACK_IMPORTED_MODULE_0__["raiseError"])(props, err.response.data)).finally(props.onClose); |
| 8976 |
}; |
| 8977 |
|
| 8978 |
/***/ }), |
| 8979 |
|
| 8980 |
/***/ "@woocommerce/blocks-registry": |
| 8981 |
/*!******************************************!*\ |
| 8982 |
!*** external ["wc","wcBlocksRegistry"] ***! |
| 8983 |
\******************************************/ |
| 8984 |
/*! no static exports found */ |
| 8985 |
/***/ (function(module, exports) { |
| 8986 |
|
| 8987 |
(function() { module.exports = window["wc"]["wcBlocksRegistry"]; }()); |
| 8988 |
|
| 8989 |
/***/ }), |
| 8990 |
|
| 8991 |
/***/ "@woocommerce/settings": |
| 8992 |
/*!************************************!*\ |
| 8993 |
!*** external ["wc","wcSettings"] ***! |
| 8994 |
\************************************/ |
| 8995 |
/*! no static exports found */ |
| 8996 |
/***/ (function(module, exports) { |
| 8997 |
|
| 8998 |
(function() { module.exports = window["wc"]["wcSettings"]; }()); |
| 8999 |
|
| 9000 |
/***/ }), |
| 9001 |
|
| 9002 |
/***/ "@wordpress/element": |
| 9003 |
/*!*********************************!*\ |
| 9004 |
!*** external ["wp","element"] ***! |
| 9005 |
\*********************************/ |
| 9006 |
/*! no static exports found */ |
| 9007 |
/***/ (function(module, exports) { |
| 9008 |
|
| 9009 |
(function() { module.exports = window["wp"]["element"]; }()); |
| 9010 |
|
| 9011 |
/***/ }), |
| 9012 |
|
| 9013 |
/***/ "@wordpress/html-entities": |
| 9014 |
/*!**************************************!*\ |
| 9015 |
!*** external ["wp","htmlEntities"] ***! |
| 9016 |
\**************************************/ |
| 9017 |
/*! no static exports found */ |
| 9018 |
/***/ (function(module, exports) { |
| 9019 |
|
| 9020 |
(function() { module.exports = window["wp"]["htmlEntities"]; }()); |
| 9021 |
|
| 9022 |
/***/ }), |
| 9023 |
|
| 9024 |
/***/ "react": |
| 9025 |
/*!************************!*\ |
| 9026 |
!*** external "React" ***! |
| 9027 |
\************************/ |
| 9028 |
/*! no static exports found */ |
| 9029 |
/***/ (function(module, exports) { |
| 9030 |
|
| 9031 |
(function() { module.exports = window["React"]; }()); |
| 9032 |
|
| 9033 |
/***/ }) |
| 9034 |
|
| 9035 |
/******/ }); |
| 9036 |
//# sourceMappingURL=blocks.js.map |