Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

25692 lignes
691 KiB

  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/ // The require function
  5. /******/ function __webpack_require__(moduleId) {
  6. /******/ // Check if module is in cache
  7. /******/ if(installedModules[moduleId])
  8. /******/ return installedModules[moduleId].exports;
  9. /******/ // Create a new module (and put it into the cache)
  10. /******/ var module = installedModules[moduleId] = {
  11. /******/ i: moduleId,
  12. /******/ l: false,
  13. /******/ exports: {}
  14. /******/ };
  15. /******/ // Execute the module function
  16. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  17. /******/ // Flag the module as loaded
  18. /******/ module.l = true;
  19. /******/ // Return the exports of the module
  20. /******/ return module.exports;
  21. /******/ }
  22. /******/ // expose the modules object (__webpack_modules__)
  23. /******/ __webpack_require__.m = modules;
  24. /******/ // expose the module cache
  25. /******/ __webpack_require__.c = installedModules;
  26. /******/ // identity function for calling harmory imports with the correct context
  27. /******/ __webpack_require__.i = function(value) { return value; };
  28. /******/ // define getter function for harmory exports
  29. /******/ __webpack_require__.d = function(exports, name, getter) {
  30. /******/ Object.defineProperty(exports, name, {
  31. /******/ configurable: false,
  32. /******/ enumerable: true,
  33. /******/ get: getter
  34. /******/ });
  35. /******/ };
  36. /******/ // getDefaultExport function for compatibility with non-harmony modules
  37. /******/ __webpack_require__.n = function(module) {
  38. /******/ var getter = module && module.__esModule ?
  39. /******/ function getDefault() { return module['default']; } :
  40. /******/ function getModuleExports() { return module; };
  41. /******/ __webpack_require__.d(getter, 'a', getter);
  42. /******/ return getter;
  43. /******/ };
  44. /******/ // Object.prototype.hasOwnProperty.call
  45. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  46. /******/ // __webpack_public_path__
  47. /******/ __webpack_require__.p = "/dist/";
  48. /******/ // Load entry module and return exports
  49. /******/ return __webpack_require__(__webpack_require__.s = 223);
  50. /******/ })
  51. /************************************************************************/
  52. /******/ ((function(modules) {
  53. // Check all modules for deduplicated modules
  54. for(var i in modules) {
  55. if(Object.prototype.hasOwnProperty.call(modules, i)) {
  56. switch(typeof modules[i]) {
  57. case "function": break;
  58. case "object":
  59. // Module can be created from a template
  60. modules[i] = (function(_m) {
  61. var args = _m.slice(1), fn = modules[_m[0]];
  62. return function (a,b,c) {
  63. fn.apply(this, [a,b,c].concat(args));
  64. };
  65. }(modules[i]));
  66. break;
  67. default:
  68. // Module is a copy of another module
  69. modules[i] = modules[modules[i]];
  70. break;
  71. }
  72. }
  73. }
  74. return modules;
  75. }([
  76. /* 0 */
  77. /***/ function(module, exports, __webpack_require__) {
  78. "use strict";
  79. /* WEBPACK VAR INJECTION */(function(Buffer, global) {/*!
  80. * The buffer module from node.js, for the browser.
  81. *
  82. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  83. * @license MIT
  84. */
  85. /* eslint-disable no-proto */
  86. 'use strict'
  87. var base64 = __webpack_require__(117)
  88. var ieee754 = __webpack_require__(171)
  89. var isArray = __webpack_require__(73)
  90. exports.Buffer = Buffer
  91. exports.SlowBuffer = SlowBuffer
  92. exports.INSPECT_MAX_BYTES = 50
  93. /**
  94. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  95. * === true Use Uint8Array implementation (fastest)
  96. * === false Use Object implementation (most compatible, even IE6)
  97. *
  98. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  99. * Opera 11.6+, iOS 4.2+.
  100. *
  101. * Due to various browser bugs, sometimes the Object implementation will be used even
  102. * when the browser supports typed arrays.
  103. *
  104. * Note:
  105. *
  106. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  107. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  108. *
  109. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  110. *
  111. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  112. * incorrect length in some situations.
  113. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  114. * get the Object implementation, which is slower but behaves correctly.
  115. */
  116. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  117. ? global.TYPED_ARRAY_SUPPORT
  118. : typedArraySupport()
  119. /*
  120. * Export kMaxLength after typed array support is determined.
  121. */
  122. exports.kMaxLength = kMaxLength()
  123. function typedArraySupport () {
  124. try {
  125. var arr = new Uint8Array(1)
  126. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  127. return arr.foo() === 42 && // typed array instances can be augmented
  128. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  129. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  130. } catch (e) {
  131. return false
  132. }
  133. }
  134. function kMaxLength () {
  135. return Buffer.TYPED_ARRAY_SUPPORT
  136. ? 0x7fffffff
  137. : 0x3fffffff
  138. }
  139. function createBuffer (that, length) {
  140. if (kMaxLength() < length) {
  141. throw new RangeError('Invalid typed array length')
  142. }
  143. if (Buffer.TYPED_ARRAY_SUPPORT) {
  144. // Return an augmented `Uint8Array` instance, for best performance
  145. that = new Uint8Array(length)
  146. that.__proto__ = Buffer.prototype
  147. } else {
  148. // Fallback: Return an object instance of the Buffer class
  149. if (that === null) {
  150. that = new Buffer(length)
  151. }
  152. that.length = length
  153. }
  154. return that
  155. }
  156. /**
  157. * The Buffer constructor returns instances of `Uint8Array` that have their
  158. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  159. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  160. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  161. * returns a single octet.
  162. *
  163. * The `Uint8Array` prototype remains unmodified.
  164. */
  165. function Buffer (arg, encodingOrOffset, length) {
  166. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  167. return new Buffer(arg, encodingOrOffset, length)
  168. }
  169. // Common case.
  170. if (typeof arg === 'number') {
  171. if (typeof encodingOrOffset === 'string') {
  172. throw new Error(
  173. 'If encoding is specified then the first argument must be a string'
  174. )
  175. }
  176. return allocUnsafe(this, arg)
  177. }
  178. return from(this, arg, encodingOrOffset, length)
  179. }
  180. Buffer.poolSize = 8192 // not used by this implementation
  181. // TODO: Legacy, not needed anymore. Remove in next major version.
  182. Buffer._augment = function (arr) {
  183. arr.__proto__ = Buffer.prototype
  184. return arr
  185. }
  186. function from (that, value, encodingOrOffset, length) {
  187. if (typeof value === 'number') {
  188. throw new TypeError('"value" argument must not be a number')
  189. }
  190. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  191. return fromArrayBuffer(that, value, encodingOrOffset, length)
  192. }
  193. if (typeof value === 'string') {
  194. return fromString(that, value, encodingOrOffset)
  195. }
  196. return fromObject(that, value)
  197. }
  198. /**
  199. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  200. * if value is a number.
  201. * Buffer.from(str[, encoding])
  202. * Buffer.from(array)
  203. * Buffer.from(buffer)
  204. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  205. **/
  206. Buffer.from = function (value, encodingOrOffset, length) {
  207. return from(null, value, encodingOrOffset, length)
  208. }
  209. if (Buffer.TYPED_ARRAY_SUPPORT) {
  210. Buffer.prototype.__proto__ = Uint8Array.prototype
  211. Buffer.__proto__ = Uint8Array
  212. if (typeof Symbol !== 'undefined' && Symbol.species &&
  213. Buffer[Symbol.species] === Buffer) {
  214. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  215. Object.defineProperty(Buffer, Symbol.species, {
  216. value: null,
  217. configurable: true
  218. })
  219. }
  220. }
  221. function assertSize (size) {
  222. if (typeof size !== 'number') {
  223. throw new TypeError('"size" argument must be a number')
  224. } else if (size < 0) {
  225. throw new RangeError('"size" argument must not be negative')
  226. }
  227. }
  228. function alloc (that, size, fill, encoding) {
  229. assertSize(size)
  230. if (size <= 0) {
  231. return createBuffer(that, size)
  232. }
  233. if (fill !== undefined) {
  234. // Only pay attention to encoding if it's a string. This
  235. // prevents accidentally sending in a number that would
  236. // be interpretted as a start offset.
  237. return typeof encoding === 'string'
  238. ? createBuffer(that, size).fill(fill, encoding)
  239. : createBuffer(that, size).fill(fill)
  240. }
  241. return createBuffer(that, size)
  242. }
  243. /**
  244. * Creates a new filled Buffer instance.
  245. * alloc(size[, fill[, encoding]])
  246. **/
  247. Buffer.alloc = function (size, fill, encoding) {
  248. return alloc(null, size, fill, encoding)
  249. }
  250. function allocUnsafe (that, size) {
  251. assertSize(size)
  252. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  253. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  254. for (var i = 0; i < size; ++i) {
  255. that[i] = 0
  256. }
  257. }
  258. return that
  259. }
  260. /**
  261. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  262. * */
  263. Buffer.allocUnsafe = function (size) {
  264. return allocUnsafe(null, size)
  265. }
  266. /**
  267. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  268. */
  269. Buffer.allocUnsafeSlow = function (size) {
  270. return allocUnsafe(null, size)
  271. }
  272. function fromString (that, string, encoding) {
  273. if (typeof encoding !== 'string' || encoding === '') {
  274. encoding = 'utf8'
  275. }
  276. if (!Buffer.isEncoding(encoding)) {
  277. throw new TypeError('"encoding" must be a valid string encoding')
  278. }
  279. var length = byteLength(string, encoding) | 0
  280. that = createBuffer(that, length)
  281. var actual = that.write(string, encoding)
  282. if (actual !== length) {
  283. // Writing a hex string, for example, that contains invalid characters will
  284. // cause everything after the first invalid character to be ignored. (e.g.
  285. // 'abxxcd' will be treated as 'ab')
  286. that = that.slice(0, actual)
  287. }
  288. return that
  289. }
  290. function fromArrayLike (that, array) {
  291. var length = array.length < 0 ? 0 : checked(array.length) | 0
  292. that = createBuffer(that, length)
  293. for (var i = 0; i < length; i += 1) {
  294. that[i] = array[i] & 255
  295. }
  296. return that
  297. }
  298. function fromArrayBuffer (that, array, byteOffset, length) {
  299. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  300. if (byteOffset < 0 || array.byteLength < byteOffset) {
  301. throw new RangeError('\'offset\' is out of bounds')
  302. }
  303. if (array.byteLength < byteOffset + (length || 0)) {
  304. throw new RangeError('\'length\' is out of bounds')
  305. }
  306. if (byteOffset === undefined && length === undefined) {
  307. array = new Uint8Array(array)
  308. } else if (length === undefined) {
  309. array = new Uint8Array(array, byteOffset)
  310. } else {
  311. array = new Uint8Array(array, byteOffset, length)
  312. }
  313. if (Buffer.TYPED_ARRAY_SUPPORT) {
  314. // Return an augmented `Uint8Array` instance, for best performance
  315. that = array
  316. that.__proto__ = Buffer.prototype
  317. } else {
  318. // Fallback: Return an object instance of the Buffer class
  319. that = fromArrayLike(that, array)
  320. }
  321. return that
  322. }
  323. function fromObject (that, obj) {
  324. if (Buffer.isBuffer(obj)) {
  325. var len = checked(obj.length) | 0
  326. that = createBuffer(that, len)
  327. if (that.length === 0) {
  328. return that
  329. }
  330. obj.copy(that, 0, 0, len)
  331. return that
  332. }
  333. if (obj) {
  334. if ((typeof ArrayBuffer !== 'undefined' &&
  335. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  336. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  337. return createBuffer(that, 0)
  338. }
  339. return fromArrayLike(that, obj)
  340. }
  341. if (obj.type === 'Buffer' && isArray(obj.data)) {
  342. return fromArrayLike(that, obj.data)
  343. }
  344. }
  345. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  346. }
  347. function checked (length) {
  348. // Note: cannot use `length < kMaxLength()` here because that fails when
  349. // length is NaN (which is otherwise coerced to zero.)
  350. if (length >= kMaxLength()) {
  351. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  352. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  353. }
  354. return length | 0
  355. }
  356. function SlowBuffer (length) {
  357. if (+length != length) { // eslint-disable-line eqeqeq
  358. length = 0
  359. }
  360. return Buffer.alloc(+length)
  361. }
  362. Buffer.isBuffer = function isBuffer (b) {
  363. return !!(b != null && b._isBuffer)
  364. }
  365. Buffer.compare = function compare (a, b) {
  366. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  367. throw new TypeError('Arguments must be Buffers')
  368. }
  369. if (a === b) return 0
  370. var x = a.length
  371. var y = b.length
  372. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  373. if (a[i] !== b[i]) {
  374. x = a[i]
  375. y = b[i]
  376. break
  377. }
  378. }
  379. if (x < y) return -1
  380. if (y < x) return 1
  381. return 0
  382. }
  383. Buffer.isEncoding = function isEncoding (encoding) {
  384. switch (String(encoding).toLowerCase()) {
  385. case 'hex':
  386. case 'utf8':
  387. case 'utf-8':
  388. case 'ascii':
  389. case 'latin1':
  390. case 'binary':
  391. case 'base64':
  392. case 'ucs2':
  393. case 'ucs-2':
  394. case 'utf16le':
  395. case 'utf-16le':
  396. return true
  397. default:
  398. return false
  399. }
  400. }
  401. Buffer.concat = function concat (list, length) {
  402. if (!isArray(list)) {
  403. throw new TypeError('"list" argument must be an Array of Buffers')
  404. }
  405. if (list.length === 0) {
  406. return Buffer.alloc(0)
  407. }
  408. var i
  409. if (length === undefined) {
  410. length = 0
  411. for (i = 0; i < list.length; ++i) {
  412. length += list[i].length
  413. }
  414. }
  415. var buffer = Buffer.allocUnsafe(length)
  416. var pos = 0
  417. for (i = 0; i < list.length; ++i) {
  418. var buf = list[i]
  419. if (!Buffer.isBuffer(buf)) {
  420. throw new TypeError('"list" argument must be an Array of Buffers')
  421. }
  422. buf.copy(buffer, pos)
  423. pos += buf.length
  424. }
  425. return buffer
  426. }
  427. function byteLength (string, encoding) {
  428. if (Buffer.isBuffer(string)) {
  429. return string.length
  430. }
  431. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  432. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  433. return string.byteLength
  434. }
  435. if (typeof string !== 'string') {
  436. string = '' + string
  437. }
  438. var len = string.length
  439. if (len === 0) return 0
  440. // Use a for loop to avoid recursion
  441. var loweredCase = false
  442. for (;;) {
  443. switch (encoding) {
  444. case 'ascii':
  445. case 'latin1':
  446. case 'binary':
  447. return len
  448. case 'utf8':
  449. case 'utf-8':
  450. case undefined:
  451. return utf8ToBytes(string).length
  452. case 'ucs2':
  453. case 'ucs-2':
  454. case 'utf16le':
  455. case 'utf-16le':
  456. return len * 2
  457. case 'hex':
  458. return len >>> 1
  459. case 'base64':
  460. return base64ToBytes(string).length
  461. default:
  462. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  463. encoding = ('' + encoding).toLowerCase()
  464. loweredCase = true
  465. }
  466. }
  467. }
  468. Buffer.byteLength = byteLength
  469. function slowToString (encoding, start, end) {
  470. var loweredCase = false
  471. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  472. // property of a typed array.
  473. // This behaves neither like String nor Uint8Array in that we set start/end
  474. // to their upper/lower bounds if the value passed is out of range.
  475. // undefined is handled specially as per ECMA-262 6th Edition,
  476. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  477. if (start === undefined || start < 0) {
  478. start = 0
  479. }
  480. // Return early if start > this.length. Done here to prevent potential uint32
  481. // coercion fail below.
  482. if (start > this.length) {
  483. return ''
  484. }
  485. if (end === undefined || end > this.length) {
  486. end = this.length
  487. }
  488. if (end <= 0) {
  489. return ''
  490. }
  491. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  492. end >>>= 0
  493. start >>>= 0
  494. if (end <= start) {
  495. return ''
  496. }
  497. if (!encoding) encoding = 'utf8'
  498. while (true) {
  499. switch (encoding) {
  500. case 'hex':
  501. return hexSlice(this, start, end)
  502. case 'utf8':
  503. case 'utf-8':
  504. return utf8Slice(this, start, end)
  505. case 'ascii':
  506. return asciiSlice(this, start, end)
  507. case 'latin1':
  508. case 'binary':
  509. return latin1Slice(this, start, end)
  510. case 'base64':
  511. return base64Slice(this, start, end)
  512. case 'ucs2':
  513. case 'ucs-2':
  514. case 'utf16le':
  515. case 'utf-16le':
  516. return utf16leSlice(this, start, end)
  517. default:
  518. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  519. encoding = (encoding + '').toLowerCase()
  520. loweredCase = true
  521. }
  522. }
  523. }
  524. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  525. // Buffer instances.
  526. Buffer.prototype._isBuffer = true
  527. function swap (b, n, m) {
  528. var i = b[n]
  529. b[n] = b[m]
  530. b[m] = i
  531. }
  532. Buffer.prototype.swap16 = function swap16 () {
  533. var len = this.length
  534. if (len % 2 !== 0) {
  535. throw new RangeError('Buffer size must be a multiple of 16-bits')
  536. }
  537. for (var i = 0; i < len; i += 2) {
  538. swap(this, i, i + 1)
  539. }
  540. return this
  541. }
  542. Buffer.prototype.swap32 = function swap32 () {
  543. var len = this.length
  544. if (len % 4 !== 0) {
  545. throw new RangeError('Buffer size must be a multiple of 32-bits')
  546. }
  547. for (var i = 0; i < len; i += 4) {
  548. swap(this, i, i + 3)
  549. swap(this, i + 1, i + 2)
  550. }
  551. return this
  552. }
  553. Buffer.prototype.swap64 = function swap64 () {
  554. var len = this.length
  555. if (len % 8 !== 0) {
  556. throw new RangeError('Buffer size must be a multiple of 64-bits')
  557. }
  558. for (var i = 0; i < len; i += 8) {
  559. swap(this, i, i + 7)
  560. swap(this, i + 1, i + 6)
  561. swap(this, i + 2, i + 5)
  562. swap(this, i + 3, i + 4)
  563. }
  564. return this
  565. }
  566. Buffer.prototype.toString = function toString () {
  567. var length = this.length | 0
  568. if (length === 0) return ''
  569. if (arguments.length === 0) return utf8Slice(this, 0, length)
  570. return slowToString.apply(this, arguments)
  571. }
  572. Buffer.prototype.equals = function equals (b) {
  573. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  574. if (this === b) return true
  575. return Buffer.compare(this, b) === 0
  576. }
  577. Buffer.prototype.inspect = function inspect () {
  578. var str = ''
  579. var max = exports.INSPECT_MAX_BYTES
  580. if (this.length > 0) {
  581. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  582. if (this.length > max) str += ' ... '
  583. }
  584. return '<Buffer ' + str + '>'
  585. }
  586. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  587. if (!Buffer.isBuffer(target)) {
  588. throw new TypeError('Argument must be a Buffer')
  589. }
  590. if (start === undefined) {
  591. start = 0
  592. }
  593. if (end === undefined) {
  594. end = target ? target.length : 0
  595. }
  596. if (thisStart === undefined) {
  597. thisStart = 0
  598. }
  599. if (thisEnd === undefined) {
  600. thisEnd = this.length
  601. }
  602. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  603. throw new RangeError('out of range index')
  604. }
  605. if (thisStart >= thisEnd && start >= end) {
  606. return 0
  607. }
  608. if (thisStart >= thisEnd) {
  609. return -1
  610. }
  611. if (start >= end) {
  612. return 1
  613. }
  614. start >>>= 0
  615. end >>>= 0
  616. thisStart >>>= 0
  617. thisEnd >>>= 0
  618. if (this === target) return 0
  619. var x = thisEnd - thisStart
  620. var y = end - start
  621. var len = Math.min(x, y)
  622. var thisCopy = this.slice(thisStart, thisEnd)
  623. var targetCopy = target.slice(start, end)
  624. for (var i = 0; i < len; ++i) {
  625. if (thisCopy[i] !== targetCopy[i]) {
  626. x = thisCopy[i]
  627. y = targetCopy[i]
  628. break
  629. }
  630. }
  631. if (x < y) return -1
  632. if (y < x) return 1
  633. return 0
  634. }
  635. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  636. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  637. //
  638. // Arguments:
  639. // - buffer - a Buffer to search
  640. // - val - a string, Buffer, or number
  641. // - byteOffset - an index into `buffer`; will be clamped to an int32
  642. // - encoding - an optional encoding, relevant is val is a string
  643. // - dir - true for indexOf, false for lastIndexOf
  644. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  645. // Empty buffer means no match
  646. if (buffer.length === 0) return -1
  647. // Normalize byteOffset
  648. if (typeof byteOffset === 'string') {
  649. encoding = byteOffset
  650. byteOffset = 0
  651. } else if (byteOffset > 0x7fffffff) {
  652. byteOffset = 0x7fffffff
  653. } else if (byteOffset < -0x80000000) {
  654. byteOffset = -0x80000000
  655. }
  656. byteOffset = +byteOffset // Coerce to Number.
  657. if (isNaN(byteOffset)) {
  658. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  659. byteOffset = dir ? 0 : (buffer.length - 1)
  660. }
  661. // Normalize byteOffset: negative offsets start from the end of the buffer
  662. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  663. if (byteOffset >= buffer.length) {
  664. if (dir) return -1
  665. else byteOffset = buffer.length - 1
  666. } else if (byteOffset < 0) {
  667. if (dir) byteOffset = 0
  668. else return -1
  669. }
  670. // Normalize val
  671. if (typeof val === 'string') {
  672. val = Buffer.from(val, encoding)
  673. }
  674. // Finally, search either indexOf (if dir is true) or lastIndexOf
  675. if (Buffer.isBuffer(val)) {
  676. // Special case: looking for empty string/buffer always fails
  677. if (val.length === 0) {
  678. return -1
  679. }
  680. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  681. } else if (typeof val === 'number') {
  682. val = val & 0xFF // Search for a byte value [0-255]
  683. if (Buffer.TYPED_ARRAY_SUPPORT &&
  684. typeof Uint8Array.prototype.indexOf === 'function') {
  685. if (dir) {
  686. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  687. } else {
  688. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  689. }
  690. }
  691. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  692. }
  693. throw new TypeError('val must be string, number or Buffer')
  694. }
  695. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  696. var indexSize = 1
  697. var arrLength = arr.length
  698. var valLength = val.length
  699. if (encoding !== undefined) {
  700. encoding = String(encoding).toLowerCase()
  701. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  702. encoding === 'utf16le' || encoding === 'utf-16le') {
  703. if (arr.length < 2 || val.length < 2) {
  704. return -1
  705. }
  706. indexSize = 2
  707. arrLength /= 2
  708. valLength /= 2
  709. byteOffset /= 2
  710. }
  711. }
  712. function read (buf, i) {
  713. if (indexSize === 1) {
  714. return buf[i]
  715. } else {
  716. return buf.readUInt16BE(i * indexSize)
  717. }
  718. }
  719. var i
  720. if (dir) {
  721. var foundIndex = -1
  722. for (i = byteOffset; i < arrLength; i++) {
  723. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  724. if (foundIndex === -1) foundIndex = i
  725. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  726. } else {
  727. if (foundIndex !== -1) i -= i - foundIndex
  728. foundIndex = -1
  729. }
  730. }
  731. } else {
  732. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  733. for (i = byteOffset; i >= 0; i--) {
  734. var found = true
  735. for (var j = 0; j < valLength; j++) {
  736. if (read(arr, i + j) !== read(val, j)) {
  737. found = false
  738. break
  739. }
  740. }
  741. if (found) return i
  742. }
  743. }
  744. return -1
  745. }
  746. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  747. return this.indexOf(val, byteOffset, encoding) !== -1
  748. }
  749. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  750. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  751. }
  752. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  753. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  754. }
  755. function hexWrite (buf, string, offset, length) {
  756. offset = Number(offset) || 0
  757. var remaining = buf.length - offset
  758. if (!length) {
  759. length = remaining
  760. } else {
  761. length = Number(length)
  762. if (length > remaining) {
  763. length = remaining
  764. }
  765. }
  766. // must be an even number of digits
  767. var strLen = string.length
  768. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  769. if (length > strLen / 2) {
  770. length = strLen / 2
  771. }
  772. for (var i = 0; i < length; ++i) {
  773. var parsed = parseInt(string.substr(i * 2, 2), 16)
  774. if (isNaN(parsed)) return i
  775. buf[offset + i] = parsed
  776. }
  777. return i
  778. }
  779. function utf8Write (buf, string, offset, length) {
  780. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  781. }
  782. function asciiWrite (buf, string, offset, length) {
  783. return blitBuffer(asciiToBytes(string), buf, offset, length)
  784. }
  785. function latin1Write (buf, string, offset, length) {
  786. return asciiWrite(buf, string, offset, length)
  787. }
  788. function base64Write (buf, string, offset, length) {
  789. return blitBuffer(base64ToBytes(string), buf, offset, length)
  790. }
  791. function ucs2Write (buf, string, offset, length) {
  792. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  793. }
  794. Buffer.prototype.write = function write (string, offset, length, encoding) {
  795. // Buffer#write(string)
  796. if (offset === undefined) {
  797. encoding = 'utf8'
  798. length = this.length
  799. offset = 0
  800. // Buffer#write(string, encoding)
  801. } else if (length === undefined && typeof offset === 'string') {
  802. encoding = offset
  803. length = this.length
  804. offset = 0
  805. // Buffer#write(string, offset[, length][, encoding])
  806. } else if (isFinite(offset)) {
  807. offset = offset | 0
  808. if (isFinite(length)) {
  809. length = length | 0
  810. if (encoding === undefined) encoding = 'utf8'
  811. } else {
  812. encoding = length
  813. length = undefined
  814. }
  815. // legacy write(string, encoding, offset, length) - remove in v0.13
  816. } else {
  817. throw new Error(
  818. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  819. )
  820. }
  821. var remaining = this.length - offset
  822. if (length === undefined || length > remaining) length = remaining
  823. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  824. throw new RangeError('Attempt to write outside buffer bounds')
  825. }
  826. if (!encoding) encoding = 'utf8'
  827. var loweredCase = false
  828. for (;;) {
  829. switch (encoding) {
  830. case 'hex':
  831. return hexWrite(this, string, offset, length)
  832. case 'utf8':
  833. case 'utf-8':
  834. return utf8Write(this, string, offset, length)
  835. case 'ascii':
  836. return asciiWrite(this, string, offset, length)
  837. case 'latin1':
  838. case 'binary':
  839. return latin1Write(this, string, offset, length)
  840. case 'base64':
  841. // Warning: maxLength not taken into account in base64Write
  842. return base64Write(this, string, offset, length)
  843. case 'ucs2':
  844. case 'ucs-2':
  845. case 'utf16le':
  846. case 'utf-16le':
  847. return ucs2Write(this, string, offset, length)
  848. default:
  849. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  850. encoding = ('' + encoding).toLowerCase()
  851. loweredCase = true
  852. }
  853. }
  854. }
  855. Buffer.prototype.toJSON = function toJSON () {
  856. return {
  857. type: 'Buffer',
  858. data: Array.prototype.slice.call(this._arr || this, 0)
  859. }
  860. }
  861. function base64Slice (buf, start, end) {
  862. if (start === 0 && end === buf.length) {
  863. return base64.fromByteArray(buf)
  864. } else {
  865. return base64.fromByteArray(buf.slice(start, end))
  866. }
  867. }
  868. function utf8Slice (buf, start, end) {
  869. end = Math.min(buf.length, end)
  870. var res = []
  871. var i = start
  872. while (i < end) {
  873. var firstByte = buf[i]
  874. var codePoint = null
  875. var bytesPerSequence = (firstByte > 0xEF) ? 4
  876. : (firstByte > 0xDF) ? 3
  877. : (firstByte > 0xBF) ? 2
  878. : 1
  879. if (i + bytesPerSequence <= end) {
  880. var secondByte, thirdByte, fourthByte, tempCodePoint
  881. switch (bytesPerSequence) {
  882. case 1:
  883. if (firstByte < 0x80) {
  884. codePoint = firstByte
  885. }
  886. break
  887. case 2:
  888. secondByte = buf[i + 1]
  889. if ((secondByte & 0xC0) === 0x80) {
  890. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  891. if (tempCodePoint > 0x7F) {
  892. codePoint = tempCodePoint
  893. }
  894. }
  895. break
  896. case 3:
  897. secondByte = buf[i + 1]
  898. thirdByte = buf[i + 2]
  899. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  900. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  901. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  902. codePoint = tempCodePoint
  903. }
  904. }
  905. break
  906. case 4:
  907. secondByte = buf[i + 1]
  908. thirdByte = buf[i + 2]
  909. fourthByte = buf[i + 3]
  910. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  911. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  912. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  913. codePoint = tempCodePoint
  914. }
  915. }
  916. }
  917. }
  918. if (codePoint === null) {
  919. // we did not generate a valid codePoint so insert a
  920. // replacement char (U+FFFD) and advance only 1 byte
  921. codePoint = 0xFFFD
  922. bytesPerSequence = 1
  923. } else if (codePoint > 0xFFFF) {
  924. // encode to utf16 (surrogate pair dance)
  925. codePoint -= 0x10000
  926. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  927. codePoint = 0xDC00 | codePoint & 0x3FF
  928. }
  929. res.push(codePoint)
  930. i += bytesPerSequence
  931. }
  932. return decodeCodePointsArray(res)
  933. }
  934. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  935. // the lowest limit is Chrome, with 0x10000 args.
  936. // We go 1 magnitude less, for safety
  937. var MAX_ARGUMENTS_LENGTH = 0x1000
  938. function decodeCodePointsArray (codePoints) {
  939. var len = codePoints.length
  940. if (len <= MAX_ARGUMENTS_LENGTH) {
  941. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  942. }
  943. // Decode in chunks to avoid "call stack size exceeded".
  944. var res = ''
  945. var i = 0
  946. while (i < len) {
  947. res += String.fromCharCode.apply(
  948. String,
  949. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  950. )
  951. }
  952. return res
  953. }
  954. function asciiSlice (buf, start, end) {
  955. var ret = ''
  956. end = Math.min(buf.length, end)
  957. for (var i = start; i < end; ++i) {
  958. ret += String.fromCharCode(buf[i] & 0x7F)
  959. }
  960. return ret
  961. }
  962. function latin1Slice (buf, start, end) {
  963. var ret = ''
  964. end = Math.min(buf.length, end)
  965. for (var i = start; i < end; ++i) {
  966. ret += String.fromCharCode(buf[i])
  967. }
  968. return ret
  969. }
  970. function hexSlice (buf, start, end) {
  971. var len = buf.length
  972. if (!start || start < 0) start = 0
  973. if (!end || end < 0 || end > len) end = len
  974. var out = ''
  975. for (var i = start; i < end; ++i) {
  976. out += toHex(buf[i])
  977. }
  978. return out
  979. }
  980. function utf16leSlice (buf, start, end) {
  981. var bytes = buf.slice(start, end)
  982. var res = ''
  983. for (var i = 0; i < bytes.length; i += 2) {
  984. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  985. }
  986. return res
  987. }
  988. Buffer.prototype.slice = function slice (start, end) {
  989. var len = this.length
  990. start = ~~start
  991. end = end === undefined ? len : ~~end
  992. if (start < 0) {
  993. start += len
  994. if (start < 0) start = 0
  995. } else if (start > len) {
  996. start = len
  997. }
  998. if (end < 0) {
  999. end += len
  1000. if (end < 0) end = 0
  1001. } else if (end > len) {
  1002. end = len
  1003. }
  1004. if (end < start) end = start
  1005. var newBuf
  1006. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1007. newBuf = this.subarray(start, end)
  1008. newBuf.__proto__ = Buffer.prototype
  1009. } else {
  1010. var sliceLen = end - start
  1011. newBuf = new Buffer(sliceLen, undefined)
  1012. for (var i = 0; i < sliceLen; ++i) {
  1013. newBuf[i] = this[i + start]
  1014. }
  1015. }
  1016. return newBuf
  1017. }
  1018. /*
  1019. * Need to make sure that buffer isn't trying to write out of bounds.
  1020. */
  1021. function checkOffset (offset, ext, length) {
  1022. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  1023. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  1024. }
  1025. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  1026. offset = offset | 0
  1027. byteLength = byteLength | 0
  1028. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1029. var val = this[offset]
  1030. var mul = 1
  1031. var i = 0
  1032. while (++i < byteLength && (mul *= 0x100)) {
  1033. val += this[offset + i] * mul
  1034. }
  1035. return val
  1036. }
  1037. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  1038. offset = offset | 0
  1039. byteLength = byteLength | 0
  1040. if (!noAssert) {
  1041. checkOffset(offset, byteLength, this.length)
  1042. }
  1043. var val = this[offset + --byteLength]
  1044. var mul = 1
  1045. while (byteLength > 0 && (mul *= 0x100)) {
  1046. val += this[offset + --byteLength] * mul
  1047. }
  1048. return val
  1049. }
  1050. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  1051. if (!noAssert) checkOffset(offset, 1, this.length)
  1052. return this[offset]
  1053. }
  1054. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  1055. if (!noAssert) checkOffset(offset, 2, this.length)
  1056. return this[offset] | (this[offset + 1] << 8)
  1057. }
  1058. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  1059. if (!noAssert) checkOffset(offset, 2, this.length)
  1060. return (this[offset] << 8) | this[offset + 1]
  1061. }
  1062. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  1063. if (!noAssert) checkOffset(offset, 4, this.length)
  1064. return ((this[offset]) |
  1065. (this[offset + 1] << 8) |
  1066. (this[offset + 2] << 16)) +
  1067. (this[offset + 3] * 0x1000000)
  1068. }
  1069. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  1070. if (!noAssert) checkOffset(offset, 4, this.length)
  1071. return (this[offset] * 0x1000000) +
  1072. ((this[offset + 1] << 16) |
  1073. (this[offset + 2] << 8) |
  1074. this[offset + 3])
  1075. }
  1076. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  1077. offset = offset | 0
  1078. byteLength = byteLength | 0
  1079. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1080. var val = this[offset]
  1081. var mul = 1
  1082. var i = 0
  1083. while (++i < byteLength && (mul *= 0x100)) {
  1084. val += this[offset + i] * mul
  1085. }
  1086. mul *= 0x80
  1087. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1088. return val
  1089. }
  1090. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  1091. offset = offset | 0
  1092. byteLength = byteLength | 0
  1093. if (!noAssert) checkOffset(offset, byteLength, this.length)
  1094. var i = byteLength
  1095. var mul = 1
  1096. var val = this[offset + --i]
  1097. while (i > 0 && (mul *= 0x100)) {
  1098. val += this[offset + --i] * mul
  1099. }
  1100. mul *= 0x80
  1101. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  1102. return val
  1103. }
  1104. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  1105. if (!noAssert) checkOffset(offset, 1, this.length)
  1106. if (!(this[offset] & 0x80)) return (this[offset])
  1107. return ((0xff - this[offset] + 1) * -1)
  1108. }
  1109. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  1110. if (!noAssert) checkOffset(offset, 2, this.length)
  1111. var val = this[offset] | (this[offset + 1] << 8)
  1112. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1113. }
  1114. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  1115. if (!noAssert) checkOffset(offset, 2, this.length)
  1116. var val = this[offset + 1] | (this[offset] << 8)
  1117. return (val & 0x8000) ? val | 0xFFFF0000 : val
  1118. }
  1119. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  1120. if (!noAssert) checkOffset(offset, 4, this.length)
  1121. return (this[offset]) |
  1122. (this[offset + 1] << 8) |
  1123. (this[offset + 2] << 16) |
  1124. (this[offset + 3] << 24)
  1125. }
  1126. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  1127. if (!noAssert) checkOffset(offset, 4, this.length)
  1128. return (this[offset] << 24) |
  1129. (this[offset + 1] << 16) |
  1130. (this[offset + 2] << 8) |
  1131. (this[offset + 3])
  1132. }
  1133. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  1134. if (!noAssert) checkOffset(offset, 4, this.length)
  1135. return ieee754.read(this, offset, true, 23, 4)
  1136. }
  1137. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  1138. if (!noAssert) checkOffset(offset, 4, this.length)
  1139. return ieee754.read(this, offset, false, 23, 4)
  1140. }
  1141. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  1142. if (!noAssert) checkOffset(offset, 8, this.length)
  1143. return ieee754.read(this, offset, true, 52, 8)
  1144. }
  1145. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  1146. if (!noAssert) checkOffset(offset, 8, this.length)
  1147. return ieee754.read(this, offset, false, 52, 8)
  1148. }
  1149. function checkInt (buf, value, offset, ext, max, min) {
  1150. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  1151. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  1152. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1153. }
  1154. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  1155. value = +value
  1156. offset = offset | 0
  1157. byteLength = byteLength | 0
  1158. if (!noAssert) {
  1159. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1160. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1161. }
  1162. var mul = 1
  1163. var i = 0
  1164. this[offset] = value & 0xFF
  1165. while (++i < byteLength && (mul *= 0x100)) {
  1166. this[offset + i] = (value / mul) & 0xFF
  1167. }
  1168. return offset + byteLength
  1169. }
  1170. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  1171. value = +value
  1172. offset = offset | 0
  1173. byteLength = byteLength | 0
  1174. if (!noAssert) {
  1175. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  1176. checkInt(this, value, offset, byteLength, maxBytes, 0)
  1177. }
  1178. var i = byteLength - 1
  1179. var mul = 1
  1180. this[offset + i] = value & 0xFF
  1181. while (--i >= 0 && (mul *= 0x100)) {
  1182. this[offset + i] = (value / mul) & 0xFF
  1183. }
  1184. return offset + byteLength
  1185. }
  1186. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  1187. value = +value
  1188. offset = offset | 0
  1189. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  1190. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  1191. this[offset] = (value & 0xff)
  1192. return offset + 1
  1193. }
  1194. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  1195. if (value < 0) value = 0xffff + value + 1
  1196. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  1197. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  1198. (littleEndian ? i : 1 - i) * 8
  1199. }
  1200. }
  1201. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  1202. value = +value
  1203. offset = offset | 0
  1204. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  1205. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1206. this[offset] = (value & 0xff)
  1207. this[offset + 1] = (value >>> 8)
  1208. } else {
  1209. objectWriteUInt16(this, value, offset, true)
  1210. }
  1211. return offset + 2
  1212. }
  1213. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  1214. value = +value
  1215. offset = offset | 0
  1216. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  1217. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1218. this[offset] = (value >>> 8)
  1219. this[offset + 1] = (value & 0xff)
  1220. } else {
  1221. objectWriteUInt16(this, value, offset, false)
  1222. }
  1223. return offset + 2
  1224. }
  1225. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  1226. if (value < 0) value = 0xffffffff + value + 1
  1227. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  1228. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  1229. }
  1230. }
  1231. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  1232. value = +value
  1233. offset = offset | 0
  1234. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  1235. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1236. this[offset + 3] = (value >>> 24)
  1237. this[offset + 2] = (value >>> 16)
  1238. this[offset + 1] = (value >>> 8)
  1239. this[offset] = (value & 0xff)
  1240. } else {
  1241. objectWriteUInt32(this, value, offset, true)
  1242. }
  1243. return offset + 4
  1244. }
  1245. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  1246. value = +value
  1247. offset = offset | 0
  1248. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  1249. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1250. this[offset] = (value >>> 24)
  1251. this[offset + 1] = (value >>> 16)
  1252. this[offset + 2] = (value >>> 8)
  1253. this[offset + 3] = (value & 0xff)
  1254. } else {
  1255. objectWriteUInt32(this, value, offset, false)
  1256. }
  1257. return offset + 4
  1258. }
  1259. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  1260. value = +value
  1261. offset = offset | 0
  1262. if (!noAssert) {
  1263. var limit = Math.pow(2, 8 * byteLength - 1)
  1264. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  1265. }
  1266. var i = 0
  1267. var mul = 1
  1268. var sub = 0
  1269. this[offset] = value & 0xFF
  1270. while (++i < byteLength && (mul *= 0x100)) {
  1271. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  1272. sub = 1
  1273. }
  1274. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  1275. }
  1276. return offset + byteLength
  1277. }
  1278. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  1279. value = +value
  1280. offset = offset | 0
  1281. if (!noAssert) {
  1282. var limit = Math.pow(2, 8 * byteLength - 1)
  1283. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  1284. }
  1285. var i = byteLength - 1
  1286. var mul = 1
  1287. var sub = 0
  1288. this[offset + i] = value & 0xFF
  1289. while (--i >= 0 && (mul *= 0x100)) {
  1290. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  1291. sub = 1
  1292. }
  1293. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  1294. }
  1295. return offset + byteLength
  1296. }
  1297. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  1298. value = +value
  1299. offset = offset | 0
  1300. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  1301. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  1302. if (value < 0) value = 0xff + value + 1
  1303. this[offset] = (value & 0xff)
  1304. return offset + 1
  1305. }
  1306. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  1307. value = +value
  1308. offset = offset | 0
  1309. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  1310. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1311. this[offset] = (value & 0xff)
  1312. this[offset + 1] = (value >>> 8)
  1313. } else {
  1314. objectWriteUInt16(this, value, offset, true)
  1315. }
  1316. return offset + 2
  1317. }
  1318. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  1319. value = +value
  1320. offset = offset | 0
  1321. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  1322. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1323. this[offset] = (value >>> 8)
  1324. this[offset + 1] = (value & 0xff)
  1325. } else {
  1326. objectWriteUInt16(this, value, offset, false)
  1327. }
  1328. return offset + 2
  1329. }
  1330. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  1331. value = +value
  1332. offset = offset | 0
  1333. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  1334. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1335. this[offset] = (value & 0xff)
  1336. this[offset + 1] = (value >>> 8)
  1337. this[offset + 2] = (value >>> 16)
  1338. this[offset + 3] = (value >>> 24)
  1339. } else {
  1340. objectWriteUInt32(this, value, offset, true)
  1341. }
  1342. return offset + 4
  1343. }
  1344. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  1345. value = +value
  1346. offset = offset | 0
  1347. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  1348. if (value < 0) value = 0xffffffff + value + 1
  1349. if (Buffer.TYPED_ARRAY_SUPPORT) {
  1350. this[offset] = (value >>> 24)
  1351. this[offset + 1] = (value >>> 16)
  1352. this[offset + 2] = (value >>> 8)
  1353. this[offset + 3] = (value & 0xff)
  1354. } else {
  1355. objectWriteUInt32(this, value, offset, false)
  1356. }
  1357. return offset + 4
  1358. }
  1359. function checkIEEE754 (buf, value, offset, ext, max, min) {
  1360. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  1361. if (offset < 0) throw new RangeError('Index out of range')
  1362. }
  1363. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  1364. if (!noAssert) {
  1365. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  1366. }
  1367. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  1368. return offset + 4
  1369. }
  1370. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  1371. return writeFloat(this, value, offset, true, noAssert)
  1372. }
  1373. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  1374. return writeFloat(this, value, offset, false, noAssert)
  1375. }
  1376. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  1377. if (!noAssert) {
  1378. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  1379. }
  1380. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  1381. return offset + 8
  1382. }
  1383. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  1384. return writeDouble(this, value, offset, true, noAssert)
  1385. }
  1386. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  1387. return writeDouble(this, value, offset, false, noAssert)
  1388. }
  1389. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  1390. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  1391. if (!start) start = 0
  1392. if (!end && end !== 0) end = this.length
  1393. if (targetStart >= target.length) targetStart = target.length
  1394. if (!targetStart) targetStart = 0
  1395. if (end > 0 && end < start) end = start
  1396. // Copy 0 bytes; we're done
  1397. if (end === start) return 0
  1398. if (target.length === 0 || this.length === 0) return 0
  1399. // Fatal error conditions
  1400. if (targetStart < 0) {
  1401. throw new RangeError('targetStart out of bounds')
  1402. }
  1403. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  1404. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  1405. // Are we oob?
  1406. if (end > this.length) end = this.length
  1407. if (target.length - targetStart < end - start) {
  1408. end = target.length - targetStart + start
  1409. }
  1410. var len = end - start
  1411. var i
  1412. if (this === target && start < targetStart && targetStart < end) {
  1413. // descending copy from end
  1414. for (i = len - 1; i >= 0; --i) {
  1415. target[i + targetStart] = this[i + start]
  1416. }
  1417. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  1418. // ascending copy from start
  1419. for (i = 0; i < len; ++i) {
  1420. target[i + targetStart] = this[i + start]
  1421. }
  1422. } else {
  1423. Uint8Array.prototype.set.call(
  1424. target,
  1425. this.subarray(start, start + len),
  1426. targetStart
  1427. )
  1428. }
  1429. return len
  1430. }
  1431. // Usage:
  1432. // buffer.fill(number[, offset[, end]])
  1433. // buffer.fill(buffer[, offset[, end]])
  1434. // buffer.fill(string[, offset[, end]][, encoding])
  1435. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  1436. // Handle string cases:
  1437. if (typeof val === 'string') {
  1438. if (typeof start === 'string') {
  1439. encoding = start
  1440. start = 0
  1441. end = this.length
  1442. } else if (typeof end === 'string') {
  1443. encoding = end
  1444. end = this.length
  1445. }
  1446. if (val.length === 1) {
  1447. var code = val.charCodeAt(0)
  1448. if (code < 256) {
  1449. val = code
  1450. }
  1451. }
  1452. if (encoding !== undefined && typeof encoding !== 'string') {
  1453. throw new TypeError('encoding must be a string')
  1454. }
  1455. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  1456. throw new TypeError('Unknown encoding: ' + encoding)
  1457. }
  1458. } else if (typeof val === 'number') {
  1459. val = val & 255
  1460. }
  1461. // Invalid ranges are not set to a default, so can range check early.
  1462. if (start < 0 || this.length < start || this.length < end) {
  1463. throw new RangeError('Out of range index')
  1464. }
  1465. if (end <= start) {
  1466. return this
  1467. }
  1468. start = start >>> 0
  1469. end = end === undefined ? this.length : end >>> 0
  1470. if (!val) val = 0
  1471. var i
  1472. if (typeof val === 'number') {
  1473. for (i = start; i < end; ++i) {
  1474. this[i] = val
  1475. }
  1476. } else {
  1477. var bytes = Buffer.isBuffer(val)
  1478. ? val
  1479. : utf8ToBytes(new Buffer(val, encoding).toString())
  1480. var len = bytes.length
  1481. for (i = 0; i < end - start; ++i) {
  1482. this[i + start] = bytes[i % len]
  1483. }
  1484. }
  1485. return this
  1486. }
  1487. // HELPER FUNCTIONS
  1488. // ================
  1489. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  1490. function base64clean (str) {
  1491. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  1492. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  1493. // Node converts strings with length < 2 to ''
  1494. if (str.length < 2) return ''
  1495. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  1496. while (str.length % 4 !== 0) {
  1497. str = str + '='
  1498. }
  1499. return str
  1500. }
  1501. function stringtrim (str) {
  1502. if (str.trim) return str.trim()
  1503. return str.replace(/^\s+|\s+$/g, '')
  1504. }
  1505. function toHex (n) {
  1506. if (n < 16) return '0' + n.toString(16)
  1507. return n.toString(16)
  1508. }
  1509. function utf8ToBytes (string, units) {
  1510. units = units || Infinity
  1511. var codePoint
  1512. var length = string.length
  1513. var leadSurrogate = null
  1514. var bytes = []
  1515. for (var i = 0; i < length; ++i) {
  1516. codePoint = string.charCodeAt(i)
  1517. // is surrogate component
  1518. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  1519. // last char was a lead
  1520. if (!leadSurrogate) {
  1521. // no lead yet
  1522. if (codePoint > 0xDBFF) {
  1523. // unexpected trail
  1524. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1525. continue
  1526. } else if (i + 1 === length) {
  1527. // unpaired lead
  1528. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1529. continue
  1530. }
  1531. // valid lead
  1532. leadSurrogate = codePoint
  1533. continue
  1534. }
  1535. // 2 leads in a row
  1536. if (codePoint < 0xDC00) {
  1537. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1538. leadSurrogate = codePoint
  1539. continue
  1540. }
  1541. // valid surrogate pair
  1542. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  1543. } else if (leadSurrogate) {
  1544. // valid bmp char, but last char was a lead
  1545. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  1546. }
  1547. leadSurrogate = null
  1548. // encode utf8
  1549. if (codePoint < 0x80) {
  1550. if ((units -= 1) < 0) break
  1551. bytes.push(codePoint)
  1552. } else if (codePoint < 0x800) {
  1553. if ((units -= 2) < 0) break
  1554. bytes.push(
  1555. codePoint >> 0x6 | 0xC0,
  1556. codePoint & 0x3F | 0x80
  1557. )
  1558. } else if (codePoint < 0x10000) {
  1559. if ((units -= 3) < 0) break
  1560. bytes.push(
  1561. codePoint >> 0xC | 0xE0,
  1562. codePoint >> 0x6 & 0x3F | 0x80,
  1563. codePoint & 0x3F | 0x80
  1564. )
  1565. } else if (codePoint < 0x110000) {
  1566. if ((units -= 4) < 0) break
  1567. bytes.push(
  1568. codePoint >> 0x12 | 0xF0,
  1569. codePoint >> 0xC & 0x3F | 0x80,
  1570. codePoint >> 0x6 & 0x3F | 0x80,
  1571. codePoint & 0x3F | 0x80
  1572. )
  1573. } else {
  1574. throw new Error('Invalid code point')
  1575. }
  1576. }
  1577. return bytes
  1578. }
  1579. function asciiToBytes (str) {
  1580. var byteArray = []
  1581. for (var i = 0; i < str.length; ++i) {
  1582. // Node's code seems to be doing this and not & 0x7F..
  1583. byteArray.push(str.charCodeAt(i) & 0xFF)
  1584. }
  1585. return byteArray
  1586. }
  1587. function utf16leToBytes (str, units) {
  1588. var c, hi, lo
  1589. var byteArray = []
  1590. for (var i = 0; i < str.length; ++i) {
  1591. if ((units -= 2) < 0) break
  1592. c = str.charCodeAt(i)
  1593. hi = c >> 8
  1594. lo = c % 256
  1595. byteArray.push(lo)
  1596. byteArray.push(hi)
  1597. }
  1598. return byteArray
  1599. }
  1600. function base64ToBytes (str) {
  1601. return base64.toByteArray(base64clean(str))
  1602. }
  1603. function blitBuffer (src, dst, offset, length) {
  1604. for (var i = 0; i < length; ++i) {
  1605. if ((i + offset >= dst.length) || (i >= src.length)) break
  1606. dst[i + offset] = src[i]
  1607. }
  1608. return i
  1609. }
  1610. function isnan (val) {
  1611. return val !== val // eslint-disable-line no-self-compare
  1612. }
  1613. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(14)))
  1614. /***/ },
  1615. /* 1 */
  1616. /***/ function(module, exports) {
  1617. if (typeof Object.create === 'function') {
  1618. // implementation from standard node.js 'util' module
  1619. module.exports = function inherits(ctor, superCtor) {
  1620. ctor.super_ = superCtor
  1621. ctor.prototype = Object.create(superCtor.prototype, {
  1622. constructor: {
  1623. value: ctor,
  1624. enumerable: false,
  1625. writable: true,
  1626. configurable: true
  1627. }
  1628. });
  1629. };
  1630. } else {
  1631. // old school shim for old browsers
  1632. module.exports = function inherits(ctor, superCtor) {
  1633. ctor.super_ = superCtor
  1634. var TempCtor = function () {}
  1635. TempCtor.prototype = superCtor.prototype
  1636. ctor.prototype = new TempCtor()
  1637. ctor.prototype.constructor = ctor
  1638. }
  1639. }
  1640. /***/ },
  1641. /* 2 */
  1642. /***/ function(module, exports, __webpack_require__) {
  1643. "use strict";
  1644. 'use strict';
  1645. var bind = __webpack_require__(55);
  1646. /*global toString:true*/
  1647. // utils is a library of generic helper functions non-specific to axios
  1648. var toString = Object.prototype.toString;
  1649. /**
  1650. * Determine if a value is an Array
  1651. *
  1652. * @param {Object} val The value to test
  1653. * @returns {boolean} True if value is an Array, otherwise false
  1654. */
  1655. function isArray(val) {
  1656. return toString.call(val) === '[object Array]';
  1657. }
  1658. /**
  1659. * Determine if a value is an ArrayBuffer
  1660. *
  1661. * @param {Object} val The value to test
  1662. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1663. */
  1664. function isArrayBuffer(val) {
  1665. return toString.call(val) === '[object ArrayBuffer]';
  1666. }
  1667. /**
  1668. * Determine if a value is a FormData
  1669. *
  1670. * @param {Object} val The value to test
  1671. * @returns {boolean} True if value is an FormData, otherwise false
  1672. */
  1673. function isFormData(val) {
  1674. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1675. }
  1676. /**
  1677. * Determine if a value is a view on an ArrayBuffer
  1678. *
  1679. * @param {Object} val The value to test
  1680. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1681. */
  1682. function isArrayBufferView(val) {
  1683. var result;
  1684. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1685. result = ArrayBuffer.isView(val);
  1686. } else {
  1687. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1688. }
  1689. return result;
  1690. }
  1691. /**
  1692. * Determine if a value is a String
  1693. *
  1694. * @param {Object} val The value to test
  1695. * @returns {boolean} True if value is a String, otherwise false
  1696. */
  1697. function isString(val) {
  1698. return typeof val === 'string';
  1699. }
  1700. /**
  1701. * Determine if a value is a Number
  1702. *
  1703. * @param {Object} val The value to test
  1704. * @returns {boolean} True if value is a Number, otherwise false
  1705. */
  1706. function isNumber(val) {
  1707. return typeof val === 'number';
  1708. }
  1709. /**
  1710. * Determine if a value is undefined
  1711. *
  1712. * @param {Object} val The value to test
  1713. * @returns {boolean} True if the value is undefined, otherwise false
  1714. */
  1715. function isUndefined(val) {
  1716. return typeof val === 'undefined';
  1717. }
  1718. /**
  1719. * Determine if a value is an Object
  1720. *
  1721. * @param {Object} val The value to test
  1722. * @returns {boolean} True if value is an Object, otherwise false
  1723. */
  1724. function isObject(val) {
  1725. return val !== null && typeof val === 'object';
  1726. }
  1727. /**
  1728. * Determine if a value is a Date
  1729. *
  1730. * @param {Object} val The value to test
  1731. * @returns {boolean} True if value is a Date, otherwise false
  1732. */
  1733. function isDate(val) {
  1734. return toString.call(val) === '[object Date]';
  1735. }
  1736. /**
  1737. * Determine if a value is a File
  1738. *
  1739. * @param {Object} val The value to test
  1740. * @returns {boolean} True if value is a File, otherwise false
  1741. */
  1742. function isFile(val) {
  1743. return toString.call(val) === '[object File]';
  1744. }
  1745. /**
  1746. * Determine if a value is a Blob
  1747. *
  1748. * @param {Object} val The value to test
  1749. * @returns {boolean} True if value is a Blob, otherwise false
  1750. */
  1751. function isBlob(val) {
  1752. return toString.call(val) === '[object Blob]';
  1753. }
  1754. /**
  1755. * Determine if a value is a Function
  1756. *
  1757. * @param {Object} val The value to test
  1758. * @returns {boolean} True if value is a Function, otherwise false
  1759. */
  1760. function isFunction(val) {
  1761. return toString.call(val) === '[object Function]';
  1762. }
  1763. /**
  1764. * Determine if a value is a Stream
  1765. *
  1766. * @param {Object} val The value to test
  1767. * @returns {boolean} True if value is a Stream, otherwise false
  1768. */
  1769. function isStream(val) {
  1770. return isObject(val) && isFunction(val.pipe);
  1771. }
  1772. /**
  1773. * Determine if a value is a URLSearchParams object
  1774. *
  1775. * @param {Object} val The value to test
  1776. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1777. */
  1778. function isURLSearchParams(val) {
  1779. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1780. }
  1781. /**
  1782. * Trim excess whitespace off the beginning and end of a string
  1783. *
  1784. * @param {String} str The String to trim
  1785. * @returns {String} The String freed of excess whitespace
  1786. */
  1787. function trim(str) {
  1788. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  1789. }
  1790. /**
  1791. * Determine if we're running in a standard browser environment
  1792. *
  1793. * This allows axios to run in a web worker, and react-native.
  1794. * Both environments support XMLHttpRequest, but not fully standard globals.
  1795. *
  1796. * web workers:
  1797. * typeof window -> undefined
  1798. * typeof document -> undefined
  1799. *
  1800. * react-native:
  1801. * typeof document.createElement -> undefined
  1802. */
  1803. function isStandardBrowserEnv() {
  1804. return (
  1805. typeof window !== 'undefined' &&
  1806. typeof document !== 'undefined' &&
  1807. typeof document.createElement === 'function'
  1808. );
  1809. }
  1810. /**
  1811. * Iterate over an Array or an Object invoking a function for each item.
  1812. *
  1813. * If `obj` is an Array callback will be called passing
  1814. * the value, index, and complete array for each item.
  1815. *
  1816. * If 'obj' is an Object callback will be called passing
  1817. * the value, key, and complete object for each property.
  1818. *
  1819. * @param {Object|Array} obj The object to iterate
  1820. * @param {Function} fn The callback to invoke for each item
  1821. */
  1822. function forEach(obj, fn) {
  1823. // Don't bother if no value provided
  1824. if (obj === null || typeof obj === 'undefined') {
  1825. return;
  1826. }
  1827. // Force an array if not already something iterable
  1828. if (typeof obj !== 'object' && !isArray(obj)) {
  1829. /*eslint no-param-reassign:0*/
  1830. obj = [obj];
  1831. }
  1832. if (isArray(obj)) {
  1833. // Iterate over array values
  1834. for (var i = 0, l = obj.length; i < l; i++) {
  1835. fn.call(null, obj[i], i, obj);
  1836. }
  1837. } else {
  1838. // Iterate over object keys
  1839. for (var key in obj) {
  1840. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1841. fn.call(null, obj[key], key, obj);
  1842. }
  1843. }
  1844. }
  1845. }
  1846. /**
  1847. * Accepts varargs expecting each argument to be an object, then
  1848. * immutably merges the properties of each object and returns result.
  1849. *
  1850. * When multiple objects contain the same key the later object in
  1851. * the arguments list will take precedence.
  1852. *
  1853. * Example:
  1854. *
  1855. * ```js
  1856. * var result = merge({foo: 123}, {foo: 456});
  1857. * console.log(result.foo); // outputs 456
  1858. * ```
  1859. *
  1860. * @param {Object} obj1 Object to merge
  1861. * @returns {Object} Result of all merge properties
  1862. */
  1863. function merge(/* obj1, obj2, obj3, ... */) {
  1864. var result = {};
  1865. function assignValue(val, key) {
  1866. if (typeof result[key] === 'object' && typeof val === 'object') {
  1867. result[key] = merge(result[key], val);
  1868. } else {
  1869. result[key] = val;
  1870. }
  1871. }
  1872. for (var i = 0, l = arguments.length; i < l; i++) {
  1873. forEach(arguments[i], assignValue);
  1874. }
  1875. return result;
  1876. }
  1877. /**
  1878. * Extends object a by mutably adding to it the properties of object b.
  1879. *
  1880. * @param {Object} a The object to be extended
  1881. * @param {Object} b The object to copy properties from
  1882. * @param {Object} thisArg The object to bind function to
  1883. * @return {Object} The resulting value of object a
  1884. */
  1885. function extend(a, b, thisArg) {
  1886. forEach(b, function assignValue(val, key) {
  1887. if (thisArg && typeof val === 'function') {
  1888. a[key] = bind(val, thisArg);
  1889. } else {
  1890. a[key] = val;
  1891. }
  1892. });
  1893. return a;
  1894. }
  1895. module.exports = {
  1896. isArray: isArray,
  1897. isArrayBuffer: isArrayBuffer,
  1898. isFormData: isFormData,
  1899. isArrayBufferView: isArrayBufferView,
  1900. isString: isString,
  1901. isNumber: isNumber,
  1902. isObject: isObject,
  1903. isUndefined: isUndefined,
  1904. isDate: isDate,
  1905. isFile: isFile,
  1906. isBlob: isBlob,
  1907. isFunction: isFunction,
  1908. isStream: isStream,
  1909. isURLSearchParams: isURLSearchParams,
  1910. isStandardBrowserEnv: isStandardBrowserEnv,
  1911. forEach: forEach,
  1912. merge: merge,
  1913. extend: extend,
  1914. trim: trim
  1915. };
  1916. /***/ },
  1917. /* 3 */
  1918. /***/ function(module, exports, __webpack_require__) {
  1919. var store = __webpack_require__(67)('wks')
  1920. , uid = __webpack_require__(71)
  1921. , Symbol = __webpack_require__(4).Symbol
  1922. , USE_SYMBOL = typeof Symbol == 'function';
  1923. var $exports = module.exports = function(name){
  1924. return store[name] || (store[name] =
  1925. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  1926. };
  1927. $exports.store = store;
  1928. /***/ },
  1929. /* 4 */
  1930. /***/ function(module, exports) {
  1931. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  1932. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  1933. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  1934. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  1935. /***/ },
  1936. /* 5 */
  1937. /***/ function(module, exports) {
  1938. // shim for using process in browser
  1939. var process = module.exports = {};
  1940. // cached from whatever global is present so that test runners that stub it
  1941. // don't break things. But we need to wrap it in a try catch in case it is
  1942. // wrapped in strict mode code which doesn't define any globals. It's inside a
  1943. // function because try/catches deoptimize in certain engines.
  1944. var cachedSetTimeout;
  1945. var cachedClearTimeout;
  1946. function defaultSetTimout() {
  1947. throw new Error('setTimeout has not been defined');
  1948. }
  1949. function defaultClearTimeout () {
  1950. throw new Error('clearTimeout has not been defined');
  1951. }
  1952. (function () {
  1953. try {
  1954. if (typeof setTimeout === 'function') {
  1955. cachedSetTimeout = setTimeout;
  1956. } else {
  1957. cachedSetTimeout = defaultSetTimout;
  1958. }
  1959. } catch (e) {
  1960. cachedSetTimeout = defaultSetTimout;
  1961. }
  1962. try {
  1963. if (typeof clearTimeout === 'function') {
  1964. cachedClearTimeout = clearTimeout;
  1965. } else {
  1966. cachedClearTimeout = defaultClearTimeout;
  1967. }
  1968. } catch (e) {
  1969. cachedClearTimeout = defaultClearTimeout;
  1970. }
  1971. } ())
  1972. function runTimeout(fun) {
  1973. if (cachedSetTimeout === setTimeout) {
  1974. //normal enviroments in sane situations
  1975. return setTimeout(fun, 0);
  1976. }
  1977. // if setTimeout wasn't available but was latter defined
  1978. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  1979. cachedSetTimeout = setTimeout;
  1980. return setTimeout(fun, 0);
  1981. }
  1982. try {
  1983. // when when somebody has screwed with setTimeout but no I.E. maddness
  1984. return cachedSetTimeout(fun, 0);
  1985. } catch(e){
  1986. try {
  1987. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  1988. return cachedSetTimeout.call(null, fun, 0);
  1989. } catch(e){
  1990. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  1991. return cachedSetTimeout.call(this, fun, 0);
  1992. }
  1993. }
  1994. }
  1995. function runClearTimeout(marker) {
  1996. if (cachedClearTimeout === clearTimeout) {
  1997. //normal enviroments in sane situations
  1998. return clearTimeout(marker);
  1999. }
  2000. // if clearTimeout wasn't available but was latter defined
  2001. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  2002. cachedClearTimeout = clearTimeout;
  2003. return clearTimeout(marker);
  2004. }
  2005. try {
  2006. // when when somebody has screwed with setTimeout but no I.E. maddness
  2007. return cachedClearTimeout(marker);
  2008. } catch (e){
  2009. try {
  2010. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  2011. return cachedClearTimeout.call(null, marker);
  2012. } catch (e){
  2013. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  2014. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  2015. return cachedClearTimeout.call(this, marker);
  2016. }
  2017. }
  2018. }
  2019. var queue = [];
  2020. var draining = false;
  2021. var currentQueue;
  2022. var queueIndex = -1;
  2023. function cleanUpNextTick() {
  2024. if (!draining || !currentQueue) {
  2025. return;
  2026. }
  2027. draining = false;
  2028. if (currentQueue.length) {
  2029. queue = currentQueue.concat(queue);
  2030. } else {
  2031. queueIndex = -1;
  2032. }
  2033. if (queue.length) {
  2034. drainQueue();
  2035. }
  2036. }
  2037. function drainQueue() {
  2038. if (draining) {
  2039. return;
  2040. }
  2041. var timeout = runTimeout(cleanUpNextTick);
  2042. draining = true;
  2043. var len = queue.length;
  2044. while(len) {
  2045. currentQueue = queue;
  2046. queue = [];
  2047. while (++queueIndex < len) {
  2048. if (currentQueue) {
  2049. currentQueue[queueIndex].run();
  2050. }
  2051. }
  2052. queueIndex = -1;
  2053. len = queue.length;
  2054. }
  2055. currentQueue = null;
  2056. draining = false;
  2057. runClearTimeout(timeout);
  2058. }
  2059. process.nextTick = function (fun) {
  2060. var args = new Array(arguments.length - 1);
  2061. if (arguments.length > 1) {
  2062. for (var i = 1; i < arguments.length; i++) {
  2063. args[i - 1] = arguments[i];
  2064. }
  2065. }
  2066. queue.push(new Item(fun, args));
  2067. if (queue.length === 1 && !draining) {
  2068. runTimeout(drainQueue);
  2069. }
  2070. };
  2071. // v8 likes predictible objects
  2072. function Item(fun, array) {
  2073. this.fun = fun;
  2074. this.array = array;
  2075. }
  2076. Item.prototype.run = function () {
  2077. this.fun.apply(null, this.array);
  2078. };
  2079. process.title = 'browser';
  2080. process.browser = true;
  2081. process.env = {};
  2082. process.argv = [];
  2083. process.version = ''; // empty string to avoid regexp issues
  2084. process.versions = {};
  2085. function noop() {}
  2086. process.on = noop;
  2087. process.addListener = noop;
  2088. process.once = noop;
  2089. process.off = noop;
  2090. process.removeListener = noop;
  2091. process.removeAllListeners = noop;
  2092. process.emit = noop;
  2093. process.binding = function (name) {
  2094. throw new Error('process.binding is not supported');
  2095. };
  2096. process.cwd = function () { return '/' };
  2097. process.chdir = function (dir) {
  2098. throw new Error('process.chdir is not supported');
  2099. };
  2100. process.umask = function() { return 0; };
  2101. /***/ },
  2102. /* 6 */
  2103. /***/ function(module, exports) {
  2104. var core = module.exports = {version: '2.4.0'};
  2105. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  2106. /***/ },
  2107. /* 7 */
  2108. /***/ function(module, exports, __webpack_require__) {
  2109. /**
  2110. * vuex v2.0.0
  2111. * (c) 2016 Evan You
  2112. * @license MIT
  2113. */
  2114. (function (global, factory) {
  2115. true ? module.exports = factory() :
  2116. typeof define === 'function' && define.amd ? define(factory) :
  2117. (global.Vuex = factory());
  2118. }(this, (function () { 'use strict';
  2119. var devtoolHook =
  2120. typeof window !== 'undefined' &&
  2121. window.__VUE_DEVTOOLS_GLOBAL_HOOK__
  2122. function devtoolPlugin (store) {
  2123. if (!devtoolHook) { return }
  2124. store._devtoolHook = devtoolHook
  2125. devtoolHook.emit('vuex:init', store)
  2126. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2127. store.replaceState(targetState)
  2128. })
  2129. store.subscribe(function (mutation, state) {
  2130. devtoolHook.emit('vuex:mutation', mutation, state)
  2131. })
  2132. }
  2133. function applyMixin (Vue) {
  2134. var version = Number(Vue.version.split('.')[0])
  2135. if (version >= 2) {
  2136. var usesInit = Vue.config._lifecycleHooks.indexOf('init') > -1
  2137. Vue.mixin(usesInit ? { init: vuexInit } : { beforeCreate: vuexInit })
  2138. } else {
  2139. // override init and inject vuex init procedure
  2140. // for 1.x backwards compatibility.
  2141. var _init = Vue.prototype._init
  2142. Vue.prototype._init = function (options) {
  2143. if ( options === void 0 ) options = {};
  2144. options.init = options.init
  2145. ? [vuexInit].concat(options.init)
  2146. : vuexInit
  2147. _init.call(this, options)
  2148. }
  2149. }
  2150. /**
  2151. * Vuex init hook, injected into each instances init hooks list.
  2152. */
  2153. function vuexInit () {
  2154. var options = this.$options
  2155. // store injection
  2156. if (options.store) {
  2157. this.$store = options.store
  2158. } else if (options.parent && options.parent.$store) {
  2159. this.$store = options.parent.$store
  2160. }
  2161. }
  2162. }
  2163. function mapState (states) {
  2164. var res = {}
  2165. normalizeMap(states).forEach(function (ref) {
  2166. var key = ref.key;
  2167. var val = ref.val;
  2168. res[key] = function mappedState () {
  2169. return typeof val === 'function'
  2170. ? val.call(this, this.$store.state, this.$store.getters)
  2171. : this.$store.state[val]
  2172. }
  2173. })
  2174. return res
  2175. }
  2176. function mapMutations (mutations) {
  2177. var res = {}
  2178. normalizeMap(mutations).forEach(function (ref) {
  2179. var key = ref.key;
  2180. var val = ref.val;
  2181. res[key] = function mappedMutation () {
  2182. var args = [], len = arguments.length;
  2183. while ( len-- ) args[ len ] = arguments[ len ];
  2184. return this.$store.commit.apply(this.$store, [val].concat(args))
  2185. }
  2186. })
  2187. return res
  2188. }
  2189. function mapGetters (getters) {
  2190. var res = {}
  2191. normalizeMap(getters).forEach(function (ref) {
  2192. var key = ref.key;
  2193. var val = ref.val;
  2194. res[key] = function mappedGetter () {
  2195. if (!(val in this.$store.getters)) {
  2196. console.error(("[vuex] unknown getter: " + val))
  2197. }
  2198. return this.$store.getters[val]
  2199. }
  2200. })
  2201. return res
  2202. }
  2203. function mapActions (actions) {
  2204. var res = {}
  2205. normalizeMap(actions).forEach(function (ref) {
  2206. var key = ref.key;
  2207. var val = ref.val;
  2208. res[key] = function mappedAction () {
  2209. var args = [], len = arguments.length;
  2210. while ( len-- ) args[ len ] = arguments[ len ];
  2211. return this.$store.dispatch.apply(this.$store, [val].concat(args))
  2212. }
  2213. })
  2214. return res
  2215. }
  2216. function normalizeMap (map) {
  2217. return Array.isArray(map)
  2218. ? map.map(function (key) { return ({ key: key, val: key }); })
  2219. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  2220. }
  2221. function isObject (obj) {
  2222. return obj !== null && typeof obj === 'object'
  2223. }
  2224. function isPromise (val) {
  2225. return val && typeof val.then === 'function'
  2226. }
  2227. function assert (condition, msg) {
  2228. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2229. }
  2230. var Vue // bind on install
  2231. var Store = function Store (options) {
  2232. var this$1 = this;
  2233. if ( options === void 0 ) options = {};
  2234. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.")
  2235. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.")
  2236. var state = options.state; if ( state === void 0 ) state = {};
  2237. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2238. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2239. // store internal state
  2240. this._options = options
  2241. this._committing = false
  2242. this._actions = Object.create(null)
  2243. this._mutations = Object.create(null)
  2244. this._wrappedGetters = Object.create(null)
  2245. this._runtimeModules = Object.create(null)
  2246. this._subscribers = []
  2247. this._watcherVM = new Vue()
  2248. // bind commit and dispatch to self
  2249. var store = this
  2250. var ref = this;
  2251. var dispatch = ref.dispatch;
  2252. var commit = ref.commit;
  2253. this.dispatch = function boundDispatch (type, payload) {
  2254. return dispatch.call(store, type, payload)
  2255. }
  2256. this.commit = function boundCommit (type, payload, options) {
  2257. return commit.call(store, type, payload, options)
  2258. }
  2259. // strict mode
  2260. this.strict = strict
  2261. // init root module.
  2262. // this also recursively registers all sub-modules
  2263. // and collects all module getters inside this._wrappedGetters
  2264. installModule(this, state, [], options)
  2265. // initialize the store vm, which is responsible for the reactivity
  2266. // (also registers _wrappedGetters as computed properties)
  2267. resetStoreVM(this, state)
  2268. // apply plugins
  2269. plugins.concat(devtoolPlugin).forEach(function (plugin) { return plugin(this$1); })
  2270. };
  2271. var prototypeAccessors = { state: {} };
  2272. prototypeAccessors.state.get = function () {
  2273. return this._vm.state
  2274. };
  2275. prototypeAccessors.state.set = function (v) {
  2276. assert(false, "Use store.replaceState() to explicit replace store state.")
  2277. };
  2278. Store.prototype.commit = function commit (type, payload, options) {
  2279. var this$1 = this;
  2280. // check object-style commit
  2281. if (isObject(type) && type.type) {
  2282. options = payload
  2283. payload = type
  2284. type = type.type
  2285. }
  2286. var mutation = { type: type, payload: payload }
  2287. var entry = this._mutations[type]
  2288. if (!entry) {
  2289. console.error(("[vuex] unknown mutation type: " + type))
  2290. return
  2291. }
  2292. this._withCommit(function () {
  2293. entry.forEach(function commitIterator (handler) {
  2294. handler(payload)
  2295. })
  2296. })
  2297. if (!options || !options.silent) {
  2298. this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); })
  2299. }
  2300. };
  2301. Store.prototype.dispatch = function dispatch (type, payload) {
  2302. // check object-style dispatch
  2303. if (isObject(type) && type.type) {
  2304. payload = type
  2305. type = type.type
  2306. }
  2307. var entry = this._actions[type]
  2308. if (!entry) {
  2309. console.error(("[vuex] unknown action type: " + type))
  2310. return
  2311. }
  2312. return entry.length > 1
  2313. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2314. : entry[0](payload)
  2315. };
  2316. Store.prototype.subscribe = function subscribe (fn) {
  2317. var subs = this._subscribers
  2318. if (subs.indexOf(fn) < 0) {
  2319. subs.push(fn)
  2320. }
  2321. return function () {
  2322. var i = subs.indexOf(fn)
  2323. if (i > -1) {
  2324. subs.splice(i, 1)
  2325. }
  2326. }
  2327. };
  2328. Store.prototype.watch = function watch (getter, cb, options) {
  2329. var this$1 = this;
  2330. assert(typeof getter === 'function', "store.watch only accepts a function.")
  2331. return this._watcherVM.$watch(function () { return getter(this$1.state); }, cb, options)
  2332. };
  2333. Store.prototype.replaceState = function replaceState (state) {
  2334. var this$1 = this;
  2335. this._withCommit(function () {
  2336. this$1._vm.state = state
  2337. })
  2338. };
  2339. Store.prototype.registerModule = function registerModule (path, module) {
  2340. if (typeof path === 'string') { path = [path] }
  2341. assert(Array.isArray(path), "module path must be a string or an Array.")
  2342. this._runtimeModules[path.join('.')] = module
  2343. installModule(this, this.state, path, module)
  2344. // reset store to update getters...
  2345. resetStoreVM(this, this.state)
  2346. };
  2347. Store.prototype.unregisterModule = function unregisterModule (path) {
  2348. var this$1 = this;
  2349. if (typeof path === 'string') { path = [path] }
  2350. assert(Array.isArray(path), "module path must be a string or an Array.")
  2351. delete this._runtimeModules[path.join('.')]
  2352. this._withCommit(function () {
  2353. var parentState = getNestedState(this$1.state, path.slice(0, -1))
  2354. Vue.delete(parentState, path[path.length - 1])
  2355. })
  2356. resetStore(this)
  2357. };
  2358. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2359. updateModule(this._options, newOptions)
  2360. resetStore(this)
  2361. };
  2362. Store.prototype._withCommit = function _withCommit (fn) {
  2363. var committing = this._committing
  2364. this._committing = true
  2365. fn()
  2366. this._committing = committing
  2367. };
  2368. Object.defineProperties( Store.prototype, prototypeAccessors );
  2369. function updateModule (targetModule, newModule) {
  2370. if (newModule.actions) {
  2371. targetModule.actions = newModule.actions
  2372. }
  2373. if (newModule.mutations) {
  2374. targetModule.mutations = newModule.mutations
  2375. }
  2376. if (newModule.getters) {
  2377. targetModule.getters = newModule.getters
  2378. }
  2379. if (newModule.modules) {
  2380. for (var key in newModule.modules) {
  2381. if (!(targetModule.modules && targetModule.modules[key])) {
  2382. console.warn(
  2383. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2384. 'manual reload is needed'
  2385. )
  2386. return
  2387. }
  2388. updateModule(targetModule.modules[key], newModule.modules[key])
  2389. }
  2390. }
  2391. }
  2392. function resetStore (store) {
  2393. store._actions = Object.create(null)
  2394. store._mutations = Object.create(null)
  2395. store._wrappedGetters = Object.create(null)
  2396. var state = store.state
  2397. // init root module
  2398. installModule(store, state, [], store._options, true)
  2399. // init all runtime modules
  2400. Object.keys(store._runtimeModules).forEach(function (key) {
  2401. installModule(store, state, key.split('.'), store._runtimeModules[key], true)
  2402. })
  2403. // reset vm
  2404. resetStoreVM(store, state)
  2405. }
  2406. function resetStoreVM (store, state) {
  2407. var oldVm = store._vm
  2408. // bind store public getters
  2409. store.getters = {}
  2410. var wrappedGetters = store._wrappedGetters
  2411. var computed = {}
  2412. Object.keys(wrappedGetters).forEach(function (key) {
  2413. var fn = wrappedGetters[key]
  2414. // use computed to leverage its lazy-caching mechanism
  2415. computed[key] = function () { return fn(store); }
  2416. Object.defineProperty(store.getters, key, {
  2417. get: function () { return store._vm[key]; }
  2418. })
  2419. })
  2420. // use a Vue instance to store the state tree
  2421. // suppress warnings just in case the user has added
  2422. // some funky global mixins
  2423. var silent = Vue.config.silent
  2424. Vue.config.silent = true
  2425. store._vm = new Vue({
  2426. data: { state: state },
  2427. computed: computed
  2428. })
  2429. Vue.config.silent = silent
  2430. // enable strict mode for new vm
  2431. if (store.strict) {
  2432. enableStrictMode(store)
  2433. }
  2434. if (oldVm) {
  2435. // dispatch changes in all subscribed watchers
  2436. // to force getter re-evaluation.
  2437. store._withCommit(function () {
  2438. oldVm.state = null
  2439. })
  2440. Vue.nextTick(function () { return oldVm.$destroy(); })
  2441. }
  2442. }
  2443. function installModule (store, rootState, path, module, hot) {
  2444. var isRoot = !path.length
  2445. var state = module.state;
  2446. var actions = module.actions;
  2447. var mutations = module.mutations;
  2448. var getters = module.getters;
  2449. var modules = module.modules;
  2450. // set state
  2451. if (!isRoot && !hot) {
  2452. var parentState = getNestedState(rootState, path.slice(0, -1))
  2453. var moduleName = path[path.length - 1]
  2454. store._withCommit(function () {
  2455. Vue.set(parentState, moduleName, state || {})
  2456. })
  2457. }
  2458. if (mutations) {
  2459. Object.keys(mutations).forEach(function (key) {
  2460. registerMutation(store, key, mutations[key], path)
  2461. })
  2462. }
  2463. if (actions) {
  2464. Object.keys(actions).forEach(function (key) {
  2465. registerAction(store, key, actions[key], path)
  2466. })
  2467. }
  2468. if (getters) {
  2469. wrapGetters(store, getters, path)
  2470. }
  2471. if (modules) {
  2472. Object.keys(modules).forEach(function (key) {
  2473. installModule(store, rootState, path.concat(key), modules[key], hot)
  2474. })
  2475. }
  2476. }
  2477. function registerMutation (store, type, handler, path) {
  2478. if ( path === void 0 ) path = [];
  2479. var entry = store._mutations[type] || (store._mutations[type] = [])
  2480. entry.push(function wrappedMutationHandler (payload) {
  2481. handler(getNestedState(store.state, path), payload)
  2482. })
  2483. }
  2484. function registerAction (store, type, handler, path) {
  2485. if ( path === void 0 ) path = [];
  2486. var entry = store._actions[type] || (store._actions[type] = [])
  2487. var dispatch = store.dispatch;
  2488. var commit = store.commit;
  2489. entry.push(function wrappedActionHandler (payload, cb) {
  2490. var res = handler({
  2491. dispatch: dispatch,
  2492. commit: commit,
  2493. getters: store.getters,
  2494. state: getNestedState(store.state, path),
  2495. rootState: store.state
  2496. }, payload, cb)
  2497. if (!isPromise(res)) {
  2498. res = Promise.resolve(res)
  2499. }
  2500. if (store._devtoolHook) {
  2501. return res.catch(function (err) {
  2502. store._devtoolHook.emit('vuex:error', err)
  2503. throw err
  2504. })
  2505. } else {
  2506. return res
  2507. }
  2508. })
  2509. }
  2510. function wrapGetters (store, moduleGetters, modulePath) {
  2511. Object.keys(moduleGetters).forEach(function (getterKey) {
  2512. var rawGetter = moduleGetters[getterKey]
  2513. if (store._wrappedGetters[getterKey]) {
  2514. console.error(("[vuex] duplicate getter key: " + getterKey))
  2515. return
  2516. }
  2517. store._wrappedGetters[getterKey] = function wrappedGetter (store) {
  2518. return rawGetter(
  2519. getNestedState(store.state, modulePath), // local state
  2520. store.getters, // getters
  2521. store.state // root state
  2522. )
  2523. }
  2524. })
  2525. }
  2526. function enableStrictMode (store) {
  2527. store._vm.$watch('state', function () {
  2528. assert(store._committing, "Do not mutate vuex store state outside mutation handlers.")
  2529. }, { deep: true, sync: true })
  2530. }
  2531. function getNestedState (state, path) {
  2532. return path.length
  2533. ? path.reduce(function (state, key) { return state[key]; }, state)
  2534. : state
  2535. }
  2536. function install (_Vue) {
  2537. if (Vue) {
  2538. console.error(
  2539. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  2540. )
  2541. return
  2542. }
  2543. Vue = _Vue
  2544. applyMixin(Vue)
  2545. }
  2546. // auto install in dist mode
  2547. if (typeof window !== 'undefined' && window.Vue) {
  2548. install(window.Vue)
  2549. }
  2550. var index = {
  2551. Store: Store,
  2552. install: install,
  2553. mapState: mapState,
  2554. mapMutations: mapMutations,
  2555. mapGetters: mapGetters,
  2556. mapActions: mapActions
  2557. }
  2558. return index;
  2559. })));
  2560. /***/ },
  2561. /* 8 */
  2562. /***/ function(module, exports, __webpack_require__) {
  2563. "use strict";
  2564. // a duplex stream is just a stream that is both readable and writable.
  2565. // Since JS doesn't have multiple prototypal inheritance, this class
  2566. // prototypally inherits from Readable, and then parasitically from
  2567. // Writable.
  2568. 'use strict';
  2569. /*<replacement>*/
  2570. var objectKeys = Object.keys || function (obj) {
  2571. var keys = [];
  2572. for (var key in obj) {
  2573. keys.push(key);
  2574. }return keys;
  2575. };
  2576. /*</replacement>*/
  2577. module.exports = Duplex;
  2578. /*<replacement>*/
  2579. var processNextTick = __webpack_require__(46);
  2580. /*</replacement>*/
  2581. /*<replacement>*/
  2582. var util = __webpack_require__(20);
  2583. util.inherits = __webpack_require__(1);
  2584. /*</replacement>*/
  2585. var Readable = __webpack_require__(76);
  2586. var Writable = __webpack_require__(48);
  2587. util.inherits(Duplex, Readable);
  2588. var keys = objectKeys(Writable.prototype);
  2589. for (var v = 0; v < keys.length; v++) {
  2590. var method = keys[v];
  2591. if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
  2592. }
  2593. function Duplex(options) {
  2594. if (!(this instanceof Duplex)) return new Duplex(options);
  2595. Readable.call(this, options);
  2596. Writable.call(this, options);
  2597. if (options && options.readable === false) this.readable = false;
  2598. if (options && options.writable === false) this.writable = false;
  2599. this.allowHalfOpen = true;
  2600. if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  2601. this.once('end', onend);
  2602. }
  2603. // the no-half-open enforcer
  2604. function onend() {
  2605. // if we allow half-open state, or if the writable side ended,
  2606. // then we're ok.
  2607. if (this.allowHalfOpen || this._writableState.ended) return;
  2608. // no more data can be written.
  2609. // But allow more writes to happen in this tick.
  2610. processNextTick(onEndNT, this);
  2611. }
  2612. function onEndNT(self) {
  2613. self.end();
  2614. }
  2615. function forEach(xs, f) {
  2616. for (var i = 0, l = xs.length; i < l; i++) {
  2617. f(xs[i], i);
  2618. }
  2619. }
  2620. /***/ },
  2621. /* 9 */
  2622. /***/ function(module, exports, __webpack_require__) {
  2623. "use strict";
  2624. "use strict";
  2625. exports.__esModule = true;
  2626. var _assign = __webpack_require__(23);
  2627. var _assign2 = _interopRequireDefault(_assign);
  2628. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2629. exports.default = _assign2.default || function (target) {
  2630. for (var i = 1; i < arguments.length; i++) {
  2631. var source = arguments[i];
  2632. for (var key in source) {
  2633. if (Object.prototype.hasOwnProperty.call(source, key)) {
  2634. target[key] = source[key];
  2635. }
  2636. }
  2637. }
  2638. return target;
  2639. };
  2640. /***/ },
  2641. /* 10 */
  2642. /***/ function(module, exports, __webpack_require__) {
  2643. var isObject = __webpack_require__(28);
  2644. module.exports = function(it){
  2645. if(!isObject(it))throw TypeError(it + ' is not an object!');
  2646. return it;
  2647. };
  2648. /***/ },
  2649. /* 11 */
  2650. /***/ function(module, exports, __webpack_require__) {
  2651. // Thank's IE8 for his funny defineProperty
  2652. module.exports = !__webpack_require__(39)(function(){
  2653. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  2654. });
  2655. /***/ },
  2656. /* 12 */
  2657. /***/ function(module, exports, __webpack_require__) {
  2658. var dP = __webpack_require__(19)
  2659. , createDesc = __webpack_require__(66);
  2660. module.exports = __webpack_require__(11) ? function(object, key, value){
  2661. return dP.f(object, key, createDesc(1, value));
  2662. } : function(object, key, value){
  2663. object[key] = value;
  2664. return object;
  2665. };
  2666. /***/ },
  2667. /* 13 */
  2668. /***/ function(module, exports, __webpack_require__) {
  2669. /* WEBPACK VAR INJECTION */(function(Buffer) {// prototype class for hash functions
  2670. function Hash (blockSize, finalSize) {
  2671. this._block = new Buffer(blockSize)
  2672. this._finalSize = finalSize
  2673. this._blockSize = blockSize
  2674. this._len = 0
  2675. this._s = 0
  2676. }
  2677. Hash.prototype.update = function (data, enc) {
  2678. if (typeof data === 'string') {
  2679. enc = enc || 'utf8'
  2680. data = new Buffer(data, enc)
  2681. }
  2682. var l = this._len += data.length
  2683. var s = this._s || 0
  2684. var f = 0
  2685. var buffer = this._block
  2686. while (s < l) {
  2687. var t = Math.min(data.length, f + this._blockSize - (s % this._blockSize))
  2688. var ch = (t - f)
  2689. for (var i = 0; i < ch; i++) {
  2690. buffer[(s % this._blockSize) + i] = data[i + f]
  2691. }
  2692. s += ch
  2693. f += ch
  2694. if ((s % this._blockSize) === 0) {
  2695. this._update(buffer)
  2696. }
  2697. }
  2698. this._s = s
  2699. return this
  2700. }
  2701. Hash.prototype.digest = function (enc) {
  2702. // Suppose the length of the message M, in bits, is l
  2703. var l = this._len * 8
  2704. // Append the bit 1 to the end of the message
  2705. this._block[this._len % this._blockSize] = 0x80
  2706. // and then k zero bits, where k is the smallest non-negative solution to the equation (l + 1 + k) === finalSize mod blockSize
  2707. this._block.fill(0, this._len % this._blockSize + 1)
  2708. if (l % (this._blockSize * 8) >= this._finalSize * 8) {
  2709. this._update(this._block)
  2710. this._block.fill(0)
  2711. }
  2712. // to this append the block which is equal to the number l written in binary
  2713. // TODO: handle case where l is > Math.pow(2, 29)
  2714. this._block.writeInt32BE(l, this._blockSize - 4)
  2715. var hash = this._update(this._block) || this._hash()
  2716. return enc ? hash.toString(enc) : hash
  2717. }
  2718. Hash.prototype._update = function () {
  2719. throw new Error('_update must be implemented by subclass')
  2720. }
  2721. module.exports = Hash
  2722. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  2723. /***/ },
  2724. /* 14 */
  2725. /***/ function(module, exports) {
  2726. var g;
  2727. // This works in non-strict mode
  2728. g = (function() { return this; })();
  2729. try {
  2730. // This works if eval is allowed (see CSP)
  2731. g = g || Function("return this")() || (1,eval)("this");
  2732. } catch(e) {
  2733. // This works if the window reference is available
  2734. if(typeof window === "object")
  2735. g = window;
  2736. }
  2737. // g can still be undefined, but nothing to do about it...
  2738. // We return undefined, instead of nothing here, so it's
  2739. // easier to handle this case. if(!global) { ...}
  2740. module.exports = g;
  2741. /***/ },
  2742. /* 15 */
  2743. /***/ function(module, exports, __webpack_require__) {
  2744. "use strict";
  2745. 'use strict';
  2746. Object.defineProperty(exports, "__esModule", {
  2747. value: true
  2748. });
  2749. exports.TOKEN_KEY = exports.LOCAL_STORAGE_KEY = undefined;
  2750. var _defineProperty2 = __webpack_require__(116);
  2751. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  2752. var _stringify = __webpack_require__(115);
  2753. var _stringify2 = _interopRequireDefault(_stringify);
  2754. var _assign = __webpack_require__(23);
  2755. var _assign2 = _interopRequireDefault(_assign);
  2756. var _classCallCheck2 = __webpack_require__(16);
  2757. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  2758. var _createClass2 = __webpack_require__(17);
  2759. var _createClass3 = _interopRequireDefault(_createClass2);
  2760. var _token = __webpack_require__(112);
  2761. var _token2 = _interopRequireDefault(_token);
  2762. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2763. var LOCAL_STORAGE_KEY = exports.LOCAL_STORAGE_KEY = 'lesspass';
  2764. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  2765. var Storage = function () {
  2766. function Storage() {
  2767. var storage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.localStorage;
  2768. (0, _classCallCheck3.default)(this, Storage);
  2769. this.storage = storage;
  2770. }
  2771. (0, _createClass3.default)(Storage, [{
  2772. key: '_getLocalStorage',
  2773. value: function _getLocalStorage() {
  2774. return JSON.parse(this.storage.getItem(LOCAL_STORAGE_KEY) || '{}');
  2775. }
  2776. }, {
  2777. key: 'json',
  2778. value: function json() {
  2779. var defaultStorage = {
  2780. baseURL: 'https://lesspass.com',
  2781. timeout: 5000
  2782. };
  2783. var localStorage = this._getLocalStorage();
  2784. return (0, _assign2.default)(defaultStorage, localStorage);
  2785. }
  2786. }, {
  2787. key: 'save',
  2788. value: function save(data) {
  2789. var newData = (0, _assign2.default)(this._getLocalStorage(), data);
  2790. this.storage.setItem(LOCAL_STORAGE_KEY, (0, _stringify2.default)(newData));
  2791. }
  2792. }, {
  2793. key: 'clear',
  2794. value: function clear() {
  2795. this.storage.clear();
  2796. }
  2797. }, {
  2798. key: 'getToken',
  2799. value: function getToken() {
  2800. var storage = this.json();
  2801. if (TOKEN_KEY in storage) {
  2802. return new _token2.default(storage[TOKEN_KEY]);
  2803. }
  2804. return new _token2.default();
  2805. }
  2806. }, {
  2807. key: 'saveToken',
  2808. value: function saveToken(token) {
  2809. this.save((0, _defineProperty3.default)({}, TOKEN_KEY, token));
  2810. }
  2811. }]);
  2812. return Storage;
  2813. }();
  2814. exports.default = Storage;
  2815. /***/ },
  2816. /* 16 */
  2817. /***/ function(module, exports) {
  2818. "use strict";
  2819. "use strict";
  2820. exports.__esModule = true;
  2821. exports.default = function (instance, Constructor) {
  2822. if (!(instance instanceof Constructor)) {
  2823. throw new TypeError("Cannot call a class as a function");
  2824. }
  2825. };
  2826. /***/ },
  2827. /* 17 */
  2828. /***/ function(module, exports, __webpack_require__) {
  2829. "use strict";
  2830. "use strict";
  2831. exports.__esModule = true;
  2832. var _defineProperty = __webpack_require__(57);
  2833. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  2834. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  2835. exports.default = function () {
  2836. function defineProperties(target, props) {
  2837. for (var i = 0; i < props.length; i++) {
  2838. var descriptor = props[i];
  2839. descriptor.enumerable = descriptor.enumerable || false;
  2840. descriptor.configurable = true;
  2841. if ("value" in descriptor) descriptor.writable = true;
  2842. (0, _defineProperty2.default)(target, descriptor.key, descriptor);
  2843. }
  2844. }
  2845. return function (Constructor, protoProps, staticProps) {
  2846. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  2847. if (staticProps) defineProperties(Constructor, staticProps);
  2848. return Constructor;
  2849. };
  2850. }();
  2851. /***/ },
  2852. /* 18 */
  2853. /***/ function(module, exports) {
  2854. module.exports = {};
  2855. /***/ },
  2856. /* 19 */
  2857. /***/ function(module, exports, __webpack_require__) {
  2858. var anObject = __webpack_require__(10)
  2859. , IE8_DOM_DEFINE = __webpack_require__(130)
  2860. , toPrimitive = __webpack_require__(151)
  2861. , dP = Object.defineProperty;
  2862. exports.f = __webpack_require__(11) ? Object.defineProperty : function defineProperty(O, P, Attributes){
  2863. anObject(O);
  2864. P = toPrimitive(P, true);
  2865. anObject(Attributes);
  2866. if(IE8_DOM_DEFINE)try {
  2867. return dP(O, P, Attributes);
  2868. } catch(e){ /* empty */ }
  2869. if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
  2870. if('value' in Attributes)O[P] = Attributes.value;
  2871. return O;
  2872. };
  2873. /***/ },
  2874. /* 20 */
  2875. /***/ function(module, exports, __webpack_require__) {
  2876. /* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.
  2877. //
  2878. // Permission is hereby granted, free of charge, to any person obtaining a
  2879. // copy of this software and associated documentation files (the
  2880. // "Software"), to deal in the Software without restriction, including
  2881. // without limitation the rights to use, copy, modify, merge, publish,
  2882. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2883. // persons to whom the Software is furnished to do so, subject to the
  2884. // following conditions:
  2885. //
  2886. // The above copyright notice and this permission notice shall be included
  2887. // in all copies or substantial portions of the Software.
  2888. //
  2889. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2890. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2891. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2892. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  2893. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  2894. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  2895. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  2896. // NOTE: These type checking functions intentionally don't use `instanceof`
  2897. // because it is fragile and can be easily faked with `Object.create()`.
  2898. function isArray(arg) {
  2899. if (Array.isArray) {
  2900. return Array.isArray(arg);
  2901. }
  2902. return objectToString(arg) === '[object Array]';
  2903. }
  2904. exports.isArray = isArray;
  2905. function isBoolean(arg) {
  2906. return typeof arg === 'boolean';
  2907. }
  2908. exports.isBoolean = isBoolean;
  2909. function isNull(arg) {
  2910. return arg === null;
  2911. }
  2912. exports.isNull = isNull;
  2913. function isNullOrUndefined(arg) {
  2914. return arg == null;
  2915. }
  2916. exports.isNullOrUndefined = isNullOrUndefined;
  2917. function isNumber(arg) {
  2918. return typeof arg === 'number';
  2919. }
  2920. exports.isNumber = isNumber;
  2921. function isString(arg) {
  2922. return typeof arg === 'string';
  2923. }
  2924. exports.isString = isString;
  2925. function isSymbol(arg) {
  2926. return typeof arg === 'symbol';
  2927. }
  2928. exports.isSymbol = isSymbol;
  2929. function isUndefined(arg) {
  2930. return arg === void 0;
  2931. }
  2932. exports.isUndefined = isUndefined;
  2933. function isRegExp(re) {
  2934. return objectToString(re) === '[object RegExp]';
  2935. }
  2936. exports.isRegExp = isRegExp;
  2937. function isObject(arg) {
  2938. return typeof arg === 'object' && arg !== null;
  2939. }
  2940. exports.isObject = isObject;
  2941. function isDate(d) {
  2942. return objectToString(d) === '[object Date]';
  2943. }
  2944. exports.isDate = isDate;
  2945. function isError(e) {
  2946. return (objectToString(e) === '[object Error]' || e instanceof Error);
  2947. }
  2948. exports.isError = isError;
  2949. function isFunction(arg) {
  2950. return typeof arg === 'function';
  2951. }
  2952. exports.isFunction = isFunction;
  2953. function isPrimitive(arg) {
  2954. return arg === null ||
  2955. typeof arg === 'boolean' ||
  2956. typeof arg === 'number' ||
  2957. typeof arg === 'string' ||
  2958. typeof arg === 'symbol' || // ES6 symbol
  2959. typeof arg === 'undefined';
  2960. }
  2961. exports.isPrimitive = isPrimitive;
  2962. exports.isBuffer = Buffer.isBuffer;
  2963. function objectToString(o) {
  2964. return Object.prototype.toString.call(o);
  2965. }
  2966. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  2967. /***/ },
  2968. /* 21 */
  2969. /***/ function(module, exports, __webpack_require__) {
  2970. // Copyright Joyent, Inc. and other Node contributors.
  2971. //
  2972. // Permission is hereby granted, free of charge, to any person obtaining a
  2973. // copy of this software and associated documentation files (the
  2974. // "Software"), to deal in the Software without restriction, including
  2975. // without limitation the rights to use, copy, modify, merge, publish,
  2976. // distribute, sublicense, and/or sell copies of the Software, and to permit
  2977. // persons to whom the Software is furnished to do so, subject to the
  2978. // following conditions:
  2979. //
  2980. // The above copyright notice and this permission notice shall be included
  2981. // in all copies or substantial portions of the Software.
  2982. //
  2983. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2984. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2985. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  2986. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  2987. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  2988. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  2989. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  2990. module.exports = Stream;
  2991. var EE = __webpack_require__(30).EventEmitter;
  2992. var inherits = __webpack_require__(1);
  2993. inherits(Stream, EE);
  2994. Stream.Readable = __webpack_require__(185);
  2995. Stream.Writable = __webpack_require__(187);
  2996. Stream.Duplex = __webpack_require__(182);
  2997. Stream.Transform = __webpack_require__(186);
  2998. Stream.PassThrough = __webpack_require__(184);
  2999. // Backwards-compat with node 0.4.x
  3000. Stream.Stream = Stream;
  3001. // old-style streams. Note that the pipe method (the only relevant
  3002. // part of this class) is overridden in the Readable class.
  3003. function Stream() {
  3004. EE.call(this);
  3005. }
  3006. Stream.prototype.pipe = function(dest, options) {
  3007. var source = this;
  3008. function ondata(chunk) {
  3009. if (dest.writable) {
  3010. if (false === dest.write(chunk) && source.pause) {
  3011. source.pause();
  3012. }
  3013. }
  3014. }
  3015. source.on('data', ondata);
  3016. function ondrain() {
  3017. if (source.readable && source.resume) {
  3018. source.resume();
  3019. }
  3020. }
  3021. dest.on('drain', ondrain);
  3022. // If the 'end' option is not supplied, dest.end() will be called when
  3023. // source gets the 'end' or 'close' events. Only dest.end() once.
  3024. if (!dest._isStdio && (!options || options.end !== false)) {
  3025. source.on('end', onend);
  3026. source.on('close', onclose);
  3027. }
  3028. var didOnEnd = false;
  3029. function onend() {
  3030. if (didOnEnd) return;
  3031. didOnEnd = true;
  3032. dest.end();
  3033. }
  3034. function onclose() {
  3035. if (didOnEnd) return;
  3036. didOnEnd = true;
  3037. if (typeof dest.destroy === 'function') dest.destroy();
  3038. }
  3039. // don't leave dangling pipes when there are errors.
  3040. function onerror(er) {
  3041. cleanup();
  3042. if (EE.listenerCount(this, 'error') === 0) {
  3043. throw er; // Unhandled stream error in pipe.
  3044. }
  3045. }
  3046. source.on('error', onerror);
  3047. dest.on('error', onerror);
  3048. // remove all the event listeners that were added.
  3049. function cleanup() {
  3050. source.removeListener('data', ondata);
  3051. dest.removeListener('drain', ondrain);
  3052. source.removeListener('end', onend);
  3053. source.removeListener('close', onclose);
  3054. source.removeListener('error', onerror);
  3055. dest.removeListener('error', onerror);
  3056. source.removeListener('end', cleanup);
  3057. source.removeListener('close', cleanup);
  3058. dest.removeListener('close', cleanup);
  3059. }
  3060. source.on('end', cleanup);
  3061. source.on('close', cleanup);
  3062. dest.on('close', cleanup);
  3063. dest.emit('pipe', source);
  3064. // Allow for unix-like usage: A.pipe(B).pipe(C)
  3065. return dest;
  3066. };
  3067. /***/ },
  3068. /* 22 */
  3069. /***/ function(module, exports, __webpack_require__) {
  3070. "use strict";
  3071. 'use strict';
  3072. Object.defineProperty(exports, "__esModule", {
  3073. value: true
  3074. });
  3075. var _promise = __webpack_require__(58);
  3076. var _promise2 = _interopRequireDefault(_promise);
  3077. var _classCallCheck2 = __webpack_require__(16);
  3078. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  3079. var _createClass2 = __webpack_require__(17);
  3080. var _createClass3 = _interopRequireDefault(_createClass2);
  3081. var _axios = __webpack_require__(50);
  3082. var _axios2 = _interopRequireDefault(_axios);
  3083. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  3084. var Auth = function () {
  3085. function Auth(storage) {
  3086. (0, _classCallCheck3.default)(this, Auth);
  3087. this.user = {
  3088. authenticated: false
  3089. };
  3090. this.storage = storage;
  3091. }
  3092. (0, _createClass3.default)(Auth, [{
  3093. key: 'isAuthenticated',
  3094. value: function isAuthenticated() {
  3095. var token = this.storage.getToken();
  3096. if (token.stillValid()) {
  3097. this.user.authenticated = true;
  3098. return true;
  3099. }
  3100. this.user.authenticated = false;
  3101. return false;
  3102. }
  3103. }, {
  3104. key: 'isGuest',
  3105. value: function isGuest() {
  3106. return !this.isAuthenticated();
  3107. }
  3108. }, {
  3109. key: 'logout',
  3110. value: function logout() {
  3111. var _this = this;
  3112. return new _promise2.default(function (resolve) {
  3113. _this.storage.clear();
  3114. _this.user.authenticated = false;
  3115. resolve();
  3116. });
  3117. }
  3118. }, {
  3119. key: 'login',
  3120. value: function login(user, baseURL) {
  3121. var _this2 = this;
  3122. var config = this.storage.json();
  3123. if (baseURL) {
  3124. config.baseURL = baseURL;
  3125. }
  3126. return Auth._requestToken(user, config).then(function (token) {
  3127. _this2.storage.saveToken(token);
  3128. });
  3129. }
  3130. }, {
  3131. key: 'refreshToken',
  3132. value: function refreshToken() {
  3133. var _this3 = this;
  3134. var config = this.storage.json();
  3135. var token = this.storage.getToken();
  3136. return Auth._requestNewToken({ token: token.name }, config).then(function (token) {
  3137. _this3.storage.saveToken(token);
  3138. });
  3139. }
  3140. }, {
  3141. key: 'register',
  3142. value: function register(user, baseURL) {
  3143. var config = this.storage.json();
  3144. if (baseURL) {
  3145. config.baseURL = baseURL;
  3146. }
  3147. return _axios2.default.post('/api/auth/register/', user, config).then(function (response) {
  3148. return response.data;
  3149. });
  3150. }
  3151. }, {
  3152. key: 'resetPassword',
  3153. value: function resetPassword(email, baseURL) {
  3154. var config = this.storage.json();
  3155. if (baseURL) {
  3156. config.baseURL = baseURL;
  3157. }
  3158. return _axios2.default.post('/api/auth/password/reset/', email, config);
  3159. }
  3160. }, {
  3161. key: 'confirmResetPassword',
  3162. value: function confirmResetPassword(password, baseURL) {
  3163. var config = this.storage.json();
  3164. if (baseURL) {
  3165. config.baseURL = baseURL;
  3166. }
  3167. return _axios2.default.post('/api/auth/password/reset/confirm/', password, config);
  3168. }
  3169. }], [{
  3170. key: '_requestToken',
  3171. value: function _requestToken(user) {
  3172. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3173. return _axios2.default.post('/api/tokens/auth/', user, config).then(function (response) {
  3174. return response.data.token;
  3175. });
  3176. }
  3177. }, {
  3178. key: '_requestNewToken',
  3179. value: function _requestNewToken(token) {
  3180. var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3181. return _axios2.default.post('/api/tokens/refresh/', token, config).then(function (response) {
  3182. return response.data.token;
  3183. });
  3184. }
  3185. }]);
  3186. return Auth;
  3187. }();
  3188. exports.default = Auth;
  3189. /***/ },
  3190. /* 23 */
  3191. /***/ function(module, exports, __webpack_require__) {
  3192. module.exports = { "default": __webpack_require__(123), __esModule: true };
  3193. /***/ },
  3194. /* 24 */
  3195. /***/ function(module, exports) {
  3196. var toString = {}.toString;
  3197. module.exports = function(it){
  3198. return toString.call(it).slice(8, -1);
  3199. };
  3200. /***/ },
  3201. /* 25 */
  3202. /***/ function(module, exports, __webpack_require__) {
  3203. // optional / simple context binding
  3204. var aFunction = __webpack_require__(36);
  3205. module.exports = function(fn, that, length){
  3206. aFunction(fn);
  3207. if(that === undefined)return fn;
  3208. switch(length){
  3209. case 1: return function(a){
  3210. return fn.call(that, a);
  3211. };
  3212. case 2: return function(a, b){
  3213. return fn.call(that, a, b);
  3214. };
  3215. case 3: return function(a, b, c){
  3216. return fn.call(that, a, b, c);
  3217. };
  3218. }
  3219. return function(/* ...args */){
  3220. return fn.apply(that, arguments);
  3221. };
  3222. };
  3223. /***/ },
  3224. /* 26 */
  3225. /***/ function(module, exports, __webpack_require__) {
  3226. var global = __webpack_require__(4)
  3227. , core = __webpack_require__(6)
  3228. , ctx = __webpack_require__(25)
  3229. , hide = __webpack_require__(12)
  3230. , PROTOTYPE = 'prototype';
  3231. var $export = function(type, name, source){
  3232. var IS_FORCED = type & $export.F
  3233. , IS_GLOBAL = type & $export.G
  3234. , IS_STATIC = type & $export.S
  3235. , IS_PROTO = type & $export.P
  3236. , IS_BIND = type & $export.B
  3237. , IS_WRAP = type & $export.W
  3238. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  3239. , expProto = exports[PROTOTYPE]
  3240. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
  3241. , key, own, out;
  3242. if(IS_GLOBAL)source = name;
  3243. for(key in source){
  3244. // contains in native
  3245. own = !IS_FORCED && target && target[key] !== undefined;
  3246. if(own && key in exports)continue;
  3247. // export native or passed
  3248. out = own ? target[key] : source[key];
  3249. // prevent global pollution for namespaces
  3250. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  3251. // bind timers to global for call from export context
  3252. : IS_BIND && own ? ctx(out, global)
  3253. // wrap global constructors for prevent change them in library
  3254. : IS_WRAP && target[key] == out ? (function(C){
  3255. var F = function(a, b, c){
  3256. if(this instanceof C){
  3257. switch(arguments.length){
  3258. case 0: return new C;
  3259. case 1: return new C(a);
  3260. case 2: return new C(a, b);
  3261. } return new C(a, b, c);
  3262. } return C.apply(this, arguments);
  3263. };
  3264. F[PROTOTYPE] = C[PROTOTYPE];
  3265. return F;
  3266. // make static versions for prototype methods
  3267. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  3268. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  3269. if(IS_PROTO){
  3270. (exports.virtual || (exports.virtual = {}))[key] = out;
  3271. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  3272. if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
  3273. }
  3274. }
  3275. };
  3276. // type bitmap
  3277. $export.F = 1; // forced
  3278. $export.G = 2; // global
  3279. $export.S = 4; // static
  3280. $export.P = 8; // proto
  3281. $export.B = 16; // bind
  3282. $export.W = 32; // wrap
  3283. $export.U = 64; // safe
  3284. $export.R = 128; // real proto method for `library`
  3285. module.exports = $export;
  3286. /***/ },
  3287. /* 27 */
  3288. /***/ function(module, exports) {
  3289. var hasOwnProperty = {}.hasOwnProperty;
  3290. module.exports = function(it, key){
  3291. return hasOwnProperty.call(it, key);
  3292. };
  3293. /***/ },
  3294. /* 28 */
  3295. /***/ function(module, exports) {
  3296. module.exports = function(it){
  3297. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3298. };
  3299. /***/ },
  3300. /* 29 */
  3301. /***/ function(module, exports) {
  3302. /*
  3303. MIT License http://www.opensource.org/licenses/mit-license.php
  3304. Author Tobias Koppers @sokra
  3305. */
  3306. // css base code, injected by the css-loader
  3307. module.exports = function() {
  3308. var list = [];
  3309. // return the list of modules as css string
  3310. list.toString = function toString() {
  3311. var result = [];
  3312. for(var i = 0; i < this.length; i++) {
  3313. var item = this[i];
  3314. if(item[2]) {
  3315. result.push("@media " + item[2] + "{" + item[1] + "}");
  3316. } else {
  3317. result.push(item[1]);
  3318. }
  3319. }
  3320. return result.join("");
  3321. };
  3322. // import a list of modules into the list
  3323. list.i = function(modules, mediaQuery) {
  3324. if(typeof modules === "string")
  3325. modules = [[null, modules, ""]];
  3326. var alreadyImportedModules = {};
  3327. for(var i = 0; i < this.length; i++) {
  3328. var id = this[i][0];
  3329. if(typeof id === "number")
  3330. alreadyImportedModules[id] = true;
  3331. }
  3332. for(i = 0; i < modules.length; i++) {
  3333. var item = modules[i];
  3334. // skip already imported module
  3335. // this implementation is not 100% perfect for weird media query combinations
  3336. // when a module is imported multiple times with different media queries.
  3337. // I hope this will never occur (Hey this way we have smaller bundles)
  3338. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  3339. if(mediaQuery && !item[2]) {
  3340. item[2] = mediaQuery;
  3341. } else if(mediaQuery) {
  3342. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  3343. }
  3344. list.push(item);
  3345. }
  3346. }
  3347. };
  3348. return list;
  3349. };
  3350. /***/ },
  3351. /* 30 */
  3352. /***/ function(module, exports) {
  3353. // Copyright Joyent, Inc. and other Node contributors.
  3354. //
  3355. // Permission is hereby granted, free of charge, to any person obtaining a
  3356. // copy of this software and associated documentation files (the
  3357. // "Software"), to deal in the Software without restriction, including
  3358. // without limitation the rights to use, copy, modify, merge, publish,
  3359. // distribute, sublicense, and/or sell copies of the Software, and to permit
  3360. // persons to whom the Software is furnished to do so, subject to the
  3361. // following conditions:
  3362. //
  3363. // The above copyright notice and this permission notice shall be included
  3364. // in all copies or substantial portions of the Software.
  3365. //
  3366. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  3367. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  3368. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  3369. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  3370. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  3371. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  3372. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  3373. function EventEmitter() {
  3374. this._events = this._events || {};
  3375. this._maxListeners = this._maxListeners || undefined;
  3376. }
  3377. module.exports = EventEmitter;
  3378. // Backwards-compat with node 0.10.x
  3379. EventEmitter.EventEmitter = EventEmitter;
  3380. EventEmitter.prototype._events = undefined;
  3381. EventEmitter.prototype._maxListeners = undefined;
  3382. // By default EventEmitters will print a warning if more than 10 listeners are
  3383. // added to it. This is a useful default which helps finding memory leaks.
  3384. EventEmitter.defaultMaxListeners = 10;
  3385. // Obviously not all Emitters should be limited to 10. This function allows
  3386. // that to be increased. Set to zero for unlimited.
  3387. EventEmitter.prototype.setMaxListeners = function(n) {
  3388. if (!isNumber(n) || n < 0 || isNaN(n))
  3389. throw TypeError('n must be a positive number');
  3390. this._maxListeners = n;
  3391. return this;
  3392. };
  3393. EventEmitter.prototype.emit = function(type) {
  3394. var er, handler, len, args, i, listeners;
  3395. if (!this._events)
  3396. this._events = {};
  3397. // If there is no 'error' event listener then throw.
  3398. if (type === 'error') {
  3399. if (!this._events.error ||
  3400. (isObject(this._events.error) && !this._events.error.length)) {
  3401. er = arguments[1];
  3402. if (er instanceof Error) {
  3403. throw er; // Unhandled 'error' event
  3404. } else {
  3405. // At least give some kind of context to the user
  3406. var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
  3407. err.context = er;
  3408. throw err;
  3409. }
  3410. }
  3411. }
  3412. handler = this._events[type];
  3413. if (isUndefined(handler))
  3414. return false;
  3415. if (isFunction(handler)) {
  3416. switch (arguments.length) {
  3417. // fast cases
  3418. case 1:
  3419. handler.call(this);
  3420. break;
  3421. case 2:
  3422. handler.call(this, arguments[1]);
  3423. break;
  3424. case 3:
  3425. handler.call(this, arguments[1], arguments[2]);
  3426. break;
  3427. // slower
  3428. default:
  3429. args = Array.prototype.slice.call(arguments, 1);
  3430. handler.apply(this, args);
  3431. }
  3432. } else if (isObject(handler)) {
  3433. args = Array.prototype.slice.call(arguments, 1);
  3434. listeners = handler.slice();
  3435. len = listeners.length;
  3436. for (i = 0; i < len; i++)
  3437. listeners[i].apply(this, args);
  3438. }
  3439. return true;
  3440. };
  3441. EventEmitter.prototype.addListener = function(type, listener) {
  3442. var m;
  3443. if (!isFunction(listener))
  3444. throw TypeError('listener must be a function');
  3445. if (!this._events)
  3446. this._events = {};
  3447. // To avoid recursion in the case that type === "newListener"! Before
  3448. // adding it to the listeners, first emit "newListener".
  3449. if (this._events.newListener)
  3450. this.emit('newListener', type,
  3451. isFunction(listener.listener) ?
  3452. listener.listener : listener);
  3453. if (!this._events[type])
  3454. // Optimize the case of one listener. Don't need the extra array object.
  3455. this._events[type] = listener;
  3456. else if (isObject(this._events[type]))
  3457. // If we've already got an array, just append.
  3458. this._events[type].push(listener);
  3459. else
  3460. // Adding the second element, need to change to array.
  3461. this._events[type] = [this._events[type], listener];
  3462. // Check for listener leak
  3463. if (isObject(this._events[type]) && !this._events[type].warned) {
  3464. if (!isUndefined(this._maxListeners)) {
  3465. m = this._maxListeners;
  3466. } else {
  3467. m = EventEmitter.defaultMaxListeners;
  3468. }
  3469. if (m && m > 0 && this._events[type].length > m) {
  3470. this._events[type].warned = true;
  3471. console.error('(node) warning: possible EventEmitter memory ' +
  3472. 'leak detected. %d listeners added. ' +
  3473. 'Use emitter.setMaxListeners() to increase limit.',
  3474. this._events[type].length);
  3475. if (typeof console.trace === 'function') {
  3476. // not supported in IE 10
  3477. console.trace();
  3478. }
  3479. }
  3480. }
  3481. return this;
  3482. };
  3483. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  3484. EventEmitter.prototype.once = function(type, listener) {
  3485. if (!isFunction(listener))
  3486. throw TypeError('listener must be a function');
  3487. var fired = false;
  3488. function g() {
  3489. this.removeListener(type, g);
  3490. if (!fired) {
  3491. fired = true;
  3492. listener.apply(this, arguments);
  3493. }
  3494. }
  3495. g.listener = listener;
  3496. this.on(type, g);
  3497. return this;
  3498. };
  3499. // emits a 'removeListener' event iff the listener was removed
  3500. EventEmitter.prototype.removeListener = function(type, listener) {
  3501. var list, position, length, i;
  3502. if (!isFunction(listener))
  3503. throw TypeError('listener must be a function');
  3504. if (!this._events || !this._events[type])
  3505. return this;
  3506. list = this._events[type];
  3507. length = list.length;
  3508. position = -1;
  3509. if (list === listener ||
  3510. (isFunction(list.listener) && list.listener === listener)) {
  3511. delete this._events[type];
  3512. if (this._events.removeListener)
  3513. this.emit('removeListener', type, listener);
  3514. } else if (isObject(list)) {
  3515. for (i = length; i-- > 0;) {
  3516. if (list[i] === listener ||
  3517. (list[i].listener && list[i].listener === listener)) {
  3518. position = i;
  3519. break;
  3520. }
  3521. }
  3522. if (position < 0)
  3523. return this;
  3524. if (list.length === 1) {
  3525. list.length = 0;
  3526. delete this._events[type];
  3527. } else {
  3528. list.splice(position, 1);
  3529. }
  3530. if (this._events.removeListener)
  3531. this.emit('removeListener', type, listener);
  3532. }
  3533. return this;
  3534. };
  3535. EventEmitter.prototype.removeAllListeners = function(type) {
  3536. var key, listeners;
  3537. if (!this._events)
  3538. return this;
  3539. // not listening for removeListener, no need to emit
  3540. if (!this._events.removeListener) {
  3541. if (arguments.length === 0)
  3542. this._events = {};
  3543. else if (this._events[type])
  3544. delete this._events[type];
  3545. return this;
  3546. }
  3547. // emit removeListener for all listeners on all events
  3548. if (arguments.length === 0) {
  3549. for (key in this._events) {
  3550. if (key === 'removeListener') continue;
  3551. this.removeAllListeners(key);
  3552. }
  3553. this.removeAllListeners('removeListener');
  3554. this._events = {};
  3555. return this;
  3556. }
  3557. listeners = this._events[type];
  3558. if (isFunction(listeners)) {
  3559. this.removeListener(type, listeners);
  3560. } else if (listeners) {
  3561. // LIFO order
  3562. while (listeners.length)
  3563. this.removeListener(type, listeners[listeners.length - 1]);
  3564. }
  3565. delete this._events[type];
  3566. return this;
  3567. };
  3568. EventEmitter.prototype.listeners = function(type) {
  3569. var ret;
  3570. if (!this._events || !this._events[type])
  3571. ret = [];
  3572. else if (isFunction(this._events[type]))
  3573. ret = [this._events[type]];
  3574. else
  3575. ret = this._events[type].slice();
  3576. return ret;
  3577. };
  3578. EventEmitter.prototype.listenerCount = function(type) {
  3579. if (this._events) {
  3580. var evlistener = this._events[type];
  3581. if (isFunction(evlistener))
  3582. return 1;
  3583. else if (evlistener)
  3584. return evlistener.length;
  3585. }
  3586. return 0;
  3587. };
  3588. EventEmitter.listenerCount = function(emitter, type) {
  3589. return emitter.listenerCount(type);
  3590. };
  3591. function isFunction(arg) {
  3592. return typeof arg === 'function';
  3593. }
  3594. function isNumber(arg) {
  3595. return typeof arg === 'number';
  3596. }
  3597. function isObject(arg) {
  3598. return typeof arg === 'object' && arg !== null;
  3599. }
  3600. function isUndefined(arg) {
  3601. return arg === void 0;
  3602. }
  3603. /***/ },
  3604. /* 31 */
  3605. /***/ function(module, exports, __webpack_require__) {
  3606. /* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {var nextTick = __webpack_require__(5).nextTick;
  3607. var apply = Function.prototype.apply;
  3608. var slice = Array.prototype.slice;
  3609. var immediateIds = {};
  3610. var nextImmediateId = 0;
  3611. // DOM APIs, for completeness
  3612. exports.setTimeout = function() {
  3613. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  3614. };
  3615. exports.setInterval = function() {
  3616. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  3617. };
  3618. exports.clearTimeout =
  3619. exports.clearInterval = function(timeout) { timeout.close(); };
  3620. function Timeout(id, clearFn) {
  3621. this._id = id;
  3622. this._clearFn = clearFn;
  3623. }
  3624. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  3625. Timeout.prototype.close = function() {
  3626. this._clearFn.call(window, this._id);
  3627. };
  3628. // Does not start the time, just sets up the members needed.
  3629. exports.enroll = function(item, msecs) {
  3630. clearTimeout(item._idleTimeoutId);
  3631. item._idleTimeout = msecs;
  3632. };
  3633. exports.unenroll = function(item) {
  3634. clearTimeout(item._idleTimeoutId);
  3635. item._idleTimeout = -1;
  3636. };
  3637. exports._unrefActive = exports.active = function(item) {
  3638. clearTimeout(item._idleTimeoutId);
  3639. var msecs = item._idleTimeout;
  3640. if (msecs >= 0) {
  3641. item._idleTimeoutId = setTimeout(function onTimeout() {
  3642. if (item._onTimeout)
  3643. item._onTimeout();
  3644. }, msecs);
  3645. }
  3646. };
  3647. // That's not how node.js implements it but the exposed api is the same.
  3648. exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
  3649. var id = nextImmediateId++;
  3650. var args = arguments.length < 2 ? false : slice.call(arguments, 1);
  3651. immediateIds[id] = true;
  3652. nextTick(function onNextTick() {
  3653. if (immediateIds[id]) {
  3654. // fn.call() is faster so we optimize for the common use-case
  3655. // @see http://jsperf.com/call-apply-segu
  3656. if (args) {
  3657. fn.apply(null, args);
  3658. } else {
  3659. fn.call(null);
  3660. }
  3661. // Prevent ids from leaking
  3662. exports.clearImmediate(id);
  3663. }
  3664. });
  3665. return id;
  3666. };
  3667. exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
  3668. delete immediateIds[id];
  3669. };
  3670. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31).setImmediate, __webpack_require__(31).clearImmediate))
  3671. /***/ },
  3672. /* 32 */
  3673. /***/ function(module, exports) {
  3674. /*
  3675. MIT License http://www.opensource.org/licenses/mit-license.php
  3676. Author Tobias Koppers @sokra
  3677. */
  3678. var stylesInDom = {},
  3679. memoize = function(fn) {
  3680. var memo;
  3681. return function () {
  3682. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  3683. return memo;
  3684. };
  3685. },
  3686. isOldIE = memoize(function() {
  3687. return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
  3688. }),
  3689. getHeadElement = memoize(function () {
  3690. return document.head || document.getElementsByTagName("head")[0];
  3691. }),
  3692. singletonElement = null,
  3693. singletonCounter = 0,
  3694. styleElementsInsertedAtTop = [];
  3695. module.exports = function(list, options) {
  3696. if(typeof DEBUG !== "undefined" && DEBUG) {
  3697. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  3698. }
  3699. options = options || {};
  3700. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  3701. // tags it will allow on a page
  3702. if (typeof options.singleton === "undefined") options.singleton = isOldIE();
  3703. // By default, add <style> tags to the bottom of <head>.
  3704. if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
  3705. var styles = listToStyles(list);
  3706. addStylesToDom(styles, options);
  3707. return function update(newList) {
  3708. var mayRemove = [];
  3709. for(var i = 0; i < styles.length; i++) {
  3710. var item = styles[i];
  3711. var domStyle = stylesInDom[item.id];
  3712. domStyle.refs--;
  3713. mayRemove.push(domStyle);
  3714. }
  3715. if(newList) {
  3716. var newStyles = listToStyles(newList);
  3717. addStylesToDom(newStyles, options);
  3718. }
  3719. for(var i = 0; i < mayRemove.length; i++) {
  3720. var domStyle = mayRemove[i];
  3721. if(domStyle.refs === 0) {
  3722. for(var j = 0; j < domStyle.parts.length; j++)
  3723. domStyle.parts[j]();
  3724. delete stylesInDom[domStyle.id];
  3725. }
  3726. }
  3727. };
  3728. }
  3729. function addStylesToDom(styles, options) {
  3730. for(var i = 0; i < styles.length; i++) {
  3731. var item = styles[i];
  3732. var domStyle = stylesInDom[item.id];
  3733. if(domStyle) {
  3734. domStyle.refs++;
  3735. for(var j = 0; j < domStyle.parts.length; j++) {
  3736. domStyle.parts[j](item.parts[j]);
  3737. }
  3738. for(; j < item.parts.length; j++) {
  3739. domStyle.parts.push(addStyle(item.parts[j], options));
  3740. }
  3741. } else {
  3742. var parts = [];
  3743. for(var j = 0; j < item.parts.length; j++) {
  3744. parts.push(addStyle(item.parts[j], options));
  3745. }
  3746. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  3747. }
  3748. }
  3749. }
  3750. function listToStyles(list) {
  3751. var styles = [];
  3752. var newStyles = {};
  3753. for(var i = 0; i < list.length; i++) {
  3754. var item = list[i];
  3755. var id = item[0];
  3756. var css = item[1];
  3757. var media = item[2];
  3758. var sourceMap = item[3];
  3759. var part = {css: css, media: media, sourceMap: sourceMap};
  3760. if(!newStyles[id])
  3761. styles.push(newStyles[id] = {id: id, parts: [part]});
  3762. else
  3763. newStyles[id].parts.push(part);
  3764. }
  3765. return styles;
  3766. }
  3767. function insertStyleElement(options, styleElement) {
  3768. var head = getHeadElement();
  3769. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  3770. if (options.insertAt === "top") {
  3771. if(!lastStyleElementInsertedAtTop) {
  3772. head.insertBefore(styleElement, head.firstChild);
  3773. } else if(lastStyleElementInsertedAtTop.nextSibling) {
  3774. head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
  3775. } else {
  3776. head.appendChild(styleElement);
  3777. }
  3778. styleElementsInsertedAtTop.push(styleElement);
  3779. } else if (options.insertAt === "bottom") {
  3780. head.appendChild(styleElement);
  3781. } else {
  3782. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  3783. }
  3784. }
  3785. function removeStyleElement(styleElement) {
  3786. styleElement.parentNode.removeChild(styleElement);
  3787. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  3788. if(idx >= 0) {
  3789. styleElementsInsertedAtTop.splice(idx, 1);
  3790. }
  3791. }
  3792. function createStyleElement(options) {
  3793. var styleElement = document.createElement("style");
  3794. styleElement.type = "text/css";
  3795. insertStyleElement(options, styleElement);
  3796. return styleElement;
  3797. }
  3798. function addStyle(obj, options) {
  3799. var styleElement, update, remove;
  3800. if (options.singleton) {
  3801. var styleIndex = singletonCounter++;
  3802. styleElement = singletonElement || (singletonElement = createStyleElement(options));
  3803. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
  3804. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
  3805. } else {
  3806. styleElement = createStyleElement(options);
  3807. update = applyToTag.bind(null, styleElement);
  3808. remove = function() {
  3809. removeStyleElement(styleElement);
  3810. };
  3811. }
  3812. update(obj);
  3813. return function updateStyle(newObj) {
  3814. if(newObj) {
  3815. if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
  3816. return;
  3817. update(obj = newObj);
  3818. } else {
  3819. remove();
  3820. }
  3821. };
  3822. }
  3823. var replaceText = (function () {
  3824. var textStore = [];
  3825. return function (index, replacement) {
  3826. textStore[index] = replacement;
  3827. return textStore.filter(Boolean).join('\n');
  3828. };
  3829. })();
  3830. function applyToSingletonTag(styleElement, index, remove, obj) {
  3831. var css = remove ? "" : obj.css;
  3832. if (styleElement.styleSheet) {
  3833. styleElement.styleSheet.cssText = replaceText(index, css);
  3834. } else {
  3835. var cssNode = document.createTextNode(css);
  3836. var childNodes = styleElement.childNodes;
  3837. if (childNodes[index]) styleElement.removeChild(childNodes[index]);
  3838. if (childNodes.length) {
  3839. styleElement.insertBefore(cssNode, childNodes[index]);
  3840. } else {
  3841. styleElement.appendChild(cssNode);
  3842. }
  3843. }
  3844. }
  3845. function applyToTag(styleElement, obj) {
  3846. var css = obj.css;
  3847. var media = obj.media;
  3848. var sourceMap = obj.sourceMap;
  3849. if (media) {
  3850. styleElement.setAttribute("media", media);
  3851. }
  3852. if (sourceMap) {
  3853. // https://developer.chrome.com/devtools/docs/javascript-debugging
  3854. // this makes source maps inside style tags work properly in Chrome
  3855. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */';
  3856. // http://stackoverflow.com/a/26603875
  3857. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  3858. }
  3859. if (styleElement.styleSheet) {
  3860. styleElement.styleSheet.cssText = css;
  3861. } else {
  3862. while(styleElement.firstChild) {
  3863. styleElement.removeChild(styleElement.firstChild);
  3864. }
  3865. styleElement.appendChild(document.createTextNode(css));
  3866. }
  3867. }
  3868. /***/ },
  3869. /* 33 */
  3870. /***/ function(module, exports, __webpack_require__) {
  3871. "use strict";
  3872. /* WEBPACK VAR INJECTION */(function(global, process) {/*!
  3873. * Vue.js v2.1.3
  3874. * (c) 2014-2016 Evan You
  3875. * Released under the MIT License.
  3876. */
  3877. 'use strict';
  3878. /* */
  3879. /**
  3880. * Convert a value to a string that is actually rendered.
  3881. */
  3882. function _toString (val) {
  3883. return val == null
  3884. ? ''
  3885. : typeof val === 'object'
  3886. ? JSON.stringify(val, null, 2)
  3887. : String(val)
  3888. }
  3889. /**
  3890. * Convert a input value to a number for persistence.
  3891. * If the conversion fails, return original string.
  3892. */
  3893. function toNumber (val) {
  3894. var n = parseFloat(val, 10);
  3895. return (n || n === 0) ? n : val
  3896. }
  3897. /**
  3898. * Make a map and return a function for checking if a key
  3899. * is in that map.
  3900. */
  3901. function makeMap (
  3902. str,
  3903. expectsLowerCase
  3904. ) {
  3905. var map = Object.create(null);
  3906. var list = str.split(',');
  3907. for (var i = 0; i < list.length; i++) {
  3908. map[list[i]] = true;
  3909. }
  3910. return expectsLowerCase
  3911. ? function (val) { return map[val.toLowerCase()]; }
  3912. : function (val) { return map[val]; }
  3913. }
  3914. /**
  3915. * Check if a tag is a built-in tag.
  3916. */
  3917. var isBuiltInTag = makeMap('slot,component', true);
  3918. /**
  3919. * Remove an item from an array
  3920. */
  3921. function remove$1 (arr, item) {
  3922. if (arr.length) {
  3923. var index = arr.indexOf(item);
  3924. if (index > -1) {
  3925. return arr.splice(index, 1)
  3926. }
  3927. }
  3928. }
  3929. /**
  3930. * Check whether the object has the property.
  3931. */
  3932. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3933. function hasOwn (obj, key) {
  3934. return hasOwnProperty.call(obj, key)
  3935. }
  3936. /**
  3937. * Check if value is primitive
  3938. */
  3939. function isPrimitive (value) {
  3940. return typeof value === 'string' || typeof value === 'number'
  3941. }
  3942. /**
  3943. * Create a cached version of a pure function.
  3944. */
  3945. function cached (fn) {
  3946. var cache = Object.create(null);
  3947. return function cachedFn (str) {
  3948. var hit = cache[str];
  3949. return hit || (cache[str] = fn(str))
  3950. }
  3951. }
  3952. /**
  3953. * Camelize a hyphen-delmited string.
  3954. */
  3955. var camelizeRE = /-(\w)/g;
  3956. var camelize = cached(function (str) {
  3957. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3958. });
  3959. /**
  3960. * Capitalize a string.
  3961. */
  3962. var capitalize = cached(function (str) {
  3963. return str.charAt(0).toUpperCase() + str.slice(1)
  3964. });
  3965. /**
  3966. * Hyphenate a camelCase string.
  3967. */
  3968. var hyphenateRE = /([^-])([A-Z])/g;
  3969. var hyphenate = cached(function (str) {
  3970. return str
  3971. .replace(hyphenateRE, '$1-$2')
  3972. .replace(hyphenateRE, '$1-$2')
  3973. .toLowerCase()
  3974. });
  3975. /**
  3976. * Simple bind, faster than native
  3977. */
  3978. function bind$1 (fn, ctx) {
  3979. function boundFn (a) {
  3980. var l = arguments.length;
  3981. return l
  3982. ? l > 1
  3983. ? fn.apply(ctx, arguments)
  3984. : fn.call(ctx, a)
  3985. : fn.call(ctx)
  3986. }
  3987. // record original fn length
  3988. boundFn._length = fn.length;
  3989. return boundFn
  3990. }
  3991. /**
  3992. * Convert an Array-like object to a real Array.
  3993. */
  3994. function toArray (list, start) {
  3995. start = start || 0;
  3996. var i = list.length - start;
  3997. var ret = new Array(i);
  3998. while (i--) {
  3999. ret[i] = list[i + start];
  4000. }
  4001. return ret
  4002. }
  4003. /**
  4004. * Mix properties into target object.
  4005. */
  4006. function extend (to, _from) {
  4007. for (var key in _from) {
  4008. to[key] = _from[key];
  4009. }
  4010. return to
  4011. }
  4012. /**
  4013. * Quick object check - this is primarily used to tell
  4014. * Objects from primitive values when we know the value
  4015. * is a JSON-compliant type.
  4016. */
  4017. function isObject (obj) {
  4018. return obj !== null && typeof obj === 'object'
  4019. }
  4020. /**
  4021. * Strict object type check. Only returns true
  4022. * for plain JavaScript objects.
  4023. */
  4024. var toString = Object.prototype.toString;
  4025. var OBJECT_STRING = '[object Object]';
  4026. function isPlainObject (obj) {
  4027. return toString.call(obj) === OBJECT_STRING
  4028. }
  4029. /**
  4030. * Merge an Array of Objects into a single Object.
  4031. */
  4032. function toObject (arr) {
  4033. var res = {};
  4034. for (var i = 0; i < arr.length; i++) {
  4035. if (arr[i]) {
  4036. extend(res, arr[i]);
  4037. }
  4038. }
  4039. return res
  4040. }
  4041. /**
  4042. * Perform no operation.
  4043. */
  4044. function noop () {}
  4045. /**
  4046. * Always return false.
  4047. */
  4048. var no = function () { return false; };
  4049. /**
  4050. * Generate a static keys string from compiler modules.
  4051. */
  4052. function genStaticKeys (modules) {
  4053. return modules.reduce(function (keys, m) {
  4054. return keys.concat(m.staticKeys || [])
  4055. }, []).join(',')
  4056. }
  4057. /**
  4058. * Check if two values are loosely equal - that is,
  4059. * if they are plain objects, do they have the same shape?
  4060. */
  4061. function looseEqual (a, b) {
  4062. /* eslint-disable eqeqeq */
  4063. return a == b || (
  4064. isObject(a) && isObject(b)
  4065. ? JSON.stringify(a) === JSON.stringify(b)
  4066. : false
  4067. )
  4068. /* eslint-enable eqeqeq */
  4069. }
  4070. function looseIndexOf (arr, val) {
  4071. for (var i = 0; i < arr.length; i++) {
  4072. if (looseEqual(arr[i], val)) { return i }
  4073. }
  4074. return -1
  4075. }
  4076. /* */
  4077. /**
  4078. * Check if a string starts with $ or _
  4079. */
  4080. function isReserved (str) {
  4081. var c = (str + '').charCodeAt(0);
  4082. return c === 0x24 || c === 0x5F
  4083. }
  4084. /**
  4085. * Define a property.
  4086. */
  4087. function def (obj, key, val, enumerable) {
  4088. Object.defineProperty(obj, key, {
  4089. value: val,
  4090. enumerable: !!enumerable,
  4091. writable: true,
  4092. configurable: true
  4093. });
  4094. }
  4095. /**
  4096. * Parse simple path.
  4097. */
  4098. var bailRE = /[^\w.$]/;
  4099. function parsePath (path) {
  4100. if (bailRE.test(path)) {
  4101. return
  4102. } else {
  4103. var segments = path.split('.');
  4104. return function (obj) {
  4105. for (var i = 0; i < segments.length; i++) {
  4106. if (!obj) { return }
  4107. obj = obj[segments[i]];
  4108. }
  4109. return obj
  4110. }
  4111. }
  4112. }
  4113. /* */
  4114. /* globals MutationObserver */
  4115. // can we use __proto__?
  4116. var hasProto = '__proto__' in {};
  4117. // Browser environment sniffing
  4118. var inBrowser =
  4119. typeof window !== 'undefined' &&
  4120. Object.prototype.toString.call(window) !== '[object Object]';
  4121. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4122. var isIE = UA && /msie|trident/.test(UA);
  4123. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4124. var isEdge = UA && UA.indexOf('edge/') > 0;
  4125. var isAndroid = UA && UA.indexOf('android') > 0;
  4126. var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
  4127. // this needs to be lazy-evaled because vue may be required before
  4128. // vue-server-renderer can set VUE_ENV
  4129. var _isServer;
  4130. var isServerRendering = function () {
  4131. if (_isServer === undefined) {
  4132. /* istanbul ignore if */
  4133. if (!inBrowser && typeof global !== 'undefined') {
  4134. // detect presence of vue-server-renderer and avoid
  4135. // Webpack shimming the process
  4136. _isServer = global['process'].env.VUE_ENV === 'server';
  4137. } else {
  4138. _isServer = false;
  4139. }
  4140. }
  4141. return _isServer
  4142. };
  4143. // detect devtools
  4144. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4145. /* istanbul ignore next */
  4146. function isNative (Ctor) {
  4147. return /native code/.test(Ctor.toString())
  4148. }
  4149. /**
  4150. * Defer a task to execute it asynchronously.
  4151. */
  4152. var nextTick = (function () {
  4153. var callbacks = [];
  4154. var pending = false;
  4155. var timerFunc;
  4156. function nextTickHandler () {
  4157. pending = false;
  4158. var copies = callbacks.slice(0);
  4159. callbacks.length = 0;
  4160. for (var i = 0; i < copies.length; i++) {
  4161. copies[i]();
  4162. }
  4163. }
  4164. // the nextTick behavior leverages the microtask queue, which can be accessed
  4165. // via either native Promise.then or MutationObserver.
  4166. // MutationObserver has wider support, however it is seriously bugged in
  4167. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  4168. // completely stops working after triggering a few times... so, if native
  4169. // Promise is available, we will use it:
  4170. /* istanbul ignore if */
  4171. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  4172. var p = Promise.resolve();
  4173. timerFunc = function () {
  4174. p.then(nextTickHandler);
  4175. // in problematic UIWebViews, Promise.then doesn't completely break, but
  4176. // it can get stuck in a weird state where callbacks are pushed into the
  4177. // microtask queue but the queue isn't being flushed, until the browser
  4178. // needs to do some other work, e.g. handle a timer. Therefore we can
  4179. // "force" the microtask queue to be flushed by adding an empty timer.
  4180. if (isIOS) { setTimeout(noop); }
  4181. };
  4182. } else if (typeof MutationObserver !== 'undefined' && (
  4183. isNative(MutationObserver) ||
  4184. // PhantomJS and iOS 7.x
  4185. MutationObserver.toString() === '[object MutationObserverConstructor]'
  4186. )) {
  4187. // use MutationObserver where native Promise is not available,
  4188. // e.g. PhantomJS IE11, iOS7, Android 4.4
  4189. var counter = 1;
  4190. var observer = new MutationObserver(nextTickHandler);
  4191. var textNode = document.createTextNode(String(counter));
  4192. observer.observe(textNode, {
  4193. characterData: true
  4194. });
  4195. timerFunc = function () {
  4196. counter = (counter + 1) % 2;
  4197. textNode.data = String(counter);
  4198. };
  4199. } else {
  4200. // fallback to setTimeout
  4201. /* istanbul ignore next */
  4202. timerFunc = function () {
  4203. setTimeout(nextTickHandler, 0);
  4204. };
  4205. }
  4206. return function queueNextTick (cb, ctx) {
  4207. var _resolve;
  4208. callbacks.push(function () {
  4209. if (cb) { cb.call(ctx); }
  4210. if (_resolve) { _resolve(ctx); }
  4211. });
  4212. if (!pending) {
  4213. pending = true;
  4214. timerFunc();
  4215. }
  4216. if (!cb && typeof Promise !== 'undefined') {
  4217. return new Promise(function (resolve) {
  4218. _resolve = resolve;
  4219. })
  4220. }
  4221. }
  4222. })();
  4223. var _Set;
  4224. /* istanbul ignore if */
  4225. if (typeof Set !== 'undefined' && isNative(Set)) {
  4226. // use native Set when available.
  4227. _Set = Set;
  4228. } else {
  4229. // a non-standard Set polyfill that only works with primitive keys.
  4230. _Set = (function () {
  4231. function Set () {
  4232. this.set = Object.create(null);
  4233. }
  4234. Set.prototype.has = function has (key) {
  4235. return this.set[key] !== undefined
  4236. };
  4237. Set.prototype.add = function add (key) {
  4238. this.set[key] = 1;
  4239. };
  4240. Set.prototype.clear = function clear () {
  4241. this.set = Object.create(null);
  4242. };
  4243. return Set;
  4244. }());
  4245. }
  4246. /* */
  4247. var config = {
  4248. /**
  4249. * Option merge strategies (used in core/util/options)
  4250. */
  4251. optionMergeStrategies: Object.create(null),
  4252. /**
  4253. * Whether to suppress warnings.
  4254. */
  4255. silent: false,
  4256. /**
  4257. * Whether to enable devtools
  4258. */
  4259. devtools: process.env.NODE_ENV !== 'production',
  4260. /**
  4261. * Error handler for watcher errors
  4262. */
  4263. errorHandler: null,
  4264. /**
  4265. * Ignore certain custom elements
  4266. */
  4267. ignoredElements: null,
  4268. /**
  4269. * Custom user key aliases for v-on
  4270. */
  4271. keyCodes: Object.create(null),
  4272. /**
  4273. * Check if a tag is reserved so that it cannot be registered as a
  4274. * component. This is platform-dependent and may be overwritten.
  4275. */
  4276. isReservedTag: no,
  4277. /**
  4278. * Check if a tag is an unknown element.
  4279. * Platform-dependent.
  4280. */
  4281. isUnknownElement: no,
  4282. /**
  4283. * Get the namespace of an element
  4284. */
  4285. getTagNamespace: noop,
  4286. /**
  4287. * Check if an attribute must be bound using property, e.g. value
  4288. * Platform-dependent.
  4289. */
  4290. mustUseProp: no,
  4291. /**
  4292. * List of asset types that a component can own.
  4293. */
  4294. _assetTypes: [
  4295. 'component',
  4296. 'directive',
  4297. 'filter'
  4298. ],
  4299. /**
  4300. * List of lifecycle hooks.
  4301. */
  4302. _lifecycleHooks: [
  4303. 'beforeCreate',
  4304. 'created',
  4305. 'beforeMount',
  4306. 'mounted',
  4307. 'beforeUpdate',
  4308. 'updated',
  4309. 'beforeDestroy',
  4310. 'destroyed',
  4311. 'activated',
  4312. 'deactivated'
  4313. ],
  4314. /**
  4315. * Max circular updates allowed in a scheduler flush cycle.
  4316. */
  4317. _maxUpdateCount: 100
  4318. };
  4319. var warn = noop;
  4320. var formatComponentName;
  4321. if (process.env.NODE_ENV !== 'production') {
  4322. var hasConsole = typeof console !== 'undefined';
  4323. warn = function (msg, vm) {
  4324. if (hasConsole && (!config.silent)) {
  4325. console.error("[Vue warn]: " + msg + " " + (
  4326. vm ? formatLocation(formatComponentName(vm)) : ''
  4327. ));
  4328. }
  4329. };
  4330. formatComponentName = function (vm) {
  4331. if (vm.$root === vm) {
  4332. return 'root instance'
  4333. }
  4334. var name = vm._isVue
  4335. ? vm.$options.name || vm.$options._componentTag
  4336. : vm.name;
  4337. return (
  4338. (name ? ("component <" + name + ">") : "anonymous component") +
  4339. (vm._isVue && vm.$options.__file ? (" at " + (vm.$options.__file)) : '')
  4340. )
  4341. };
  4342. var formatLocation = function (str) {
  4343. if (str === 'anonymous component') {
  4344. str += " - use the \"name\" option for better debugging messages.";
  4345. }
  4346. return ("\n(found in " + str + ")")
  4347. };
  4348. }
  4349. /* */
  4350. var uid$1 = 0;
  4351. /**
  4352. * A dep is an observable that can have multiple
  4353. * directives subscribing to it.
  4354. */
  4355. var Dep = function Dep () {
  4356. this.id = uid$1++;
  4357. this.subs = [];
  4358. };
  4359. Dep.prototype.addSub = function addSub (sub) {
  4360. this.subs.push(sub);
  4361. };
  4362. Dep.prototype.removeSub = function removeSub (sub) {
  4363. remove$1(this.subs, sub);
  4364. };
  4365. Dep.prototype.depend = function depend () {
  4366. if (Dep.target) {
  4367. Dep.target.addDep(this);
  4368. }
  4369. };
  4370. Dep.prototype.notify = function notify () {
  4371. // stablize the subscriber list first
  4372. var subs = this.subs.slice();
  4373. for (var i = 0, l = subs.length; i < l; i++) {
  4374. subs[i].update();
  4375. }
  4376. };
  4377. // the current target watcher being evaluated.
  4378. // this is globally unique because there could be only one
  4379. // watcher being evaluated at any time.
  4380. Dep.target = null;
  4381. var targetStack = [];
  4382. function pushTarget (_target) {
  4383. if (Dep.target) { targetStack.push(Dep.target); }
  4384. Dep.target = _target;
  4385. }
  4386. function popTarget () {
  4387. Dep.target = targetStack.pop();
  4388. }
  4389. /*
  4390. * not type checking this file because flow doesn't play well with
  4391. * dynamically accessing methods on Array prototype
  4392. */
  4393. var arrayProto = Array.prototype;
  4394. var arrayMethods = Object.create(arrayProto);[
  4395. 'push',
  4396. 'pop',
  4397. 'shift',
  4398. 'unshift',
  4399. 'splice',
  4400. 'sort',
  4401. 'reverse'
  4402. ]
  4403. .forEach(function (method) {
  4404. // cache original method
  4405. var original = arrayProto[method];
  4406. def(arrayMethods, method, function mutator () {
  4407. var arguments$1 = arguments;
  4408. // avoid leaking arguments:
  4409. // http://jsperf.com/closure-with-arguments
  4410. var i = arguments.length;
  4411. var args = new Array(i);
  4412. while (i--) {
  4413. args[i] = arguments$1[i];
  4414. }
  4415. var result = original.apply(this, args);
  4416. var ob = this.__ob__;
  4417. var inserted;
  4418. switch (method) {
  4419. case 'push':
  4420. inserted = args;
  4421. break
  4422. case 'unshift':
  4423. inserted = args;
  4424. break
  4425. case 'splice':
  4426. inserted = args.slice(2);
  4427. break
  4428. }
  4429. if (inserted) { ob.observeArray(inserted); }
  4430. // notify change
  4431. ob.dep.notify();
  4432. return result
  4433. });
  4434. });
  4435. /* */
  4436. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4437. /**
  4438. * By default, when a reactive property is set, the new value is
  4439. * also converted to become reactive. However when passing down props,
  4440. * we don't want to force conversion because the value may be a nested value
  4441. * under a frozen data structure. Converting it would defeat the optimization.
  4442. */
  4443. var observerState = {
  4444. shouldConvert: true,
  4445. isSettingProps: false
  4446. };
  4447. /**
  4448. * Observer class that are attached to each observed
  4449. * object. Once attached, the observer converts target
  4450. * object's property keys into getter/setters that
  4451. * collect dependencies and dispatches updates.
  4452. */
  4453. var Observer = function Observer (value) {
  4454. this.value = value;
  4455. this.dep = new Dep();
  4456. this.vmCount = 0;
  4457. def(value, '__ob__', this);
  4458. if (Array.isArray(value)) {
  4459. var augment = hasProto
  4460. ? protoAugment
  4461. : copyAugment;
  4462. augment(value, arrayMethods, arrayKeys);
  4463. this.observeArray(value);
  4464. } else {
  4465. this.walk(value);
  4466. }
  4467. };
  4468. /**
  4469. * Walk through each property and convert them into
  4470. * getter/setters. This method should only be called when
  4471. * value type is Object.
  4472. */
  4473. Observer.prototype.walk = function walk (obj) {
  4474. var keys = Object.keys(obj);
  4475. for (var i = 0; i < keys.length; i++) {
  4476. defineReactive$$1(obj, keys[i], obj[keys[i]]);
  4477. }
  4478. };
  4479. /**
  4480. * Observe a list of Array items.
  4481. */
  4482. Observer.prototype.observeArray = function observeArray (items) {
  4483. for (var i = 0, l = items.length; i < l; i++) {
  4484. observe(items[i]);
  4485. }
  4486. };
  4487. // helpers
  4488. /**
  4489. * Augment an target Object or Array by intercepting
  4490. * the prototype chain using __proto__
  4491. */
  4492. function protoAugment (target, src) {
  4493. /* eslint-disable no-proto */
  4494. target.__proto__ = src;
  4495. /* eslint-enable no-proto */
  4496. }
  4497. /**
  4498. * Augment an target Object or Array by defining
  4499. * hidden properties.
  4500. *
  4501. * istanbul ignore next
  4502. */
  4503. function copyAugment (target, src, keys) {
  4504. for (var i = 0, l = keys.length; i < l; i++) {
  4505. var key = keys[i];
  4506. def(target, key, src[key]);
  4507. }
  4508. }
  4509. /**
  4510. * Attempt to create an observer instance for a value,
  4511. * returns the new observer if successfully observed,
  4512. * or the existing observer if the value already has one.
  4513. */
  4514. function observe (value) {
  4515. if (!isObject(value)) {
  4516. return
  4517. }
  4518. var ob;
  4519. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4520. ob = value.__ob__;
  4521. } else if (
  4522. observerState.shouldConvert &&
  4523. !isServerRendering() &&
  4524. (Array.isArray(value) || isPlainObject(value)) &&
  4525. Object.isExtensible(value) &&
  4526. !value._isVue
  4527. ) {
  4528. ob = new Observer(value);
  4529. }
  4530. return ob
  4531. }
  4532. /**
  4533. * Define a reactive property on an Object.
  4534. */
  4535. function defineReactive$$1 (
  4536. obj,
  4537. key,
  4538. val,
  4539. customSetter
  4540. ) {
  4541. var dep = new Dep();
  4542. var property = Object.getOwnPropertyDescriptor(obj, key);
  4543. if (property && property.configurable === false) {
  4544. return
  4545. }
  4546. // cater for pre-defined getter/setters
  4547. var getter = property && property.get;
  4548. var setter = property && property.set;
  4549. var childOb = observe(val);
  4550. Object.defineProperty(obj, key, {
  4551. enumerable: true,
  4552. configurable: true,
  4553. get: function reactiveGetter () {
  4554. var value = getter ? getter.call(obj) : val;
  4555. if (Dep.target) {
  4556. dep.depend();
  4557. if (childOb) {
  4558. childOb.dep.depend();
  4559. }
  4560. if (Array.isArray(value)) {
  4561. dependArray(value);
  4562. }
  4563. }
  4564. return value
  4565. },
  4566. set: function reactiveSetter (newVal) {
  4567. var value = getter ? getter.call(obj) : val;
  4568. /* eslint-disable no-self-compare */
  4569. if (newVal === value || (newVal !== newVal && value !== value)) {
  4570. return
  4571. }
  4572. /* eslint-enable no-self-compare */
  4573. if (process.env.NODE_ENV !== 'production' && customSetter) {
  4574. customSetter();
  4575. }
  4576. if (setter) {
  4577. setter.call(obj, newVal);
  4578. } else {
  4579. val = newVal;
  4580. }
  4581. childOb = observe(newVal);
  4582. dep.notify();
  4583. }
  4584. });
  4585. }
  4586. /**
  4587. * Set a property on an object. Adds the new property and
  4588. * triggers change notification if the property doesn't
  4589. * already exist.
  4590. */
  4591. function set (obj, key, val) {
  4592. if (Array.isArray(obj)) {
  4593. obj.length = Math.max(obj.length, key);
  4594. obj.splice(key, 1, val);
  4595. return val
  4596. }
  4597. if (hasOwn(obj, key)) {
  4598. obj[key] = val;
  4599. return
  4600. }
  4601. var ob = obj.__ob__;
  4602. if (obj._isVue || (ob && ob.vmCount)) {
  4603. process.env.NODE_ENV !== 'production' && warn(
  4604. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4605. 'at runtime - declare it upfront in the data option.'
  4606. );
  4607. return
  4608. }
  4609. if (!ob) {
  4610. obj[key] = val;
  4611. return
  4612. }
  4613. defineReactive$$1(ob.value, key, val);
  4614. ob.dep.notify();
  4615. return val
  4616. }
  4617. /**
  4618. * Delete a property and trigger change if necessary.
  4619. */
  4620. function del (obj, key) {
  4621. var ob = obj.__ob__;
  4622. if (obj._isVue || (ob && ob.vmCount)) {
  4623. process.env.NODE_ENV !== 'production' && warn(
  4624. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4625. '- just set it to null.'
  4626. );
  4627. return
  4628. }
  4629. if (!hasOwn(obj, key)) {
  4630. return
  4631. }
  4632. delete obj[key];
  4633. if (!ob) {
  4634. return
  4635. }
  4636. ob.dep.notify();
  4637. }
  4638. /**
  4639. * Collect dependencies on array elements when the array is touched, since
  4640. * we cannot intercept array element access like property getters.
  4641. */
  4642. function dependArray (value) {
  4643. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4644. e = value[i];
  4645. e && e.__ob__ && e.__ob__.dep.depend();
  4646. if (Array.isArray(e)) {
  4647. dependArray(e);
  4648. }
  4649. }
  4650. }
  4651. /* */
  4652. /**
  4653. * Option overwriting strategies are functions that handle
  4654. * how to merge a parent option value and a child option
  4655. * value into the final value.
  4656. */
  4657. var strats = config.optionMergeStrategies;
  4658. /**
  4659. * Options with restrictions
  4660. */
  4661. if (process.env.NODE_ENV !== 'production') {
  4662. strats.el = strats.propsData = function (parent, child, vm, key) {
  4663. if (!vm) {
  4664. warn(
  4665. "option \"" + key + "\" can only be used during instance " +
  4666. 'creation with the `new` keyword.'
  4667. );
  4668. }
  4669. return defaultStrat(parent, child)
  4670. };
  4671. }
  4672. /**
  4673. * Helper that recursively merges two data objects together.
  4674. */
  4675. function mergeData (to, from) {
  4676. if (!from) { return to }
  4677. var key, toVal, fromVal;
  4678. var keys = Object.keys(from);
  4679. for (var i = 0; i < keys.length; i++) {
  4680. key = keys[i];
  4681. toVal = to[key];
  4682. fromVal = from[key];
  4683. if (!hasOwn(to, key)) {
  4684. set(to, key, fromVal);
  4685. } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
  4686. mergeData(toVal, fromVal);
  4687. }
  4688. }
  4689. return to
  4690. }
  4691. /**
  4692. * Data
  4693. */
  4694. strats.data = function (
  4695. parentVal,
  4696. childVal,
  4697. vm
  4698. ) {
  4699. if (!vm) {
  4700. // in a Vue.extend merge, both should be functions
  4701. if (!childVal) {
  4702. return parentVal
  4703. }
  4704. if (typeof childVal !== 'function') {
  4705. process.env.NODE_ENV !== 'production' && warn(
  4706. 'The "data" option should be a function ' +
  4707. 'that returns a per-instance value in component ' +
  4708. 'definitions.',
  4709. vm
  4710. );
  4711. return parentVal
  4712. }
  4713. if (!parentVal) {
  4714. return childVal
  4715. }
  4716. // when parentVal & childVal are both present,
  4717. // we need to return a function that returns the
  4718. // merged result of both functions... no need to
  4719. // check if parentVal is a function here because
  4720. // it has to be a function to pass previous merges.
  4721. return function mergedDataFn () {
  4722. return mergeData(
  4723. childVal.call(this),
  4724. parentVal.call(this)
  4725. )
  4726. }
  4727. } else if (parentVal || childVal) {
  4728. return function mergedInstanceDataFn () {
  4729. // instance merge
  4730. var instanceData = typeof childVal === 'function'
  4731. ? childVal.call(vm)
  4732. : childVal;
  4733. var defaultData = typeof parentVal === 'function'
  4734. ? parentVal.call(vm)
  4735. : undefined;
  4736. if (instanceData) {
  4737. return mergeData(instanceData, defaultData)
  4738. } else {
  4739. return defaultData
  4740. }
  4741. }
  4742. }
  4743. };
  4744. /**
  4745. * Hooks and param attributes are merged as arrays.
  4746. */
  4747. function mergeHook (
  4748. parentVal,
  4749. childVal
  4750. ) {
  4751. return childVal
  4752. ? parentVal
  4753. ? parentVal.concat(childVal)
  4754. : Array.isArray(childVal)
  4755. ? childVal
  4756. : [childVal]
  4757. : parentVal
  4758. }
  4759. config._lifecycleHooks.forEach(function (hook) {
  4760. strats[hook] = mergeHook;
  4761. });
  4762. /**
  4763. * Assets
  4764. *
  4765. * When a vm is present (instance creation), we need to do
  4766. * a three-way merge between constructor options, instance
  4767. * options and parent options.
  4768. */
  4769. function mergeAssets (parentVal, childVal) {
  4770. var res = Object.create(parentVal || null);
  4771. return childVal
  4772. ? extend(res, childVal)
  4773. : res
  4774. }
  4775. config._assetTypes.forEach(function (type) {
  4776. strats[type + 's'] = mergeAssets;
  4777. });
  4778. /**
  4779. * Watchers.
  4780. *
  4781. * Watchers hashes should not overwrite one
  4782. * another, so we merge them as arrays.
  4783. */
  4784. strats.watch = function (parentVal, childVal) {
  4785. /* istanbul ignore if */
  4786. if (!childVal) { return parentVal }
  4787. if (!parentVal) { return childVal }
  4788. var ret = {};
  4789. extend(ret, parentVal);
  4790. for (var key in childVal) {
  4791. var parent = ret[key];
  4792. var child = childVal[key];
  4793. if (parent && !Array.isArray(parent)) {
  4794. parent = [parent];
  4795. }
  4796. ret[key] = parent
  4797. ? parent.concat(child)
  4798. : [child];
  4799. }
  4800. return ret
  4801. };
  4802. /**
  4803. * Other object hashes.
  4804. */
  4805. strats.props =
  4806. strats.methods =
  4807. strats.computed = function (parentVal, childVal) {
  4808. if (!childVal) { return parentVal }
  4809. if (!parentVal) { return childVal }
  4810. var ret = Object.create(null);
  4811. extend(ret, parentVal);
  4812. extend(ret, childVal);
  4813. return ret
  4814. };
  4815. /**
  4816. * Default strategy.
  4817. */
  4818. var defaultStrat = function (parentVal, childVal) {
  4819. return childVal === undefined
  4820. ? parentVal
  4821. : childVal
  4822. };
  4823. /**
  4824. * Validate component names
  4825. */
  4826. function checkComponents (options) {
  4827. for (var key in options.components) {
  4828. var lower = key.toLowerCase();
  4829. if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
  4830. warn(
  4831. 'Do not use built-in or reserved HTML elements as component ' +
  4832. 'id: ' + key
  4833. );
  4834. }
  4835. }
  4836. }
  4837. /**
  4838. * Ensure all props option syntax are normalized into the
  4839. * Object-based format.
  4840. */
  4841. function normalizeProps (options) {
  4842. var props = options.props;
  4843. if (!props) { return }
  4844. var res = {};
  4845. var i, val, name;
  4846. if (Array.isArray(props)) {
  4847. i = props.length;
  4848. while (i--) {
  4849. val = props[i];
  4850. if (typeof val === 'string') {
  4851. name = camelize(val);
  4852. res[name] = { type: null };
  4853. } else if (process.env.NODE_ENV !== 'production') {
  4854. warn('props must be strings when using array syntax.');
  4855. }
  4856. }
  4857. } else if (isPlainObject(props)) {
  4858. for (var key in props) {
  4859. val = props[key];
  4860. name = camelize(key);
  4861. res[name] = isPlainObject(val)
  4862. ? val
  4863. : { type: val };
  4864. }
  4865. }
  4866. options.props = res;
  4867. }
  4868. /**
  4869. * Normalize raw function directives into object format.
  4870. */
  4871. function normalizeDirectives (options) {
  4872. var dirs = options.directives;
  4873. if (dirs) {
  4874. for (var key in dirs) {
  4875. var def = dirs[key];
  4876. if (typeof def === 'function') {
  4877. dirs[key] = { bind: def, update: def };
  4878. }
  4879. }
  4880. }
  4881. }
  4882. /**
  4883. * Merge two option objects into a new one.
  4884. * Core utility used in both instantiation and inheritance.
  4885. */
  4886. function mergeOptions (
  4887. parent,
  4888. child,
  4889. vm
  4890. ) {
  4891. if (process.env.NODE_ENV !== 'production') {
  4892. checkComponents(child);
  4893. }
  4894. normalizeProps(child);
  4895. normalizeDirectives(child);
  4896. var extendsFrom = child.extends;
  4897. if (extendsFrom) {
  4898. parent = typeof extendsFrom === 'function'
  4899. ? mergeOptions(parent, extendsFrom.options, vm)
  4900. : mergeOptions(parent, extendsFrom, vm);
  4901. }
  4902. if (child.mixins) {
  4903. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4904. var mixin = child.mixins[i];
  4905. if (mixin.prototype instanceof Vue$2) {
  4906. mixin = mixin.options;
  4907. }
  4908. parent = mergeOptions(parent, mixin, vm);
  4909. }
  4910. }
  4911. var options = {};
  4912. var key;
  4913. for (key in parent) {
  4914. mergeField(key);
  4915. }
  4916. for (key in child) {
  4917. if (!hasOwn(parent, key)) {
  4918. mergeField(key);
  4919. }
  4920. }
  4921. function mergeField (key) {
  4922. var strat = strats[key] || defaultStrat;
  4923. options[key] = strat(parent[key], child[key], vm, key);
  4924. }
  4925. return options
  4926. }
  4927. /**
  4928. * Resolve an asset.
  4929. * This function is used because child instances need access
  4930. * to assets defined in its ancestor chain.
  4931. */
  4932. function resolveAsset (
  4933. options,
  4934. type,
  4935. id,
  4936. warnMissing
  4937. ) {
  4938. /* istanbul ignore if */
  4939. if (typeof id !== 'string') {
  4940. return
  4941. }
  4942. var assets = options[type];
  4943. var res = assets[id] ||
  4944. // camelCase ID
  4945. assets[camelize(id)] ||
  4946. // Pascal Case ID
  4947. assets[capitalize(camelize(id))];
  4948. if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
  4949. warn(
  4950. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4951. options
  4952. );
  4953. }
  4954. return res
  4955. }
  4956. /* */
  4957. function validateProp (
  4958. key,
  4959. propOptions,
  4960. propsData,
  4961. vm
  4962. ) {
  4963. var prop = propOptions[key];
  4964. var absent = !hasOwn(propsData, key);
  4965. var value = propsData[key];
  4966. // handle boolean props
  4967. if (isBooleanType(prop.type)) {
  4968. if (absent && !hasOwn(prop, 'default')) {
  4969. value = false;
  4970. } else if (value === '' || value === hyphenate(key)) {
  4971. value = true;
  4972. }
  4973. }
  4974. // check default value
  4975. if (value === undefined) {
  4976. value = getPropDefaultValue(vm, prop, key);
  4977. // since the default value is a fresh copy,
  4978. // make sure to observe it.
  4979. var prevShouldConvert = observerState.shouldConvert;
  4980. observerState.shouldConvert = true;
  4981. observe(value);
  4982. observerState.shouldConvert = prevShouldConvert;
  4983. }
  4984. if (process.env.NODE_ENV !== 'production') {
  4985. assertProp(prop, key, value, vm, absent);
  4986. }
  4987. return value
  4988. }
  4989. /**
  4990. * Get the default value of a prop.
  4991. */
  4992. function getPropDefaultValue (vm, prop, key) {
  4993. // no default, return undefined
  4994. if (!hasOwn(prop, 'default')) {
  4995. return undefined
  4996. }
  4997. var def = prop.default;
  4998. // warn against non-factory defaults for Object & Array
  4999. if (isObject(def)) {
  5000. process.env.NODE_ENV !== 'production' && warn(
  5001. 'Invalid default value for prop "' + key + '": ' +
  5002. 'Props with type Object/Array must use a factory function ' +
  5003. 'to return the default value.',
  5004. vm
  5005. );
  5006. }
  5007. // the raw prop value was also undefined from previous render,
  5008. // return previous default value to avoid unnecessary watcher trigger
  5009. if (vm && vm.$options.propsData &&
  5010. vm.$options.propsData[key] === undefined &&
  5011. vm[key] !== undefined) {
  5012. return vm[key]
  5013. }
  5014. // call factory function for non-Function types
  5015. return typeof def === 'function' && prop.type !== Function
  5016. ? def.call(vm)
  5017. : def
  5018. }
  5019. /**
  5020. * Assert whether a prop is valid.
  5021. */
  5022. function assertProp (
  5023. prop,
  5024. name,
  5025. value,
  5026. vm,
  5027. absent
  5028. ) {
  5029. if (prop.required && absent) {
  5030. warn(
  5031. 'Missing required prop: "' + name + '"',
  5032. vm
  5033. );
  5034. return
  5035. }
  5036. if (value == null && !prop.required) {
  5037. return
  5038. }
  5039. var type = prop.type;
  5040. var valid = !type || type === true;
  5041. var expectedTypes = [];
  5042. if (type) {
  5043. if (!Array.isArray(type)) {
  5044. type = [type];
  5045. }
  5046. for (var i = 0; i < type.length && !valid; i++) {
  5047. var assertedType = assertType(value, type[i]);
  5048. expectedTypes.push(assertedType.expectedType);
  5049. valid = assertedType.valid;
  5050. }
  5051. }
  5052. if (!valid) {
  5053. warn(
  5054. 'Invalid prop: type check failed for prop "' + name + '".' +
  5055. ' Expected ' + expectedTypes.map(capitalize).join(', ') +
  5056. ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',
  5057. vm
  5058. );
  5059. return
  5060. }
  5061. var validator = prop.validator;
  5062. if (validator) {
  5063. if (!validator(value)) {
  5064. warn(
  5065. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5066. vm
  5067. );
  5068. }
  5069. }
  5070. }
  5071. /**
  5072. * Assert the type of a value
  5073. */
  5074. function assertType (value, type) {
  5075. var valid;
  5076. var expectedType = getType(type);
  5077. if (expectedType === 'String') {
  5078. valid = typeof value === (expectedType = 'string');
  5079. } else if (expectedType === 'Number') {
  5080. valid = typeof value === (expectedType = 'number');
  5081. } else if (expectedType === 'Boolean') {
  5082. valid = typeof value === (expectedType = 'boolean');
  5083. } else if (expectedType === 'Function') {
  5084. valid = typeof value === (expectedType = 'function');
  5085. } else if (expectedType === 'Object') {
  5086. valid = isPlainObject(value);
  5087. } else if (expectedType === 'Array') {
  5088. valid = Array.isArray(value);
  5089. } else {
  5090. valid = value instanceof type;
  5091. }
  5092. return {
  5093. valid: valid,
  5094. expectedType: expectedType
  5095. }
  5096. }
  5097. /**
  5098. * Use function string name to check built-in types,
  5099. * because a simple equality check will fail when running
  5100. * across different vms / iframes.
  5101. */
  5102. function getType (fn) {
  5103. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5104. return match && match[1]
  5105. }
  5106. function isBooleanType (fn) {
  5107. if (!Array.isArray(fn)) {
  5108. return getType(fn) === 'Boolean'
  5109. }
  5110. for (var i = 0, len = fn.length; i < len; i++) {
  5111. if (getType(fn[i]) === 'Boolean') {
  5112. return true
  5113. }
  5114. }
  5115. /* istanbul ignore next */
  5116. return false
  5117. }
  5118. var util = Object.freeze({
  5119. defineReactive: defineReactive$$1,
  5120. _toString: _toString,
  5121. toNumber: toNumber,
  5122. makeMap: makeMap,
  5123. isBuiltInTag: isBuiltInTag,
  5124. remove: remove$1,
  5125. hasOwn: hasOwn,
  5126. isPrimitive: isPrimitive,
  5127. cached: cached,
  5128. camelize: camelize,
  5129. capitalize: capitalize,
  5130. hyphenate: hyphenate,
  5131. bind: bind$1,
  5132. toArray: toArray,
  5133. extend: extend,
  5134. isObject: isObject,
  5135. isPlainObject: isPlainObject,
  5136. toObject: toObject,
  5137. noop: noop,
  5138. no: no,
  5139. genStaticKeys: genStaticKeys,
  5140. looseEqual: looseEqual,
  5141. looseIndexOf: looseIndexOf,
  5142. isReserved: isReserved,
  5143. def: def,
  5144. parsePath: parsePath,
  5145. hasProto: hasProto,
  5146. inBrowser: inBrowser,
  5147. UA: UA,
  5148. isIE: isIE,
  5149. isIE9: isIE9,
  5150. isEdge: isEdge,
  5151. isAndroid: isAndroid,
  5152. isIOS: isIOS,
  5153. isServerRendering: isServerRendering,
  5154. devtools: devtools,
  5155. nextTick: nextTick,
  5156. get _Set () { return _Set; },
  5157. mergeOptions: mergeOptions,
  5158. resolveAsset: resolveAsset,
  5159. get warn () { return warn; },
  5160. get formatComponentName () { return formatComponentName; },
  5161. validateProp: validateProp
  5162. });
  5163. /* not type checking this file because flow doesn't play well with Proxy */
  5164. var initProxy;
  5165. if (process.env.NODE_ENV !== 'production') {
  5166. var allowedGlobals = makeMap(
  5167. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5168. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5169. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5170. 'require' // for Webpack/Browserify
  5171. );
  5172. var warnNonPresent = function (target, key) {
  5173. warn(
  5174. "Property or method \"" + key + "\" is not defined on the instance but " +
  5175. "referenced during render. Make sure to declare reactive data " +
  5176. "properties in the data option.",
  5177. target
  5178. );
  5179. };
  5180. var hasProxy =
  5181. typeof Proxy !== 'undefined' &&
  5182. Proxy.toString().match(/native code/);
  5183. var hasHandler = {
  5184. has: function has (target, key) {
  5185. var has = key in target;
  5186. var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
  5187. if (!has && !isAllowed) {
  5188. warnNonPresent(target, key);
  5189. }
  5190. return has || !isAllowed
  5191. }
  5192. };
  5193. var getHandler = {
  5194. get: function get (target, key) {
  5195. if (typeof key === 'string' && !(key in target)) {
  5196. warnNonPresent(target, key);
  5197. }
  5198. return target[key]
  5199. }
  5200. };
  5201. initProxy = function initProxy (vm) {
  5202. if (hasProxy) {
  5203. // determine which proxy handler to use
  5204. var options = vm.$options;
  5205. var handlers = options.render && options.render._withStripped
  5206. ? getHandler
  5207. : hasHandler;
  5208. vm._renderProxy = new Proxy(vm, handlers);
  5209. } else {
  5210. vm._renderProxy = vm;
  5211. }
  5212. };
  5213. }
  5214. /* */
  5215. var queue = [];
  5216. var has$1 = {};
  5217. var circular = {};
  5218. var waiting = false;
  5219. var flushing = false;
  5220. var index = 0;
  5221. /**
  5222. * Reset the scheduler's state.
  5223. */
  5224. function resetSchedulerState () {
  5225. queue.length = 0;
  5226. has$1 = {};
  5227. if (process.env.NODE_ENV !== 'production') {
  5228. circular = {};
  5229. }
  5230. waiting = flushing = false;
  5231. }
  5232. /**
  5233. * Flush both queues and run the watchers.
  5234. */
  5235. function flushSchedulerQueue () {
  5236. flushing = true;
  5237. // Sort queue before flush.
  5238. // This ensures that:
  5239. // 1. Components are updated from parent to child. (because parent is always
  5240. // created before the child)
  5241. // 2. A component's user watchers are run before its render watcher (because
  5242. // user watchers are created before the render watcher)
  5243. // 3. If a component is destroyed during a parent component's watcher run,
  5244. // its watchers can be skipped.
  5245. queue.sort(function (a, b) { return a.id - b.id; });
  5246. // do not cache length because more watchers might be pushed
  5247. // as we run existing watchers
  5248. for (index = 0; index < queue.length; index++) {
  5249. var watcher = queue[index];
  5250. var id = watcher.id;
  5251. has$1[id] = null;
  5252. watcher.run();
  5253. // in dev build, check and stop circular updates.
  5254. if (process.env.NODE_ENV !== 'production' && has$1[id] != null) {
  5255. circular[id] = (circular[id] || 0) + 1;
  5256. if (circular[id] > config._maxUpdateCount) {
  5257. warn(
  5258. 'You may have an infinite update loop ' + (
  5259. watcher.user
  5260. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5261. : "in a component render function."
  5262. ),
  5263. watcher.vm
  5264. );
  5265. break
  5266. }
  5267. }
  5268. }
  5269. // devtool hook
  5270. /* istanbul ignore if */
  5271. if (devtools && config.devtools) {
  5272. devtools.emit('flush');
  5273. }
  5274. resetSchedulerState();
  5275. }
  5276. /**
  5277. * Push a watcher into the watcher queue.
  5278. * Jobs with duplicate IDs will be skipped unless it's
  5279. * pushed when the queue is being flushed.
  5280. */
  5281. function queueWatcher (watcher) {
  5282. var id = watcher.id;
  5283. if (has$1[id] == null) {
  5284. has$1[id] = true;
  5285. if (!flushing) {
  5286. queue.push(watcher);
  5287. } else {
  5288. // if already flushing, splice the watcher based on its id
  5289. // if already past its id, it will be run next immediately.
  5290. var i = queue.length - 1;
  5291. while (i >= 0 && queue[i].id > watcher.id) {
  5292. i--;
  5293. }
  5294. queue.splice(Math.max(i, index) + 1, 0, watcher);
  5295. }
  5296. // queue the flush
  5297. if (!waiting) {
  5298. waiting = true;
  5299. nextTick(flushSchedulerQueue);
  5300. }
  5301. }
  5302. }
  5303. /* */
  5304. var uid$2 = 0;
  5305. /**
  5306. * A watcher parses an expression, collects dependencies,
  5307. * and fires callback when the expression value changes.
  5308. * This is used for both the $watch() api and directives.
  5309. */
  5310. var Watcher = function Watcher (
  5311. vm,
  5312. expOrFn,
  5313. cb,
  5314. options
  5315. ) {
  5316. if ( options === void 0 ) options = {};
  5317. this.vm = vm;
  5318. vm._watchers.push(this);
  5319. // options
  5320. this.deep = !!options.deep;
  5321. this.user = !!options.user;
  5322. this.lazy = !!options.lazy;
  5323. this.sync = !!options.sync;
  5324. this.expression = expOrFn.toString();
  5325. this.cb = cb;
  5326. this.id = ++uid$2; // uid for batching
  5327. this.active = true;
  5328. this.dirty = this.lazy; // for lazy watchers
  5329. this.deps = [];
  5330. this.newDeps = [];
  5331. this.depIds = new _Set();
  5332. this.newDepIds = new _Set();
  5333. // parse expression for getter
  5334. if (typeof expOrFn === 'function') {
  5335. this.getter = expOrFn;
  5336. } else {
  5337. this.getter = parsePath(expOrFn);
  5338. if (!this.getter) {
  5339. this.getter = function () {};
  5340. process.env.NODE_ENV !== 'production' && warn(
  5341. "Failed watching path: \"" + expOrFn + "\" " +
  5342. 'Watcher only accepts simple dot-delimited paths. ' +
  5343. 'For full control, use a function instead.',
  5344. vm
  5345. );
  5346. }
  5347. }
  5348. this.value = this.lazy
  5349. ? undefined
  5350. : this.get();
  5351. };
  5352. /**
  5353. * Evaluate the getter, and re-collect dependencies.
  5354. */
  5355. Watcher.prototype.get = function get () {
  5356. pushTarget(this);
  5357. var value = this.getter.call(this.vm, this.vm);
  5358. // "touch" every property so they are all tracked as
  5359. // dependencies for deep watching
  5360. if (this.deep) {
  5361. traverse(value);
  5362. }
  5363. popTarget();
  5364. this.cleanupDeps();
  5365. return value
  5366. };
  5367. /**
  5368. * Add a dependency to this directive.
  5369. */
  5370. Watcher.prototype.addDep = function addDep (dep) {
  5371. var id = dep.id;
  5372. if (!this.newDepIds.has(id)) {
  5373. this.newDepIds.add(id);
  5374. this.newDeps.push(dep);
  5375. if (!this.depIds.has(id)) {
  5376. dep.addSub(this);
  5377. }
  5378. }
  5379. };
  5380. /**
  5381. * Clean up for dependency collection.
  5382. */
  5383. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5384. var this$1 = this;
  5385. var i = this.deps.length;
  5386. while (i--) {
  5387. var dep = this$1.deps[i];
  5388. if (!this$1.newDepIds.has(dep.id)) {
  5389. dep.removeSub(this$1);
  5390. }
  5391. }
  5392. var tmp = this.depIds;
  5393. this.depIds = this.newDepIds;
  5394. this.newDepIds = tmp;
  5395. this.newDepIds.clear();
  5396. tmp = this.deps;
  5397. this.deps = this.newDeps;
  5398. this.newDeps = tmp;
  5399. this.newDeps.length = 0;
  5400. };
  5401. /**
  5402. * Subscriber interface.
  5403. * Will be called when a dependency changes.
  5404. */
  5405. Watcher.prototype.update = function update () {
  5406. /* istanbul ignore else */
  5407. if (this.lazy) {
  5408. this.dirty = true;
  5409. } else if (this.sync) {
  5410. this.run();
  5411. } else {
  5412. queueWatcher(this);
  5413. }
  5414. };
  5415. /**
  5416. * Scheduler job interface.
  5417. * Will be called by the scheduler.
  5418. */
  5419. Watcher.prototype.run = function run () {
  5420. if (this.active) {
  5421. var value = this.get();
  5422. if (
  5423. value !== this.value ||
  5424. // Deep watchers and watchers on Object/Arrays should fire even
  5425. // when the value is the same, because the value may
  5426. // have mutated.
  5427. isObject(value) ||
  5428. this.deep
  5429. ) {
  5430. // set new value
  5431. var oldValue = this.value;
  5432. this.value = value;
  5433. if (this.user) {
  5434. try {
  5435. this.cb.call(this.vm, value, oldValue);
  5436. } catch (e) {
  5437. process.env.NODE_ENV !== 'production' && warn(
  5438. ("Error in watcher \"" + (this.expression) + "\""),
  5439. this.vm
  5440. );
  5441. /* istanbul ignore else */
  5442. if (config.errorHandler) {
  5443. config.errorHandler.call(null, e, this.vm);
  5444. } else {
  5445. throw e
  5446. }
  5447. }
  5448. } else {
  5449. this.cb.call(this.vm, value, oldValue);
  5450. }
  5451. }
  5452. }
  5453. };
  5454. /**
  5455. * Evaluate the value of the watcher.
  5456. * This only gets called for lazy watchers.
  5457. */
  5458. Watcher.prototype.evaluate = function evaluate () {
  5459. this.value = this.get();
  5460. this.dirty = false;
  5461. };
  5462. /**
  5463. * Depend on all deps collected by this watcher.
  5464. */
  5465. Watcher.prototype.depend = function depend () {
  5466. var this$1 = this;
  5467. var i = this.deps.length;
  5468. while (i--) {
  5469. this$1.deps[i].depend();
  5470. }
  5471. };
  5472. /**
  5473. * Remove self from all dependencies' subscriber list.
  5474. */
  5475. Watcher.prototype.teardown = function teardown () {
  5476. var this$1 = this;
  5477. if (this.active) {
  5478. // remove self from vm's watcher list
  5479. // this is a somewhat expensive operation so we skip it
  5480. // if the vm is being destroyed or is performing a v-for
  5481. // re-render (the watcher list is then filtered by v-for).
  5482. if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
  5483. remove$1(this.vm._watchers, this);
  5484. }
  5485. var i = this.deps.length;
  5486. while (i--) {
  5487. this$1.deps[i].removeSub(this$1);
  5488. }
  5489. this.active = false;
  5490. }
  5491. };
  5492. /**
  5493. * Recursively traverse an object to evoke all converted
  5494. * getters, so that every nested property inside the object
  5495. * is collected as a "deep" dependency.
  5496. */
  5497. var seenObjects = new _Set();
  5498. function traverse (val) {
  5499. seenObjects.clear();
  5500. _traverse(val, seenObjects);
  5501. }
  5502. function _traverse (val, seen) {
  5503. var i, keys;
  5504. var isA = Array.isArray(val);
  5505. if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
  5506. return
  5507. }
  5508. if (val.__ob__) {
  5509. var depId = val.__ob__.dep.id;
  5510. if (seen.has(depId)) {
  5511. return
  5512. }
  5513. seen.add(depId);
  5514. }
  5515. if (isA) {
  5516. i = val.length;
  5517. while (i--) { _traverse(val[i], seen); }
  5518. } else {
  5519. keys = Object.keys(val);
  5520. i = keys.length;
  5521. while (i--) { _traverse(val[keys[i]], seen); }
  5522. }
  5523. }
  5524. /* */
  5525. function initState (vm) {
  5526. vm._watchers = [];
  5527. initProps(vm);
  5528. initData(vm);
  5529. initComputed(vm);
  5530. initMethods(vm);
  5531. initWatch(vm);
  5532. }
  5533. var isReservedProp = makeMap('key,ref,slot');
  5534. function initProps (vm) {
  5535. var props = vm.$options.props;
  5536. if (props) {
  5537. var propsData = vm.$options.propsData || {};
  5538. var keys = vm.$options._propKeys = Object.keys(props);
  5539. var isRoot = !vm.$parent;
  5540. // root instance props should be converted
  5541. observerState.shouldConvert = isRoot;
  5542. var loop = function ( i ) {
  5543. var key = keys[i];
  5544. /* istanbul ignore else */
  5545. if (process.env.NODE_ENV !== 'production') {
  5546. if (isReservedProp(key)) {
  5547. warn(
  5548. ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
  5549. vm
  5550. );
  5551. }
  5552. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
  5553. if (vm.$parent && !observerState.isSettingProps) {
  5554. warn(
  5555. "Avoid mutating a prop directly since the value will be " +
  5556. "overwritten whenever the parent component re-renders. " +
  5557. "Instead, use a data or computed property based on the prop's " +
  5558. "value. Prop being mutated: \"" + key + "\"",
  5559. vm
  5560. );
  5561. }
  5562. });
  5563. } else {
  5564. defineReactive$$1(vm, key, validateProp(key, props, propsData, vm));
  5565. }
  5566. };
  5567. for (var i = 0; i < keys.length; i++) loop( i );
  5568. observerState.shouldConvert = true;
  5569. }
  5570. }
  5571. function initData (vm) {
  5572. var data = vm.$options.data;
  5573. data = vm._data = typeof data === 'function'
  5574. ? data.call(vm)
  5575. : data || {};
  5576. if (!isPlainObject(data)) {
  5577. data = {};
  5578. process.env.NODE_ENV !== 'production' && warn(
  5579. 'data functions should return an object.',
  5580. vm
  5581. );
  5582. }
  5583. // proxy data on instance
  5584. var keys = Object.keys(data);
  5585. var props = vm.$options.props;
  5586. var i = keys.length;
  5587. while (i--) {
  5588. if (props && hasOwn(props, keys[i])) {
  5589. process.env.NODE_ENV !== 'production' && warn(
  5590. "The data property \"" + (keys[i]) + "\" is already declared as a prop. " +
  5591. "Use prop default value instead.",
  5592. vm
  5593. );
  5594. } else {
  5595. proxy(vm, keys[i]);
  5596. }
  5597. }
  5598. // observe data
  5599. observe(data);
  5600. data.__ob__ && data.__ob__.vmCount++;
  5601. }
  5602. var computedSharedDefinition = {
  5603. enumerable: true,
  5604. configurable: true,
  5605. get: noop,
  5606. set: noop
  5607. };
  5608. function initComputed (vm) {
  5609. var computed = vm.$options.computed;
  5610. if (computed) {
  5611. for (var key in computed) {
  5612. var userDef = computed[key];
  5613. if (typeof userDef === 'function') {
  5614. computedSharedDefinition.get = makeComputedGetter(userDef, vm);
  5615. computedSharedDefinition.set = noop;
  5616. } else {
  5617. computedSharedDefinition.get = userDef.get
  5618. ? userDef.cache !== false
  5619. ? makeComputedGetter(userDef.get, vm)
  5620. : bind$1(userDef.get, vm)
  5621. : noop;
  5622. computedSharedDefinition.set = userDef.set
  5623. ? bind$1(userDef.set, vm)
  5624. : noop;
  5625. }
  5626. Object.defineProperty(vm, key, computedSharedDefinition);
  5627. }
  5628. }
  5629. }
  5630. function makeComputedGetter (getter, owner) {
  5631. var watcher = new Watcher(owner, getter, noop, {
  5632. lazy: true
  5633. });
  5634. return function computedGetter () {
  5635. if (watcher.dirty) {
  5636. watcher.evaluate();
  5637. }
  5638. if (Dep.target) {
  5639. watcher.depend();
  5640. }
  5641. return watcher.value
  5642. }
  5643. }
  5644. function initMethods (vm) {
  5645. var methods = vm.$options.methods;
  5646. if (methods) {
  5647. for (var key in methods) {
  5648. vm[key] = methods[key] == null ? noop : bind$1(methods[key], vm);
  5649. if (process.env.NODE_ENV !== 'production' && methods[key] == null) {
  5650. warn(
  5651. "method \"" + key + "\" has an undefined value in the component definition. " +
  5652. "Did you reference the function correctly?",
  5653. vm
  5654. );
  5655. }
  5656. }
  5657. }
  5658. }
  5659. function initWatch (vm) {
  5660. var watch = vm.$options.watch;
  5661. if (watch) {
  5662. for (var key in watch) {
  5663. var handler = watch[key];
  5664. if (Array.isArray(handler)) {
  5665. for (var i = 0; i < handler.length; i++) {
  5666. createWatcher(vm, key, handler[i]);
  5667. }
  5668. } else {
  5669. createWatcher(vm, key, handler);
  5670. }
  5671. }
  5672. }
  5673. }
  5674. function createWatcher (vm, key, handler) {
  5675. var options;
  5676. if (isPlainObject(handler)) {
  5677. options = handler;
  5678. handler = handler.handler;
  5679. }
  5680. if (typeof handler === 'string') {
  5681. handler = vm[handler];
  5682. }
  5683. vm.$watch(key, handler, options);
  5684. }
  5685. function stateMixin (Vue) {
  5686. // flow somehow has problems with directly declared definition object
  5687. // when using Object.defineProperty, so we have to procedurally build up
  5688. // the object here.
  5689. var dataDef = {};
  5690. dataDef.get = function () {
  5691. return this._data
  5692. };
  5693. if (process.env.NODE_ENV !== 'production') {
  5694. dataDef.set = function (newData) {
  5695. warn(
  5696. 'Avoid replacing instance root $data. ' +
  5697. 'Use nested data properties instead.',
  5698. this
  5699. );
  5700. };
  5701. }
  5702. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5703. Vue.prototype.$set = set;
  5704. Vue.prototype.$delete = del;
  5705. Vue.prototype.$watch = function (
  5706. expOrFn,
  5707. cb,
  5708. options
  5709. ) {
  5710. var vm = this;
  5711. options = options || {};
  5712. options.user = true;
  5713. var watcher = new Watcher(vm, expOrFn, cb, options);
  5714. if (options.immediate) {
  5715. cb.call(vm, watcher.value);
  5716. }
  5717. return function unwatchFn () {
  5718. watcher.teardown();
  5719. }
  5720. };
  5721. }
  5722. function proxy (vm, key) {
  5723. if (!isReserved(key)) {
  5724. Object.defineProperty(vm, key, {
  5725. configurable: true,
  5726. enumerable: true,
  5727. get: function proxyGetter () {
  5728. return vm._data[key]
  5729. },
  5730. set: function proxySetter (val) {
  5731. vm._data[key] = val;
  5732. }
  5733. });
  5734. }
  5735. }
  5736. /* */
  5737. var VNode = function VNode (
  5738. tag,
  5739. data,
  5740. children,
  5741. text,
  5742. elm,
  5743. ns,
  5744. context,
  5745. componentOptions
  5746. ) {
  5747. this.tag = tag;
  5748. this.data = data;
  5749. this.children = children;
  5750. this.text = text;
  5751. this.elm = elm;
  5752. this.ns = ns;
  5753. this.context = context;
  5754. this.functionalContext = undefined;
  5755. this.key = data && data.key;
  5756. this.componentOptions = componentOptions;
  5757. this.child = undefined;
  5758. this.parent = undefined;
  5759. this.raw = false;
  5760. this.isStatic = false;
  5761. this.isRootInsert = true;
  5762. this.isComment = false;
  5763. this.isCloned = false;
  5764. this.isOnce = false;
  5765. };
  5766. var emptyVNode = function () {
  5767. var node = new VNode();
  5768. node.text = '';
  5769. node.isComment = true;
  5770. return node
  5771. };
  5772. // optimized shallow clone
  5773. // used for static nodes and slot nodes because they may be reused across
  5774. // multiple renders, cloning them avoids errors when DOM manipulations rely
  5775. // on their elm reference.
  5776. function cloneVNode (vnode) {
  5777. var cloned = new VNode(
  5778. vnode.tag,
  5779. vnode.data,
  5780. vnode.children,
  5781. vnode.text,
  5782. vnode.elm,
  5783. vnode.ns,
  5784. vnode.context,
  5785. vnode.componentOptions
  5786. );
  5787. cloned.isStatic = vnode.isStatic;
  5788. cloned.key = vnode.key;
  5789. cloned.isCloned = true;
  5790. return cloned
  5791. }
  5792. function cloneVNodes (vnodes) {
  5793. var res = new Array(vnodes.length);
  5794. for (var i = 0; i < vnodes.length; i++) {
  5795. res[i] = cloneVNode(vnodes[i]);
  5796. }
  5797. return res
  5798. }
  5799. /* */
  5800. function mergeVNodeHook (def, hookKey, hook, key) {
  5801. key = key + hookKey;
  5802. var injectedHash = def.__injected || (def.__injected = {});
  5803. if (!injectedHash[key]) {
  5804. injectedHash[key] = true;
  5805. var oldHook = def[hookKey];
  5806. if (oldHook) {
  5807. def[hookKey] = function () {
  5808. oldHook.apply(this, arguments);
  5809. hook.apply(this, arguments);
  5810. };
  5811. } else {
  5812. def[hookKey] = hook;
  5813. }
  5814. }
  5815. }
  5816. /* */
  5817. function updateListeners (
  5818. on,
  5819. oldOn,
  5820. add,
  5821. remove$$1,
  5822. vm
  5823. ) {
  5824. var name, cur, old, fn, event, capture;
  5825. for (name in on) {
  5826. cur = on[name];
  5827. old = oldOn[name];
  5828. if (!cur) {
  5829. process.env.NODE_ENV !== 'production' && warn(
  5830. "Invalid handler for event \"" + name + "\": got " + String(cur),
  5831. vm
  5832. );
  5833. } else if (!old) {
  5834. capture = name.charAt(0) === '!';
  5835. event = capture ? name.slice(1) : name;
  5836. if (Array.isArray(cur)) {
  5837. add(event, (cur.invoker = arrInvoker(cur)), capture);
  5838. } else {
  5839. if (!cur.invoker) {
  5840. fn = cur;
  5841. cur = on[name] = {};
  5842. cur.fn = fn;
  5843. cur.invoker = fnInvoker(cur);
  5844. }
  5845. add(event, cur.invoker, capture);
  5846. }
  5847. } else if (cur !== old) {
  5848. if (Array.isArray(old)) {
  5849. old.length = cur.length;
  5850. for (var i = 0; i < old.length; i++) { old[i] = cur[i]; }
  5851. on[name] = old;
  5852. } else {
  5853. old.fn = cur;
  5854. on[name] = old;
  5855. }
  5856. }
  5857. }
  5858. for (name in oldOn) {
  5859. if (!on[name]) {
  5860. event = name.charAt(0) === '!' ? name.slice(1) : name;
  5861. remove$$1(event, oldOn[name].invoker);
  5862. }
  5863. }
  5864. }
  5865. function arrInvoker (arr) {
  5866. return function (ev) {
  5867. var arguments$1 = arguments;
  5868. var single = arguments.length === 1;
  5869. for (var i = 0; i < arr.length; i++) {
  5870. single ? arr[i](ev) : arr[i].apply(null, arguments$1);
  5871. }
  5872. }
  5873. }
  5874. function fnInvoker (o) {
  5875. return function (ev) {
  5876. var single = arguments.length === 1;
  5877. single ? o.fn(ev) : o.fn.apply(null, arguments);
  5878. }
  5879. }
  5880. /* */
  5881. function normalizeChildren (
  5882. children,
  5883. ns,
  5884. nestedIndex
  5885. ) {
  5886. if (isPrimitive(children)) {
  5887. return [createTextVNode(children)]
  5888. }
  5889. if (Array.isArray(children)) {
  5890. var res = [];
  5891. for (var i = 0, l = children.length; i < l; i++) {
  5892. var c = children[i];
  5893. var last = res[res.length - 1];
  5894. // nested
  5895. if (Array.isArray(c)) {
  5896. res.push.apply(res, normalizeChildren(c, ns, ((nestedIndex || '') + "_" + i)));
  5897. } else if (isPrimitive(c)) {
  5898. if (last && last.text) {
  5899. last.text += String(c);
  5900. } else if (c !== '') {
  5901. // convert primitive to vnode
  5902. res.push(createTextVNode(c));
  5903. }
  5904. } else if (c instanceof VNode) {
  5905. if (c.text && last && last.text) {
  5906. if (!last.isCloned) {
  5907. last.text += c.text;
  5908. }
  5909. } else {
  5910. // inherit parent namespace
  5911. if (ns) {
  5912. applyNS(c, ns);
  5913. }
  5914. // default key for nested array children (likely generated by v-for)
  5915. if (c.tag && c.key == null && nestedIndex != null) {
  5916. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5917. }
  5918. res.push(c);
  5919. }
  5920. }
  5921. }
  5922. return res
  5923. }
  5924. }
  5925. function createTextVNode (val) {
  5926. return new VNode(undefined, undefined, undefined, String(val))
  5927. }
  5928. function applyNS (vnode, ns) {
  5929. if (vnode.tag && !vnode.ns) {
  5930. vnode.ns = ns;
  5931. if (vnode.children) {
  5932. for (var i = 0, l = vnode.children.length; i < l; i++) {
  5933. applyNS(vnode.children[i], ns);
  5934. }
  5935. }
  5936. }
  5937. }
  5938. /* */
  5939. function getFirstComponentChild (children) {
  5940. return children && children.filter(function (c) { return c && c.componentOptions; })[0]
  5941. }
  5942. /* */
  5943. var activeInstance = null;
  5944. function initLifecycle (vm) {
  5945. var options = vm.$options;
  5946. // locate first non-abstract parent
  5947. var parent = options.parent;
  5948. if (parent && !options.abstract) {
  5949. while (parent.$options.abstract && parent.$parent) {
  5950. parent = parent.$parent;
  5951. }
  5952. parent.$children.push(vm);
  5953. }
  5954. vm.$parent = parent;
  5955. vm.$root = parent ? parent.$root : vm;
  5956. vm.$children = [];
  5957. vm.$refs = {};
  5958. vm._watcher = null;
  5959. vm._inactive = false;
  5960. vm._isMounted = false;
  5961. vm._isDestroyed = false;
  5962. vm._isBeingDestroyed = false;
  5963. }
  5964. function lifecycleMixin (Vue) {
  5965. Vue.prototype._mount = function (
  5966. el,
  5967. hydrating
  5968. ) {
  5969. var vm = this;
  5970. vm.$el = el;
  5971. if (!vm.$options.render) {
  5972. vm.$options.render = emptyVNode;
  5973. if (process.env.NODE_ENV !== 'production') {
  5974. /* istanbul ignore if */
  5975. if (vm.$options.template && vm.$options.template.charAt(0) !== '#') {
  5976. warn(
  5977. 'You are using the runtime-only build of Vue where the template ' +
  5978. 'option is not available. Either pre-compile the templates into ' +
  5979. 'render functions, or use the compiler-included build.',
  5980. vm
  5981. );
  5982. } else {
  5983. warn(
  5984. 'Failed to mount component: template or render function not defined.',
  5985. vm
  5986. );
  5987. }
  5988. }
  5989. }
  5990. callHook(vm, 'beforeMount');
  5991. vm._watcher = new Watcher(vm, function () {
  5992. vm._update(vm._render(), hydrating);
  5993. }, noop);
  5994. hydrating = false;
  5995. // manually mounted instance, call mounted on self
  5996. // mounted is called for render-created child components in its inserted hook
  5997. if (vm.$vnode == null) {
  5998. vm._isMounted = true;
  5999. callHook(vm, 'mounted');
  6000. }
  6001. return vm
  6002. };
  6003. Vue.prototype._update = function (vnode, hydrating) {
  6004. var vm = this;
  6005. if (vm._isMounted) {
  6006. callHook(vm, 'beforeUpdate');
  6007. }
  6008. var prevEl = vm.$el;
  6009. var prevActiveInstance = activeInstance;
  6010. activeInstance = vm;
  6011. var prevVnode = vm._vnode;
  6012. vm._vnode = vnode;
  6013. if (!prevVnode) {
  6014. // Vue.prototype.__patch__ is injected in entry points
  6015. // based on the rendering backend used.
  6016. vm.$el = vm.__patch__(vm.$el, vnode, hydrating);
  6017. } else {
  6018. vm.$el = vm.__patch__(prevVnode, vnode);
  6019. }
  6020. activeInstance = prevActiveInstance;
  6021. // update __vue__ reference
  6022. if (prevEl) {
  6023. prevEl.__vue__ = null;
  6024. }
  6025. if (vm.$el) {
  6026. vm.$el.__vue__ = vm;
  6027. }
  6028. // if parent is an HOC, update its $el as well
  6029. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  6030. vm.$parent.$el = vm.$el;
  6031. }
  6032. if (vm._isMounted) {
  6033. callHook(vm, 'updated');
  6034. }
  6035. };
  6036. Vue.prototype._updateFromParent = function (
  6037. propsData,
  6038. listeners,
  6039. parentVnode,
  6040. renderChildren
  6041. ) {
  6042. var vm = this;
  6043. var hasChildren = !!(vm.$options._renderChildren || renderChildren);
  6044. vm.$options._parentVnode = parentVnode;
  6045. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  6046. if (vm._vnode) { // update child tree's parent
  6047. vm._vnode.parent = parentVnode;
  6048. }
  6049. vm.$options._renderChildren = renderChildren;
  6050. // update props
  6051. if (propsData && vm.$options.props) {
  6052. observerState.shouldConvert = false;
  6053. if (process.env.NODE_ENV !== 'production') {
  6054. observerState.isSettingProps = true;
  6055. }
  6056. var propKeys = vm.$options._propKeys || [];
  6057. for (var i = 0; i < propKeys.length; i++) {
  6058. var key = propKeys[i];
  6059. vm[key] = validateProp(key, vm.$options.props, propsData, vm);
  6060. }
  6061. observerState.shouldConvert = true;
  6062. if (process.env.NODE_ENV !== 'production') {
  6063. observerState.isSettingProps = false;
  6064. }
  6065. vm.$options.propsData = propsData;
  6066. }
  6067. // update listeners
  6068. if (listeners) {
  6069. var oldListeners = vm.$options._parentListeners;
  6070. vm.$options._parentListeners = listeners;
  6071. vm._updateListeners(listeners, oldListeners);
  6072. }
  6073. // resolve slots + force update if has children
  6074. if (hasChildren) {
  6075. vm.$slots = resolveSlots(renderChildren, vm._renderContext);
  6076. vm.$forceUpdate();
  6077. }
  6078. };
  6079. Vue.prototype.$forceUpdate = function () {
  6080. var vm = this;
  6081. if (vm._watcher) {
  6082. vm._watcher.update();
  6083. }
  6084. };
  6085. Vue.prototype.$destroy = function () {
  6086. var vm = this;
  6087. if (vm._isBeingDestroyed) {
  6088. return
  6089. }
  6090. callHook(vm, 'beforeDestroy');
  6091. vm._isBeingDestroyed = true;
  6092. // remove self from parent
  6093. var parent = vm.$parent;
  6094. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  6095. remove$1(parent.$children, vm);
  6096. }
  6097. // teardown watchers
  6098. if (vm._watcher) {
  6099. vm._watcher.teardown();
  6100. }
  6101. var i = vm._watchers.length;
  6102. while (i--) {
  6103. vm._watchers[i].teardown();
  6104. }
  6105. // remove reference from data ob
  6106. // frozen object may not have observer.
  6107. if (vm._data.__ob__) {
  6108. vm._data.__ob__.vmCount--;
  6109. }
  6110. // call the last hook...
  6111. vm._isDestroyed = true;
  6112. callHook(vm, 'destroyed');
  6113. // turn off all instance listeners.
  6114. vm.$off();
  6115. // remove __vue__ reference
  6116. if (vm.$el) {
  6117. vm.$el.__vue__ = null;
  6118. }
  6119. // invoke destroy hooks on current rendered tree
  6120. vm.__patch__(vm._vnode, null);
  6121. };
  6122. }
  6123. function callHook (vm, hook) {
  6124. var handlers = vm.$options[hook];
  6125. if (handlers) {
  6126. for (var i = 0, j = handlers.length; i < j; i++) {
  6127. handlers[i].call(vm);
  6128. }
  6129. }
  6130. vm.$emit('hook:' + hook);
  6131. }
  6132. /* */
  6133. var hooks = { init: init, prepatch: prepatch, insert: insert, destroy: destroy$1 };
  6134. var hooksToMerge = Object.keys(hooks);
  6135. function createComponent (
  6136. Ctor,
  6137. data,
  6138. context,
  6139. children,
  6140. tag
  6141. ) {
  6142. if (!Ctor) {
  6143. return
  6144. }
  6145. var baseCtor = context.$options._base;
  6146. if (isObject(Ctor)) {
  6147. Ctor = baseCtor.extend(Ctor);
  6148. }
  6149. if (typeof Ctor !== 'function') {
  6150. if (process.env.NODE_ENV !== 'production') {
  6151. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6152. }
  6153. return
  6154. }
  6155. // async component
  6156. if (!Ctor.cid) {
  6157. if (Ctor.resolved) {
  6158. Ctor = Ctor.resolved;
  6159. } else {
  6160. Ctor = resolveAsyncComponent(Ctor, baseCtor, function () {
  6161. // it's ok to queue this on every render because
  6162. // $forceUpdate is buffered by the scheduler.
  6163. context.$forceUpdate();
  6164. });
  6165. if (!Ctor) {
  6166. // return nothing if this is indeed an async component
  6167. // wait for the callback to trigger parent update.
  6168. return
  6169. }
  6170. }
  6171. }
  6172. // resolve constructor options in case global mixins are applied after
  6173. // component constructor creation
  6174. resolveConstructorOptions(Ctor);
  6175. data = data || {};
  6176. // extract props
  6177. var propsData = extractProps(data, Ctor);
  6178. // functional component
  6179. if (Ctor.options.functional) {
  6180. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6181. }
  6182. // extract listeners, since these needs to be treated as
  6183. // child component listeners instead of DOM listeners
  6184. var listeners = data.on;
  6185. // replace with listeners with .native modifier
  6186. data.on = data.nativeOn;
  6187. if (Ctor.options.abstract) {
  6188. // abstract components do not keep anything
  6189. // other than props & listeners
  6190. data = {};
  6191. }
  6192. // merge component management hooks onto the placeholder node
  6193. mergeHooks(data);
  6194. // return a placeholder vnode
  6195. var name = Ctor.options.name || tag;
  6196. var vnode = new VNode(
  6197. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6198. data, undefined, undefined, undefined, undefined, context,
  6199. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }
  6200. );
  6201. return vnode
  6202. }
  6203. function createFunctionalComponent (
  6204. Ctor,
  6205. propsData,
  6206. data,
  6207. context,
  6208. children
  6209. ) {
  6210. var props = {};
  6211. var propOptions = Ctor.options.props;
  6212. if (propOptions) {
  6213. for (var key in propOptions) {
  6214. props[key] = validateProp(key, propOptions, propsData);
  6215. }
  6216. }
  6217. var vnode = Ctor.options.render.call(
  6218. null,
  6219. // ensure the createElement function in functional components
  6220. // gets a unique context - this is necessary for correct named slot check
  6221. bind$1(createElement, { _self: Object.create(context) }),
  6222. {
  6223. props: props,
  6224. data: data,
  6225. parent: context,
  6226. children: normalizeChildren(children),
  6227. slots: function () { return resolveSlots(children, context); }
  6228. }
  6229. );
  6230. if (vnode instanceof VNode) {
  6231. vnode.functionalContext = context;
  6232. if (data.slot) {
  6233. (vnode.data || (vnode.data = {})).slot = data.slot;
  6234. }
  6235. }
  6236. return vnode
  6237. }
  6238. function createComponentInstanceForVnode (
  6239. vnode, // we know it's MountedComponentVNode but flow doesn't
  6240. parent // activeInstance in lifecycle state
  6241. ) {
  6242. var vnodeComponentOptions = vnode.componentOptions;
  6243. var options = {
  6244. _isComponent: true,
  6245. parent: parent,
  6246. propsData: vnodeComponentOptions.propsData,
  6247. _componentTag: vnodeComponentOptions.tag,
  6248. _parentVnode: vnode,
  6249. _parentListeners: vnodeComponentOptions.listeners,
  6250. _renderChildren: vnodeComponentOptions.children
  6251. };
  6252. // check inline-template render functions
  6253. var inlineTemplate = vnode.data.inlineTemplate;
  6254. if (inlineTemplate) {
  6255. options.render = inlineTemplate.render;
  6256. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6257. }
  6258. return new vnodeComponentOptions.Ctor(options)
  6259. }
  6260. function init (vnode, hydrating) {
  6261. if (!vnode.child || vnode.child._isDestroyed) {
  6262. var child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance);
  6263. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6264. } else if (vnode.data.keepAlive) {
  6265. // kept-alive components, treat as a patch
  6266. var mountedNode = vnode; // work around flow
  6267. prepatch(mountedNode, mountedNode);
  6268. }
  6269. }
  6270. function prepatch (
  6271. oldVnode,
  6272. vnode
  6273. ) {
  6274. var options = vnode.componentOptions;
  6275. var child = vnode.child = oldVnode.child;
  6276. child._updateFromParent(
  6277. options.propsData, // updated props
  6278. options.listeners, // updated listeners
  6279. vnode, // new parent vnode
  6280. options.children // new children
  6281. );
  6282. }
  6283. function insert (vnode) {
  6284. if (!vnode.child._isMounted) {
  6285. vnode.child._isMounted = true;
  6286. callHook(vnode.child, 'mounted');
  6287. }
  6288. if (vnode.data.keepAlive) {
  6289. vnode.child._inactive = false;
  6290. callHook(vnode.child, 'activated');
  6291. }
  6292. }
  6293. function destroy$1 (vnode) {
  6294. if (!vnode.child._isDestroyed) {
  6295. if (!vnode.data.keepAlive) {
  6296. vnode.child.$destroy();
  6297. } else {
  6298. vnode.child._inactive = true;
  6299. callHook(vnode.child, 'deactivated');
  6300. }
  6301. }
  6302. }
  6303. function resolveAsyncComponent (
  6304. factory,
  6305. baseCtor,
  6306. cb
  6307. ) {
  6308. if (factory.requested) {
  6309. // pool callbacks
  6310. factory.pendingCallbacks.push(cb);
  6311. } else {
  6312. factory.requested = true;
  6313. var cbs = factory.pendingCallbacks = [cb];
  6314. var sync = true;
  6315. var resolve = function (res) {
  6316. if (isObject(res)) {
  6317. res = baseCtor.extend(res);
  6318. }
  6319. // cache resolved
  6320. factory.resolved = res;
  6321. // invoke callbacks only if this is not a synchronous resolve
  6322. // (async resolves are shimmed as synchronous during SSR)
  6323. if (!sync) {
  6324. for (var i = 0, l = cbs.length; i < l; i++) {
  6325. cbs[i](res);
  6326. }
  6327. }
  6328. };
  6329. var reject = function (reason) {
  6330. process.env.NODE_ENV !== 'production' && warn(
  6331. "Failed to resolve async component: " + (String(factory)) +
  6332. (reason ? ("\nReason: " + reason) : '')
  6333. );
  6334. };
  6335. var res = factory(resolve, reject);
  6336. // handle promise
  6337. if (res && typeof res.then === 'function' && !factory.resolved) {
  6338. res.then(resolve, reject);
  6339. }
  6340. sync = false;
  6341. // return in case resolved synchronously
  6342. return factory.resolved
  6343. }
  6344. }
  6345. function extractProps (data, Ctor) {
  6346. // we are only extracting raw values here.
  6347. // validation and default values are handled in the child
  6348. // component itself.
  6349. var propOptions = Ctor.options.props;
  6350. if (!propOptions) {
  6351. return
  6352. }
  6353. var res = {};
  6354. var attrs = data.attrs;
  6355. var props = data.props;
  6356. var domProps = data.domProps;
  6357. if (attrs || props || domProps) {
  6358. for (var key in propOptions) {
  6359. var altKey = hyphenate(key);
  6360. checkProp(res, props, key, altKey, true) ||
  6361. checkProp(res, attrs, key, altKey) ||
  6362. checkProp(res, domProps, key, altKey);
  6363. }
  6364. }
  6365. return res
  6366. }
  6367. function checkProp (
  6368. res,
  6369. hash,
  6370. key,
  6371. altKey,
  6372. preserve
  6373. ) {
  6374. if (hash) {
  6375. if (hasOwn(hash, key)) {
  6376. res[key] = hash[key];
  6377. if (!preserve) {
  6378. delete hash[key];
  6379. }
  6380. return true
  6381. } else if (hasOwn(hash, altKey)) {
  6382. res[key] = hash[altKey];
  6383. if (!preserve) {
  6384. delete hash[altKey];
  6385. }
  6386. return true
  6387. }
  6388. }
  6389. return false
  6390. }
  6391. function mergeHooks (data) {
  6392. if (!data.hook) {
  6393. data.hook = {};
  6394. }
  6395. for (var i = 0; i < hooksToMerge.length; i++) {
  6396. var key = hooksToMerge[i];
  6397. var fromParent = data.hook[key];
  6398. var ours = hooks[key];
  6399. data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
  6400. }
  6401. }
  6402. function mergeHook$1 (a, b) {
  6403. // since all hooks have at most two args, use fixed args
  6404. // to avoid having to use fn.apply().
  6405. return function (_, __) {
  6406. a(_, __);
  6407. b(_, __);
  6408. }
  6409. }
  6410. /* */
  6411. // wrapper function for providing a more flexible interface
  6412. // without getting yelled at by flow
  6413. function createElement (
  6414. tag,
  6415. data,
  6416. children
  6417. ) {
  6418. if (data && (Array.isArray(data) || typeof data !== 'object')) {
  6419. children = data;
  6420. data = undefined;
  6421. }
  6422. // make sure to use real instance instead of proxy as context
  6423. return _createElement(this._self, tag, data, children)
  6424. }
  6425. function _createElement (
  6426. context,
  6427. tag,
  6428. data,
  6429. children
  6430. ) {
  6431. if (data && data.__ob__) {
  6432. process.env.NODE_ENV !== 'production' && warn(
  6433. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6434. 'Always create fresh vnode data objects in each render!',
  6435. context
  6436. );
  6437. return
  6438. }
  6439. if (!tag) {
  6440. // in case of component :is set to falsy value
  6441. return emptyVNode()
  6442. }
  6443. // support single function children as default scoped slot
  6444. if (Array.isArray(children) &&
  6445. typeof children[0] === 'function') {
  6446. data = data || {};
  6447. data.scopedSlots = { default: children[0] };
  6448. children.length = 0;
  6449. }
  6450. if (typeof tag === 'string') {
  6451. var Ctor;
  6452. var ns = config.getTagNamespace(tag);
  6453. if (config.isReservedTag(tag)) {
  6454. // platform built-in elements
  6455. return new VNode(
  6456. tag, data, normalizeChildren(children, ns),
  6457. undefined, undefined, ns, context
  6458. )
  6459. } else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
  6460. // component
  6461. return createComponent(Ctor, data, context, children, tag)
  6462. } else {
  6463. // unknown or unlisted namespaced elements
  6464. // check at runtime because it may get assigned a namespace when its
  6465. // parent normalizes children
  6466. var childNs = tag === 'foreignObject' ? 'xhtml' : ns;
  6467. return new VNode(
  6468. tag, data, normalizeChildren(children, childNs),
  6469. undefined, undefined, ns, context
  6470. )
  6471. }
  6472. } else {
  6473. // direct component options / constructor
  6474. return createComponent(tag, data, context, children)
  6475. }
  6476. }
  6477. /* */
  6478. function initRender (vm) {
  6479. vm.$vnode = null; // the placeholder node in parent tree
  6480. vm._vnode = null; // the root of the child tree
  6481. vm._staticTrees = null;
  6482. vm._renderContext = vm.$options._parentVnode && vm.$options._parentVnode.context;
  6483. vm.$slots = resolveSlots(vm.$options._renderChildren, vm._renderContext);
  6484. vm.$scopedSlots = {};
  6485. // bind the public createElement fn to this instance
  6486. // so that we get proper render context inside it.
  6487. vm.$createElement = bind$1(createElement, vm);
  6488. if (vm.$options.el) {
  6489. vm.$mount(vm.$options.el);
  6490. }
  6491. }
  6492. function renderMixin (Vue) {
  6493. Vue.prototype.$nextTick = function (fn) {
  6494. return nextTick(fn, this)
  6495. };
  6496. Vue.prototype._render = function () {
  6497. var vm = this;
  6498. var ref = vm.$options;
  6499. var render = ref.render;
  6500. var staticRenderFns = ref.staticRenderFns;
  6501. var _parentVnode = ref._parentVnode;
  6502. if (vm._isMounted) {
  6503. // clone slot nodes on re-renders
  6504. for (var key in vm.$slots) {
  6505. vm.$slots[key] = cloneVNodes(vm.$slots[key]);
  6506. }
  6507. }
  6508. if (_parentVnode && _parentVnode.data.scopedSlots) {
  6509. vm.$scopedSlots = _parentVnode.data.scopedSlots;
  6510. }
  6511. if (staticRenderFns && !vm._staticTrees) {
  6512. vm._staticTrees = [];
  6513. }
  6514. // set parent vnode. this allows render functions to have access
  6515. // to the data on the placeholder node.
  6516. vm.$vnode = _parentVnode;
  6517. // render self
  6518. var vnode;
  6519. try {
  6520. vnode = render.call(vm._renderProxy, vm.$createElement);
  6521. } catch (e) {
  6522. if (process.env.NODE_ENV !== 'production') {
  6523. warn(("Error when rendering " + (formatComponentName(vm)) + ":"));
  6524. }
  6525. /* istanbul ignore else */
  6526. if (config.errorHandler) {
  6527. config.errorHandler.call(null, e, vm);
  6528. } else {
  6529. if (isServerRendering()) {
  6530. throw e
  6531. } else {
  6532. console.error(e);
  6533. }
  6534. }
  6535. // return previous vnode to prevent render error causing blank component
  6536. vnode = vm._vnode;
  6537. }
  6538. // return empty vnode in case the render function errored out
  6539. if (!(vnode instanceof VNode)) {
  6540. if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
  6541. warn(
  6542. 'Multiple root nodes returned from render function. Render function ' +
  6543. 'should return a single root node.',
  6544. vm
  6545. );
  6546. }
  6547. vnode = emptyVNode();
  6548. }
  6549. // set parent
  6550. vnode.parent = _parentVnode;
  6551. return vnode
  6552. };
  6553. // shorthands used in render functions
  6554. Vue.prototype._h = createElement;
  6555. // toString for mustaches
  6556. Vue.prototype._s = _toString;
  6557. // number conversion
  6558. Vue.prototype._n = toNumber;
  6559. // empty vnode
  6560. Vue.prototype._e = emptyVNode;
  6561. // loose equal
  6562. Vue.prototype._q = looseEqual;
  6563. // loose indexOf
  6564. Vue.prototype._i = looseIndexOf;
  6565. // render static tree by index
  6566. Vue.prototype._m = function renderStatic (
  6567. index,
  6568. isInFor
  6569. ) {
  6570. var tree = this._staticTrees[index];
  6571. // if has already-rendered static tree and not inside v-for,
  6572. // we can reuse the same tree by doing a shallow clone.
  6573. if (tree && !isInFor) {
  6574. return Array.isArray(tree)
  6575. ? cloneVNodes(tree)
  6576. : cloneVNode(tree)
  6577. }
  6578. // otherwise, render a fresh tree.
  6579. tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(this._renderProxy);
  6580. markStatic(tree, ("__static__" + index), false);
  6581. return tree
  6582. };
  6583. // mark node as static (v-once)
  6584. Vue.prototype._o = function markOnce (
  6585. tree,
  6586. index,
  6587. key
  6588. ) {
  6589. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6590. return tree
  6591. };
  6592. function markStatic (tree, key, isOnce) {
  6593. if (Array.isArray(tree)) {
  6594. for (var i = 0; i < tree.length; i++) {
  6595. if (tree[i] && typeof tree[i] !== 'string') {
  6596. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6597. }
  6598. }
  6599. } else {
  6600. markStaticNode(tree, key, isOnce);
  6601. }
  6602. }
  6603. function markStaticNode (node, key, isOnce) {
  6604. node.isStatic = true;
  6605. node.key = key;
  6606. node.isOnce = isOnce;
  6607. }
  6608. // filter resolution helper
  6609. var identity = function (_) { return _; };
  6610. Vue.prototype._f = function resolveFilter (id) {
  6611. return resolveAsset(this.$options, 'filters', id, true) || identity
  6612. };
  6613. // render v-for
  6614. Vue.prototype._l = function renderList (
  6615. val,
  6616. render
  6617. ) {
  6618. var ret, i, l, keys, key;
  6619. if (Array.isArray(val)) {
  6620. ret = new Array(val.length);
  6621. for (i = 0, l = val.length; i < l; i++) {
  6622. ret[i] = render(val[i], i);
  6623. }
  6624. } else if (typeof val === 'number') {
  6625. ret = new Array(val);
  6626. for (i = 0; i < val; i++) {
  6627. ret[i] = render(i + 1, i);
  6628. }
  6629. } else if (isObject(val)) {
  6630. keys = Object.keys(val);
  6631. ret = new Array(keys.length);
  6632. for (i = 0, l = keys.length; i < l; i++) {
  6633. key = keys[i];
  6634. ret[i] = render(val[key], key, i);
  6635. }
  6636. }
  6637. return ret
  6638. };
  6639. // renderSlot
  6640. Vue.prototype._t = function (
  6641. name,
  6642. fallback,
  6643. props
  6644. ) {
  6645. var scopedSlotFn = this.$scopedSlots[name];
  6646. if (scopedSlotFn) { // scoped slot
  6647. return scopedSlotFn(props || {}) || fallback
  6648. } else {
  6649. var slotNodes = this.$slots[name];
  6650. // warn duplicate slot usage
  6651. if (slotNodes && process.env.NODE_ENV !== 'production') {
  6652. slotNodes._rendered && warn(
  6653. "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
  6654. "- this will likely cause render errors.",
  6655. this
  6656. );
  6657. slotNodes._rendered = true;
  6658. }
  6659. return slotNodes || fallback
  6660. }
  6661. };
  6662. // apply v-bind object
  6663. Vue.prototype._b = function bindProps (
  6664. data,
  6665. tag,
  6666. value,
  6667. asProp
  6668. ) {
  6669. if (value) {
  6670. if (!isObject(value)) {
  6671. process.env.NODE_ENV !== 'production' && warn(
  6672. 'v-bind without argument expects an Object or Array value',
  6673. this
  6674. );
  6675. } else {
  6676. if (Array.isArray(value)) {
  6677. value = toObject(value);
  6678. }
  6679. for (var key in value) {
  6680. if (key === 'class' || key === 'style') {
  6681. data[key] = value[key];
  6682. } else {
  6683. var hash = asProp || config.mustUseProp(tag, key)
  6684. ? data.domProps || (data.domProps = {})
  6685. : data.attrs || (data.attrs = {});
  6686. hash[key] = value[key];
  6687. }
  6688. }
  6689. }
  6690. }
  6691. return data
  6692. };
  6693. // expose v-on keyCodes
  6694. Vue.prototype._k = function getKeyCodes (key) {
  6695. return config.keyCodes[key]
  6696. };
  6697. }
  6698. function resolveSlots (
  6699. renderChildren,
  6700. context
  6701. ) {
  6702. var slots = {};
  6703. if (!renderChildren) {
  6704. return slots
  6705. }
  6706. var children = normalizeChildren(renderChildren) || [];
  6707. var defaultSlot = [];
  6708. var name, child;
  6709. for (var i = 0, l = children.length; i < l; i++) {
  6710. child = children[i];
  6711. // named slots should only be respected if the vnode was rendered in the
  6712. // same context.
  6713. if ((child.context === context || child.functionalContext === context) &&
  6714. child.data && (name = child.data.slot)) {
  6715. var slot = (slots[name] || (slots[name] = []));
  6716. if (child.tag === 'template') {
  6717. slot.push.apply(slot, child.children);
  6718. } else {
  6719. slot.push(child);
  6720. }
  6721. } else {
  6722. defaultSlot.push(child);
  6723. }
  6724. }
  6725. // ignore single whitespace
  6726. if (defaultSlot.length && !(
  6727. defaultSlot.length === 1 &&
  6728. (defaultSlot[0].text === ' ' || defaultSlot[0].isComment)
  6729. )) {
  6730. slots.default = defaultSlot;
  6731. }
  6732. return slots
  6733. }
  6734. /* */
  6735. function initEvents (vm) {
  6736. vm._events = Object.create(null);
  6737. // init parent attached events
  6738. var listeners = vm.$options._parentListeners;
  6739. var on = bind$1(vm.$on, vm);
  6740. var off = bind$1(vm.$off, vm);
  6741. vm._updateListeners = function (listeners, oldListeners) {
  6742. updateListeners(listeners, oldListeners || {}, on, off, vm);
  6743. };
  6744. if (listeners) {
  6745. vm._updateListeners(listeners);
  6746. }
  6747. }
  6748. function eventsMixin (Vue) {
  6749. Vue.prototype.$on = function (event, fn) {
  6750. var vm = this;(vm._events[event] || (vm._events[event] = [])).push(fn);
  6751. return vm
  6752. };
  6753. Vue.prototype.$once = function (event, fn) {
  6754. var vm = this;
  6755. function on () {
  6756. vm.$off(event, on);
  6757. fn.apply(vm, arguments);
  6758. }
  6759. on.fn = fn;
  6760. vm.$on(event, on);
  6761. return vm
  6762. };
  6763. Vue.prototype.$off = function (event, fn) {
  6764. var vm = this;
  6765. // all
  6766. if (!arguments.length) {
  6767. vm._events = Object.create(null);
  6768. return vm
  6769. }
  6770. // specific event
  6771. var cbs = vm._events[event];
  6772. if (!cbs) {
  6773. return vm
  6774. }
  6775. if (arguments.length === 1) {
  6776. vm._events[event] = null;
  6777. return vm
  6778. }
  6779. // specific handler
  6780. var cb;
  6781. var i = cbs.length;
  6782. while (i--) {
  6783. cb = cbs[i];
  6784. if (cb === fn || cb.fn === fn) {
  6785. cbs.splice(i, 1);
  6786. break
  6787. }
  6788. }
  6789. return vm
  6790. };
  6791. Vue.prototype.$emit = function (event) {
  6792. var vm = this;
  6793. var cbs = vm._events[event];
  6794. if (cbs) {
  6795. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  6796. var args = toArray(arguments, 1);
  6797. for (var i = 0, l = cbs.length; i < l; i++) {
  6798. cbs[i].apply(vm, args);
  6799. }
  6800. }
  6801. return vm
  6802. };
  6803. }
  6804. /* */
  6805. var uid = 0;
  6806. function initMixin (Vue) {
  6807. Vue.prototype._init = function (options) {
  6808. var vm = this;
  6809. // a uid
  6810. vm._uid = uid++;
  6811. // a flag to avoid this being observed
  6812. vm._isVue = true;
  6813. // merge options
  6814. if (options && options._isComponent) {
  6815. // optimize internal component instantiation
  6816. // since dynamic options merging is pretty slow, and none of the
  6817. // internal component options needs special treatment.
  6818. initInternalComponent(vm, options);
  6819. } else {
  6820. vm.$options = mergeOptions(
  6821. resolveConstructorOptions(vm.constructor),
  6822. options || {},
  6823. vm
  6824. );
  6825. }
  6826. /* istanbul ignore else */
  6827. if (process.env.NODE_ENV !== 'production') {
  6828. initProxy(vm);
  6829. } else {
  6830. vm._renderProxy = vm;
  6831. }
  6832. // expose real self
  6833. vm._self = vm;
  6834. initLifecycle(vm);
  6835. initEvents(vm);
  6836. callHook(vm, 'beforeCreate');
  6837. initState(vm);
  6838. callHook(vm, 'created');
  6839. initRender(vm);
  6840. };
  6841. }
  6842. function initInternalComponent (vm, options) {
  6843. var opts = vm.$options = Object.create(vm.constructor.options);
  6844. // doing this because it's faster than dynamic enumeration.
  6845. opts.parent = options.parent;
  6846. opts.propsData = options.propsData;
  6847. opts._parentVnode = options._parentVnode;
  6848. opts._parentListeners = options._parentListeners;
  6849. opts._renderChildren = options._renderChildren;
  6850. opts._componentTag = options._componentTag;
  6851. if (options.render) {
  6852. opts.render = options.render;
  6853. opts.staticRenderFns = options.staticRenderFns;
  6854. }
  6855. }
  6856. function resolveConstructorOptions (Ctor) {
  6857. var options = Ctor.options;
  6858. if (Ctor.super) {
  6859. var superOptions = Ctor.super.options;
  6860. var cachedSuperOptions = Ctor.superOptions;
  6861. var extendOptions = Ctor.extendOptions;
  6862. if (superOptions !== cachedSuperOptions) {
  6863. // super option changed
  6864. Ctor.superOptions = superOptions;
  6865. extendOptions.render = options.render;
  6866. extendOptions.staticRenderFns = options.staticRenderFns;
  6867. extendOptions._scopeId = options._scopeId;
  6868. options = Ctor.options = mergeOptions(superOptions, extendOptions);
  6869. if (options.name) {
  6870. options.components[options.name] = Ctor;
  6871. }
  6872. }
  6873. }
  6874. return options
  6875. }
  6876. function Vue$2 (options) {
  6877. if (process.env.NODE_ENV !== 'production' &&
  6878. !(this instanceof Vue$2)) {
  6879. warn('Vue is a constructor and should be called with the `new` keyword');
  6880. }
  6881. this._init(options);
  6882. }
  6883. initMixin(Vue$2);
  6884. stateMixin(Vue$2);
  6885. eventsMixin(Vue$2);
  6886. lifecycleMixin(Vue$2);
  6887. renderMixin(Vue$2);
  6888. /* */
  6889. function initUse (Vue) {
  6890. Vue.use = function (plugin) {
  6891. /* istanbul ignore if */
  6892. if (plugin.installed) {
  6893. return
  6894. }
  6895. // additional parameters
  6896. var args = toArray(arguments, 1);
  6897. args.unshift(this);
  6898. if (typeof plugin.install === 'function') {
  6899. plugin.install.apply(plugin, args);
  6900. } else {
  6901. plugin.apply(null, args);
  6902. }
  6903. plugin.installed = true;
  6904. return this
  6905. };
  6906. }
  6907. /* */
  6908. function initMixin$1 (Vue) {
  6909. Vue.mixin = function (mixin) {
  6910. this.options = mergeOptions(this.options, mixin);
  6911. };
  6912. }
  6913. /* */
  6914. function initExtend (Vue) {
  6915. /**
  6916. * Each instance constructor, including Vue, has a unique
  6917. * cid. This enables us to create wrapped "child
  6918. * constructors" for prototypal inheritance and cache them.
  6919. */
  6920. Vue.cid = 0;
  6921. var cid = 1;
  6922. /**
  6923. * Class inheritance
  6924. */
  6925. Vue.extend = function (extendOptions) {
  6926. extendOptions = extendOptions || {};
  6927. var Super = this;
  6928. var SuperId = Super.cid;
  6929. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6930. if (cachedCtors[SuperId]) {
  6931. return cachedCtors[SuperId]
  6932. }
  6933. var name = extendOptions.name || Super.options.name;
  6934. if (process.env.NODE_ENV !== 'production') {
  6935. if (!/^[a-zA-Z][\w-]*$/.test(name)) {
  6936. warn(
  6937. 'Invalid component name: "' + name + '". Component names ' +
  6938. 'can only contain alphanumeric characaters and the hyphen.'
  6939. );
  6940. }
  6941. }
  6942. var Sub = function VueComponent (options) {
  6943. this._init(options);
  6944. };
  6945. Sub.prototype = Object.create(Super.prototype);
  6946. Sub.prototype.constructor = Sub;
  6947. Sub.cid = cid++;
  6948. Sub.options = mergeOptions(
  6949. Super.options,
  6950. extendOptions
  6951. );
  6952. Sub['super'] = Super;
  6953. // allow further extension/mixin/plugin usage
  6954. Sub.extend = Super.extend;
  6955. Sub.mixin = Super.mixin;
  6956. Sub.use = Super.use;
  6957. // create asset registers, so extended classes
  6958. // can have their private assets too.
  6959. config._assetTypes.forEach(function (type) {
  6960. Sub[type] = Super[type];
  6961. });
  6962. // enable recursive self-lookup
  6963. if (name) {
  6964. Sub.options.components[name] = Sub;
  6965. }
  6966. // keep a reference to the super options at extension time.
  6967. // later at instantiation we can check if Super's options have
  6968. // been updated.
  6969. Sub.superOptions = Super.options;
  6970. Sub.extendOptions = extendOptions;
  6971. // cache constructor
  6972. cachedCtors[SuperId] = Sub;
  6973. return Sub
  6974. };
  6975. }
  6976. /* */
  6977. function initAssetRegisters (Vue) {
  6978. /**
  6979. * Create asset registration methods.
  6980. */
  6981. config._assetTypes.forEach(function (type) {
  6982. Vue[type] = function (
  6983. id,
  6984. definition
  6985. ) {
  6986. if (!definition) {
  6987. return this.options[type + 's'][id]
  6988. } else {
  6989. /* istanbul ignore if */
  6990. if (process.env.NODE_ENV !== 'production') {
  6991. if (type === 'component' && config.isReservedTag(id)) {
  6992. warn(
  6993. 'Do not use built-in or reserved HTML elements as component ' +
  6994. 'id: ' + id
  6995. );
  6996. }
  6997. }
  6998. if (type === 'component' && isPlainObject(definition)) {
  6999. definition.name = definition.name || id;
  7000. definition = this.options._base.extend(definition);
  7001. }
  7002. if (type === 'directive' && typeof definition === 'function') {
  7003. definition = { bind: definition, update: definition };
  7004. }
  7005. this.options[type + 's'][id] = definition;
  7006. return definition
  7007. }
  7008. };
  7009. });
  7010. }
  7011. /* */
  7012. var patternTypes = [String, RegExp];
  7013. function matches (pattern, name) {
  7014. if (typeof pattern === 'string') {
  7015. return pattern.split(',').indexOf(name) > -1
  7016. } else {
  7017. return pattern.test(name)
  7018. }
  7019. }
  7020. var KeepAlive = {
  7021. name: 'keep-alive',
  7022. abstract: true,
  7023. props: {
  7024. include: patternTypes,
  7025. exclude: patternTypes
  7026. },
  7027. created: function created () {
  7028. this.cache = Object.create(null);
  7029. },
  7030. render: function render () {
  7031. var vnode = getFirstComponentChild(this.$slots.default);
  7032. if (vnode && vnode.componentOptions) {
  7033. var opts = vnode.componentOptions;
  7034. // check pattern
  7035. var name = opts.Ctor.options.name || opts.tag;
  7036. if (name && (
  7037. (this.include && !matches(this.include, name)) ||
  7038. (this.exclude && matches(this.exclude, name))
  7039. )) {
  7040. return vnode
  7041. }
  7042. var key = vnode.key == null
  7043. // same constructor may get registered as different local components
  7044. // so cid alone is not enough (#3269)
  7045. ? opts.Ctor.cid + (opts.tag ? ("::" + (opts.tag)) : '')
  7046. : vnode.key;
  7047. if (this.cache[key]) {
  7048. vnode.child = this.cache[key].child;
  7049. } else {
  7050. this.cache[key] = vnode;
  7051. }
  7052. vnode.data.keepAlive = true;
  7053. }
  7054. return vnode
  7055. },
  7056. destroyed: function destroyed () {
  7057. var this$1 = this;
  7058. for (var key in this.cache) {
  7059. var vnode = this$1.cache[key];
  7060. callHook(vnode.child, 'deactivated');
  7061. vnode.child.$destroy();
  7062. }
  7063. }
  7064. };
  7065. var builtInComponents = {
  7066. KeepAlive: KeepAlive
  7067. };
  7068. /* */
  7069. function initGlobalAPI (Vue) {
  7070. // config
  7071. var configDef = {};
  7072. configDef.get = function () { return config; };
  7073. if (process.env.NODE_ENV !== 'production') {
  7074. configDef.set = function () {
  7075. warn(
  7076. 'Do not replace the Vue.config object, set individual fields instead.'
  7077. );
  7078. };
  7079. }
  7080. Object.defineProperty(Vue, 'config', configDef);
  7081. Vue.util = util;
  7082. Vue.set = set;
  7083. Vue.delete = del;
  7084. Vue.nextTick = nextTick;
  7085. Vue.options = Object.create(null);
  7086. config._assetTypes.forEach(function (type) {
  7087. Vue.options[type + 's'] = Object.create(null);
  7088. });
  7089. // this is used to identify the "base" constructor to extend all plain-object
  7090. // components with in Weex's multi-instance scenarios.
  7091. Vue.options._base = Vue;
  7092. extend(Vue.options.components, builtInComponents);
  7093. initUse(Vue);
  7094. initMixin$1(Vue);
  7095. initExtend(Vue);
  7096. initAssetRegisters(Vue);
  7097. }
  7098. initGlobalAPI(Vue$2);
  7099. Object.defineProperty(Vue$2.prototype, '$isServer', {
  7100. get: isServerRendering
  7101. });
  7102. Vue$2.version = '2.1.3';
  7103. /* */
  7104. // attributes that should be using props for binding
  7105. var mustUseProp = function (tag, attr) {
  7106. return (
  7107. (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||
  7108. (attr === 'selected' && tag === 'option') ||
  7109. (attr === 'checked' && tag === 'input') ||
  7110. (attr === 'muted' && tag === 'video')
  7111. )
  7112. };
  7113. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  7114. var isBooleanAttr = makeMap(
  7115. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  7116. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  7117. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  7118. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  7119. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  7120. 'truespeed,typemustmatch,visible'
  7121. );
  7122. var isAttr = makeMap(
  7123. 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' +
  7124. 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' +
  7125. 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' +
  7126. 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' +
  7127. 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' +
  7128. 'form,formaction,headers,<th>,height,hidden,high,href,hreflang,http-equiv,' +
  7129. 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' +
  7130. 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' +
  7131. 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' +
  7132. 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' +
  7133. 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' +
  7134. 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' +
  7135. 'target,title,type,usemap,value,width,wrap'
  7136. );
  7137. var xlinkNS = 'http://www.w3.org/1999/xlink';
  7138. var isXlink = function (name) {
  7139. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  7140. };
  7141. var getXlinkProp = function (name) {
  7142. return isXlink(name) ? name.slice(6, name.length) : ''
  7143. };
  7144. var isFalsyAttrValue = function (val) {
  7145. return val == null || val === false
  7146. };
  7147. /* */
  7148. function genClassForVnode (vnode) {
  7149. var data = vnode.data;
  7150. var parentNode = vnode;
  7151. var childNode = vnode;
  7152. while (childNode.child) {
  7153. childNode = childNode.child._vnode;
  7154. if (childNode.data) {
  7155. data = mergeClassData(childNode.data, data);
  7156. }
  7157. }
  7158. while ((parentNode = parentNode.parent)) {
  7159. if (parentNode.data) {
  7160. data = mergeClassData(data, parentNode.data);
  7161. }
  7162. }
  7163. return genClassFromData(data)
  7164. }
  7165. function mergeClassData (child, parent) {
  7166. return {
  7167. staticClass: concat(child.staticClass, parent.staticClass),
  7168. class: child.class
  7169. ? [child.class, parent.class]
  7170. : parent.class
  7171. }
  7172. }
  7173. function genClassFromData (data) {
  7174. var dynamicClass = data.class;
  7175. var staticClass = data.staticClass;
  7176. if (staticClass || dynamicClass) {
  7177. return concat(staticClass, stringifyClass(dynamicClass))
  7178. }
  7179. /* istanbul ignore next */
  7180. return ''
  7181. }
  7182. function concat (a, b) {
  7183. return a ? b ? (a + ' ' + b) : a : (b || '')
  7184. }
  7185. function stringifyClass (value) {
  7186. var res = '';
  7187. if (!value) {
  7188. return res
  7189. }
  7190. if (typeof value === 'string') {
  7191. return value
  7192. }
  7193. if (Array.isArray(value)) {
  7194. var stringified;
  7195. for (var i = 0, l = value.length; i < l; i++) {
  7196. if (value[i]) {
  7197. if ((stringified = stringifyClass(value[i]))) {
  7198. res += stringified + ' ';
  7199. }
  7200. }
  7201. }
  7202. return res.slice(0, -1)
  7203. }
  7204. if (isObject(value)) {
  7205. for (var key in value) {
  7206. if (value[key]) { res += key + ' '; }
  7207. }
  7208. return res.slice(0, -1)
  7209. }
  7210. /* istanbul ignore next */
  7211. return res
  7212. }
  7213. /* */
  7214. var namespaceMap = {
  7215. svg: 'http://www.w3.org/2000/svg',
  7216. math: 'http://www.w3.org/1998/Math/MathML',
  7217. xhtml: 'http://www.w3.org/1999/xhtml'
  7218. };
  7219. var isHTMLTag = makeMap(
  7220. 'html,body,base,head,link,meta,style,title,' +
  7221. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  7222. 'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
  7223. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  7224. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  7225. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  7226. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  7227. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  7228. 'output,progress,select,textarea,' +
  7229. 'details,dialog,menu,menuitem,summary,' +
  7230. 'content,element,shadow,template'
  7231. );
  7232. var isUnaryTag = makeMap(
  7233. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  7234. 'link,meta,param,source,track,wbr',
  7235. true
  7236. );
  7237. // Elements that you can, intentionally, leave open
  7238. // (and which close themselves)
  7239. var canBeLeftOpenTag = makeMap(
  7240. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source',
  7241. true
  7242. );
  7243. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  7244. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  7245. var isNonPhrasingTag = makeMap(
  7246. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  7247. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  7248. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  7249. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  7250. 'title,tr,track',
  7251. true
  7252. );
  7253. // this map is intentionally selective, only covering SVG elements that may
  7254. // contain child elements.
  7255. var isSVG = makeMap(
  7256. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font,' +
  7257. 'font-face,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  7258. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  7259. true
  7260. );
  7261. var isReservedTag = function (tag) {
  7262. return isHTMLTag(tag) || isSVG(tag)
  7263. };
  7264. function getTagNamespace (tag) {
  7265. if (isSVG(tag)) {
  7266. return 'svg'
  7267. }
  7268. // basic support for MathML
  7269. // note it doesn't support other MathML elements being component roots
  7270. if (tag === 'math') {
  7271. return 'math'
  7272. }
  7273. }
  7274. var unknownElementCache = Object.create(null);
  7275. function isUnknownElement (tag) {
  7276. /* istanbul ignore if */
  7277. if (!inBrowser) {
  7278. return true
  7279. }
  7280. if (isReservedTag(tag)) {
  7281. return false
  7282. }
  7283. tag = tag.toLowerCase();
  7284. /* istanbul ignore if */
  7285. if (unknownElementCache[tag] != null) {
  7286. return unknownElementCache[tag]
  7287. }
  7288. var el = document.createElement(tag);
  7289. if (tag.indexOf('-') > -1) {
  7290. // http://stackoverflow.com/a/28210364/1070244
  7291. return (unknownElementCache[tag] = (
  7292. el.constructor === window.HTMLUnknownElement ||
  7293. el.constructor === window.HTMLElement
  7294. ))
  7295. } else {
  7296. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  7297. }
  7298. }
  7299. /* */
  7300. /**
  7301. * Query an element selector if it's not an element already.
  7302. */
  7303. function query (el) {
  7304. if (typeof el === 'string') {
  7305. var selector = el;
  7306. el = document.querySelector(el);
  7307. if (!el) {
  7308. process.env.NODE_ENV !== 'production' && warn(
  7309. 'Cannot find element: ' + selector
  7310. );
  7311. return document.createElement('div')
  7312. }
  7313. }
  7314. return el
  7315. }
  7316. /* */
  7317. function createElement$1 (tagName, vnode) {
  7318. var elm = document.createElement(tagName);
  7319. if (tagName !== 'select') {
  7320. return elm
  7321. }
  7322. if (vnode.data && vnode.data.attrs && 'multiple' in vnode.data.attrs) {
  7323. elm.setAttribute('multiple', 'multiple');
  7324. }
  7325. return elm
  7326. }
  7327. function createElementNS (namespace, tagName) {
  7328. return document.createElementNS(namespaceMap[namespace], tagName)
  7329. }
  7330. function createTextNode (text) {
  7331. return document.createTextNode(text)
  7332. }
  7333. function createComment (text) {
  7334. return document.createComment(text)
  7335. }
  7336. function insertBefore (parentNode, newNode, referenceNode) {
  7337. parentNode.insertBefore(newNode, referenceNode);
  7338. }
  7339. function removeChild (node, child) {
  7340. node.removeChild(child);
  7341. }
  7342. function appendChild (node, child) {
  7343. node.appendChild(child);
  7344. }
  7345. function parentNode (node) {
  7346. return node.parentNode
  7347. }
  7348. function nextSibling (node) {
  7349. return node.nextSibling
  7350. }
  7351. function tagName (node) {
  7352. return node.tagName
  7353. }
  7354. function setTextContent (node, text) {
  7355. node.textContent = text;
  7356. }
  7357. function childNodes (node) {
  7358. return node.childNodes
  7359. }
  7360. function setAttribute (node, key, val) {
  7361. node.setAttribute(key, val);
  7362. }
  7363. var nodeOps = Object.freeze({
  7364. createElement: createElement$1,
  7365. createElementNS: createElementNS,
  7366. createTextNode: createTextNode,
  7367. createComment: createComment,
  7368. insertBefore: insertBefore,
  7369. removeChild: removeChild,
  7370. appendChild: appendChild,
  7371. parentNode: parentNode,
  7372. nextSibling: nextSibling,
  7373. tagName: tagName,
  7374. setTextContent: setTextContent,
  7375. childNodes: childNodes,
  7376. setAttribute: setAttribute
  7377. });
  7378. /* */
  7379. var ref = {
  7380. create: function create (_, vnode) {
  7381. registerRef(vnode);
  7382. },
  7383. update: function update (oldVnode, vnode) {
  7384. if (oldVnode.data.ref !== vnode.data.ref) {
  7385. registerRef(oldVnode, true);
  7386. registerRef(vnode);
  7387. }
  7388. },
  7389. destroy: function destroy (vnode) {
  7390. registerRef(vnode, true);
  7391. }
  7392. };
  7393. function registerRef (vnode, isRemoval) {
  7394. var key = vnode.data.ref;
  7395. if (!key) { return }
  7396. var vm = vnode.context;
  7397. var ref = vnode.child || vnode.elm;
  7398. var refs = vm.$refs;
  7399. if (isRemoval) {
  7400. if (Array.isArray(refs[key])) {
  7401. remove$1(refs[key], ref);
  7402. } else if (refs[key] === ref) {
  7403. refs[key] = undefined;
  7404. }
  7405. } else {
  7406. if (vnode.data.refInFor) {
  7407. if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
  7408. refs[key].push(ref);
  7409. } else {
  7410. refs[key] = [ref];
  7411. }
  7412. } else {
  7413. refs[key] = ref;
  7414. }
  7415. }
  7416. }
  7417. /**
  7418. * Virtual DOM patching algorithm based on Snabbdom by
  7419. * Simon Friis Vindum (@paldepind)
  7420. * Licensed under the MIT License
  7421. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  7422. *
  7423. * modified by Evan You (@yyx990803)
  7424. *
  7425. /*
  7426. * Not type-checking this because this file is perf-critical and the cost
  7427. * of making flow understand it is not worth it.
  7428. */
  7429. var emptyNode = new VNode('', {}, []);
  7430. var hooks$1 = ['create', 'update', 'remove', 'destroy'];
  7431. function isUndef (s) {
  7432. return s == null
  7433. }
  7434. function isDef (s) {
  7435. return s != null
  7436. }
  7437. function sameVnode (vnode1, vnode2) {
  7438. return (
  7439. vnode1.key === vnode2.key &&
  7440. vnode1.tag === vnode2.tag &&
  7441. vnode1.isComment === vnode2.isComment &&
  7442. !vnode1.data === !vnode2.data
  7443. )
  7444. }
  7445. function createKeyToOldIdx (children, beginIdx, endIdx) {
  7446. var i, key;
  7447. var map = {};
  7448. for (i = beginIdx; i <= endIdx; ++i) {
  7449. key = children[i].key;
  7450. if (isDef(key)) { map[key] = i; }
  7451. }
  7452. return map
  7453. }
  7454. function createPatchFunction (backend) {
  7455. var i, j;
  7456. var cbs = {};
  7457. var modules = backend.modules;
  7458. var nodeOps = backend.nodeOps;
  7459. for (i = 0; i < hooks$1.length; ++i) {
  7460. cbs[hooks$1[i]] = [];
  7461. for (j = 0; j < modules.length; ++j) {
  7462. if (modules[j][hooks$1[i]] !== undefined) { cbs[hooks$1[i]].push(modules[j][hooks$1[i]]); }
  7463. }
  7464. }
  7465. function emptyNodeAt (elm) {
  7466. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  7467. }
  7468. function createRmCb (childElm, listeners) {
  7469. function remove$$1 () {
  7470. if (--remove$$1.listeners === 0) {
  7471. removeElement(childElm);
  7472. }
  7473. }
  7474. remove$$1.listeners = listeners;
  7475. return remove$$1
  7476. }
  7477. function removeElement (el) {
  7478. var parent = nodeOps.parentNode(el);
  7479. // element may have already been removed due to v-html
  7480. if (parent) {
  7481. nodeOps.removeChild(parent, el);
  7482. }
  7483. }
  7484. function createElm (vnode, insertedVnodeQueue, nested) {
  7485. var i;
  7486. var data = vnode.data;
  7487. vnode.isRootInsert = !nested;
  7488. if (isDef(data)) {
  7489. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode); }
  7490. // after calling the init hook, if the vnode is a child component
  7491. // it should've created a child instance and mounted it. the child
  7492. // component also has set the placeholder vnode's elm.
  7493. // in that case we can just return the element and be done.
  7494. if (isDef(i = vnode.child)) {
  7495. initComponent(vnode, insertedVnodeQueue);
  7496. return vnode.elm
  7497. }
  7498. }
  7499. var children = vnode.children;
  7500. var tag = vnode.tag;
  7501. if (isDef(tag)) {
  7502. if (process.env.NODE_ENV !== 'production') {
  7503. if (
  7504. !vnode.ns &&
  7505. !(config.ignoredElements && config.ignoredElements.indexOf(tag) > -1) &&
  7506. config.isUnknownElement(tag)
  7507. ) {
  7508. warn(
  7509. 'Unknown custom element: <' + tag + '> - did you ' +
  7510. 'register the component correctly? For recursive components, ' +
  7511. 'make sure to provide the "name" option.',
  7512. vnode.context
  7513. );
  7514. }
  7515. }
  7516. vnode.elm = vnode.ns
  7517. ? nodeOps.createElementNS(vnode.ns, tag)
  7518. : nodeOps.createElement(tag, vnode);
  7519. setScope(vnode);
  7520. createChildren(vnode, children, insertedVnodeQueue);
  7521. if (isDef(data)) {
  7522. invokeCreateHooks(vnode, insertedVnodeQueue);
  7523. }
  7524. } else if (vnode.isComment) {
  7525. vnode.elm = nodeOps.createComment(vnode.text);
  7526. } else {
  7527. vnode.elm = nodeOps.createTextNode(vnode.text);
  7528. }
  7529. return vnode.elm
  7530. }
  7531. function createChildren (vnode, children, insertedVnodeQueue) {
  7532. if (Array.isArray(children)) {
  7533. for (var i = 0; i < children.length; ++i) {
  7534. nodeOps.appendChild(vnode.elm, createElm(children[i], insertedVnodeQueue, true));
  7535. }
  7536. } else if (isPrimitive(vnode.text)) {
  7537. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
  7538. }
  7539. }
  7540. function isPatchable (vnode) {
  7541. while (vnode.child) {
  7542. vnode = vnode.child._vnode;
  7543. }
  7544. return isDef(vnode.tag)
  7545. }
  7546. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  7547. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  7548. cbs.create[i$1](emptyNode, vnode);
  7549. }
  7550. i = vnode.data.hook; // Reuse variable
  7551. if (isDef(i)) {
  7552. if (i.create) { i.create(emptyNode, vnode); }
  7553. if (i.insert) { insertedVnodeQueue.push(vnode); }
  7554. }
  7555. }
  7556. function initComponent (vnode, insertedVnodeQueue) {
  7557. if (vnode.data.pendingInsert) {
  7558. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  7559. }
  7560. vnode.elm = vnode.child.$el;
  7561. if (isPatchable(vnode)) {
  7562. invokeCreateHooks(vnode, insertedVnodeQueue);
  7563. setScope(vnode);
  7564. } else {
  7565. // empty component root.
  7566. // skip all element-related modules except for ref (#3455)
  7567. registerRef(vnode);
  7568. // make sure to invoke the insert hook
  7569. insertedVnodeQueue.push(vnode);
  7570. }
  7571. }
  7572. // set scope id attribute for scoped CSS.
  7573. // this is implemented as a special case to avoid the overhead
  7574. // of going through the normal attribute patching process.
  7575. function setScope (vnode) {
  7576. var i;
  7577. if (isDef(i = vnode.context) && isDef(i = i.$options._scopeId)) {
  7578. nodeOps.setAttribute(vnode.elm, i, '');
  7579. }
  7580. if (isDef(i = activeInstance) &&
  7581. i !== vnode.context &&
  7582. isDef(i = i.$options._scopeId)) {
  7583. nodeOps.setAttribute(vnode.elm, i, '');
  7584. }
  7585. }
  7586. function addVnodes (parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  7587. for (; startIdx <= endIdx; ++startIdx) {
  7588. nodeOps.insertBefore(parentElm, createElm(vnodes[startIdx], insertedVnodeQueue), before);
  7589. }
  7590. }
  7591. function invokeDestroyHook (vnode) {
  7592. var i, j;
  7593. var data = vnode.data;
  7594. if (isDef(data)) {
  7595. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  7596. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  7597. }
  7598. if (isDef(i = vnode.children)) {
  7599. for (j = 0; j < vnode.children.length; ++j) {
  7600. invokeDestroyHook(vnode.children[j]);
  7601. }
  7602. }
  7603. }
  7604. function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
  7605. for (; startIdx <= endIdx; ++startIdx) {
  7606. var ch = vnodes[startIdx];
  7607. if (isDef(ch)) {
  7608. if (isDef(ch.tag)) {
  7609. removeAndInvokeRemoveHook(ch);
  7610. invokeDestroyHook(ch);
  7611. } else { // Text node
  7612. nodeOps.removeChild(parentElm, ch.elm);
  7613. }
  7614. }
  7615. }
  7616. }
  7617. function removeAndInvokeRemoveHook (vnode, rm) {
  7618. if (rm || isDef(vnode.data)) {
  7619. var listeners = cbs.remove.length + 1;
  7620. if (!rm) {
  7621. // directly removing
  7622. rm = createRmCb(vnode.elm, listeners);
  7623. } else {
  7624. // we have a recursively passed down rm callback
  7625. // increase the listeners count
  7626. rm.listeners += listeners;
  7627. }
  7628. // recursively invoke hooks on child component root node
  7629. if (isDef(i = vnode.child) && isDef(i = i._vnode) && isDef(i.data)) {
  7630. removeAndInvokeRemoveHook(i, rm);
  7631. }
  7632. for (i = 0; i < cbs.remove.length; ++i) {
  7633. cbs.remove[i](vnode, rm);
  7634. }
  7635. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  7636. i(vnode, rm);
  7637. } else {
  7638. rm();
  7639. }
  7640. } else {
  7641. removeElement(vnode.elm);
  7642. }
  7643. }
  7644. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  7645. var oldStartIdx = 0;
  7646. var newStartIdx = 0;
  7647. var oldEndIdx = oldCh.length - 1;
  7648. var oldStartVnode = oldCh[0];
  7649. var oldEndVnode = oldCh[oldEndIdx];
  7650. var newEndIdx = newCh.length - 1;
  7651. var newStartVnode = newCh[0];
  7652. var newEndVnode = newCh[newEndIdx];
  7653. var oldKeyToIdx, idxInOld, elmToMove, before;
  7654. // removeOnly is a special flag used only by <transition-group>
  7655. // to ensure removed elements stay in correct relative positions
  7656. // during leaving transitions
  7657. var canMove = !removeOnly;
  7658. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  7659. if (isUndef(oldStartVnode)) {
  7660. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  7661. } else if (isUndef(oldEndVnode)) {
  7662. oldEndVnode = oldCh[--oldEndIdx];
  7663. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  7664. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  7665. oldStartVnode = oldCh[++oldStartIdx];
  7666. newStartVnode = newCh[++newStartIdx];
  7667. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  7668. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  7669. oldEndVnode = oldCh[--oldEndIdx];
  7670. newEndVnode = newCh[--newEndIdx];
  7671. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  7672. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  7673. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  7674. oldStartVnode = oldCh[++oldStartIdx];
  7675. newEndVnode = newCh[--newEndIdx];
  7676. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  7677. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  7678. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  7679. oldEndVnode = oldCh[--oldEndIdx];
  7680. newStartVnode = newCh[++newStartIdx];
  7681. } else {
  7682. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  7683. idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : null;
  7684. if (isUndef(idxInOld)) { // New element
  7685. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  7686. newStartVnode = newCh[++newStartIdx];
  7687. } else {
  7688. elmToMove = oldCh[idxInOld];
  7689. /* istanbul ignore if */
  7690. if (process.env.NODE_ENV !== 'production' && !elmToMove) {
  7691. warn(
  7692. 'It seems there are duplicate keys that is causing an update error. ' +
  7693. 'Make sure each v-for item has a unique key.'
  7694. );
  7695. }
  7696. if (elmToMove.tag !== newStartVnode.tag) {
  7697. // same key but different element. treat as new element
  7698. nodeOps.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  7699. newStartVnode = newCh[++newStartIdx];
  7700. } else {
  7701. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  7702. oldCh[idxInOld] = undefined;
  7703. canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm);
  7704. newStartVnode = newCh[++newStartIdx];
  7705. }
  7706. }
  7707. }
  7708. }
  7709. if (oldStartIdx > oldEndIdx) {
  7710. before = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  7711. addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  7712. } else if (newStartIdx > newEndIdx) {
  7713. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  7714. }
  7715. }
  7716. function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
  7717. if (oldVnode === vnode) {
  7718. return
  7719. }
  7720. // reuse element for static trees.
  7721. // note we only do this if the vnode is cloned -
  7722. // if the new node is not cloned it means the render functions have been
  7723. // reset by the hot-reload-api and we need to do a proper re-render.
  7724. if (vnode.isStatic &&
  7725. oldVnode.isStatic &&
  7726. vnode.key === oldVnode.key &&
  7727. (vnode.isCloned || vnode.isOnce)) {
  7728. vnode.elm = oldVnode.elm;
  7729. vnode.child = oldVnode.child;
  7730. return
  7731. }
  7732. var i;
  7733. var data = vnode.data;
  7734. var hasData = isDef(data);
  7735. if (hasData && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  7736. i(oldVnode, vnode);
  7737. }
  7738. var elm = vnode.elm = oldVnode.elm;
  7739. var oldCh = oldVnode.children;
  7740. var ch = vnode.children;
  7741. if (hasData && isPatchable(vnode)) {
  7742. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  7743. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  7744. }
  7745. if (isUndef(vnode.text)) {
  7746. if (isDef(oldCh) && isDef(ch)) {
  7747. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  7748. } else if (isDef(ch)) {
  7749. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  7750. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  7751. } else if (isDef(oldCh)) {
  7752. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  7753. } else if (isDef(oldVnode.text)) {
  7754. nodeOps.setTextContent(elm, '');
  7755. }
  7756. } else if (oldVnode.text !== vnode.text) {
  7757. nodeOps.setTextContent(elm, vnode.text);
  7758. }
  7759. if (hasData) {
  7760. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  7761. }
  7762. }
  7763. function invokeInsertHook (vnode, queue, initial) {
  7764. // delay insert hooks for component root nodes, invoke them after the
  7765. // element is really inserted
  7766. if (initial && vnode.parent) {
  7767. vnode.parent.data.pendingInsert = queue;
  7768. } else {
  7769. for (var i = 0; i < queue.length; ++i) {
  7770. queue[i].data.hook.insert(queue[i]);
  7771. }
  7772. }
  7773. }
  7774. var bailed = false;
  7775. function hydrate (elm, vnode, insertedVnodeQueue) {
  7776. if (process.env.NODE_ENV !== 'production') {
  7777. if (!assertNodeMatch(elm, vnode)) {
  7778. return false
  7779. }
  7780. }
  7781. vnode.elm = elm;
  7782. var tag = vnode.tag;
  7783. var data = vnode.data;
  7784. var children = vnode.children;
  7785. if (isDef(data)) {
  7786. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  7787. if (isDef(i = vnode.child)) {
  7788. // child component. it should have hydrated its own tree.
  7789. initComponent(vnode, insertedVnodeQueue);
  7790. return true
  7791. }
  7792. }
  7793. if (isDef(tag)) {
  7794. if (isDef(children)) {
  7795. var childNodes = nodeOps.childNodes(elm);
  7796. // empty element, allow client to pick up and populate children
  7797. if (!childNodes.length) {
  7798. createChildren(vnode, children, insertedVnodeQueue);
  7799. } else {
  7800. var childrenMatch = true;
  7801. if (childNodes.length !== children.length) {
  7802. childrenMatch = false;
  7803. } else {
  7804. for (var i$1 = 0; i$1 < children.length; i$1++) {
  7805. if (!hydrate(childNodes[i$1], children[i$1], insertedVnodeQueue)) {
  7806. childrenMatch = false;
  7807. break
  7808. }
  7809. }
  7810. }
  7811. if (!childrenMatch) {
  7812. if (process.env.NODE_ENV !== 'production' &&
  7813. typeof console !== 'undefined' &&
  7814. !bailed) {
  7815. bailed = true;
  7816. console.warn('Parent: ', elm);
  7817. console.warn('Mismatching childNodes vs. VNodes: ', childNodes, children);
  7818. }
  7819. return false
  7820. }
  7821. }
  7822. }
  7823. if (isDef(data)) {
  7824. invokeCreateHooks(vnode, insertedVnodeQueue);
  7825. }
  7826. }
  7827. return true
  7828. }
  7829. function assertNodeMatch (node, vnode) {
  7830. if (vnode.tag) {
  7831. return (
  7832. vnode.tag.indexOf('vue-component') === 0 ||
  7833. vnode.tag.toLowerCase() === nodeOps.tagName(node).toLowerCase()
  7834. )
  7835. } else {
  7836. return _toString(vnode.text) === node.data
  7837. }
  7838. }
  7839. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  7840. if (!vnode) {
  7841. if (oldVnode) { invokeDestroyHook(oldVnode); }
  7842. return
  7843. }
  7844. var elm, parent;
  7845. var isInitialPatch = false;
  7846. var insertedVnodeQueue = [];
  7847. if (!oldVnode) {
  7848. // empty mount, create new root element
  7849. isInitialPatch = true;
  7850. createElm(vnode, insertedVnodeQueue);
  7851. } else {
  7852. var isRealElement = isDef(oldVnode.nodeType);
  7853. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  7854. patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
  7855. } else {
  7856. if (isRealElement) {
  7857. // mounting to a real element
  7858. // check if this is server-rendered content and if we can perform
  7859. // a successful hydration.
  7860. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute('server-rendered')) {
  7861. oldVnode.removeAttribute('server-rendered');
  7862. hydrating = true;
  7863. }
  7864. if (hydrating) {
  7865. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  7866. invokeInsertHook(vnode, insertedVnodeQueue, true);
  7867. return oldVnode
  7868. } else if (process.env.NODE_ENV !== 'production') {
  7869. warn(
  7870. 'The client-side rendered virtual DOM tree is not matching ' +
  7871. 'server-rendered content. This is likely caused by incorrect ' +
  7872. 'HTML markup, for example nesting block-level elements inside ' +
  7873. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  7874. 'full client-side render.'
  7875. );
  7876. }
  7877. }
  7878. // either not server-rendered, or hydration failed.
  7879. // create an empty node and replace it
  7880. oldVnode = emptyNodeAt(oldVnode);
  7881. }
  7882. elm = oldVnode.elm;
  7883. parent = nodeOps.parentNode(elm);
  7884. createElm(vnode, insertedVnodeQueue);
  7885. // component root element replaced.
  7886. // update parent placeholder node element, recursively
  7887. if (vnode.parent) {
  7888. var ancestor = vnode.parent;
  7889. while (ancestor) {
  7890. ancestor.elm = vnode.elm;
  7891. ancestor = ancestor.parent;
  7892. }
  7893. if (isPatchable(vnode)) {
  7894. for (var i = 0; i < cbs.create.length; ++i) {
  7895. cbs.create[i](emptyNode, vnode.parent);
  7896. }
  7897. }
  7898. }
  7899. if (parent !== null) {
  7900. nodeOps.insertBefore(parent, vnode.elm, nodeOps.nextSibling(elm));
  7901. removeVnodes(parent, [oldVnode], 0, 0);
  7902. } else if (isDef(oldVnode.tag)) {
  7903. invokeDestroyHook(oldVnode);
  7904. }
  7905. }
  7906. }
  7907. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  7908. return vnode.elm
  7909. }
  7910. }
  7911. /* */
  7912. var directives = {
  7913. create: updateDirectives,
  7914. update: updateDirectives,
  7915. destroy: function unbindDirectives (vnode) {
  7916. updateDirectives(vnode, emptyNode);
  7917. }
  7918. };
  7919. function updateDirectives (
  7920. oldVnode,
  7921. vnode
  7922. ) {
  7923. if (!oldVnode.data.directives && !vnode.data.directives) {
  7924. return
  7925. }
  7926. var isCreate = oldVnode === emptyNode;
  7927. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  7928. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  7929. var dirsWithInsert = [];
  7930. var dirsWithPostpatch = [];
  7931. var key, oldDir, dir;
  7932. for (key in newDirs) {
  7933. oldDir = oldDirs[key];
  7934. dir = newDirs[key];
  7935. if (!oldDir) {
  7936. // new directive, bind
  7937. callHook$1(dir, 'bind', vnode, oldVnode);
  7938. if (dir.def && dir.def.inserted) {
  7939. dirsWithInsert.push(dir);
  7940. }
  7941. } else {
  7942. // existing directive, update
  7943. dir.oldValue = oldDir.value;
  7944. callHook$1(dir, 'update', vnode, oldVnode);
  7945. if (dir.def && dir.def.componentUpdated) {
  7946. dirsWithPostpatch.push(dir);
  7947. }
  7948. }
  7949. }
  7950. if (dirsWithInsert.length) {
  7951. var callInsert = function () {
  7952. dirsWithInsert.forEach(function (dir) {
  7953. callHook$1(dir, 'inserted', vnode, oldVnode);
  7954. });
  7955. };
  7956. if (isCreate) {
  7957. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert, 'dir-insert');
  7958. } else {
  7959. callInsert();
  7960. }
  7961. }
  7962. if (dirsWithPostpatch.length) {
  7963. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
  7964. dirsWithPostpatch.forEach(function (dir) {
  7965. callHook$1(dir, 'componentUpdated', vnode, oldVnode);
  7966. });
  7967. }, 'dir-postpatch');
  7968. }
  7969. if (!isCreate) {
  7970. for (key in oldDirs) {
  7971. if (!newDirs[key]) {
  7972. // no longer present, unbind
  7973. callHook$1(oldDirs[key], 'unbind', oldVnode);
  7974. }
  7975. }
  7976. }
  7977. }
  7978. var emptyModifiers = Object.create(null);
  7979. function normalizeDirectives$1 (
  7980. dirs,
  7981. vm
  7982. ) {
  7983. var res = Object.create(null);
  7984. if (!dirs) {
  7985. return res
  7986. }
  7987. var i, dir;
  7988. for (i = 0; i < dirs.length; i++) {
  7989. dir = dirs[i];
  7990. if (!dir.modifiers) {
  7991. dir.modifiers = emptyModifiers;
  7992. }
  7993. res[getRawDirName(dir)] = dir;
  7994. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  7995. }
  7996. return res
  7997. }
  7998. function getRawDirName (dir) {
  7999. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  8000. }
  8001. function callHook$1 (dir, hook, vnode, oldVnode) {
  8002. var fn = dir.def && dir.def[hook];
  8003. if (fn) {
  8004. fn(vnode.elm, dir, vnode, oldVnode);
  8005. }
  8006. }
  8007. var baseModules = [
  8008. ref,
  8009. directives
  8010. ];
  8011. /* */
  8012. function updateAttrs (oldVnode, vnode) {
  8013. if (!oldVnode.data.attrs && !vnode.data.attrs) {
  8014. return
  8015. }
  8016. var key, cur, old;
  8017. var elm = vnode.elm;
  8018. var oldAttrs = oldVnode.data.attrs || {};
  8019. var attrs = vnode.data.attrs || {};
  8020. // clone observed objects, as the user probably wants to mutate it
  8021. if (attrs.__ob__) {
  8022. attrs = vnode.data.attrs = extend({}, attrs);
  8023. }
  8024. for (key in attrs) {
  8025. cur = attrs[key];
  8026. old = oldAttrs[key];
  8027. if (old !== cur) {
  8028. setAttr(elm, key, cur);
  8029. }
  8030. }
  8031. for (key in oldAttrs) {
  8032. if (attrs[key] == null) {
  8033. if (isXlink(key)) {
  8034. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  8035. } else if (!isEnumeratedAttr(key)) {
  8036. elm.removeAttribute(key);
  8037. }
  8038. }
  8039. }
  8040. }
  8041. function setAttr (el, key, value) {
  8042. if (isBooleanAttr(key)) {
  8043. // set attribute for blank value
  8044. // e.g. <option disabled>Select one</option>
  8045. if (isFalsyAttrValue(value)) {
  8046. el.removeAttribute(key);
  8047. } else {
  8048. el.setAttribute(key, key);
  8049. }
  8050. } else if (isEnumeratedAttr(key)) {
  8051. el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
  8052. } else if (isXlink(key)) {
  8053. if (isFalsyAttrValue(value)) {
  8054. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  8055. } else {
  8056. el.setAttributeNS(xlinkNS, key, value);
  8057. }
  8058. } else {
  8059. if (isFalsyAttrValue(value)) {
  8060. el.removeAttribute(key);
  8061. } else {
  8062. el.setAttribute(key, value);
  8063. }
  8064. }
  8065. }
  8066. var attrs = {
  8067. create: updateAttrs,
  8068. update: updateAttrs
  8069. };
  8070. /* */
  8071. function updateClass (oldVnode, vnode) {
  8072. var el = vnode.elm;
  8073. var data = vnode.data;
  8074. var oldData = oldVnode.data;
  8075. if (!data.staticClass && !data.class &&
  8076. (!oldData || (!oldData.staticClass && !oldData.class))) {
  8077. return
  8078. }
  8079. var cls = genClassForVnode(vnode);
  8080. // handle transition classes
  8081. var transitionClass = el._transitionClasses;
  8082. if (transitionClass) {
  8083. cls = concat(cls, stringifyClass(transitionClass));
  8084. }
  8085. // set the class
  8086. if (cls !== el._prevClass) {
  8087. el.setAttribute('class', cls);
  8088. el._prevClass = cls;
  8089. }
  8090. }
  8091. var klass = {
  8092. create: updateClass,
  8093. update: updateClass
  8094. };
  8095. // skip type checking this file because we need to attach private properties
  8096. // to elements
  8097. function updateDOMListeners (oldVnode, vnode) {
  8098. if (!oldVnode.data.on && !vnode.data.on) {
  8099. return
  8100. }
  8101. var on = vnode.data.on || {};
  8102. var oldOn = oldVnode.data.on || {};
  8103. var add = vnode.elm._v_add || (vnode.elm._v_add = function (event, handler, capture) {
  8104. vnode.elm.addEventListener(event, handler, capture);
  8105. });
  8106. var remove = vnode.elm._v_remove || (vnode.elm._v_remove = function (event, handler) {
  8107. vnode.elm.removeEventListener(event, handler);
  8108. });
  8109. updateListeners(on, oldOn, add, remove, vnode.context);
  8110. }
  8111. var events = {
  8112. create: updateDOMListeners,
  8113. update: updateDOMListeners
  8114. };
  8115. /* */
  8116. function updateDOMProps (oldVnode, vnode) {
  8117. if (!oldVnode.data.domProps && !vnode.data.domProps) {
  8118. return
  8119. }
  8120. var key, cur;
  8121. var elm = vnode.elm;
  8122. var oldProps = oldVnode.data.domProps || {};
  8123. var props = vnode.data.domProps || {};
  8124. // clone observed objects, as the user probably wants to mutate it
  8125. if (props.__ob__) {
  8126. props = vnode.data.domProps = extend({}, props);
  8127. }
  8128. for (key in oldProps) {
  8129. if (props[key] == null) {
  8130. elm[key] = '';
  8131. }
  8132. }
  8133. for (key in props) {
  8134. cur = props[key];
  8135. // ignore children if the node has textContent or innerHTML,
  8136. // as these will throw away existing DOM nodes and cause removal errors
  8137. // on subsequent patches (#3360)
  8138. if (key === 'textContent' || key === 'innerHTML') {
  8139. if (vnode.children) { vnode.children.length = 0; }
  8140. if (cur === oldProps[key]) { continue }
  8141. }
  8142. if (key === 'value') {
  8143. // store value as _value as well since
  8144. // non-string values will be stringified
  8145. elm._value = cur;
  8146. // avoid resetting cursor position when value is the same
  8147. var strCur = cur == null ? '' : String(cur);
  8148. if (elm.value !== strCur && !elm.composing) {
  8149. elm.value = strCur;
  8150. }
  8151. } else {
  8152. elm[key] = cur;
  8153. }
  8154. }
  8155. }
  8156. var domProps = {
  8157. create: updateDOMProps,
  8158. update: updateDOMProps
  8159. };
  8160. /* */
  8161. var parseStyleText = cached(function (cssText) {
  8162. var res = {};
  8163. var hasBackground = cssText.indexOf('background') >= 0;
  8164. // maybe with background-image: url(http://xxx) or base64 img
  8165. var listDelimiter = hasBackground ? /;(?![^(]*\))/g : ';';
  8166. var propertyDelimiter = hasBackground ? /:(.+)/ : ':';
  8167. cssText.split(listDelimiter).forEach(function (item) {
  8168. if (item) {
  8169. var tmp = item.split(propertyDelimiter);
  8170. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8171. }
  8172. });
  8173. return res
  8174. });
  8175. // merge static and dynamic style data on the same vnode
  8176. function normalizeStyleData (data) {
  8177. var style = normalizeStyleBinding(data.style);
  8178. // static style is pre-processed into an object during compilation
  8179. // and is always a fresh object, so it's safe to merge into it
  8180. return data.staticStyle
  8181. ? extend(data.staticStyle, style)
  8182. : style
  8183. }
  8184. // normalize possible array / string values into Object
  8185. function normalizeStyleBinding (bindingStyle) {
  8186. if (Array.isArray(bindingStyle)) {
  8187. return toObject(bindingStyle)
  8188. }
  8189. if (typeof bindingStyle === 'string') {
  8190. return parseStyleText(bindingStyle)
  8191. }
  8192. return bindingStyle
  8193. }
  8194. /**
  8195. * parent component style should be after child's
  8196. * so that parent component's style could override it
  8197. */
  8198. function getStyle (vnode, checkChild) {
  8199. var res = {};
  8200. var styleData;
  8201. if (checkChild) {
  8202. var childNode = vnode;
  8203. while (childNode.child) {
  8204. childNode = childNode.child._vnode;
  8205. if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
  8206. extend(res, styleData);
  8207. }
  8208. }
  8209. }
  8210. if ((styleData = normalizeStyleData(vnode.data))) {
  8211. extend(res, styleData);
  8212. }
  8213. var parentNode = vnode;
  8214. while ((parentNode = parentNode.parent)) {
  8215. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  8216. extend(res, styleData);
  8217. }
  8218. }
  8219. return res
  8220. }
  8221. /* */
  8222. var cssVarRE = /^--/;
  8223. var setProp = function (el, name, val) {
  8224. /* istanbul ignore if */
  8225. if (cssVarRE.test(name)) {
  8226. el.style.setProperty(name, val);
  8227. } else {
  8228. el.style[normalize(name)] = val;
  8229. }
  8230. };
  8231. var prefixes = ['Webkit', 'Moz', 'ms'];
  8232. var testEl;
  8233. var normalize = cached(function (prop) {
  8234. testEl = testEl || document.createElement('div');
  8235. prop = camelize(prop);
  8236. if (prop !== 'filter' && (prop in testEl.style)) {
  8237. return prop
  8238. }
  8239. var upper = prop.charAt(0).toUpperCase() + prop.slice(1);
  8240. for (var i = 0; i < prefixes.length; i++) {
  8241. var prefixed = prefixes[i] + upper;
  8242. if (prefixed in testEl.style) {
  8243. return prefixed
  8244. }
  8245. }
  8246. });
  8247. function updateStyle (oldVnode, vnode) {
  8248. var data = vnode.data;
  8249. var oldData = oldVnode.data;
  8250. if (!data.staticStyle && !data.style &&
  8251. !oldData.staticStyle && !oldData.style) {
  8252. return
  8253. }
  8254. var cur, name;
  8255. var el = vnode.elm;
  8256. var oldStaticStyle = oldVnode.data.staticStyle;
  8257. var oldStyleBinding = oldVnode.data.style || {};
  8258. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  8259. var oldStyle = oldStaticStyle || oldStyleBinding;
  8260. var style = normalizeStyleBinding(vnode.data.style) || {};
  8261. vnode.data.style = style.__ob__ ? extend({}, style) : style;
  8262. var newStyle = getStyle(vnode, true);
  8263. for (name in oldStyle) {
  8264. if (newStyle[name] == null) {
  8265. setProp(el, name, '');
  8266. }
  8267. }
  8268. for (name in newStyle) {
  8269. cur = newStyle[name];
  8270. if (cur !== oldStyle[name]) {
  8271. // ie9 setting to null has no effect, must use empty string
  8272. setProp(el, name, cur == null ? '' : cur);
  8273. }
  8274. }
  8275. }
  8276. var style = {
  8277. create: updateStyle,
  8278. update: updateStyle
  8279. };
  8280. /* */
  8281. /**
  8282. * Add class with compatibility for SVG since classList is not supported on
  8283. * SVG elements in IE
  8284. */
  8285. function addClass (el, cls) {
  8286. /* istanbul ignore if */
  8287. if (!cls || !cls.trim()) {
  8288. return
  8289. }
  8290. /* istanbul ignore else */
  8291. if (el.classList) {
  8292. if (cls.indexOf(' ') > -1) {
  8293. cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
  8294. } else {
  8295. el.classList.add(cls);
  8296. }
  8297. } else {
  8298. var cur = ' ' + el.getAttribute('class') + ' ';
  8299. if (cur.indexOf(' ' + cls + ' ') < 0) {
  8300. el.setAttribute('class', (cur + cls).trim());
  8301. }
  8302. }
  8303. }
  8304. /**
  8305. * Remove class with compatibility for SVG since classList is not supported on
  8306. * SVG elements in IE
  8307. */
  8308. function removeClass (el, cls) {
  8309. /* istanbul ignore if */
  8310. if (!cls || !cls.trim()) {
  8311. return
  8312. }
  8313. /* istanbul ignore else */
  8314. if (el.classList) {
  8315. if (cls.indexOf(' ') > -1) {
  8316. cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
  8317. } else {
  8318. el.classList.remove(cls);
  8319. }
  8320. } else {
  8321. var cur = ' ' + el.getAttribute('class') + ' ';
  8322. var tar = ' ' + cls + ' ';
  8323. while (cur.indexOf(tar) >= 0) {
  8324. cur = cur.replace(tar, ' ');
  8325. }
  8326. el.setAttribute('class', cur.trim());
  8327. }
  8328. }
  8329. /* */
  8330. var hasTransition = inBrowser && !isIE9;
  8331. var TRANSITION = 'transition';
  8332. var ANIMATION = 'animation';
  8333. // Transition property/event sniffing
  8334. var transitionProp = 'transition';
  8335. var transitionEndEvent = 'transitionend';
  8336. var animationProp = 'animation';
  8337. var animationEndEvent = 'animationend';
  8338. if (hasTransition) {
  8339. /* istanbul ignore if */
  8340. if (window.ontransitionend === undefined &&
  8341. window.onwebkittransitionend !== undefined) {
  8342. transitionProp = 'WebkitTransition';
  8343. transitionEndEvent = 'webkitTransitionEnd';
  8344. }
  8345. if (window.onanimationend === undefined &&
  8346. window.onwebkitanimationend !== undefined) {
  8347. animationProp = 'WebkitAnimation';
  8348. animationEndEvent = 'webkitAnimationEnd';
  8349. }
  8350. }
  8351. var raf = (inBrowser && window.requestAnimationFrame) || setTimeout;
  8352. function nextFrame (fn) {
  8353. raf(function () {
  8354. raf(fn);
  8355. });
  8356. }
  8357. function addTransitionClass (el, cls) {
  8358. (el._transitionClasses || (el._transitionClasses = [])).push(cls);
  8359. addClass(el, cls);
  8360. }
  8361. function removeTransitionClass (el, cls) {
  8362. if (el._transitionClasses) {
  8363. remove$1(el._transitionClasses, cls);
  8364. }
  8365. removeClass(el, cls);
  8366. }
  8367. function whenTransitionEnds (
  8368. el,
  8369. expectedType,
  8370. cb
  8371. ) {
  8372. var ref = getTransitionInfo(el, expectedType);
  8373. var type = ref.type;
  8374. var timeout = ref.timeout;
  8375. var propCount = ref.propCount;
  8376. if (!type) { return cb() }
  8377. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  8378. var ended = 0;
  8379. var end = function () {
  8380. el.removeEventListener(event, onEnd);
  8381. cb();
  8382. };
  8383. var onEnd = function (e) {
  8384. if (e.target === el) {
  8385. if (++ended >= propCount) {
  8386. end();
  8387. }
  8388. }
  8389. };
  8390. setTimeout(function () {
  8391. if (ended < propCount) {
  8392. end();
  8393. }
  8394. }, timeout + 1);
  8395. el.addEventListener(event, onEnd);
  8396. }
  8397. var transformRE = /\b(transform|all)(,|$)/;
  8398. function getTransitionInfo (el, expectedType) {
  8399. var styles = window.getComputedStyle(el);
  8400. var transitioneDelays = styles[transitionProp + 'Delay'].split(', ');
  8401. var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
  8402. var transitionTimeout = getTimeout(transitioneDelays, transitionDurations);
  8403. var animationDelays = styles[animationProp + 'Delay'].split(', ');
  8404. var animationDurations = styles[animationProp + 'Duration'].split(', ');
  8405. var animationTimeout = getTimeout(animationDelays, animationDurations);
  8406. var type;
  8407. var timeout = 0;
  8408. var propCount = 0;
  8409. /* istanbul ignore if */
  8410. if (expectedType === TRANSITION) {
  8411. if (transitionTimeout > 0) {
  8412. type = TRANSITION;
  8413. timeout = transitionTimeout;
  8414. propCount = transitionDurations.length;
  8415. }
  8416. } else if (expectedType === ANIMATION) {
  8417. if (animationTimeout > 0) {
  8418. type = ANIMATION;
  8419. timeout = animationTimeout;
  8420. propCount = animationDurations.length;
  8421. }
  8422. } else {
  8423. timeout = Math.max(transitionTimeout, animationTimeout);
  8424. type = timeout > 0
  8425. ? transitionTimeout > animationTimeout
  8426. ? TRANSITION
  8427. : ANIMATION
  8428. : null;
  8429. propCount = type
  8430. ? type === TRANSITION
  8431. ? transitionDurations.length
  8432. : animationDurations.length
  8433. : 0;
  8434. }
  8435. var hasTransform =
  8436. type === TRANSITION &&
  8437. transformRE.test(styles[transitionProp + 'Property']);
  8438. return {
  8439. type: type,
  8440. timeout: timeout,
  8441. propCount: propCount,
  8442. hasTransform: hasTransform
  8443. }
  8444. }
  8445. function getTimeout (delays, durations) {
  8446. /* istanbul ignore next */
  8447. while (delays.length < durations.length) {
  8448. delays = delays.concat(delays);
  8449. }
  8450. return Math.max.apply(null, durations.map(function (d, i) {
  8451. return toMs(d) + toMs(delays[i])
  8452. }))
  8453. }
  8454. function toMs (s) {
  8455. return Number(s.slice(0, -1)) * 1000
  8456. }
  8457. /* */
  8458. function enter (vnode) {
  8459. var el = vnode.elm;
  8460. // call leave callback now
  8461. if (el._leaveCb) {
  8462. el._leaveCb.cancelled = true;
  8463. el._leaveCb();
  8464. }
  8465. var data = resolveTransition(vnode.data.transition);
  8466. if (!data) {
  8467. return
  8468. }
  8469. /* istanbul ignore if */
  8470. if (el._enterCb || el.nodeType !== 1) {
  8471. return
  8472. }
  8473. var css = data.css;
  8474. var type = data.type;
  8475. var enterClass = data.enterClass;
  8476. var enterActiveClass = data.enterActiveClass;
  8477. var appearClass = data.appearClass;
  8478. var appearActiveClass = data.appearActiveClass;
  8479. var beforeEnter = data.beforeEnter;
  8480. var enter = data.enter;
  8481. var afterEnter = data.afterEnter;
  8482. var enterCancelled = data.enterCancelled;
  8483. var beforeAppear = data.beforeAppear;
  8484. var appear = data.appear;
  8485. var afterAppear = data.afterAppear;
  8486. var appearCancelled = data.appearCancelled;
  8487. // activeInstance will always be the <transition> component managing this
  8488. // transition. One edge case to check is when the <transition> is placed
  8489. // as the root node of a child component. In that case we need to check
  8490. // <transition>'s parent for appear check.
  8491. var transitionNode = activeInstance.$vnode;
  8492. var context = transitionNode && transitionNode.parent
  8493. ? transitionNode.parent.context
  8494. : activeInstance;
  8495. var isAppear = !context._isMounted || !vnode.isRootInsert;
  8496. if (isAppear && !appear && appear !== '') {
  8497. return
  8498. }
  8499. var startClass = isAppear ? appearClass : enterClass;
  8500. var activeClass = isAppear ? appearActiveClass : enterActiveClass;
  8501. var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
  8502. var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
  8503. var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
  8504. var enterCancelledHook = isAppear ? (appearCancelled || enterCancelled) : enterCancelled;
  8505. var expectsCSS = css !== false && !isIE9;
  8506. var userWantsControl =
  8507. enterHook &&
  8508. // enterHook may be a bound method which exposes
  8509. // the length of original fn as _length
  8510. (enterHook._length || enterHook.length) > 1;
  8511. var cb = el._enterCb = once(function () {
  8512. if (expectsCSS) {
  8513. removeTransitionClass(el, activeClass);
  8514. }
  8515. if (cb.cancelled) {
  8516. if (expectsCSS) {
  8517. removeTransitionClass(el, startClass);
  8518. }
  8519. enterCancelledHook && enterCancelledHook(el);
  8520. } else {
  8521. afterEnterHook && afterEnterHook(el);
  8522. }
  8523. el._enterCb = null;
  8524. });
  8525. if (!vnode.data.show) {
  8526. // remove pending leave element on enter by injecting an insert hook
  8527. mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
  8528. var parent = el.parentNode;
  8529. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  8530. if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
  8531. pendingNode.elm._leaveCb();
  8532. }
  8533. enterHook && enterHook(el, cb);
  8534. }, 'transition-insert');
  8535. }
  8536. // start enter transition
  8537. beforeEnterHook && beforeEnterHook(el);
  8538. if (expectsCSS) {
  8539. addTransitionClass(el, startClass);
  8540. addTransitionClass(el, activeClass);
  8541. nextFrame(function () {
  8542. removeTransitionClass(el, startClass);
  8543. if (!cb.cancelled && !userWantsControl) {
  8544. whenTransitionEnds(el, type, cb);
  8545. }
  8546. });
  8547. }
  8548. if (vnode.data.show) {
  8549. enterHook && enterHook(el, cb);
  8550. }
  8551. if (!expectsCSS && !userWantsControl) {
  8552. cb();
  8553. }
  8554. }
  8555. function leave (vnode, rm) {
  8556. var el = vnode.elm;
  8557. // call enter callback now
  8558. if (el._enterCb) {
  8559. el._enterCb.cancelled = true;
  8560. el._enterCb();
  8561. }
  8562. var data = resolveTransition(vnode.data.transition);
  8563. if (!data) {
  8564. return rm()
  8565. }
  8566. /* istanbul ignore if */
  8567. if (el._leaveCb || el.nodeType !== 1) {
  8568. return
  8569. }
  8570. var css = data.css;
  8571. var type = data.type;
  8572. var leaveClass = data.leaveClass;
  8573. var leaveActiveClass = data.leaveActiveClass;
  8574. var beforeLeave = data.beforeLeave;
  8575. var leave = data.leave;
  8576. var afterLeave = data.afterLeave;
  8577. var leaveCancelled = data.leaveCancelled;
  8578. var delayLeave = data.delayLeave;
  8579. var expectsCSS = css !== false && !isIE9;
  8580. var userWantsControl =
  8581. leave &&
  8582. // leave hook may be a bound method which exposes
  8583. // the length of original fn as _length
  8584. (leave._length || leave.length) > 1;
  8585. var cb = el._leaveCb = once(function () {
  8586. if (el.parentNode && el.parentNode._pending) {
  8587. el.parentNode._pending[vnode.key] = null;
  8588. }
  8589. if (expectsCSS) {
  8590. removeTransitionClass(el, leaveActiveClass);
  8591. }
  8592. if (cb.cancelled) {
  8593. if (expectsCSS) {
  8594. removeTransitionClass(el, leaveClass);
  8595. }
  8596. leaveCancelled && leaveCancelled(el);
  8597. } else {
  8598. rm();
  8599. afterLeave && afterLeave(el);
  8600. }
  8601. el._leaveCb = null;
  8602. });
  8603. if (delayLeave) {
  8604. delayLeave(performLeave);
  8605. } else {
  8606. performLeave();
  8607. }
  8608. function performLeave () {
  8609. // the delayed leave may have already been cancelled
  8610. if (cb.cancelled) {
  8611. return
  8612. }
  8613. // record leaving element
  8614. if (!vnode.data.show) {
  8615. (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
  8616. }
  8617. beforeLeave && beforeLeave(el);
  8618. if (expectsCSS) {
  8619. addTransitionClass(el, leaveClass);
  8620. addTransitionClass(el, leaveActiveClass);
  8621. nextFrame(function () {
  8622. removeTransitionClass(el, leaveClass);
  8623. if (!cb.cancelled && !userWantsControl) {
  8624. whenTransitionEnds(el, type, cb);
  8625. }
  8626. });
  8627. }
  8628. leave && leave(el, cb);
  8629. if (!expectsCSS && !userWantsControl) {
  8630. cb();
  8631. }
  8632. }
  8633. }
  8634. function resolveTransition (def$$1) {
  8635. if (!def$$1) {
  8636. return
  8637. }
  8638. /* istanbul ignore else */
  8639. if (typeof def$$1 === 'object') {
  8640. var res = {};
  8641. if (def$$1.css !== false) {
  8642. extend(res, autoCssTransition(def$$1.name || 'v'));
  8643. }
  8644. extend(res, def$$1);
  8645. return res
  8646. } else if (typeof def$$1 === 'string') {
  8647. return autoCssTransition(def$$1)
  8648. }
  8649. }
  8650. var autoCssTransition = cached(function (name) {
  8651. return {
  8652. enterClass: (name + "-enter"),
  8653. leaveClass: (name + "-leave"),
  8654. appearClass: (name + "-enter"),
  8655. enterActiveClass: (name + "-enter-active"),
  8656. leaveActiveClass: (name + "-leave-active"),
  8657. appearActiveClass: (name + "-enter-active")
  8658. }
  8659. });
  8660. function once (fn) {
  8661. var called = false;
  8662. return function () {
  8663. if (!called) {
  8664. called = true;
  8665. fn();
  8666. }
  8667. }
  8668. }
  8669. var transition = inBrowser ? {
  8670. create: function create (_, vnode) {
  8671. if (!vnode.data.show) {
  8672. enter(vnode);
  8673. }
  8674. },
  8675. remove: function remove (vnode, rm) {
  8676. /* istanbul ignore else */
  8677. if (!vnode.data.show) {
  8678. leave(vnode, rm);
  8679. } else {
  8680. rm();
  8681. }
  8682. }
  8683. } : {};
  8684. var platformModules = [
  8685. attrs,
  8686. klass,
  8687. events,
  8688. domProps,
  8689. style,
  8690. transition
  8691. ];
  8692. /* */
  8693. // the directive module should be applied last, after all
  8694. // built-in modules have been applied.
  8695. var modules = platformModules.concat(baseModules);
  8696. var patch$1 = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  8697. /**
  8698. * Not type checking this file because flow doesn't like attaching
  8699. * properties to Elements.
  8700. */
  8701. var modelableTagRE = /^input|select|textarea|vue-component-[0-9]+(-[0-9a-zA-Z_-]*)?$/;
  8702. /* istanbul ignore if */
  8703. if (isIE9) {
  8704. // http://www.matts411.com/post/internet-explorer-9-oninput/
  8705. document.addEventListener('selectionchange', function () {
  8706. var el = document.activeElement;
  8707. if (el && el.vmodel) {
  8708. trigger(el, 'input');
  8709. }
  8710. });
  8711. }
  8712. var model = {
  8713. inserted: function inserted (el, binding, vnode) {
  8714. if (process.env.NODE_ENV !== 'production') {
  8715. if (!modelableTagRE.test(vnode.tag)) {
  8716. warn(
  8717. "v-model is not supported on element type: <" + (vnode.tag) + ">. " +
  8718. 'If you are working with contenteditable, it\'s recommended to ' +
  8719. 'wrap a library dedicated for that purpose inside a custom component.',
  8720. vnode.context
  8721. );
  8722. }
  8723. }
  8724. if (vnode.tag === 'select') {
  8725. var cb = function () {
  8726. setSelected(el, binding, vnode.context);
  8727. };
  8728. cb();
  8729. /* istanbul ignore if */
  8730. if (isIE || isEdge) {
  8731. setTimeout(cb, 0);
  8732. }
  8733. } else if (
  8734. (vnode.tag === 'textarea' || el.type === 'text') &&
  8735. !binding.modifiers.lazy
  8736. ) {
  8737. if (!isAndroid) {
  8738. el.addEventListener('compositionstart', onCompositionStart);
  8739. el.addEventListener('compositionend', onCompositionEnd);
  8740. }
  8741. /* istanbul ignore if */
  8742. if (isIE9) {
  8743. el.vmodel = true;
  8744. }
  8745. }
  8746. },
  8747. componentUpdated: function componentUpdated (el, binding, vnode) {
  8748. if (vnode.tag === 'select') {
  8749. setSelected(el, binding, vnode.context);
  8750. // in case the options rendered by v-for have changed,
  8751. // it's possible that the value is out-of-sync with the rendered options.
  8752. // detect such cases and filter out values that no longer has a matching
  8753. // option in the DOM.
  8754. var needReset = el.multiple
  8755. ? binding.value.some(function (v) { return hasNoMatchingOption(v, el.options); })
  8756. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, el.options);
  8757. if (needReset) {
  8758. trigger(el, 'change');
  8759. }
  8760. }
  8761. }
  8762. };
  8763. function setSelected (el, binding, vm) {
  8764. var value = binding.value;
  8765. var isMultiple = el.multiple;
  8766. if (isMultiple && !Array.isArray(value)) {
  8767. process.env.NODE_ENV !== 'production' && warn(
  8768. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  8769. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  8770. vm
  8771. );
  8772. return
  8773. }
  8774. var selected, option;
  8775. for (var i = 0, l = el.options.length; i < l; i++) {
  8776. option = el.options[i];
  8777. if (isMultiple) {
  8778. selected = looseIndexOf(value, getValue(option)) > -1;
  8779. if (option.selected !== selected) {
  8780. option.selected = selected;
  8781. }
  8782. } else {
  8783. if (looseEqual(getValue(option), value)) {
  8784. if (el.selectedIndex !== i) {
  8785. el.selectedIndex = i;
  8786. }
  8787. return
  8788. }
  8789. }
  8790. }
  8791. if (!isMultiple) {
  8792. el.selectedIndex = -1;
  8793. }
  8794. }
  8795. function hasNoMatchingOption (value, options) {
  8796. for (var i = 0, l = options.length; i < l; i++) {
  8797. if (looseEqual(getValue(options[i]), value)) {
  8798. return false
  8799. }
  8800. }
  8801. return true
  8802. }
  8803. function getValue (option) {
  8804. return '_value' in option
  8805. ? option._value
  8806. : option.value
  8807. }
  8808. function onCompositionStart (e) {
  8809. e.target.composing = true;
  8810. }
  8811. function onCompositionEnd (e) {
  8812. e.target.composing = false;
  8813. trigger(e.target, 'input');
  8814. }
  8815. function trigger (el, type) {
  8816. var e = document.createEvent('HTMLEvents');
  8817. e.initEvent(type, true, true);
  8818. el.dispatchEvent(e);
  8819. }
  8820. /* */
  8821. // recursively search for possible transition defined inside the component root
  8822. function locateNode (vnode) {
  8823. return vnode.child && (!vnode.data || !vnode.data.transition)
  8824. ? locateNode(vnode.child._vnode)
  8825. : vnode
  8826. }
  8827. var show = {
  8828. bind: function bind (el, ref, vnode) {
  8829. var value = ref.value;
  8830. vnode = locateNode(vnode);
  8831. var transition = vnode.data && vnode.data.transition;
  8832. if (value && transition && !isIE9) {
  8833. enter(vnode);
  8834. }
  8835. var originalDisplay = el.style.display === 'none' ? '' : el.style.display;
  8836. el.style.display = value ? originalDisplay : 'none';
  8837. el.__vOriginalDisplay = originalDisplay;
  8838. },
  8839. update: function update (el, ref, vnode) {
  8840. var value = ref.value;
  8841. var oldValue = ref.oldValue;
  8842. /* istanbul ignore if */
  8843. if (value === oldValue) { return }
  8844. vnode = locateNode(vnode);
  8845. var transition = vnode.data && vnode.data.transition;
  8846. if (transition && !isIE9) {
  8847. if (value) {
  8848. enter(vnode);
  8849. el.style.display = el.__vOriginalDisplay;
  8850. } else {
  8851. leave(vnode, function () {
  8852. el.style.display = 'none';
  8853. });
  8854. }
  8855. } else {
  8856. el.style.display = value ? el.__vOriginalDisplay : 'none';
  8857. }
  8858. }
  8859. };
  8860. var platformDirectives = {
  8861. model: model,
  8862. show: show
  8863. };
  8864. /* */
  8865. // Provides transition support for a single element/component.
  8866. // supports transition mode (out-in / in-out)
  8867. var transitionProps = {
  8868. name: String,
  8869. appear: Boolean,
  8870. css: Boolean,
  8871. mode: String,
  8872. type: String,
  8873. enterClass: String,
  8874. leaveClass: String,
  8875. enterActiveClass: String,
  8876. leaveActiveClass: String,
  8877. appearClass: String,
  8878. appearActiveClass: String
  8879. };
  8880. // in case the child is also an abstract component, e.g. <keep-alive>
  8881. // we want to recursively retrieve the real component to be rendered
  8882. function getRealChild (vnode) {
  8883. var compOptions = vnode && vnode.componentOptions;
  8884. if (compOptions && compOptions.Ctor.options.abstract) {
  8885. return getRealChild(getFirstComponentChild(compOptions.children))
  8886. } else {
  8887. return vnode
  8888. }
  8889. }
  8890. function extractTransitionData (comp) {
  8891. var data = {};
  8892. var options = comp.$options;
  8893. // props
  8894. for (var key in options.propsData) {
  8895. data[key] = comp[key];
  8896. }
  8897. // events.
  8898. // extract listeners and pass them directly to the transition methods
  8899. var listeners = options._parentListeners;
  8900. for (var key$1 in listeners) {
  8901. data[camelize(key$1)] = listeners[key$1].fn;
  8902. }
  8903. return data
  8904. }
  8905. function placeholder (h, rawChild) {
  8906. return /\d-keep-alive$/.test(rawChild.tag)
  8907. ? h('keep-alive')
  8908. : null
  8909. }
  8910. function hasParentTransition (vnode) {
  8911. while ((vnode = vnode.parent)) {
  8912. if (vnode.data.transition) {
  8913. return true
  8914. }
  8915. }
  8916. }
  8917. var Transition = {
  8918. name: 'transition',
  8919. props: transitionProps,
  8920. abstract: true,
  8921. render: function render (h) {
  8922. var this$1 = this;
  8923. var children = this.$slots.default;
  8924. if (!children) {
  8925. return
  8926. }
  8927. // filter out text nodes (possible whitespaces)
  8928. children = children.filter(function (c) { return c.tag; });
  8929. /* istanbul ignore if */
  8930. if (!children.length) {
  8931. return
  8932. }
  8933. // warn multiple elements
  8934. if (process.env.NODE_ENV !== 'production' && children.length > 1) {
  8935. warn(
  8936. '<transition> can only be used on a single element. Use ' +
  8937. '<transition-group> for lists.',
  8938. this.$parent
  8939. );
  8940. }
  8941. var mode = this.mode;
  8942. // warn invalid mode
  8943. if (process.env.NODE_ENV !== 'production' &&
  8944. mode && mode !== 'in-out' && mode !== 'out-in') {
  8945. warn(
  8946. 'invalid <transition> mode: ' + mode,
  8947. this.$parent
  8948. );
  8949. }
  8950. var rawChild = children[0];
  8951. // if this is a component root node and the component's
  8952. // parent container node also has transition, skip.
  8953. if (hasParentTransition(this.$vnode)) {
  8954. return rawChild
  8955. }
  8956. // apply transition data to child
  8957. // use getRealChild() to ignore abstract components e.g. keep-alive
  8958. var child = getRealChild(rawChild);
  8959. /* istanbul ignore if */
  8960. if (!child) {
  8961. return rawChild
  8962. }
  8963. if (this._leaving) {
  8964. return placeholder(h, rawChild)
  8965. }
  8966. var key = child.key = child.key == null || child.isStatic
  8967. ? ("__v" + (child.tag + this._uid) + "__")
  8968. : child.key;
  8969. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  8970. var oldRawChild = this._vnode;
  8971. var oldChild = getRealChild(oldRawChild);
  8972. // mark v-show
  8973. // so that the transition module can hand over the control to the directive
  8974. if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
  8975. child.data.show = true;
  8976. }
  8977. if (oldChild && oldChild.data && oldChild.key !== key) {
  8978. // replace old child transition data with fresh one
  8979. // important for dynamic transitions!
  8980. var oldData = oldChild.data.transition = extend({}, data);
  8981. // handle transition mode
  8982. if (mode === 'out-in') {
  8983. // return placeholder node and queue update when leave finishes
  8984. this._leaving = true;
  8985. mergeVNodeHook(oldData, 'afterLeave', function () {
  8986. this$1._leaving = false;
  8987. this$1.$forceUpdate();
  8988. }, key);
  8989. return placeholder(h, rawChild)
  8990. } else if (mode === 'in-out') {
  8991. var delayedLeave;
  8992. var performLeave = function () { delayedLeave(); };
  8993. mergeVNodeHook(data, 'afterEnter', performLeave, key);
  8994. mergeVNodeHook(data, 'enterCancelled', performLeave, key);
  8995. mergeVNodeHook(oldData, 'delayLeave', function (leave) {
  8996. delayedLeave = leave;
  8997. }, key);
  8998. }
  8999. }
  9000. return rawChild
  9001. }
  9002. };
  9003. /* */
  9004. // Provides transition support for list items.
  9005. // supports move transitions using the FLIP technique.
  9006. // Because the vdom's children update algorithm is "unstable" - i.e.
  9007. // it doesn't guarantee the relative positioning of removed elements,
  9008. // we force transition-group to update its children into two passes:
  9009. // in the first pass, we remove all nodes that need to be removed,
  9010. // triggering their leaving transition; in the second pass, we insert/move
  9011. // into the final disired state. This way in the second pass removed
  9012. // nodes will remain where they should be.
  9013. var props = extend({
  9014. tag: String,
  9015. moveClass: String
  9016. }, transitionProps);
  9017. delete props.mode;
  9018. var TransitionGroup = {
  9019. props: props,
  9020. render: function render (h) {
  9021. var tag = this.tag || this.$vnode.data.tag || 'span';
  9022. var map = Object.create(null);
  9023. var prevChildren = this.prevChildren = this.children;
  9024. var rawChildren = this.$slots.default || [];
  9025. var children = this.children = [];
  9026. var transitionData = extractTransitionData(this);
  9027. for (var i = 0; i < rawChildren.length; i++) {
  9028. var c = rawChildren[i];
  9029. if (c.tag) {
  9030. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  9031. children.push(c);
  9032. map[c.key] = c
  9033. ;(c.data || (c.data = {})).transition = transitionData;
  9034. } else if (process.env.NODE_ENV !== 'production') {
  9035. var opts = c.componentOptions;
  9036. var name = opts
  9037. ? (opts.Ctor.options.name || opts.tag)
  9038. : c.tag;
  9039. warn(("<transition-group> children must be keyed: <" + name + ">"));
  9040. }
  9041. }
  9042. }
  9043. if (prevChildren) {
  9044. var kept = [];
  9045. var removed = [];
  9046. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  9047. var c$1 = prevChildren[i$1];
  9048. c$1.data.transition = transitionData;
  9049. c$1.data.pos = c$1.elm.getBoundingClientRect();
  9050. if (map[c$1.key]) {
  9051. kept.push(c$1);
  9052. } else {
  9053. removed.push(c$1);
  9054. }
  9055. }
  9056. this.kept = h(tag, null, kept);
  9057. this.removed = removed;
  9058. }
  9059. return h(tag, null, children)
  9060. },
  9061. beforeUpdate: function beforeUpdate () {
  9062. // force removing pass
  9063. this.__patch__(
  9064. this._vnode,
  9065. this.kept,
  9066. false, // hydrating
  9067. true // removeOnly (!important, avoids unnecessary moves)
  9068. );
  9069. this._vnode = this.kept;
  9070. },
  9071. updated: function updated () {
  9072. var children = this.prevChildren;
  9073. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  9074. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  9075. return
  9076. }
  9077. // we divide the work into three loops to avoid mixing DOM reads and writes
  9078. // in each iteration - which helps prevent layout thrashing.
  9079. children.forEach(callPendingCbs);
  9080. children.forEach(recordPosition);
  9081. children.forEach(applyTranslation);
  9082. // force reflow to put everything in position
  9083. var f = document.body.offsetHeight; // eslint-disable-line
  9084. children.forEach(function (c) {
  9085. if (c.data.moved) {
  9086. var el = c.elm;
  9087. var s = el.style;
  9088. addTransitionClass(el, moveClass);
  9089. s.transform = s.WebkitTransform = s.transitionDuration = '';
  9090. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  9091. if (!e || /transform$/.test(e.propertyName)) {
  9092. el.removeEventListener(transitionEndEvent, cb);
  9093. el._moveCb = null;
  9094. removeTransitionClass(el, moveClass);
  9095. }
  9096. });
  9097. }
  9098. });
  9099. },
  9100. methods: {
  9101. hasMove: function hasMove (el, moveClass) {
  9102. /* istanbul ignore if */
  9103. if (!hasTransition) {
  9104. return false
  9105. }
  9106. if (this._hasMove != null) {
  9107. return this._hasMove
  9108. }
  9109. addTransitionClass(el, moveClass);
  9110. var info = getTransitionInfo(el);
  9111. removeTransitionClass(el, moveClass);
  9112. return (this._hasMove = info.hasTransform)
  9113. }
  9114. }
  9115. };
  9116. function callPendingCbs (c) {
  9117. /* istanbul ignore if */
  9118. if (c.elm._moveCb) {
  9119. c.elm._moveCb();
  9120. }
  9121. /* istanbul ignore if */
  9122. if (c.elm._enterCb) {
  9123. c.elm._enterCb();
  9124. }
  9125. }
  9126. function recordPosition (c) {
  9127. c.data.newPos = c.elm.getBoundingClientRect();
  9128. }
  9129. function applyTranslation (c) {
  9130. var oldPos = c.data.pos;
  9131. var newPos = c.data.newPos;
  9132. var dx = oldPos.left - newPos.left;
  9133. var dy = oldPos.top - newPos.top;
  9134. if (dx || dy) {
  9135. c.data.moved = true;
  9136. var s = c.elm.style;
  9137. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  9138. s.transitionDuration = '0s';
  9139. }
  9140. }
  9141. var platformComponents = {
  9142. Transition: Transition,
  9143. TransitionGroup: TransitionGroup
  9144. };
  9145. /* */
  9146. // install platform specific utils
  9147. Vue$2.config.isUnknownElement = isUnknownElement;
  9148. Vue$2.config.isReservedTag = isReservedTag;
  9149. Vue$2.config.getTagNamespace = getTagNamespace;
  9150. Vue$2.config.mustUseProp = mustUseProp;
  9151. // install platform runtime directives & components
  9152. extend(Vue$2.options.directives, platformDirectives);
  9153. extend(Vue$2.options.components, platformComponents);
  9154. // install platform patch function
  9155. Vue$2.prototype.__patch__ = inBrowser ? patch$1 : noop;
  9156. // wrap mount
  9157. Vue$2.prototype.$mount = function (
  9158. el,
  9159. hydrating
  9160. ) {
  9161. el = el && inBrowser ? query(el) : undefined;
  9162. return this._mount(el, hydrating)
  9163. };
  9164. // devtools global hook
  9165. /* istanbul ignore next */
  9166. setTimeout(function () {
  9167. if (config.devtools) {
  9168. if (devtools) {
  9169. devtools.emit('init', Vue$2);
  9170. } else if (
  9171. process.env.NODE_ENV !== 'production' &&
  9172. inBrowser && /Chrome\/\d+/.test(window.navigator.userAgent)
  9173. ) {
  9174. console.log(
  9175. 'Download the Vue Devtools for a better development experience:\n' +
  9176. 'https://github.com/vuejs/vue-devtools'
  9177. );
  9178. }
  9179. }
  9180. }, 0);
  9181. module.exports = Vue$2;
  9182. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14), __webpack_require__(5)))
  9183. /***/ },
  9184. /* 34 */
  9185. /***/ function(module, exports, __webpack_require__) {
  9186. "use strict";
  9187. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9188. var utils = __webpack_require__(2);
  9189. var normalizeHeaderName = __webpack_require__(99);
  9190. var PROTECTION_PREFIX = /^\)\]\}',?\n/;
  9191. var DEFAULT_CONTENT_TYPE = {
  9192. 'Content-Type': 'application/x-www-form-urlencoded'
  9193. };
  9194. function setContentTypeIfUnset(headers, value) {
  9195. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  9196. headers['Content-Type'] = value;
  9197. }
  9198. }
  9199. function getDefaultAdapter() {
  9200. var adapter;
  9201. if (typeof XMLHttpRequest !== 'undefined') {
  9202. // For browsers use XHR adapter
  9203. adapter = __webpack_require__(51);
  9204. } else if (typeof process !== 'undefined') {
  9205. // For node use HTTP adapter
  9206. adapter = __webpack_require__(51);
  9207. }
  9208. return adapter;
  9209. }
  9210. var defaults = {
  9211. adapter: getDefaultAdapter(),
  9212. transformRequest: [function transformRequest(data, headers) {
  9213. normalizeHeaderName(headers, 'Content-Type');
  9214. if (utils.isFormData(data) ||
  9215. utils.isArrayBuffer(data) ||
  9216. utils.isStream(data) ||
  9217. utils.isFile(data) ||
  9218. utils.isBlob(data)
  9219. ) {
  9220. return data;
  9221. }
  9222. if (utils.isArrayBufferView(data)) {
  9223. return data.buffer;
  9224. }
  9225. if (utils.isURLSearchParams(data)) {
  9226. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  9227. return data.toString();
  9228. }
  9229. if (utils.isObject(data)) {
  9230. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  9231. return JSON.stringify(data);
  9232. }
  9233. return data;
  9234. }],
  9235. transformResponse: [function transformResponse(data) {
  9236. /*eslint no-param-reassign:0*/
  9237. if (typeof data === 'string') {
  9238. data = data.replace(PROTECTION_PREFIX, '');
  9239. try {
  9240. data = JSON.parse(data);
  9241. } catch (e) { /* Ignore */ }
  9242. }
  9243. return data;
  9244. }],
  9245. timeout: 0,
  9246. xsrfCookieName: 'XSRF-TOKEN',
  9247. xsrfHeaderName: 'X-XSRF-TOKEN',
  9248. maxContentLength: -1,
  9249. validateStatus: function validateStatus(status) {
  9250. return status >= 200 && status < 300;
  9251. }
  9252. };
  9253. defaults.headers = {
  9254. common: {
  9255. 'Accept': 'application/json, text/plain, */*'
  9256. }
  9257. };
  9258. utils.forEach(['delete', 'get', 'head'], function forEachMehtodNoData(method) {
  9259. defaults.headers[method] = {};
  9260. });
  9261. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  9262. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  9263. });
  9264. module.exports = defaults;
  9265. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9266. /***/ },
  9267. /* 35 */
  9268. /***/ function(module, exports, __webpack_require__) {
  9269. "use strict";
  9270. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  9271. var buffer = __webpack_require__(0);
  9272. var Buffer = buffer.Buffer;
  9273. var SlowBuffer = buffer.SlowBuffer;
  9274. var MAX_LEN = buffer.kMaxLength || 2147483647;
  9275. exports.alloc = function alloc(size, fill, encoding) {
  9276. if (typeof Buffer.alloc === 'function') {
  9277. return Buffer.alloc(size, fill, encoding);
  9278. }
  9279. if (typeof encoding === 'number') {
  9280. throw new TypeError('encoding must not be number');
  9281. }
  9282. if (typeof size !== 'number') {
  9283. throw new TypeError('size must be a number');
  9284. }
  9285. if (size > MAX_LEN) {
  9286. throw new RangeError('size is too large');
  9287. }
  9288. var enc = encoding;
  9289. var _fill = fill;
  9290. if (_fill === undefined) {
  9291. enc = undefined;
  9292. _fill = 0;
  9293. }
  9294. var buf = new Buffer(size);
  9295. if (typeof _fill === 'string') {
  9296. var fillBuf = new Buffer(_fill, enc);
  9297. var flen = fillBuf.length;
  9298. var i = -1;
  9299. while (++i < size) {
  9300. buf[i] = fillBuf[i % flen];
  9301. }
  9302. } else {
  9303. buf.fill(_fill);
  9304. }
  9305. return buf;
  9306. }
  9307. exports.allocUnsafe = function allocUnsafe(size) {
  9308. if (typeof Buffer.allocUnsafe === 'function') {
  9309. return Buffer.allocUnsafe(size);
  9310. }
  9311. if (typeof size !== 'number') {
  9312. throw new TypeError('size must be a number');
  9313. }
  9314. if (size > MAX_LEN) {
  9315. throw new RangeError('size is too large');
  9316. }
  9317. return new Buffer(size);
  9318. }
  9319. exports.from = function from(value, encodingOrOffset, length) {
  9320. if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
  9321. return Buffer.from(value, encodingOrOffset, length);
  9322. }
  9323. if (typeof value === 'number') {
  9324. throw new TypeError('"value" argument must not be a number');
  9325. }
  9326. if (typeof value === 'string') {
  9327. return new Buffer(value, encodingOrOffset);
  9328. }
  9329. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  9330. var offset = encodingOrOffset;
  9331. if (arguments.length === 1) {
  9332. return new Buffer(value);
  9333. }
  9334. if (typeof offset === 'undefined') {
  9335. offset = 0;
  9336. }
  9337. var len = length;
  9338. if (typeof len === 'undefined') {
  9339. len = value.byteLength - offset;
  9340. }
  9341. if (offset >= value.byteLength) {
  9342. throw new RangeError('\'offset\' is out of bounds');
  9343. }
  9344. if (len > value.byteLength - offset) {
  9345. throw new RangeError('\'length\' is out of bounds');
  9346. }
  9347. return new Buffer(value.slice(offset, offset + len));
  9348. }
  9349. if (Buffer.isBuffer(value)) {
  9350. var out = new Buffer(value.length);
  9351. value.copy(out, 0, 0, value.length);
  9352. return out;
  9353. }
  9354. if (value) {
  9355. if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
  9356. return new Buffer(value);
  9357. }
  9358. if (value.type === 'Buffer' && Array.isArray(value.data)) {
  9359. return new Buffer(value.data);
  9360. }
  9361. }
  9362. throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
  9363. }
  9364. exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
  9365. if (typeof Buffer.allocUnsafeSlow === 'function') {
  9366. return Buffer.allocUnsafeSlow(size);
  9367. }
  9368. if (typeof size !== 'number') {
  9369. throw new TypeError('size must be a number');
  9370. }
  9371. if (size >= MAX_LEN) {
  9372. throw new RangeError('size is too large');
  9373. }
  9374. return new SlowBuffer(size);
  9375. }
  9376. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  9377. /***/ },
  9378. /* 36 */
  9379. /***/ function(module, exports) {
  9380. module.exports = function(it){
  9381. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  9382. return it;
  9383. };
  9384. /***/ },
  9385. /* 37 */
  9386. /***/ function(module, exports) {
  9387. // 7.2.1 RequireObjectCoercible(argument)
  9388. module.exports = function(it){
  9389. if(it == undefined)throw TypeError("Can't call method on " + it);
  9390. return it;
  9391. };
  9392. /***/ },
  9393. /* 38 */
  9394. /***/ function(module, exports, __webpack_require__) {
  9395. var isObject = __webpack_require__(28)
  9396. , document = __webpack_require__(4).document
  9397. // in old IE typeof document.createElement is 'object'
  9398. , is = isObject(document) && isObject(document.createElement);
  9399. module.exports = function(it){
  9400. return is ? document.createElement(it) : {};
  9401. };
  9402. /***/ },
  9403. /* 39 */
  9404. /***/ function(module, exports) {
  9405. module.exports = function(exec){
  9406. try {
  9407. return !!exec();
  9408. } catch(e){
  9409. return true;
  9410. }
  9411. };
  9412. /***/ },
  9413. /* 40 */
  9414. /***/ function(module, exports, __webpack_require__) {
  9415. var def = __webpack_require__(19).f
  9416. , has = __webpack_require__(27)
  9417. , TAG = __webpack_require__(3)('toStringTag');
  9418. module.exports = function(it, tag, stat){
  9419. if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
  9420. };
  9421. /***/ },
  9422. /* 41 */
  9423. /***/ function(module, exports, __webpack_require__) {
  9424. var shared = __webpack_require__(67)('keys')
  9425. , uid = __webpack_require__(71);
  9426. module.exports = function(key){
  9427. return shared[key] || (shared[key] = uid(key));
  9428. };
  9429. /***/ },
  9430. /* 42 */
  9431. /***/ function(module, exports) {
  9432. // 7.1.4 ToInteger
  9433. var ceil = Math.ceil
  9434. , floor = Math.floor;
  9435. module.exports = function(it){
  9436. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  9437. };
  9438. /***/ },
  9439. /* 43 */
  9440. /***/ function(module, exports, __webpack_require__) {
  9441. // to indexed object, toObject with fallback for non-array-like ES3 strings
  9442. var IObject = __webpack_require__(62)
  9443. , defined = __webpack_require__(37);
  9444. module.exports = function(it){
  9445. return IObject(defined(it));
  9446. };
  9447. /***/ },
  9448. /* 44 */
  9449. /***/ function(module, exports, __webpack_require__) {
  9450. var v1 = __webpack_require__(175);
  9451. var v2 = __webpack_require__(176);
  9452. var pbkdf2 = __webpack_require__(45);
  9453. var objectAssign = __webpack_require__(178);
  9454. module.exports = {
  9455. encryptLogin: v1.encryptLogin,
  9456. renderPassword: v1.renderPassword,
  9457. createFingerprint: v1.createFingerprint,
  9458. _deriveEncryptedLogin: v1._deriveEncryptedLogin,
  9459. _getPasswordTemplate: v1._getPasswordTemplate,
  9460. _prettyPrint: v1._prettyPrint,
  9461. _string2charCodes: v1._string2charCodes,
  9462. _getCharType: v1._getCharType,
  9463. _getPasswordChar: v1._getPasswordChar,
  9464. _createHmac: v1._createHmac,
  9465. generatePassword: generatePassword,
  9466. _calcEntropy: v2._calcEntropy,
  9467. _consumeEntropy: v2._consumeEntropy,
  9468. _getSetOfCharacters: v2._getSetOfCharacters,
  9469. _getConfiguredRules: v2._getConfiguredRules,
  9470. _insertStringPseudoRandomly: v2._insertStringPseudoRandomly,
  9471. _getOneCharPerRule: v2._getOneCharPerRule,
  9472. _renderPassword: v2._renderPassword,
  9473. pbkdf2: pbkdf2
  9474. };
  9475. var defaultPasswordProfile = {
  9476. version: 2,
  9477. lowercase: true,
  9478. numbers: true,
  9479. uppercase: true,
  9480. symbols: true,
  9481. keylen: 32,
  9482. digest: 'sha256',
  9483. length: 16,
  9484. index: 1,
  9485. iterations: 100000
  9486. };
  9487. function generatePassword(site, login, masterPassword, passwordProfile) {
  9488. var _passwordProfile = objectAssign({}, defaultPasswordProfile, passwordProfile);
  9489. if (_passwordProfile.version === 1) {
  9490. var options = {
  9491. counter: _passwordProfile.counter,
  9492. length: _passwordProfile.length,
  9493. lowercase: _passwordProfile.lowercase,
  9494. uppercase: _passwordProfile.uppercase,
  9495. numbers: _passwordProfile.numbers,
  9496. symbols: _passwordProfile.symbols
  9497. };
  9498. return v1.encryptLogin(login, masterPassword)
  9499. .then(function (encryptedLogin) {
  9500. return v1.renderPassword(encryptedLogin, site, options).then(function (generatedPassword) {
  9501. return generatedPassword
  9502. });
  9503. });
  9504. }
  9505. return v2.generatePassword(site, login, masterPassword, _passwordProfile);
  9506. }
  9507. /***/ },
  9508. /* 45 */
  9509. /***/ function(module, exports, __webpack_require__) {
  9510. /* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2 = __webpack_require__(179);
  9511. var Promise = __webpack_require__(74);
  9512. function shouldUseNative() {
  9513. return !!(typeof window !== 'undefined' && window.crypto && window.crypto.subtle);
  9514. }
  9515. function pbkdf2Native(password, salt, iterations, keylen, digest) {
  9516. var algorithms = {
  9517. 'sha1': 'SHA-1',
  9518. 'sha-1': 'SHA-1',
  9519. 'sha256': 'SHA-256',
  9520. 'sha-256': 'SHA-256',
  9521. 'sha512': 'SHA-512',
  9522. 'sha-512': 'SHA-512',
  9523. };
  9524. return window.crypto.subtle.importKey('raw', new Buffer(password), 'PBKDF2', false, ['deriveKey'])
  9525. .then(function (key) {
  9526. var algo = {
  9527. name: 'PBKDF2',
  9528. salt: new Buffer(salt),
  9529. iterations: iterations,
  9530. hash: algorithms[digest.toLowerCase()],
  9531. };
  9532. return window.crypto.subtle.deriveKey(algo, key, {
  9533. name: 'AES-CTR',
  9534. length: keylen * 8
  9535. }, true, ['encrypt', 'decrypt']);
  9536. })
  9537. .then(function (derivedKey) {
  9538. return window.crypto.subtle.exportKey('raw', derivedKey).then(function (keyArray) {
  9539. return new Buffer(keyArray).toString('hex');
  9540. });
  9541. });
  9542. }
  9543. function pbkdf2Browserified(password, salt, iterations, keylen, digest) {
  9544. return new Promise(function (resolve, reject) {
  9545. pbkdf2.pbkdf2(password, salt, iterations, keylen, digest, function (error, key) {
  9546. if (error) {
  9547. reject('error in pbkdf2');
  9548. } else {
  9549. resolve(key.toString('hex'));
  9550. }
  9551. });
  9552. });
  9553. }
  9554. module.exports = shouldUseNative() ? pbkdf2Native : pbkdf2Browserified;
  9555. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  9556. /***/ },
  9557. /* 46 */
  9558. /***/ function(module, exports, __webpack_require__) {
  9559. "use strict";
  9560. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  9561. if (!process.version ||
  9562. process.version.indexOf('v0.') === 0 ||
  9563. process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
  9564. module.exports = nextTick;
  9565. } else {
  9566. module.exports = process.nextTick;
  9567. }
  9568. function nextTick(fn, arg1, arg2, arg3) {
  9569. if (typeof fn !== 'function') {
  9570. throw new TypeError('"callback" argument must be a function');
  9571. }
  9572. var len = arguments.length;
  9573. var args, i;
  9574. switch (len) {
  9575. case 0:
  9576. case 1:
  9577. return process.nextTick(fn);
  9578. case 2:
  9579. return process.nextTick(function afterTickOne() {
  9580. fn.call(null, arg1);
  9581. });
  9582. case 3:
  9583. return process.nextTick(function afterTickTwo() {
  9584. fn.call(null, arg1, arg2);
  9585. });
  9586. case 4:
  9587. return process.nextTick(function afterTickThree() {
  9588. fn.call(null, arg1, arg2, arg3);
  9589. });
  9590. default:
  9591. args = new Array(len - 1);
  9592. i = 0;
  9593. while (i < args.length) {
  9594. args[i++] = arguments[i];
  9595. }
  9596. return process.nextTick(function afterTick() {
  9597. fn.apply(null, args);
  9598. });
  9599. }
  9600. }
  9601. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  9602. /***/ },
  9603. /* 47 */
  9604. /***/ function(module, exports, __webpack_require__) {
  9605. "use strict";
  9606. // a transform stream is a readable/writable stream where you do
  9607. // something with the data. Sometimes it's called a "filter",
  9608. // but that's not a great name for it, since that implies a thing where
  9609. // some bits pass through, and others are simply ignored. (That would
  9610. // be a valid example of a transform, of course.)
  9611. //
  9612. // While the output is causally related to the input, it's not a
  9613. // necessarily symmetric or synchronous transformation. For example,
  9614. // a zlib stream might take multiple plain-text writes(), and then
  9615. // emit a single compressed chunk some time in the future.
  9616. //
  9617. // Here's how this works:
  9618. //
  9619. // The Transform stream has all the aspects of the readable and writable
  9620. // stream classes. When you write(chunk), that calls _write(chunk,cb)
  9621. // internally, and returns false if there's a lot of pending writes
  9622. // buffered up. When you call read(), that calls _read(n) until
  9623. // there's enough pending readable data buffered up.
  9624. //
  9625. // In a transform stream, the written data is placed in a buffer. When
  9626. // _read(n) is called, it transforms the queued up data, calling the
  9627. // buffered _write cb's as it consumes chunks. If consuming a single
  9628. // written chunk would result in multiple output chunks, then the first
  9629. // outputted bit calls the readcb, and subsequent chunks just go into
  9630. // the read buffer, and will cause it to emit 'readable' if necessary.
  9631. //
  9632. // This way, back-pressure is actually determined by the reading side,
  9633. // since _read has to be called to start processing a new chunk. However,
  9634. // a pathological inflate type of transform can cause excessive buffering
  9635. // here. For example, imagine a stream where every byte of input is
  9636. // interpreted as an integer from 0-255, and then results in that many
  9637. // bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
  9638. // 1kb of data being output. In this case, you could write a very small
  9639. // amount of input, and end up with a very large amount of output. In
  9640. // such a pathological inflating mechanism, there'd be no way to tell
  9641. // the system to stop doing the transform. A single 4MB write could
  9642. // cause the system to run out of memory.
  9643. //
  9644. // However, even in such a pathological case, only a single written chunk
  9645. // would be consumed, and then the rest would wait (un-transformed) until
  9646. // the results of the previous transformed chunk were consumed.
  9647. 'use strict';
  9648. module.exports = Transform;
  9649. var Duplex = __webpack_require__(8);
  9650. /*<replacement>*/
  9651. var util = __webpack_require__(20);
  9652. util.inherits = __webpack_require__(1);
  9653. /*</replacement>*/
  9654. util.inherits(Transform, Duplex);
  9655. function TransformState(stream) {
  9656. this.afterTransform = function (er, data) {
  9657. return afterTransform(stream, er, data);
  9658. };
  9659. this.needTransform = false;
  9660. this.transforming = false;
  9661. this.writecb = null;
  9662. this.writechunk = null;
  9663. this.writeencoding = null;
  9664. }
  9665. function afterTransform(stream, er, data) {
  9666. var ts = stream._transformState;
  9667. ts.transforming = false;
  9668. var cb = ts.writecb;
  9669. if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
  9670. ts.writechunk = null;
  9671. ts.writecb = null;
  9672. if (data !== null && data !== undefined) stream.push(data);
  9673. cb(er);
  9674. var rs = stream._readableState;
  9675. rs.reading = false;
  9676. if (rs.needReadable || rs.length < rs.highWaterMark) {
  9677. stream._read(rs.highWaterMark);
  9678. }
  9679. }
  9680. function Transform(options) {
  9681. if (!(this instanceof Transform)) return new Transform(options);
  9682. Duplex.call(this, options);
  9683. this._transformState = new TransformState(this);
  9684. var stream = this;
  9685. // start out asking for a readable event once data is transformed.
  9686. this._readableState.needReadable = true;
  9687. // we have implemented the _read method, and done the other things
  9688. // that Readable wants before the first _read call, so unset the
  9689. // sync guard flag.
  9690. this._readableState.sync = false;
  9691. if (options) {
  9692. if (typeof options.transform === 'function') this._transform = options.transform;
  9693. if (typeof options.flush === 'function') this._flush = options.flush;
  9694. }
  9695. // When the writable side finishes, then flush out anything remaining.
  9696. this.once('prefinish', function () {
  9697. if (typeof this._flush === 'function') this._flush(function (er, data) {
  9698. done(stream, er, data);
  9699. });else done(stream);
  9700. });
  9701. }
  9702. Transform.prototype.push = function (chunk, encoding) {
  9703. this._transformState.needTransform = false;
  9704. return Duplex.prototype.push.call(this, chunk, encoding);
  9705. };
  9706. // This is the part where you do stuff!
  9707. // override this function in implementation classes.
  9708. // 'chunk' is an input chunk.
  9709. //
  9710. // Call `push(newChunk)` to pass along transformed output
  9711. // to the readable side. You may call 'push' zero or more times.
  9712. //
  9713. // Call `cb(err)` when you are done with this chunk. If you pass
  9714. // an error, then that'll put the hurt on the whole operation. If you
  9715. // never call cb(), then you'll never get another chunk.
  9716. Transform.prototype._transform = function (chunk, encoding, cb) {
  9717. throw new Error('_transform() is not implemented');
  9718. };
  9719. Transform.prototype._write = function (chunk, encoding, cb) {
  9720. var ts = this._transformState;
  9721. ts.writecb = cb;
  9722. ts.writechunk = chunk;
  9723. ts.writeencoding = encoding;
  9724. if (!ts.transforming) {
  9725. var rs = this._readableState;
  9726. if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
  9727. }
  9728. };
  9729. // Doesn't matter what the args are here.
  9730. // _transform does all the work.
  9731. // That we got here means that the readable side wants more data.
  9732. Transform.prototype._read = function (n) {
  9733. var ts = this._transformState;
  9734. if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  9735. ts.transforming = true;
  9736. this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
  9737. } else {
  9738. // mark that we need a transform, so that any data that comes in
  9739. // will get processed, now that we've asked for it.
  9740. ts.needTransform = true;
  9741. }
  9742. };
  9743. function done(stream, er, data) {
  9744. if (er) return stream.emit('error', er);
  9745. if (data !== null && data !== undefined) stream.push(data);
  9746. // if there's nothing in the write buffer, then that means
  9747. // that nothing more will ever be provided
  9748. var ws = stream._writableState;
  9749. var ts = stream._transformState;
  9750. if (ws.length) throw new Error('Calling transform done when ws.length != 0');
  9751. if (ts.transforming) throw new Error('Calling transform done when still transforming');
  9752. return stream.push(null);
  9753. }
  9754. /***/ },
  9755. /* 48 */
  9756. /***/ function(module, exports, __webpack_require__) {
  9757. "use strict";
  9758. /* WEBPACK VAR INJECTION */(function(process, setImmediate) {// A bit simpler than readable streams.
  9759. // Implement an async ._write(chunk, encoding, cb), and it'll handle all
  9760. // the drain event emission and buffering.
  9761. 'use strict';
  9762. module.exports = Writable;
  9763. /*<replacement>*/
  9764. var processNextTick = __webpack_require__(46);
  9765. /*</replacement>*/
  9766. /*<replacement>*/
  9767. var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
  9768. /*</replacement>*/
  9769. /*<replacement>*/
  9770. var Duplex;
  9771. /*</replacement>*/
  9772. Writable.WritableState = WritableState;
  9773. /*<replacement>*/
  9774. var util = __webpack_require__(20);
  9775. util.inherits = __webpack_require__(1);
  9776. /*</replacement>*/
  9777. /*<replacement>*/
  9778. var internalUtil = {
  9779. deprecate: __webpack_require__(196)
  9780. };
  9781. /*</replacement>*/
  9782. /*<replacement>*/
  9783. var Stream;
  9784. (function () {
  9785. try {
  9786. Stream = __webpack_require__(21);
  9787. } catch (_) {} finally {
  9788. if (!Stream) Stream = __webpack_require__(30).EventEmitter;
  9789. }
  9790. })();
  9791. /*</replacement>*/
  9792. var Buffer = __webpack_require__(0).Buffer;
  9793. /*<replacement>*/
  9794. var bufferShim = __webpack_require__(35);
  9795. /*</replacement>*/
  9796. util.inherits(Writable, Stream);
  9797. function nop() {}
  9798. function WriteReq(chunk, encoding, cb) {
  9799. this.chunk = chunk;
  9800. this.encoding = encoding;
  9801. this.callback = cb;
  9802. this.next = null;
  9803. }
  9804. function WritableState(options, stream) {
  9805. Duplex = Duplex || __webpack_require__(8);
  9806. options = options || {};
  9807. // object stream flag to indicate whether or not this stream
  9808. // contains buffers or objects.
  9809. this.objectMode = !!options.objectMode;
  9810. if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  9811. // the point at which write() starts returning false
  9812. // Note: 0 is a valid value, means that we always return false if
  9813. // the entire buffer is not flushed immediately on write()
  9814. var hwm = options.highWaterMark;
  9815. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  9816. this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
  9817. // cast to ints.
  9818. this.highWaterMark = ~ ~this.highWaterMark;
  9819. // drain event flag.
  9820. this.needDrain = false;
  9821. // at the start of calling end()
  9822. this.ending = false;
  9823. // when end() has been called, and returned
  9824. this.ended = false;
  9825. // when 'finish' is emitted
  9826. this.finished = false;
  9827. // should we decode strings into buffers before passing to _write?
  9828. // this is here so that some node-core streams can optimize string
  9829. // handling at a lower level.
  9830. var noDecode = options.decodeStrings === false;
  9831. this.decodeStrings = !noDecode;
  9832. // Crypto is kind of old and crusty. Historically, its default string
  9833. // encoding is 'binary' so we have to make this configurable.
  9834. // Everything else in the universe uses 'utf8', though.
  9835. this.defaultEncoding = options.defaultEncoding || 'utf8';
  9836. // not an actual buffer we keep track of, but a measurement
  9837. // of how much we're waiting to get pushed to some underlying
  9838. // socket or file.
  9839. this.length = 0;
  9840. // a flag to see when we're in the middle of a write.
  9841. this.writing = false;
  9842. // when true all writes will be buffered until .uncork() call
  9843. this.corked = 0;
  9844. // a flag to be able to tell if the onwrite cb is called immediately,
  9845. // or on a later tick. We set this to true at first, because any
  9846. // actions that shouldn't happen until "later" should generally also
  9847. // not happen before the first write call.
  9848. this.sync = true;
  9849. // a flag to know if we're processing previously buffered items, which
  9850. // may call the _write() callback in the same tick, so that we don't
  9851. // end up in an overlapped onwrite situation.
  9852. this.bufferProcessing = false;
  9853. // the callback that's passed to _write(chunk,cb)
  9854. this.onwrite = function (er) {
  9855. onwrite(stream, er);
  9856. };
  9857. // the callback that the user supplies to write(chunk,encoding,cb)
  9858. this.writecb = null;
  9859. // the amount that is being written when _write is called.
  9860. this.writelen = 0;
  9861. this.bufferedRequest = null;
  9862. this.lastBufferedRequest = null;
  9863. // number of pending user-supplied write callbacks
  9864. // this must be 0 before 'finish' can be emitted
  9865. this.pendingcb = 0;
  9866. // emit prefinish if the only thing we're waiting for is _write cbs
  9867. // This is relevant for synchronous Transform streams
  9868. this.prefinished = false;
  9869. // True if the error was already emitted and should not be thrown again
  9870. this.errorEmitted = false;
  9871. // count buffered requests
  9872. this.bufferedRequestCount = 0;
  9873. // allocate the first CorkedRequest, there is always
  9874. // one allocated and free to use, and we maintain at most two
  9875. this.corkedRequestsFree = new CorkedRequest(this);
  9876. }
  9877. WritableState.prototype.getBuffer = function getBuffer() {
  9878. var current = this.bufferedRequest;
  9879. var out = [];
  9880. while (current) {
  9881. out.push(current);
  9882. current = current.next;
  9883. }
  9884. return out;
  9885. };
  9886. (function () {
  9887. try {
  9888. Object.defineProperty(WritableState.prototype, 'buffer', {
  9889. get: internalUtil.deprecate(function () {
  9890. return this.getBuffer();
  9891. }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
  9892. });
  9893. } catch (_) {}
  9894. })();
  9895. // Test _writableState for inheritance to account for Duplex streams,
  9896. // whose prototype chain only points to Readable.
  9897. var realHasInstance;
  9898. if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
  9899. realHasInstance = Function.prototype[Symbol.hasInstance];
  9900. Object.defineProperty(Writable, Symbol.hasInstance, {
  9901. value: function (object) {
  9902. if (realHasInstance.call(this, object)) return true;
  9903. return object && object._writableState instanceof WritableState;
  9904. }
  9905. });
  9906. } else {
  9907. realHasInstance = function (object) {
  9908. return object instanceof this;
  9909. };
  9910. }
  9911. function Writable(options) {
  9912. Duplex = Duplex || __webpack_require__(8);
  9913. // Writable ctor is applied to Duplexes, too.
  9914. // `realHasInstance` is necessary because using plain `instanceof`
  9915. // would return false, as no `_writableState` property is attached.
  9916. // Trying to use the custom `instanceof` for Writable here will also break the
  9917. // Node.js LazyTransform implementation, which has a non-trivial getter for
  9918. // `_writableState` that would lead to infinite recursion.
  9919. if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  9920. return new Writable(options);
  9921. }
  9922. this._writableState = new WritableState(options, this);
  9923. // legacy.
  9924. this.writable = true;
  9925. if (options) {
  9926. if (typeof options.write === 'function') this._write = options.write;
  9927. if (typeof options.writev === 'function') this._writev = options.writev;
  9928. }
  9929. Stream.call(this);
  9930. }
  9931. // Otherwise people can pipe Writable streams, which is just wrong.
  9932. Writable.prototype.pipe = function () {
  9933. this.emit('error', new Error('Cannot pipe, not readable'));
  9934. };
  9935. function writeAfterEnd(stream, cb) {
  9936. var er = new Error('write after end');
  9937. // TODO: defer error events consistently everywhere, not just the cb
  9938. stream.emit('error', er);
  9939. processNextTick(cb, er);
  9940. }
  9941. // If we get something that is not a buffer, string, null, or undefined,
  9942. // and we're not in objectMode, then that's an error.
  9943. // Otherwise stream chunks are all considered to be of length=1, and the
  9944. // watermarks determine how many objects to keep in the buffer, rather than
  9945. // how many bytes or characters.
  9946. function validChunk(stream, state, chunk, cb) {
  9947. var valid = true;
  9948. var er = false;
  9949. // Always throw error if a null is written
  9950. // if we are not in object mode then throw
  9951. // if it is not a buffer, string, or undefined.
  9952. if (chunk === null) {
  9953. er = new TypeError('May not write null values to stream');
  9954. } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
  9955. er = new TypeError('Invalid non-string/buffer chunk');
  9956. }
  9957. if (er) {
  9958. stream.emit('error', er);
  9959. processNextTick(cb, er);
  9960. valid = false;
  9961. }
  9962. return valid;
  9963. }
  9964. Writable.prototype.write = function (chunk, encoding, cb) {
  9965. var state = this._writableState;
  9966. var ret = false;
  9967. if (typeof encoding === 'function') {
  9968. cb = encoding;
  9969. encoding = null;
  9970. }
  9971. if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
  9972. if (typeof cb !== 'function') cb = nop;
  9973. if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
  9974. state.pendingcb++;
  9975. ret = writeOrBuffer(this, state, chunk, encoding, cb);
  9976. }
  9977. return ret;
  9978. };
  9979. Writable.prototype.cork = function () {
  9980. var state = this._writableState;
  9981. state.corked++;
  9982. };
  9983. Writable.prototype.uncork = function () {
  9984. var state = this._writableState;
  9985. if (state.corked) {
  9986. state.corked--;
  9987. if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
  9988. }
  9989. };
  9990. Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  9991. // node::ParseEncoding() requires lower case.
  9992. if (typeof encoding === 'string') encoding = encoding.toLowerCase();
  9993. if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
  9994. this._writableState.defaultEncoding = encoding;
  9995. return this;
  9996. };
  9997. function decodeChunk(state, chunk, encoding) {
  9998. if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
  9999. chunk = bufferShim.from(chunk, encoding);
  10000. }
  10001. return chunk;
  10002. }
  10003. // if we're already writing something, then just put this
  10004. // in the queue, and wait our turn. Otherwise, call _write
  10005. // If we return false, then we need a drain event, so set that flag.
  10006. function writeOrBuffer(stream, state, chunk, encoding, cb) {
  10007. chunk = decodeChunk(state, chunk, encoding);
  10008. if (Buffer.isBuffer(chunk)) encoding = 'buffer';
  10009. var len = state.objectMode ? 1 : chunk.length;
  10010. state.length += len;
  10011. var ret = state.length < state.highWaterMark;
  10012. // we must ensure that previous needDrain will not be reset to false.
  10013. if (!ret) state.needDrain = true;
  10014. if (state.writing || state.corked) {
  10015. var last = state.lastBufferedRequest;
  10016. state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
  10017. if (last) {
  10018. last.next = state.lastBufferedRequest;
  10019. } else {
  10020. state.bufferedRequest = state.lastBufferedRequest;
  10021. }
  10022. state.bufferedRequestCount += 1;
  10023. } else {
  10024. doWrite(stream, state, false, len, chunk, encoding, cb);
  10025. }
  10026. return ret;
  10027. }
  10028. function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  10029. state.writelen = len;
  10030. state.writecb = cb;
  10031. state.writing = true;
  10032. state.sync = true;
  10033. if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
  10034. state.sync = false;
  10035. }
  10036. function onwriteError(stream, state, sync, er, cb) {
  10037. --state.pendingcb;
  10038. if (sync) processNextTick(cb, er);else cb(er);
  10039. stream._writableState.errorEmitted = true;
  10040. stream.emit('error', er);
  10041. }
  10042. function onwriteStateUpdate(state) {
  10043. state.writing = false;
  10044. state.writecb = null;
  10045. state.length -= state.writelen;
  10046. state.writelen = 0;
  10047. }
  10048. function onwrite(stream, er) {
  10049. var state = stream._writableState;
  10050. var sync = state.sync;
  10051. var cb = state.writecb;
  10052. onwriteStateUpdate(state);
  10053. if (er) onwriteError(stream, state, sync, er, cb);else {
  10054. // Check if we're actually ready to finish, but don't emit yet
  10055. var finished = needFinish(state);
  10056. if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  10057. clearBuffer(stream, state);
  10058. }
  10059. if (sync) {
  10060. /*<replacement>*/
  10061. asyncWrite(afterWrite, stream, state, finished, cb);
  10062. /*</replacement>*/
  10063. } else {
  10064. afterWrite(stream, state, finished, cb);
  10065. }
  10066. }
  10067. }
  10068. function afterWrite(stream, state, finished, cb) {
  10069. if (!finished) onwriteDrain(stream, state);
  10070. state.pendingcb--;
  10071. cb();
  10072. finishMaybe(stream, state);
  10073. }
  10074. // Must force callback to be called on nextTick, so that we don't
  10075. // emit 'drain' before the write() consumer gets the 'false' return
  10076. // value, and has a chance to attach a 'drain' listener.
  10077. function onwriteDrain(stream, state) {
  10078. if (state.length === 0 && state.needDrain) {
  10079. state.needDrain = false;
  10080. stream.emit('drain');
  10081. }
  10082. }
  10083. // if there's something in the buffer waiting, then process it
  10084. function clearBuffer(stream, state) {
  10085. state.bufferProcessing = true;
  10086. var entry = state.bufferedRequest;
  10087. if (stream._writev && entry && entry.next) {
  10088. // Fast case, write everything using _writev()
  10089. var l = state.bufferedRequestCount;
  10090. var buffer = new Array(l);
  10091. var holder = state.corkedRequestsFree;
  10092. holder.entry = entry;
  10093. var count = 0;
  10094. while (entry) {
  10095. buffer[count] = entry;
  10096. entry = entry.next;
  10097. count += 1;
  10098. }
  10099. doWrite(stream, state, true, state.length, buffer, '', holder.finish);
  10100. // doWrite is almost always async, defer these to save a bit of time
  10101. // as the hot path ends with doWrite
  10102. state.pendingcb++;
  10103. state.lastBufferedRequest = null;
  10104. if (holder.next) {
  10105. state.corkedRequestsFree = holder.next;
  10106. holder.next = null;
  10107. } else {
  10108. state.corkedRequestsFree = new CorkedRequest(state);
  10109. }
  10110. } else {
  10111. // Slow case, write chunks one-by-one
  10112. while (entry) {
  10113. var chunk = entry.chunk;
  10114. var encoding = entry.encoding;
  10115. var cb = entry.callback;
  10116. var len = state.objectMode ? 1 : chunk.length;
  10117. doWrite(stream, state, false, len, chunk, encoding, cb);
  10118. entry = entry.next;
  10119. // if we didn't call the onwrite immediately, then
  10120. // it means that we need to wait until it does.
  10121. // also, that means that the chunk and cb are currently
  10122. // being processed, so move the buffer counter past them.
  10123. if (state.writing) {
  10124. break;
  10125. }
  10126. }
  10127. if (entry === null) state.lastBufferedRequest = null;
  10128. }
  10129. state.bufferedRequestCount = 0;
  10130. state.bufferedRequest = entry;
  10131. state.bufferProcessing = false;
  10132. }
  10133. Writable.prototype._write = function (chunk, encoding, cb) {
  10134. cb(new Error('_write() is not implemented'));
  10135. };
  10136. Writable.prototype._writev = null;
  10137. Writable.prototype.end = function (chunk, encoding, cb) {
  10138. var state = this._writableState;
  10139. if (typeof chunk === 'function') {
  10140. cb = chunk;
  10141. chunk = null;
  10142. encoding = null;
  10143. } else if (typeof encoding === 'function') {
  10144. cb = encoding;
  10145. encoding = null;
  10146. }
  10147. if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  10148. // .end() fully uncorks
  10149. if (state.corked) {
  10150. state.corked = 1;
  10151. this.uncork();
  10152. }
  10153. // ignore unnecessary end() calls.
  10154. if (!state.ending && !state.finished) endWritable(this, state, cb);
  10155. };
  10156. function needFinish(state) {
  10157. return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
  10158. }
  10159. function prefinish(stream, state) {
  10160. if (!state.prefinished) {
  10161. state.prefinished = true;
  10162. stream.emit('prefinish');
  10163. }
  10164. }
  10165. function finishMaybe(stream, state) {
  10166. var need = needFinish(state);
  10167. if (need) {
  10168. if (state.pendingcb === 0) {
  10169. prefinish(stream, state);
  10170. state.finished = true;
  10171. stream.emit('finish');
  10172. } else {
  10173. prefinish(stream, state);
  10174. }
  10175. }
  10176. return need;
  10177. }
  10178. function endWritable(stream, state, cb) {
  10179. state.ending = true;
  10180. finishMaybe(stream, state);
  10181. if (cb) {
  10182. if (state.finished) processNextTick(cb);else stream.once('finish', cb);
  10183. }
  10184. state.ended = true;
  10185. stream.writable = false;
  10186. }
  10187. // It seems a linked list but it is not
  10188. // there will be only 2 of these for each stream
  10189. function CorkedRequest(state) {
  10190. var _this = this;
  10191. this.next = null;
  10192. this.entry = null;
  10193. this.finish = function (err) {
  10194. var entry = _this.entry;
  10195. _this.entry = null;
  10196. while (entry) {
  10197. var cb = entry.callback;
  10198. state.pendingcb--;
  10199. cb(err);
  10200. entry = entry.next;
  10201. }
  10202. if (state.corkedRequestsFree) {
  10203. state.corkedRequestsFree.next = _this;
  10204. } else {
  10205. state.corkedRequestsFree = _this;
  10206. }
  10207. };
  10208. }
  10209. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(31).setImmediate))
  10210. /***/ },
  10211. /* 49 */
  10212. /***/ function(module, exports, __webpack_require__) {
  10213. // Copyright Joyent, Inc. and other Node contributors.
  10214. //
  10215. // Permission is hereby granted, free of charge, to any person obtaining a
  10216. // copy of this software and associated documentation files (the
  10217. // "Software"), to deal in the Software without restriction, including
  10218. // without limitation the rights to use, copy, modify, merge, publish,
  10219. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10220. // persons to whom the Software is furnished to do so, subject to the
  10221. // following conditions:
  10222. //
  10223. // The above copyright notice and this permission notice shall be included
  10224. // in all copies or substantial portions of the Software.
  10225. //
  10226. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10227. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10228. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10229. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10230. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10231. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10232. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10233. var Buffer = __webpack_require__(0).Buffer;
  10234. var isBufferEncoding = Buffer.isEncoding
  10235. || function(encoding) {
  10236. switch (encoding && encoding.toLowerCase()) {
  10237. case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
  10238. default: return false;
  10239. }
  10240. }
  10241. function assertEncoding(encoding) {
  10242. if (encoding && !isBufferEncoding(encoding)) {
  10243. throw new Error('Unknown encoding: ' + encoding);
  10244. }
  10245. }
  10246. // StringDecoder provides an interface for efficiently splitting a series of
  10247. // buffers into a series of JS strings without breaking apart multi-byte
  10248. // characters. CESU-8 is handled as part of the UTF-8 encoding.
  10249. //
  10250. // @TODO Handling all encodings inside a single object makes it very difficult
  10251. // to reason about this code, so it should be split up in the future.
  10252. // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
  10253. // points as used by CESU-8.
  10254. var StringDecoder = exports.StringDecoder = function(encoding) {
  10255. this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
  10256. assertEncoding(encoding);
  10257. switch (this.encoding) {
  10258. case 'utf8':
  10259. // CESU-8 represents each of Surrogate Pair by 3-bytes
  10260. this.surrogateSize = 3;
  10261. break;
  10262. case 'ucs2':
  10263. case 'utf16le':
  10264. // UTF-16 represents each of Surrogate Pair by 2-bytes
  10265. this.surrogateSize = 2;
  10266. this.detectIncompleteChar = utf16DetectIncompleteChar;
  10267. break;
  10268. case 'base64':
  10269. // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
  10270. this.surrogateSize = 3;
  10271. this.detectIncompleteChar = base64DetectIncompleteChar;
  10272. break;
  10273. default:
  10274. this.write = passThroughWrite;
  10275. return;
  10276. }
  10277. // Enough space to store all bytes of a single character. UTF-8 needs 4
  10278. // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
  10279. this.charBuffer = new Buffer(6);
  10280. // Number of bytes received for the current incomplete multi-byte character.
  10281. this.charReceived = 0;
  10282. // Number of bytes expected for the current incomplete multi-byte character.
  10283. this.charLength = 0;
  10284. };
  10285. // write decodes the given buffer and returns it as JS string that is
  10286. // guaranteed to not contain any partial multi-byte characters. Any partial
  10287. // character found at the end of the buffer is buffered up, and will be
  10288. // returned when calling write again with the remaining bytes.
  10289. //
  10290. // Note: Converting a Buffer containing an orphan surrogate to a String
  10291. // currently works, but converting a String to a Buffer (via `new Buffer`, or
  10292. // Buffer#write) will replace incomplete surrogates with the unicode
  10293. // replacement character. See https://codereview.chromium.org/121173009/ .
  10294. StringDecoder.prototype.write = function(buffer) {
  10295. var charStr = '';
  10296. // if our last write ended with an incomplete multibyte character
  10297. while (this.charLength) {
  10298. // determine how many remaining bytes this buffer has to offer for this char
  10299. var available = (buffer.length >= this.charLength - this.charReceived) ?
  10300. this.charLength - this.charReceived :
  10301. buffer.length;
  10302. // add the new bytes to the char buffer
  10303. buffer.copy(this.charBuffer, this.charReceived, 0, available);
  10304. this.charReceived += available;
  10305. if (this.charReceived < this.charLength) {
  10306. // still not enough chars in this buffer? wait for more ...
  10307. return '';
  10308. }
  10309. // remove bytes belonging to the current character from the buffer
  10310. buffer = buffer.slice(available, buffer.length);
  10311. // get the character that was split
  10312. charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
  10313. // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  10314. var charCode = charStr.charCodeAt(charStr.length - 1);
  10315. if (charCode >= 0xD800 && charCode <= 0xDBFF) {
  10316. this.charLength += this.surrogateSize;
  10317. charStr = '';
  10318. continue;
  10319. }
  10320. this.charReceived = this.charLength = 0;
  10321. // if there are no more bytes in this buffer, just emit our char
  10322. if (buffer.length === 0) {
  10323. return charStr;
  10324. }
  10325. break;
  10326. }
  10327. // determine and set charLength / charReceived
  10328. this.detectIncompleteChar(buffer);
  10329. var end = buffer.length;
  10330. if (this.charLength) {
  10331. // buffer the incomplete character bytes we got
  10332. buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
  10333. end -= this.charReceived;
  10334. }
  10335. charStr += buffer.toString(this.encoding, 0, end);
  10336. var end = charStr.length - 1;
  10337. var charCode = charStr.charCodeAt(end);
  10338. // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  10339. if (charCode >= 0xD800 && charCode <= 0xDBFF) {
  10340. var size = this.surrogateSize;
  10341. this.charLength += size;
  10342. this.charReceived += size;
  10343. this.charBuffer.copy(this.charBuffer, size, 0, size);
  10344. buffer.copy(this.charBuffer, 0, 0, size);
  10345. return charStr.substring(0, end);
  10346. }
  10347. // or just emit the charStr
  10348. return charStr;
  10349. };
  10350. // detectIncompleteChar determines if there is an incomplete UTF-8 character at
  10351. // the end of the given buffer. If so, it sets this.charLength to the byte
  10352. // length that character, and sets this.charReceived to the number of bytes
  10353. // that are available for this character.
  10354. StringDecoder.prototype.detectIncompleteChar = function(buffer) {
  10355. // determine how many bytes we have to check at the end of this buffer
  10356. var i = (buffer.length >= 3) ? 3 : buffer.length;
  10357. // Figure out if one of the last i bytes of our buffer announces an
  10358. // incomplete char.
  10359. for (; i > 0; i--) {
  10360. var c = buffer[buffer.length - i];
  10361. // See http://en.wikipedia.org/wiki/UTF-8#Description
  10362. // 110XXXXX
  10363. if (i == 1 && c >> 5 == 0x06) {
  10364. this.charLength = 2;
  10365. break;
  10366. }
  10367. // 1110XXXX
  10368. if (i <= 2 && c >> 4 == 0x0E) {
  10369. this.charLength = 3;
  10370. break;
  10371. }
  10372. // 11110XXX
  10373. if (i <= 3 && c >> 3 == 0x1E) {
  10374. this.charLength = 4;
  10375. break;
  10376. }
  10377. }
  10378. this.charReceived = i;
  10379. };
  10380. StringDecoder.prototype.end = function(buffer) {
  10381. var res = '';
  10382. if (buffer && buffer.length)
  10383. res = this.write(buffer);
  10384. if (this.charReceived) {
  10385. var cr = this.charReceived;
  10386. var buf = this.charBuffer;
  10387. var enc = this.encoding;
  10388. res += buf.slice(0, cr).toString(enc);
  10389. }
  10390. return res;
  10391. };
  10392. function passThroughWrite(buffer) {
  10393. return buffer.toString(this.encoding);
  10394. }
  10395. function utf16DetectIncompleteChar(buffer) {
  10396. this.charReceived = buffer.length % 2;
  10397. this.charLength = this.charReceived ? 2 : 0;
  10398. }
  10399. function base64DetectIncompleteChar(buffer) {
  10400. this.charReceived = buffer.length % 3;
  10401. this.charLength = this.charReceived ? 3 : 0;
  10402. }
  10403. /***/ },
  10404. /* 50 */
  10405. /***/ function(module, exports, __webpack_require__) {
  10406. module.exports = __webpack_require__(85);
  10407. /***/ },
  10408. /* 51 */
  10409. /***/ function(module, exports, __webpack_require__) {
  10410. "use strict";
  10411. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  10412. var utils = __webpack_require__(2);
  10413. var settle = __webpack_require__(91);
  10414. var buildURL = __webpack_require__(94);
  10415. var parseHeaders = __webpack_require__(100);
  10416. var isURLSameOrigin = __webpack_require__(98);
  10417. var createError = __webpack_require__(54);
  10418. var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(93);
  10419. module.exports = function xhrAdapter(config) {
  10420. return new Promise(function dispatchXhrRequest(resolve, reject) {
  10421. var requestData = config.data;
  10422. var requestHeaders = config.headers;
  10423. if (utils.isFormData(requestData)) {
  10424. delete requestHeaders['Content-Type']; // Let the browser set it
  10425. }
  10426. var request = new XMLHttpRequest();
  10427. var loadEvent = 'onreadystatechange';
  10428. var xDomain = false;
  10429. // For IE 8/9 CORS support
  10430. // Only supports POST and GET calls and doesn't returns the response headers.
  10431. // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
  10432. if (process.env.NODE_ENV !== 'test' &&
  10433. typeof window !== 'undefined' &&
  10434. window.XDomainRequest && !('withCredentials' in request) &&
  10435. !isURLSameOrigin(config.url)) {
  10436. request = new window.XDomainRequest();
  10437. loadEvent = 'onload';
  10438. xDomain = true;
  10439. request.onprogress = function handleProgress() {};
  10440. request.ontimeout = function handleTimeout() {};
  10441. }
  10442. // HTTP basic authentication
  10443. if (config.auth) {
  10444. var username = config.auth.username || '';
  10445. var password = config.auth.password || '';
  10446. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  10447. }
  10448. request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
  10449. // Set the request timeout in MS
  10450. request.timeout = config.timeout;
  10451. // Listen for ready state
  10452. request[loadEvent] = function handleLoad() {
  10453. if (!request || (request.readyState !== 4 && !xDomain)) {
  10454. return;
  10455. }
  10456. // The request errored out and we didn't get a response, this will be
  10457. // handled by onerror instead
  10458. // With one exception: request that using file: protocol, most browsers
  10459. // will return status as 0 even though it's a successful request
  10460. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  10461. return;
  10462. }
  10463. // Prepare the response
  10464. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  10465. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  10466. var response = {
  10467. data: responseData,
  10468. // IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
  10469. status: request.status === 1223 ? 204 : request.status,
  10470. statusText: request.status === 1223 ? 'No Content' : request.statusText,
  10471. headers: responseHeaders,
  10472. config: config,
  10473. request: request
  10474. };
  10475. settle(resolve, reject, response);
  10476. // Clean up request
  10477. request = null;
  10478. };
  10479. // Handle low level network errors
  10480. request.onerror = function handleError() {
  10481. // Real errors are hidden from us by the browser
  10482. // onerror should only fire if it's a network error
  10483. reject(createError('Network Error', config));
  10484. // Clean up request
  10485. request = null;
  10486. };
  10487. // Handle timeout
  10488. request.ontimeout = function handleTimeout() {
  10489. reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
  10490. // Clean up request
  10491. request = null;
  10492. };
  10493. // Add xsrf header
  10494. // This is only done if running in a standard browser environment.
  10495. // Specifically not if we're in a web worker, or react-native.
  10496. if (utils.isStandardBrowserEnv()) {
  10497. var cookies = __webpack_require__(96);
  10498. // Add xsrf header
  10499. var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
  10500. cookies.read(config.xsrfCookieName) :
  10501. undefined;
  10502. if (xsrfValue) {
  10503. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  10504. }
  10505. }
  10506. // Add headers to the request
  10507. if ('setRequestHeader' in request) {
  10508. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  10509. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  10510. // Remove Content-Type if data is undefined
  10511. delete requestHeaders[key];
  10512. } else {
  10513. // Otherwise add header to the request
  10514. request.setRequestHeader(key, val);
  10515. }
  10516. });
  10517. }
  10518. // Add withCredentials to request if needed
  10519. if (config.withCredentials) {
  10520. request.withCredentials = true;
  10521. }
  10522. // Add responseType to request if needed
  10523. if (config.responseType) {
  10524. try {
  10525. request.responseType = config.responseType;
  10526. } catch (e) {
  10527. if (request.responseType !== 'json') {
  10528. throw e;
  10529. }
  10530. }
  10531. }
  10532. // Handle progress if needed
  10533. if (typeof config.onDownloadProgress === 'function') {
  10534. request.addEventListener('progress', config.onDownloadProgress);
  10535. }
  10536. // Not all browsers support upload events
  10537. if (typeof config.onUploadProgress === 'function' && request.upload) {
  10538. request.upload.addEventListener('progress', config.onUploadProgress);
  10539. }
  10540. if (config.cancelToken) {
  10541. // Handle cancellation
  10542. config.cancelToken.promise.then(function onCanceled(cancel) {
  10543. if (!request) {
  10544. return;
  10545. }
  10546. request.abort();
  10547. reject(cancel);
  10548. // Clean up request
  10549. request = null;
  10550. });
  10551. }
  10552. if (requestData === undefined) {
  10553. requestData = null;
  10554. }
  10555. // Send the request
  10556. request.send(requestData);
  10557. });
  10558. };
  10559. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  10560. /***/ },
  10561. /* 52 */
  10562. /***/ function(module, exports) {
  10563. "use strict";
  10564. 'use strict';
  10565. /**
  10566. * A `Cancel` is an object that is thrown when an operation is canceled.
  10567. *
  10568. * @class
  10569. * @param {string=} message The message.
  10570. */
  10571. function Cancel(message) {
  10572. this.message = message;
  10573. }
  10574. Cancel.prototype.toString = function toString() {
  10575. return 'Cancel' + (this.message ? ': ' + this.message : '');
  10576. };
  10577. Cancel.prototype.__CANCEL__ = true;
  10578. module.exports = Cancel;
  10579. /***/ },
  10580. /* 53 */
  10581. /***/ function(module, exports) {
  10582. "use strict";
  10583. 'use strict';
  10584. module.exports = function isCancel(value) {
  10585. return !!(value && value.__CANCEL__);
  10586. };
  10587. /***/ },
  10588. /* 54 */
  10589. /***/ function(module, exports, __webpack_require__) {
  10590. "use strict";
  10591. 'use strict';
  10592. var enhanceError = __webpack_require__(90);
  10593. /**
  10594. * Create an Error with the specified message, config, error code, and response.
  10595. *
  10596. * @param {string} message The error message.
  10597. * @param {Object} config The config.
  10598. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  10599. @ @param {Object} [response] The response.
  10600. * @returns {Error} The created error.
  10601. */
  10602. module.exports = function createError(message, config, code, response) {
  10603. var error = new Error(message);
  10604. return enhanceError(error, config, code, response);
  10605. };
  10606. /***/ },
  10607. /* 55 */
  10608. /***/ function(module, exports) {
  10609. "use strict";
  10610. 'use strict';
  10611. module.exports = function bind(fn, thisArg) {
  10612. return function wrap() {
  10613. var args = new Array(arguments.length);
  10614. for (var i = 0; i < args.length; i++) {
  10615. args[i] = arguments[i];
  10616. }
  10617. return fn.apply(thisArg, args);
  10618. };
  10619. };
  10620. /***/ },
  10621. /* 56 */
  10622. /***/ function(module, exports, __webpack_require__) {
  10623. "use strict";
  10624. "use strict";
  10625. Object.defineProperty(exports, "__esModule", {
  10626. value: true
  10627. });
  10628. var _assign = __webpack_require__(23);
  10629. var _assign2 = _interopRequireDefault(_assign);
  10630. var _classCallCheck2 = __webpack_require__(16);
  10631. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  10632. var _createClass2 = __webpack_require__(17);
  10633. var _createClass3 = _interopRequireDefault(_createClass2);
  10634. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10635. var Password = function () {
  10636. function Password(pwd) {
  10637. (0, _classCallCheck3.default)(this, Password);
  10638. var password = (0, _assign2.default)({}, pwd);
  10639. this.options = {
  10640. uppercase: password.uppercase,
  10641. lowercase: password.lowercase,
  10642. numbers: password.numbers,
  10643. symbols: password.symbols,
  10644. length: password.length,
  10645. counter: password.counter
  10646. };
  10647. this.password = password;
  10648. }
  10649. (0, _createClass3.default)(Password, [{
  10650. key: "isNewPassword",
  10651. value: function isNewPassword(passwords) {
  10652. var _this = this;
  10653. var isNew = true;
  10654. passwords.forEach(function (pwd) {
  10655. if (pwd.site === _this.password.site && pwd.login === _this.password.login) {
  10656. isNew = false;
  10657. }
  10658. });
  10659. return isNew;
  10660. }
  10661. }, {
  10662. key: "json",
  10663. value: function json() {
  10664. return this.password;
  10665. }
  10666. }]);
  10667. return Password;
  10668. }();
  10669. exports.default = Password;
  10670. /***/ },
  10671. /* 57 */
  10672. /***/ function(module, exports, __webpack_require__) {
  10673. module.exports = { "default": __webpack_require__(124), __esModule: true };
  10674. /***/ },
  10675. /* 58 */
  10676. /***/ function(module, exports, __webpack_require__) {
  10677. module.exports = { "default": __webpack_require__(125), __esModule: true };
  10678. /***/ },
  10679. /* 59 */
  10680. /***/ function(module, exports, __webpack_require__) {
  10681. // getting tag from 19.1.3.6 Object.prototype.toString()
  10682. var cof = __webpack_require__(24)
  10683. , TAG = __webpack_require__(3)('toStringTag')
  10684. // ES3 wrong here
  10685. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  10686. // fallback for IE11 Script Access Denied error
  10687. var tryGet = function(it, key){
  10688. try {
  10689. return it[key];
  10690. } catch(e){ /* empty */ }
  10691. };
  10692. module.exports = function(it){
  10693. var O, T, B;
  10694. return it === undefined ? 'Undefined' : it === null ? 'Null'
  10695. // @@toStringTag case
  10696. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  10697. // builtinTag case
  10698. : ARG ? cof(O)
  10699. // ES3 arguments fallback
  10700. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  10701. };
  10702. /***/ },
  10703. /* 60 */
  10704. /***/ function(module, exports) {
  10705. // IE 8- don't enum bug keys
  10706. module.exports = (
  10707. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  10708. ).split(',');
  10709. /***/ },
  10710. /* 61 */
  10711. /***/ function(module, exports, __webpack_require__) {
  10712. module.exports = __webpack_require__(4).document && document.documentElement;
  10713. /***/ },
  10714. /* 62 */
  10715. /***/ function(module, exports, __webpack_require__) {
  10716. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  10717. var cof = __webpack_require__(24);
  10718. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
  10719. return cof(it) == 'String' ? it.split('') : Object(it);
  10720. };
  10721. /***/ },
  10722. /* 63 */
  10723. /***/ function(module, exports, __webpack_require__) {
  10724. "use strict";
  10725. 'use strict';
  10726. var LIBRARY = __webpack_require__(64)
  10727. , $export = __webpack_require__(26)
  10728. , redefine = __webpack_require__(146)
  10729. , hide = __webpack_require__(12)
  10730. , has = __webpack_require__(27)
  10731. , Iterators = __webpack_require__(18)
  10732. , $iterCreate = __webpack_require__(134)
  10733. , setToStringTag = __webpack_require__(40)
  10734. , getPrototypeOf = __webpack_require__(142)
  10735. , ITERATOR = __webpack_require__(3)('iterator')
  10736. , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
  10737. , FF_ITERATOR = '@@iterator'
  10738. , KEYS = 'keys'
  10739. , VALUES = 'values';
  10740. var returnThis = function(){ return this; };
  10741. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
  10742. $iterCreate(Constructor, NAME, next);
  10743. var getMethod = function(kind){
  10744. if(!BUGGY && kind in proto)return proto[kind];
  10745. switch(kind){
  10746. case KEYS: return function keys(){ return new Constructor(this, kind); };
  10747. case VALUES: return function values(){ return new Constructor(this, kind); };
  10748. } return function entries(){ return new Constructor(this, kind); };
  10749. };
  10750. var TAG = NAME + ' Iterator'
  10751. , DEF_VALUES = DEFAULT == VALUES
  10752. , VALUES_BUG = false
  10753. , proto = Base.prototype
  10754. , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  10755. , $default = $native || getMethod(DEFAULT)
  10756. , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
  10757. , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
  10758. , methods, key, IteratorPrototype;
  10759. // Fix native
  10760. if($anyNative){
  10761. IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
  10762. if(IteratorPrototype !== Object.prototype){
  10763. // Set @@toStringTag to native iterators
  10764. setToStringTag(IteratorPrototype, TAG, true);
  10765. // fix for some old engines
  10766. if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
  10767. }
  10768. }
  10769. // fix Array#{values, @@iterator}.name in V8 / FF
  10770. if(DEF_VALUES && $native && $native.name !== VALUES){
  10771. VALUES_BUG = true;
  10772. $default = function values(){ return $native.call(this); };
  10773. }
  10774. // Define iterator
  10775. if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
  10776. hide(proto, ITERATOR, $default);
  10777. }
  10778. // Plug for library
  10779. Iterators[NAME] = $default;
  10780. Iterators[TAG] = returnThis;
  10781. if(DEFAULT){
  10782. methods = {
  10783. values: DEF_VALUES ? $default : getMethod(VALUES),
  10784. keys: IS_SET ? $default : getMethod(KEYS),
  10785. entries: $entries
  10786. };
  10787. if(FORCED)for(key in methods){
  10788. if(!(key in proto))redefine(proto, key, methods[key]);
  10789. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  10790. }
  10791. return methods;
  10792. };
  10793. /***/ },
  10794. /* 64 */
  10795. /***/ function(module, exports) {
  10796. module.exports = true;
  10797. /***/ },
  10798. /* 65 */
  10799. /***/ function(module, exports, __webpack_require__) {
  10800. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  10801. var $keys = __webpack_require__(143)
  10802. , enumBugKeys = __webpack_require__(60);
  10803. module.exports = Object.keys || function keys(O){
  10804. return $keys(O, enumBugKeys);
  10805. };
  10806. /***/ },
  10807. /* 66 */
  10808. /***/ function(module, exports) {
  10809. module.exports = function(bitmap, value){
  10810. return {
  10811. enumerable : !(bitmap & 1),
  10812. configurable: !(bitmap & 2),
  10813. writable : !(bitmap & 4),
  10814. value : value
  10815. };
  10816. };
  10817. /***/ },
  10818. /* 67 */
  10819. /***/ function(module, exports, __webpack_require__) {
  10820. var global = __webpack_require__(4)
  10821. , SHARED = '__core-js_shared__'
  10822. , store = global[SHARED] || (global[SHARED] = {});
  10823. module.exports = function(key){
  10824. return store[key] || (store[key] = {});
  10825. };
  10826. /***/ },
  10827. /* 68 */
  10828. /***/ function(module, exports, __webpack_require__) {
  10829. var ctx = __webpack_require__(25)
  10830. , invoke = __webpack_require__(131)
  10831. , html = __webpack_require__(61)
  10832. , cel = __webpack_require__(38)
  10833. , global = __webpack_require__(4)
  10834. , process = global.process
  10835. , setTask = global.setImmediate
  10836. , clearTask = global.clearImmediate
  10837. , MessageChannel = global.MessageChannel
  10838. , counter = 0
  10839. , queue = {}
  10840. , ONREADYSTATECHANGE = 'onreadystatechange'
  10841. , defer, channel, port;
  10842. var run = function(){
  10843. var id = +this;
  10844. if(queue.hasOwnProperty(id)){
  10845. var fn = queue[id];
  10846. delete queue[id];
  10847. fn();
  10848. }
  10849. };
  10850. var listener = function(event){
  10851. run.call(event.data);
  10852. };
  10853. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  10854. if(!setTask || !clearTask){
  10855. setTask = function setImmediate(fn){
  10856. var args = [], i = 1;
  10857. while(arguments.length > i)args.push(arguments[i++]);
  10858. queue[++counter] = function(){
  10859. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  10860. };
  10861. defer(counter);
  10862. return counter;
  10863. };
  10864. clearTask = function clearImmediate(id){
  10865. delete queue[id];
  10866. };
  10867. // Node.js 0.8-
  10868. if(__webpack_require__(24)(process) == 'process'){
  10869. defer = function(id){
  10870. process.nextTick(ctx(run, id, 1));
  10871. };
  10872. // Browsers with MessageChannel, includes WebWorkers
  10873. } else if(MessageChannel){
  10874. channel = new MessageChannel;
  10875. port = channel.port2;
  10876. channel.port1.onmessage = listener;
  10877. defer = ctx(port.postMessage, port, 1);
  10878. // Browsers with postMessage, skip WebWorkers
  10879. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  10880. } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){
  10881. defer = function(id){
  10882. global.postMessage(id + '', '*');
  10883. };
  10884. global.addEventListener('message', listener, false);
  10885. // IE8-
  10886. } else if(ONREADYSTATECHANGE in cel('script')){
  10887. defer = function(id){
  10888. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){
  10889. html.removeChild(this);
  10890. run.call(id);
  10891. };
  10892. };
  10893. // Rest old browsers
  10894. } else {
  10895. defer = function(id){
  10896. setTimeout(ctx(run, id, 1), 0);
  10897. };
  10898. }
  10899. }
  10900. module.exports = {
  10901. set: setTask,
  10902. clear: clearTask
  10903. };
  10904. /***/ },
  10905. /* 69 */
  10906. /***/ function(module, exports, __webpack_require__) {
  10907. // 7.1.15 ToLength
  10908. var toInteger = __webpack_require__(42)
  10909. , min = Math.min;
  10910. module.exports = function(it){
  10911. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  10912. };
  10913. /***/ },
  10914. /* 70 */
  10915. /***/ function(module, exports, __webpack_require__) {
  10916. // 7.1.13 ToObject(argument)
  10917. var defined = __webpack_require__(37);
  10918. module.exports = function(it){
  10919. return Object(defined(it));
  10920. };
  10921. /***/ },
  10922. /* 71 */
  10923. /***/ function(module, exports) {
  10924. var id = 0
  10925. , px = Math.random();
  10926. module.exports = function(key){
  10927. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  10928. };
  10929. /***/ },
  10930. /* 72 */
  10931. /***/ function(module, exports, __webpack_require__) {
  10932. "use strict";
  10933. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  10934. var createHash = __webpack_require__(160);
  10935. var inherits = __webpack_require__(1)
  10936. var Transform = __webpack_require__(21).Transform
  10937. var ZEROS = new Buffer(128)
  10938. ZEROS.fill(0)
  10939. function Hmac(alg, key) {
  10940. Transform.call(this)
  10941. alg = alg.toLowerCase()
  10942. if (typeof key === 'string') {
  10943. key = new Buffer(key)
  10944. }
  10945. var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64
  10946. this._alg = alg
  10947. this._key = key
  10948. if (key.length > blocksize) {
  10949. key = createHash(alg).update(key).digest()
  10950. } else if (key.length < blocksize) {
  10951. key = Buffer.concat([key, ZEROS], blocksize)
  10952. }
  10953. var ipad = this._ipad = new Buffer(blocksize)
  10954. var opad = this._opad = new Buffer(blocksize)
  10955. for (var i = 0; i < blocksize; i++) {
  10956. ipad[i] = key[i] ^ 0x36
  10957. opad[i] = key[i] ^ 0x5C
  10958. }
  10959. this._hash = createHash(alg).update(ipad)
  10960. }
  10961. inherits(Hmac, Transform)
  10962. Hmac.prototype.update = function (data, enc) {
  10963. this._hash.update(data, enc)
  10964. return this
  10965. }
  10966. Hmac.prototype._transform = function (data, _, next) {
  10967. this._hash.update(data)
  10968. next()
  10969. }
  10970. Hmac.prototype._flush = function (next) {
  10971. this.push(this.digest())
  10972. next()
  10973. }
  10974. Hmac.prototype.digest = function (enc) {
  10975. var h = this._hash.digest()
  10976. return createHash(this._alg).update(this._opad).update(h).digest(enc)
  10977. }
  10978. module.exports = function createHmac(alg, key) {
  10979. return new Hmac(alg, key)
  10980. }
  10981. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  10982. /***/ },
  10983. /* 73 */
  10984. /***/ function(module, exports) {
  10985. var toString = {}.toString;
  10986. module.exports = Array.isArray || function (arr) {
  10987. return toString.call(arr) == '[object Array]';
  10988. };
  10989. /***/ },
  10990. /* 74 */
  10991. /***/ function(module, exports, __webpack_require__) {
  10992. "use strict";
  10993. 'use strict';
  10994. module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(181);
  10995. /***/ },
  10996. /* 75 */
  10997. /***/ function(module, exports, __webpack_require__) {
  10998. "use strict";
  10999. // a passthrough stream.
  11000. // basically just the most minimal sort of Transform stream.
  11001. // Every written chunk gets output as-is.
  11002. 'use strict';
  11003. module.exports = PassThrough;
  11004. var Transform = __webpack_require__(47);
  11005. /*<replacement>*/
  11006. var util = __webpack_require__(20);
  11007. util.inherits = __webpack_require__(1);
  11008. /*</replacement>*/
  11009. util.inherits(PassThrough, Transform);
  11010. function PassThrough(options) {
  11011. if (!(this instanceof PassThrough)) return new PassThrough(options);
  11012. Transform.call(this, options);
  11013. }
  11014. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  11015. cb(null, chunk);
  11016. };
  11017. /***/ },
  11018. /* 76 */
  11019. /***/ function(module, exports, __webpack_require__) {
  11020. "use strict";
  11021. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  11022. module.exports = Readable;
  11023. /*<replacement>*/
  11024. var processNextTick = __webpack_require__(46);
  11025. /*</replacement>*/
  11026. /*<replacement>*/
  11027. var isArray = __webpack_require__(73);
  11028. /*</replacement>*/
  11029. /*<replacement>*/
  11030. var Duplex;
  11031. /*</replacement>*/
  11032. Readable.ReadableState = ReadableState;
  11033. /*<replacement>*/
  11034. var EE = __webpack_require__(30).EventEmitter;
  11035. var EElistenerCount = function (emitter, type) {
  11036. return emitter.listeners(type).length;
  11037. };
  11038. /*</replacement>*/
  11039. /*<replacement>*/
  11040. var Stream;
  11041. (function () {
  11042. try {
  11043. Stream = __webpack_require__(21);
  11044. } catch (_) {} finally {
  11045. if (!Stream) Stream = __webpack_require__(30).EventEmitter;
  11046. }
  11047. })();
  11048. /*</replacement>*/
  11049. var Buffer = __webpack_require__(0).Buffer;
  11050. /*<replacement>*/
  11051. var bufferShim = __webpack_require__(35);
  11052. /*</replacement>*/
  11053. /*<replacement>*/
  11054. var util = __webpack_require__(20);
  11055. util.inherits = __webpack_require__(1);
  11056. /*</replacement>*/
  11057. /*<replacement>*/
  11058. var debugUtil = __webpack_require__(222);
  11059. var debug = void 0;
  11060. if (debugUtil && debugUtil.debuglog) {
  11061. debug = debugUtil.debuglog('stream');
  11062. } else {
  11063. debug = function () {};
  11064. }
  11065. /*</replacement>*/
  11066. var BufferList = __webpack_require__(183);
  11067. var StringDecoder;
  11068. util.inherits(Readable, Stream);
  11069. function prependListener(emitter, event, fn) {
  11070. // Sadly this is not cacheable as some libraries bundle their own
  11071. // event emitter implementation with them.
  11072. if (typeof emitter.prependListener === 'function') {
  11073. return emitter.prependListener(event, fn);
  11074. } else {
  11075. // This is a hack to make sure that our error handler is attached before any
  11076. // userland ones. NEVER DO THIS. This is here only because this code needs
  11077. // to continue to work with older versions of Node.js that do not include
  11078. // the prependListener() method. The goal is to eventually remove this hack.
  11079. if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
  11080. }
  11081. }
  11082. function ReadableState(options, stream) {
  11083. Duplex = Duplex || __webpack_require__(8);
  11084. options = options || {};
  11085. // object stream flag. Used to make read(n) ignore n and to
  11086. // make all the buffer merging and length checks go away
  11087. this.objectMode = !!options.objectMode;
  11088. if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  11089. // the point at which it stops calling _read() to fill the buffer
  11090. // Note: 0 is a valid value, means "don't call _read preemptively ever"
  11091. var hwm = options.highWaterMark;
  11092. var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  11093. this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
  11094. // cast to ints.
  11095. this.highWaterMark = ~ ~this.highWaterMark;
  11096. // A linked list is used to store data chunks instead of an array because the
  11097. // linked list can remove elements from the beginning faster than
  11098. // array.shift()
  11099. this.buffer = new BufferList();
  11100. this.length = 0;
  11101. this.pipes = null;
  11102. this.pipesCount = 0;
  11103. this.flowing = null;
  11104. this.ended = false;
  11105. this.endEmitted = false;
  11106. this.reading = false;
  11107. // a flag to be able to tell if the onwrite cb is called immediately,
  11108. // or on a later tick. We set this to true at first, because any
  11109. // actions that shouldn't happen until "later" should generally also
  11110. // not happen before the first write call.
  11111. this.sync = true;
  11112. // whenever we return null, then we set a flag to say
  11113. // that we're awaiting a 'readable' event emission.
  11114. this.needReadable = false;
  11115. this.emittedReadable = false;
  11116. this.readableListening = false;
  11117. this.resumeScheduled = false;
  11118. // Crypto is kind of old and crusty. Historically, its default string
  11119. // encoding is 'binary' so we have to make this configurable.
  11120. // Everything else in the universe uses 'utf8', though.
  11121. this.defaultEncoding = options.defaultEncoding || 'utf8';
  11122. // when piping, we only care about 'readable' events that happen
  11123. // after read()ing all the bytes and not getting any pushback.
  11124. this.ranOut = false;
  11125. // the number of writers that are awaiting a drain event in .pipe()s
  11126. this.awaitDrain = 0;
  11127. // if true, a maybeReadMore has been scheduled
  11128. this.readingMore = false;
  11129. this.decoder = null;
  11130. this.encoding = null;
  11131. if (options.encoding) {
  11132. if (!StringDecoder) StringDecoder = __webpack_require__(49).StringDecoder;
  11133. this.decoder = new StringDecoder(options.encoding);
  11134. this.encoding = options.encoding;
  11135. }
  11136. }
  11137. function Readable(options) {
  11138. Duplex = Duplex || __webpack_require__(8);
  11139. if (!(this instanceof Readable)) return new Readable(options);
  11140. this._readableState = new ReadableState(options, this);
  11141. // legacy
  11142. this.readable = true;
  11143. if (options && typeof options.read === 'function') this._read = options.read;
  11144. Stream.call(this);
  11145. }
  11146. // Manually shove something into the read() buffer.
  11147. // This returns true if the highWaterMark has not been hit yet,
  11148. // similar to how Writable.write() returns true if you should
  11149. // write() some more.
  11150. Readable.prototype.push = function (chunk, encoding) {
  11151. var state = this._readableState;
  11152. if (!state.objectMode && typeof chunk === 'string') {
  11153. encoding = encoding || state.defaultEncoding;
  11154. if (encoding !== state.encoding) {
  11155. chunk = bufferShim.from(chunk, encoding);
  11156. encoding = '';
  11157. }
  11158. }
  11159. return readableAddChunk(this, state, chunk, encoding, false);
  11160. };
  11161. // Unshift should *always* be something directly out of read()
  11162. Readable.prototype.unshift = function (chunk) {
  11163. var state = this._readableState;
  11164. return readableAddChunk(this, state, chunk, '', true);
  11165. };
  11166. Readable.prototype.isPaused = function () {
  11167. return this._readableState.flowing === false;
  11168. };
  11169. function readableAddChunk(stream, state, chunk, encoding, addToFront) {
  11170. var er = chunkInvalid(state, chunk);
  11171. if (er) {
  11172. stream.emit('error', er);
  11173. } else if (chunk === null) {
  11174. state.reading = false;
  11175. onEofChunk(stream, state);
  11176. } else if (state.objectMode || chunk && chunk.length > 0) {
  11177. if (state.ended && !addToFront) {
  11178. var e = new Error('stream.push() after EOF');
  11179. stream.emit('error', e);
  11180. } else if (state.endEmitted && addToFront) {
  11181. var _e = new Error('stream.unshift() after end event');
  11182. stream.emit('error', _e);
  11183. } else {
  11184. var skipAdd;
  11185. if (state.decoder && !addToFront && !encoding) {
  11186. chunk = state.decoder.write(chunk);
  11187. skipAdd = !state.objectMode && chunk.length === 0;
  11188. }
  11189. if (!addToFront) state.reading = false;
  11190. // Don't add to the buffer if we've decoded to an empty string chunk and
  11191. // we're not in object mode
  11192. if (!skipAdd) {
  11193. // if we want the data now, just emit it.
  11194. if (state.flowing && state.length === 0 && !state.sync) {
  11195. stream.emit('data', chunk);
  11196. stream.read(0);
  11197. } else {
  11198. // update the buffer info.
  11199. state.length += state.objectMode ? 1 : chunk.length;
  11200. if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
  11201. if (state.needReadable) emitReadable(stream);
  11202. }
  11203. }
  11204. maybeReadMore(stream, state);
  11205. }
  11206. } else if (!addToFront) {
  11207. state.reading = false;
  11208. }
  11209. return needMoreData(state);
  11210. }
  11211. // if it's past the high water mark, we can push in some more.
  11212. // Also, if we have no data yet, we can stand some
  11213. // more bytes. This is to work around cases where hwm=0,
  11214. // such as the repl. Also, if the push() triggered a
  11215. // readable event, and the user called read(largeNumber) such that
  11216. // needReadable was set, then we ought to push more, so that another
  11217. // 'readable' event will be triggered.
  11218. function needMoreData(state) {
  11219. return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
  11220. }
  11221. // backwards compatibility.
  11222. Readable.prototype.setEncoding = function (enc) {
  11223. if (!StringDecoder) StringDecoder = __webpack_require__(49).StringDecoder;
  11224. this._readableState.decoder = new StringDecoder(enc);
  11225. this._readableState.encoding = enc;
  11226. return this;
  11227. };
  11228. // Don't raise the hwm > 8MB
  11229. var MAX_HWM = 0x800000;
  11230. function computeNewHighWaterMark(n) {
  11231. if (n >= MAX_HWM) {
  11232. n = MAX_HWM;
  11233. } else {
  11234. // Get the next highest power of 2 to prevent increasing hwm excessively in
  11235. // tiny amounts
  11236. n--;
  11237. n |= n >>> 1;
  11238. n |= n >>> 2;
  11239. n |= n >>> 4;
  11240. n |= n >>> 8;
  11241. n |= n >>> 16;
  11242. n++;
  11243. }
  11244. return n;
  11245. }
  11246. // This function is designed to be inlinable, so please take care when making
  11247. // changes to the function body.
  11248. function howMuchToRead(n, state) {
  11249. if (n <= 0 || state.length === 0 && state.ended) return 0;
  11250. if (state.objectMode) return 1;
  11251. if (n !== n) {
  11252. // Only flow one buffer at a time
  11253. if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
  11254. }
  11255. // If we're asking for more than the current hwm, then raise the hwm.
  11256. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  11257. if (n <= state.length) return n;
  11258. // Don't have enough
  11259. if (!state.ended) {
  11260. state.needReadable = true;
  11261. return 0;
  11262. }
  11263. return state.length;
  11264. }
  11265. // you can override either this method, or the async _read(n) below.
  11266. Readable.prototype.read = function (n) {
  11267. debug('read', n);
  11268. n = parseInt(n, 10);
  11269. var state = this._readableState;
  11270. var nOrig = n;
  11271. if (n !== 0) state.emittedReadable = false;
  11272. // if we're doing read(0) to trigger a readable event, but we
  11273. // already have a bunch of data in the buffer, then just trigger
  11274. // the 'readable' event and move on.
  11275. if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  11276. debug('read: emitReadable', state.length, state.ended);
  11277. if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
  11278. return null;
  11279. }
  11280. n = howMuchToRead(n, state);
  11281. // if we've ended, and we're now clear, then finish it up.
  11282. if (n === 0 && state.ended) {
  11283. if (state.length === 0) endReadable(this);
  11284. return null;
  11285. }
  11286. // All the actual chunk generation logic needs to be
  11287. // *below* the call to _read. The reason is that in certain
  11288. // synthetic stream cases, such as passthrough streams, _read
  11289. // may be a completely synchronous operation which may change
  11290. // the state of the read buffer, providing enough data when
  11291. // before there was *not* enough.
  11292. //
  11293. // So, the steps are:
  11294. // 1. Figure out what the state of things will be after we do
  11295. // a read from the buffer.
  11296. //
  11297. // 2. If that resulting state will trigger a _read, then call _read.
  11298. // Note that this may be asynchronous, or synchronous. Yes, it is
  11299. // deeply ugly to write APIs this way, but that still doesn't mean
  11300. // that the Readable class should behave improperly, as streams are
  11301. // designed to be sync/async agnostic.
  11302. // Take note if the _read call is sync or async (ie, if the read call
  11303. // has returned yet), so that we know whether or not it's safe to emit
  11304. // 'readable' etc.
  11305. //
  11306. // 3. Actually pull the requested chunks out of the buffer and return.
  11307. // if we need a readable event, then we need to do some reading.
  11308. var doRead = state.needReadable;
  11309. debug('need readable', doRead);
  11310. // if we currently have less than the highWaterMark, then also read some
  11311. if (state.length === 0 || state.length - n < state.highWaterMark) {
  11312. doRead = true;
  11313. debug('length less than watermark', doRead);
  11314. }
  11315. // however, if we've ended, then there's no point, and if we're already
  11316. // reading, then it's unnecessary.
  11317. if (state.ended || state.reading) {
  11318. doRead = false;
  11319. debug('reading or ended', doRead);
  11320. } else if (doRead) {
  11321. debug('do read');
  11322. state.reading = true;
  11323. state.sync = true;
  11324. // if the length is currently zero, then we *need* a readable event.
  11325. if (state.length === 0) state.needReadable = true;
  11326. // call internal read method
  11327. this._read(state.highWaterMark);
  11328. state.sync = false;
  11329. // If _read pushed data synchronously, then `reading` will be false,
  11330. // and we need to re-evaluate how much data we can return to the user.
  11331. if (!state.reading) n = howMuchToRead(nOrig, state);
  11332. }
  11333. var ret;
  11334. if (n > 0) ret = fromList(n, state);else ret = null;
  11335. if (ret === null) {
  11336. state.needReadable = true;
  11337. n = 0;
  11338. } else {
  11339. state.length -= n;
  11340. }
  11341. if (state.length === 0) {
  11342. // If we have nothing in the buffer, then we want to know
  11343. // as soon as we *do* get something into the buffer.
  11344. if (!state.ended) state.needReadable = true;
  11345. // If we tried to read() past the EOF, then emit end on the next tick.
  11346. if (nOrig !== n && state.ended) endReadable(this);
  11347. }
  11348. if (ret !== null) this.emit('data', ret);
  11349. return ret;
  11350. };
  11351. function chunkInvalid(state, chunk) {
  11352. var er = null;
  11353. if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
  11354. er = new TypeError('Invalid non-string/buffer chunk');
  11355. }
  11356. return er;
  11357. }
  11358. function onEofChunk(stream, state) {
  11359. if (state.ended) return;
  11360. if (state.decoder) {
  11361. var chunk = state.decoder.end();
  11362. if (chunk && chunk.length) {
  11363. state.buffer.push(chunk);
  11364. state.length += state.objectMode ? 1 : chunk.length;
  11365. }
  11366. }
  11367. state.ended = true;
  11368. // emit 'readable' now to make sure it gets picked up.
  11369. emitReadable(stream);
  11370. }
  11371. // Don't emit readable right away in sync mode, because this can trigger
  11372. // another read() call => stack overflow. This way, it might trigger
  11373. // a nextTick recursion warning, but that's not so bad.
  11374. function emitReadable(stream) {
  11375. var state = stream._readableState;
  11376. state.needReadable = false;
  11377. if (!state.emittedReadable) {
  11378. debug('emitReadable', state.flowing);
  11379. state.emittedReadable = true;
  11380. if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
  11381. }
  11382. }
  11383. function emitReadable_(stream) {
  11384. debug('emit readable');
  11385. stream.emit('readable');
  11386. flow(stream);
  11387. }
  11388. // at this point, the user has presumably seen the 'readable' event,
  11389. // and called read() to consume some data. that may have triggered
  11390. // in turn another _read(n) call, in which case reading = true if
  11391. // it's in progress.
  11392. // However, if we're not ended, or reading, and the length < hwm,
  11393. // then go ahead and try to read some more preemptively.
  11394. function maybeReadMore(stream, state) {
  11395. if (!state.readingMore) {
  11396. state.readingMore = true;
  11397. processNextTick(maybeReadMore_, stream, state);
  11398. }
  11399. }
  11400. function maybeReadMore_(stream, state) {
  11401. var len = state.length;
  11402. while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  11403. debug('maybeReadMore read 0');
  11404. stream.read(0);
  11405. if (len === state.length)
  11406. // didn't get any data, stop spinning.
  11407. break;else len = state.length;
  11408. }
  11409. state.readingMore = false;
  11410. }
  11411. // abstract method. to be overridden in specific implementation classes.
  11412. // call cb(er, data) where data is <= n in length.
  11413. // for virtual (non-string, non-buffer) streams, "length" is somewhat
  11414. // arbitrary, and perhaps not very meaningful.
  11415. Readable.prototype._read = function (n) {
  11416. this.emit('error', new Error('_read() is not implemented'));
  11417. };
  11418. Readable.prototype.pipe = function (dest, pipeOpts) {
  11419. var src = this;
  11420. var state = this._readableState;
  11421. switch (state.pipesCount) {
  11422. case 0:
  11423. state.pipes = dest;
  11424. break;
  11425. case 1:
  11426. state.pipes = [state.pipes, dest];
  11427. break;
  11428. default:
  11429. state.pipes.push(dest);
  11430. break;
  11431. }
  11432. state.pipesCount += 1;
  11433. debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
  11434. var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  11435. var endFn = doEnd ? onend : cleanup;
  11436. if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
  11437. dest.on('unpipe', onunpipe);
  11438. function onunpipe(readable) {
  11439. debug('onunpipe');
  11440. if (readable === src) {
  11441. cleanup();
  11442. }
  11443. }
  11444. function onend() {
  11445. debug('onend');
  11446. dest.end();
  11447. }
  11448. // when the dest drains, it reduces the awaitDrain counter
  11449. // on the source. This would be more elegant with a .once()
  11450. // handler in flow(), but adding and removing repeatedly is
  11451. // too slow.
  11452. var ondrain = pipeOnDrain(src);
  11453. dest.on('drain', ondrain);
  11454. var cleanedUp = false;
  11455. function cleanup() {
  11456. debug('cleanup');
  11457. // cleanup event handlers once the pipe is broken
  11458. dest.removeListener('close', onclose);
  11459. dest.removeListener('finish', onfinish);
  11460. dest.removeListener('drain', ondrain);
  11461. dest.removeListener('error', onerror);
  11462. dest.removeListener('unpipe', onunpipe);
  11463. src.removeListener('end', onend);
  11464. src.removeListener('end', cleanup);
  11465. src.removeListener('data', ondata);
  11466. cleanedUp = true;
  11467. // if the reader is waiting for a drain event from this
  11468. // specific writer, then it would cause it to never start
  11469. // flowing again.
  11470. // So, if this is awaiting a drain, then we just call it now.
  11471. // If we don't know, then assume that we are waiting for one.
  11472. if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
  11473. }
  11474. // If the user pushes more data while we're writing to dest then we'll end up
  11475. // in ondata again. However, we only want to increase awaitDrain once because
  11476. // dest will only emit one 'drain' event for the multiple writes.
  11477. // => Introduce a guard on increasing awaitDrain.
  11478. var increasedAwaitDrain = false;
  11479. src.on('data', ondata);
  11480. function ondata(chunk) {
  11481. debug('ondata');
  11482. increasedAwaitDrain = false;
  11483. var ret = dest.write(chunk);
  11484. if (false === ret && !increasedAwaitDrain) {
  11485. // If the user unpiped during `dest.write()`, it is possible
  11486. // to get stuck in a permanently paused state if that write
  11487. // also returned false.
  11488. // => Check whether `dest` is still a piping destination.
  11489. if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  11490. debug('false write response, pause', src._readableState.awaitDrain);
  11491. src._readableState.awaitDrain++;
  11492. increasedAwaitDrain = true;
  11493. }
  11494. src.pause();
  11495. }
  11496. }
  11497. // if the dest has an error, then stop piping into it.
  11498. // however, don't suppress the throwing behavior for this.
  11499. function onerror(er) {
  11500. debug('onerror', er);
  11501. unpipe();
  11502. dest.removeListener('error', onerror);
  11503. if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
  11504. }
  11505. // Make sure our error handler is attached before userland ones.
  11506. prependListener(dest, 'error', onerror);
  11507. // Both close and finish should trigger unpipe, but only once.
  11508. function onclose() {
  11509. dest.removeListener('finish', onfinish);
  11510. unpipe();
  11511. }
  11512. dest.once('close', onclose);
  11513. function onfinish() {
  11514. debug('onfinish');
  11515. dest.removeListener('close', onclose);
  11516. unpipe();
  11517. }
  11518. dest.once('finish', onfinish);
  11519. function unpipe() {
  11520. debug('unpipe');
  11521. src.unpipe(dest);
  11522. }
  11523. // tell the dest that it's being piped to
  11524. dest.emit('pipe', src);
  11525. // start the flow if it hasn't been started already.
  11526. if (!state.flowing) {
  11527. debug('pipe resume');
  11528. src.resume();
  11529. }
  11530. return dest;
  11531. };
  11532. function pipeOnDrain(src) {
  11533. return function () {
  11534. var state = src._readableState;
  11535. debug('pipeOnDrain', state.awaitDrain);
  11536. if (state.awaitDrain) state.awaitDrain--;
  11537. if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
  11538. state.flowing = true;
  11539. flow(src);
  11540. }
  11541. };
  11542. }
  11543. Readable.prototype.unpipe = function (dest) {
  11544. var state = this._readableState;
  11545. // if we're not piping anywhere, then do nothing.
  11546. if (state.pipesCount === 0) return this;
  11547. // just one destination. most common case.
  11548. if (state.pipesCount === 1) {
  11549. // passed in one, but it's not the right one.
  11550. if (dest && dest !== state.pipes) return this;
  11551. if (!dest) dest = state.pipes;
  11552. // got a match.
  11553. state.pipes = null;
  11554. state.pipesCount = 0;
  11555. state.flowing = false;
  11556. if (dest) dest.emit('unpipe', this);
  11557. return this;
  11558. }
  11559. // slow case. multiple pipe destinations.
  11560. if (!dest) {
  11561. // remove all.
  11562. var dests = state.pipes;
  11563. var len = state.pipesCount;
  11564. state.pipes = null;
  11565. state.pipesCount = 0;
  11566. state.flowing = false;
  11567. for (var i = 0; i < len; i++) {
  11568. dests[i].emit('unpipe', this);
  11569. }return this;
  11570. }
  11571. // try to find the right one.
  11572. var index = indexOf(state.pipes, dest);
  11573. if (index === -1) return this;
  11574. state.pipes.splice(index, 1);
  11575. state.pipesCount -= 1;
  11576. if (state.pipesCount === 1) state.pipes = state.pipes[0];
  11577. dest.emit('unpipe', this);
  11578. return this;
  11579. };
  11580. // set up data events if they are asked for
  11581. // Ensure readable listeners eventually get something
  11582. Readable.prototype.on = function (ev, fn) {
  11583. var res = Stream.prototype.on.call(this, ev, fn);
  11584. if (ev === 'data') {
  11585. // Start flowing on next tick if stream isn't explicitly paused
  11586. if (this._readableState.flowing !== false) this.resume();
  11587. } else if (ev === 'readable') {
  11588. var state = this._readableState;
  11589. if (!state.endEmitted && !state.readableListening) {
  11590. state.readableListening = state.needReadable = true;
  11591. state.emittedReadable = false;
  11592. if (!state.reading) {
  11593. processNextTick(nReadingNextTick, this);
  11594. } else if (state.length) {
  11595. emitReadable(this, state);
  11596. }
  11597. }
  11598. }
  11599. return res;
  11600. };
  11601. Readable.prototype.addListener = Readable.prototype.on;
  11602. function nReadingNextTick(self) {
  11603. debug('readable nexttick read 0');
  11604. self.read(0);
  11605. }
  11606. // pause() and resume() are remnants of the legacy readable stream API
  11607. // If the user uses them, then switch into old mode.
  11608. Readable.prototype.resume = function () {
  11609. var state = this._readableState;
  11610. if (!state.flowing) {
  11611. debug('resume');
  11612. state.flowing = true;
  11613. resume(this, state);
  11614. }
  11615. return this;
  11616. };
  11617. function resume(stream, state) {
  11618. if (!state.resumeScheduled) {
  11619. state.resumeScheduled = true;
  11620. processNextTick(resume_, stream, state);
  11621. }
  11622. }
  11623. function resume_(stream, state) {
  11624. if (!state.reading) {
  11625. debug('resume read 0');
  11626. stream.read(0);
  11627. }
  11628. state.resumeScheduled = false;
  11629. state.awaitDrain = 0;
  11630. stream.emit('resume');
  11631. flow(stream);
  11632. if (state.flowing && !state.reading) stream.read(0);
  11633. }
  11634. Readable.prototype.pause = function () {
  11635. debug('call pause flowing=%j', this._readableState.flowing);
  11636. if (false !== this._readableState.flowing) {
  11637. debug('pause');
  11638. this._readableState.flowing = false;
  11639. this.emit('pause');
  11640. }
  11641. return this;
  11642. };
  11643. function flow(stream) {
  11644. var state = stream._readableState;
  11645. debug('flow', state.flowing);
  11646. while (state.flowing && stream.read() !== null) {}
  11647. }
  11648. // wrap an old-style stream as the async data source.
  11649. // This is *not* part of the readable stream interface.
  11650. // It is an ugly unfortunate mess of history.
  11651. Readable.prototype.wrap = function (stream) {
  11652. var state = this._readableState;
  11653. var paused = false;
  11654. var self = this;
  11655. stream.on('end', function () {
  11656. debug('wrapped end');
  11657. if (state.decoder && !state.ended) {
  11658. var chunk = state.decoder.end();
  11659. if (chunk && chunk.length) self.push(chunk);
  11660. }
  11661. self.push(null);
  11662. });
  11663. stream.on('data', function (chunk) {
  11664. debug('wrapped data');
  11665. if (state.decoder) chunk = state.decoder.write(chunk);
  11666. // don't skip over falsy values in objectMode
  11667. if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
  11668. var ret = self.push(chunk);
  11669. if (!ret) {
  11670. paused = true;
  11671. stream.pause();
  11672. }
  11673. });
  11674. // proxy all the other methods.
  11675. // important when wrapping filters and duplexes.
  11676. for (var i in stream) {
  11677. if (this[i] === undefined && typeof stream[i] === 'function') {
  11678. this[i] = function (method) {
  11679. return function () {
  11680. return stream[method].apply(stream, arguments);
  11681. };
  11682. }(i);
  11683. }
  11684. }
  11685. // proxy certain important events.
  11686. var events = ['error', 'close', 'destroy', 'pause', 'resume'];
  11687. forEach(events, function (ev) {
  11688. stream.on(ev, self.emit.bind(self, ev));
  11689. });
  11690. // when we try to consume some more bytes, simply unpause the
  11691. // underlying stream.
  11692. self._read = function (n) {
  11693. debug('wrapped _read', n);
  11694. if (paused) {
  11695. paused = false;
  11696. stream.resume();
  11697. }
  11698. };
  11699. return self;
  11700. };
  11701. // exposed for testing purposes only.
  11702. Readable._fromList = fromList;
  11703. // Pluck off n bytes from an array of buffers.
  11704. // Length is the combined lengths of all the buffers in the list.
  11705. // This function is designed to be inlinable, so please take care when making
  11706. // changes to the function body.
  11707. function fromList(n, state) {
  11708. // nothing buffered
  11709. if (state.length === 0) return null;
  11710. var ret;
  11711. if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
  11712. // read it all, truncate the list
  11713. if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
  11714. state.buffer.clear();
  11715. } else {
  11716. // read part of list
  11717. ret = fromListPartial(n, state.buffer, state.decoder);
  11718. }
  11719. return ret;
  11720. }
  11721. // Extracts only enough buffered data to satisfy the amount requested.
  11722. // This function is designed to be inlinable, so please take care when making
  11723. // changes to the function body.
  11724. function fromListPartial(n, list, hasStrings) {
  11725. var ret;
  11726. if (n < list.head.data.length) {
  11727. // slice is the same for buffers and strings
  11728. ret = list.head.data.slice(0, n);
  11729. list.head.data = list.head.data.slice(n);
  11730. } else if (n === list.head.data.length) {
  11731. // first chunk is a perfect match
  11732. ret = list.shift();
  11733. } else {
  11734. // result spans more than one buffer
  11735. ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
  11736. }
  11737. return ret;
  11738. }
  11739. // Copies a specified amount of characters from the list of buffered data
  11740. // chunks.
  11741. // This function is designed to be inlinable, so please take care when making
  11742. // changes to the function body.
  11743. function copyFromBufferString(n, list) {
  11744. var p = list.head;
  11745. var c = 1;
  11746. var ret = p.data;
  11747. n -= ret.length;
  11748. while (p = p.next) {
  11749. var str = p.data;
  11750. var nb = n > str.length ? str.length : n;
  11751. if (nb === str.length) ret += str;else ret += str.slice(0, n);
  11752. n -= nb;
  11753. if (n === 0) {
  11754. if (nb === str.length) {
  11755. ++c;
  11756. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11757. } else {
  11758. list.head = p;
  11759. p.data = str.slice(nb);
  11760. }
  11761. break;
  11762. }
  11763. ++c;
  11764. }
  11765. list.length -= c;
  11766. return ret;
  11767. }
  11768. // Copies a specified amount of bytes from the list of buffered data chunks.
  11769. // This function is designed to be inlinable, so please take care when making
  11770. // changes to the function body.
  11771. function copyFromBuffer(n, list) {
  11772. var ret = bufferShim.allocUnsafe(n);
  11773. var p = list.head;
  11774. var c = 1;
  11775. p.data.copy(ret);
  11776. n -= p.data.length;
  11777. while (p = p.next) {
  11778. var buf = p.data;
  11779. var nb = n > buf.length ? buf.length : n;
  11780. buf.copy(ret, ret.length - n, 0, nb);
  11781. n -= nb;
  11782. if (n === 0) {
  11783. if (nb === buf.length) {
  11784. ++c;
  11785. if (p.next) list.head = p.next;else list.head = list.tail = null;
  11786. } else {
  11787. list.head = p;
  11788. p.data = buf.slice(nb);
  11789. }
  11790. break;
  11791. }
  11792. ++c;
  11793. }
  11794. list.length -= c;
  11795. return ret;
  11796. }
  11797. function endReadable(stream) {
  11798. var state = stream._readableState;
  11799. // If we get here before consuming all the bytes, then that is a
  11800. // bug in node. Should never happen.
  11801. if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  11802. if (!state.endEmitted) {
  11803. state.ended = true;
  11804. processNextTick(endReadableNT, state, stream);
  11805. }
  11806. }
  11807. function endReadableNT(state, stream) {
  11808. // Check that we didn't get one last unshift.
  11809. if (!state.endEmitted && state.length === 0) {
  11810. state.endEmitted = true;
  11811. stream.readable = false;
  11812. stream.emit('end');
  11813. }
  11814. }
  11815. function forEach(xs, f) {
  11816. for (var i = 0, l = xs.length; i < l; i++) {
  11817. f(xs[i], i);
  11818. }
  11819. }
  11820. function indexOf(xs, x) {
  11821. for (var i = 0, l = xs.length; i < l; i++) {
  11822. if (xs[i] === x) return i;
  11823. }
  11824. return -1;
  11825. }
  11826. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  11827. /***/ },
  11828. /* 77 */
  11829. /***/ function(module, exports, __webpack_require__) {
  11830. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  11831. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  11832. * in FIPS 180-2
  11833. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  11834. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  11835. *
  11836. */
  11837. var inherits = __webpack_require__(1)
  11838. var Hash = __webpack_require__(13)
  11839. var K = [
  11840. 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
  11841. 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
  11842. 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
  11843. 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
  11844. 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
  11845. 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
  11846. 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
  11847. 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
  11848. 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
  11849. 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
  11850. 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
  11851. 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
  11852. 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
  11853. 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
  11854. 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
  11855. 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
  11856. ]
  11857. var W = new Array(64)
  11858. function Sha256 () {
  11859. this.init()
  11860. this._w = W // new Array(64)
  11861. Hash.call(this, 64, 56)
  11862. }
  11863. inherits(Sha256, Hash)
  11864. Sha256.prototype.init = function () {
  11865. this._a = 0x6a09e667
  11866. this._b = 0xbb67ae85
  11867. this._c = 0x3c6ef372
  11868. this._d = 0xa54ff53a
  11869. this._e = 0x510e527f
  11870. this._f = 0x9b05688c
  11871. this._g = 0x1f83d9ab
  11872. this._h = 0x5be0cd19
  11873. return this
  11874. }
  11875. function ch (x, y, z) {
  11876. return z ^ (x & (y ^ z))
  11877. }
  11878. function maj (x, y, z) {
  11879. return (x & y) | (z & (x | y))
  11880. }
  11881. function sigma0 (x) {
  11882. return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)
  11883. }
  11884. function sigma1 (x) {
  11885. return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)
  11886. }
  11887. function gamma0 (x) {
  11888. return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)
  11889. }
  11890. function gamma1 (x) {
  11891. return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)
  11892. }
  11893. Sha256.prototype._update = function (M) {
  11894. var W = this._w
  11895. var a = this._a | 0
  11896. var b = this._b | 0
  11897. var c = this._c | 0
  11898. var d = this._d | 0
  11899. var e = this._e | 0
  11900. var f = this._f | 0
  11901. var g = this._g | 0
  11902. var h = this._h | 0
  11903. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  11904. for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0
  11905. for (var j = 0; j < 64; ++j) {
  11906. var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0
  11907. var T2 = (sigma0(a) + maj(a, b, c)) | 0
  11908. h = g
  11909. g = f
  11910. f = e
  11911. e = (d + T1) | 0
  11912. d = c
  11913. c = b
  11914. b = a
  11915. a = (T1 + T2) | 0
  11916. }
  11917. this._a = (a + this._a) | 0
  11918. this._b = (b + this._b) | 0
  11919. this._c = (c + this._c) | 0
  11920. this._d = (d + this._d) | 0
  11921. this._e = (e + this._e) | 0
  11922. this._f = (f + this._f) | 0
  11923. this._g = (g + this._g) | 0
  11924. this._h = (h + this._h) | 0
  11925. }
  11926. Sha256.prototype._hash = function () {
  11927. var H = new Buffer(32)
  11928. H.writeInt32BE(this._a, 0)
  11929. H.writeInt32BE(this._b, 4)
  11930. H.writeInt32BE(this._c, 8)
  11931. H.writeInt32BE(this._d, 12)
  11932. H.writeInt32BE(this._e, 16)
  11933. H.writeInt32BE(this._f, 20)
  11934. H.writeInt32BE(this._g, 24)
  11935. H.writeInt32BE(this._h, 28)
  11936. return H
  11937. }
  11938. module.exports = Sha256
  11939. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  11940. /***/ },
  11941. /* 78 */
  11942. /***/ function(module, exports, __webpack_require__) {
  11943. /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(1)
  11944. var Hash = __webpack_require__(13)
  11945. var K = [
  11946. 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
  11947. 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
  11948. 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
  11949. 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
  11950. 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
  11951. 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
  11952. 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
  11953. 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
  11954. 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
  11955. 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
  11956. 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
  11957. 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
  11958. 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
  11959. 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
  11960. 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
  11961. 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
  11962. 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
  11963. 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
  11964. 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
  11965. 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
  11966. 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
  11967. 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
  11968. 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
  11969. 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
  11970. 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
  11971. 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
  11972. 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
  11973. 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
  11974. 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
  11975. 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
  11976. 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
  11977. 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
  11978. 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
  11979. 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
  11980. 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
  11981. 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
  11982. 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
  11983. 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
  11984. 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
  11985. 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
  11986. ]
  11987. var W = new Array(160)
  11988. function Sha512 () {
  11989. this.init()
  11990. this._w = W
  11991. Hash.call(this, 128, 112)
  11992. }
  11993. inherits(Sha512, Hash)
  11994. Sha512.prototype.init = function () {
  11995. this._ah = 0x6a09e667
  11996. this._bh = 0xbb67ae85
  11997. this._ch = 0x3c6ef372
  11998. this._dh = 0xa54ff53a
  11999. this._eh = 0x510e527f
  12000. this._fh = 0x9b05688c
  12001. this._gh = 0x1f83d9ab
  12002. this._hh = 0x5be0cd19
  12003. this._al = 0xf3bcc908
  12004. this._bl = 0x84caa73b
  12005. this._cl = 0xfe94f82b
  12006. this._dl = 0x5f1d36f1
  12007. this._el = 0xade682d1
  12008. this._fl = 0x2b3e6c1f
  12009. this._gl = 0xfb41bd6b
  12010. this._hl = 0x137e2179
  12011. return this
  12012. }
  12013. function Ch (x, y, z) {
  12014. return z ^ (x & (y ^ z))
  12015. }
  12016. function maj (x, y, z) {
  12017. return (x & y) | (z & (x | y))
  12018. }
  12019. function sigma0 (x, xl) {
  12020. return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)
  12021. }
  12022. function sigma1 (x, xl) {
  12023. return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)
  12024. }
  12025. function Gamma0 (x, xl) {
  12026. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)
  12027. }
  12028. function Gamma0l (x, xl) {
  12029. return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)
  12030. }
  12031. function Gamma1 (x, xl) {
  12032. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)
  12033. }
  12034. function Gamma1l (x, xl) {
  12035. return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)
  12036. }
  12037. function getCarry (a, b) {
  12038. return (a >>> 0) < (b >>> 0) ? 1 : 0
  12039. }
  12040. Sha512.prototype._update = function (M) {
  12041. var W = this._w
  12042. var ah = this._ah | 0
  12043. var bh = this._bh | 0
  12044. var ch = this._ch | 0
  12045. var dh = this._dh | 0
  12046. var eh = this._eh | 0
  12047. var fh = this._fh | 0
  12048. var gh = this._gh | 0
  12049. var hh = this._hh | 0
  12050. var al = this._al | 0
  12051. var bl = this._bl | 0
  12052. var cl = this._cl | 0
  12053. var dl = this._dl | 0
  12054. var el = this._el | 0
  12055. var fl = this._fl | 0
  12056. var gl = this._gl | 0
  12057. var hl = this._hl | 0
  12058. for (var i = 0; i < 32; i += 2) {
  12059. W[i] = M.readInt32BE(i * 4)
  12060. W[i + 1] = M.readInt32BE(i * 4 + 4)
  12061. }
  12062. for (; i < 160; i += 2) {
  12063. var xh = W[i - 15 * 2]
  12064. var xl = W[i - 15 * 2 + 1]
  12065. var gamma0 = Gamma0(xh, xl)
  12066. var gamma0l = Gamma0l(xl, xh)
  12067. xh = W[i - 2 * 2]
  12068. xl = W[i - 2 * 2 + 1]
  12069. var gamma1 = Gamma1(xh, xl)
  12070. var gamma1l = Gamma1l(xl, xh)
  12071. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  12072. var Wi7h = W[i - 7 * 2]
  12073. var Wi7l = W[i - 7 * 2 + 1]
  12074. var Wi16h = W[i - 16 * 2]
  12075. var Wi16l = W[i - 16 * 2 + 1]
  12076. var Wil = (gamma0l + Wi7l) | 0
  12077. var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0
  12078. Wil = (Wil + gamma1l) | 0
  12079. Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0
  12080. Wil = (Wil + Wi16l) | 0
  12081. Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0
  12082. W[i] = Wih
  12083. W[i + 1] = Wil
  12084. }
  12085. for (var j = 0; j < 160; j += 2) {
  12086. Wih = W[j]
  12087. Wil = W[j + 1]
  12088. var majh = maj(ah, bh, ch)
  12089. var majl = maj(al, bl, cl)
  12090. var sigma0h = sigma0(ah, al)
  12091. var sigma0l = sigma0(al, ah)
  12092. var sigma1h = sigma1(eh, el)
  12093. var sigma1l = sigma1(el, eh)
  12094. // t1 = h + sigma1 + ch + K[j] + W[j]
  12095. var Kih = K[j]
  12096. var Kil = K[j + 1]
  12097. var chh = Ch(eh, fh, gh)
  12098. var chl = Ch(el, fl, gl)
  12099. var t1l = (hl + sigma1l) | 0
  12100. var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0
  12101. t1l = (t1l + chl) | 0
  12102. t1h = (t1h + chh + getCarry(t1l, chl)) | 0
  12103. t1l = (t1l + Kil) | 0
  12104. t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0
  12105. t1l = (t1l + Wil) | 0
  12106. t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0
  12107. // t2 = sigma0 + maj
  12108. var t2l = (sigma0l + majl) | 0
  12109. var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0
  12110. hh = gh
  12111. hl = gl
  12112. gh = fh
  12113. gl = fl
  12114. fh = eh
  12115. fl = el
  12116. el = (dl + t1l) | 0
  12117. eh = (dh + t1h + getCarry(el, dl)) | 0
  12118. dh = ch
  12119. dl = cl
  12120. ch = bh
  12121. cl = bl
  12122. bh = ah
  12123. bl = al
  12124. al = (t1l + t2l) | 0
  12125. ah = (t1h + t2h + getCarry(al, t1l)) | 0
  12126. }
  12127. this._al = (this._al + al) | 0
  12128. this._bl = (this._bl + bl) | 0
  12129. this._cl = (this._cl + cl) | 0
  12130. this._dl = (this._dl + dl) | 0
  12131. this._el = (this._el + el) | 0
  12132. this._fl = (this._fl + fl) | 0
  12133. this._gl = (this._gl + gl) | 0
  12134. this._hl = (this._hl + hl) | 0
  12135. this._ah = (this._ah + ah + getCarry(this._al, al)) | 0
  12136. this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0
  12137. this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0
  12138. this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0
  12139. this._eh = (this._eh + eh + getCarry(this._el, el)) | 0
  12140. this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0
  12141. this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0
  12142. this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0
  12143. }
  12144. Sha512.prototype._hash = function () {
  12145. var H = new Buffer(64)
  12146. function writeInt64BE (h, l, offset) {
  12147. H.writeInt32BE(h, offset)
  12148. H.writeInt32BE(l, offset + 4)
  12149. }
  12150. writeInt64BE(this._ah, this._al, 0)
  12151. writeInt64BE(this._bh, this._bl, 8)
  12152. writeInt64BE(this._ch, this._cl, 16)
  12153. writeInt64BE(this._dh, this._dl, 24)
  12154. writeInt64BE(this._eh, this._el, 32)
  12155. writeInt64BE(this._fh, this._fl, 40)
  12156. writeInt64BE(this._gh, this._gl, 48)
  12157. writeInt64BE(this._hh, this._hl, 56)
  12158. return H
  12159. }
  12160. module.exports = Sha512
  12161. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  12162. /***/ },
  12163. /* 79 */
  12164. /***/ function(module, exports, __webpack_require__) {
  12165. "use strict";
  12166. 'use strict';
  12167. Object.defineProperty(exports, "__esModule", {
  12168. value: true
  12169. });
  12170. var _vue = __webpack_require__(33);
  12171. var _vue2 = _interopRequireDefault(_vue);
  12172. var _vueRouter = __webpack_require__(216);
  12173. var _vueRouter2 = _interopRequireDefault(_vueRouter);
  12174. var _PasswordGenerator = __webpack_require__(202);
  12175. var _PasswordGenerator2 = _interopRequireDefault(_PasswordGenerator);
  12176. var _Login = __webpack_require__(201);
  12177. var _Login2 = _interopRequireDefault(_Login);
  12178. var _PasswordReset = __webpack_require__(203);
  12179. var _PasswordReset2 = _interopRequireDefault(_PasswordReset);
  12180. var _PasswordResetConfirm = __webpack_require__(204);
  12181. var _PasswordResetConfirm2 = _interopRequireDefault(_PasswordResetConfirm);
  12182. var _Passwords = __webpack_require__(205);
  12183. var _Passwords2 = _interopRequireDefault(_Passwords);
  12184. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12185. _vue2.default.use(_vueRouter2.default);
  12186. var routes = [{ path: '/', name: 'home', component: _PasswordGenerator2.default }, { path: '/login', name: 'login', component: _Login2.default }, { path: '/passwords/', name: 'passwords', component: _Passwords2.default }, { path: '/passwords/:id', name: 'password', component: _PasswordGenerator2.default }, { path: '/password/reset', name: 'passwordReset', component: _PasswordReset2.default }, { path: '/password/reset/confirm/:uid/:token', name: 'passwordResetConfirm', component: _PasswordResetConfirm2.default }];
  12187. var router = new _vueRouter2.default({
  12188. routes: routes
  12189. });
  12190. exports.default = router;
  12191. /***/ },
  12192. /* 80 */
  12193. /***/ function(module, exports, __webpack_require__) {
  12194. "use strict";
  12195. 'use strict';
  12196. Object.defineProperty(exports, "__esModule", {
  12197. value: true
  12198. });
  12199. var _assign = __webpack_require__(23);
  12200. var _assign2 = _interopRequireDefault(_assign);
  12201. var _vue = __webpack_require__(33);
  12202. var _vue2 = _interopRequireDefault(_vue);
  12203. var _vuex = __webpack_require__(7);
  12204. var _vuex2 = _interopRequireDefault(_vuex);
  12205. var _auth = __webpack_require__(22);
  12206. var _auth2 = _interopRequireDefault(_auth);
  12207. var _http = __webpack_require__(111);
  12208. var _http2 = _interopRequireDefault(_http);
  12209. var _storage = __webpack_require__(15);
  12210. var _storage2 = _interopRequireDefault(_storage);
  12211. var _password = __webpack_require__(56);
  12212. var _password2 = _interopRequireDefault(_password);
  12213. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12214. _vue2.default.use(_vuex2.default);
  12215. var storage = new _storage2.default();
  12216. var auth = new _auth2.default(storage);
  12217. var PasswordsAPI = new _http2.default('passwords', storage);
  12218. var defaultPassword = {
  12219. id: '',
  12220. site: '',
  12221. login: '',
  12222. uppercase: true,
  12223. lowercase: true,
  12224. numbers: true,
  12225. symbols: true,
  12226. length: 12,
  12227. counter: 1
  12228. };
  12229. function getDefaultPasswordProfile(version) {
  12230. var passwordProfile = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12231. if (version === 1) {
  12232. return (0, _assign2.default)({}, defaultPassword, passwordProfile, { version: 1, length: 12 });
  12233. }
  12234. if (version === 2) {
  12235. return (0, _assign2.default)({}, defaultPassword, passwordProfile, { version: 2, length: 16 });
  12236. }
  12237. }
  12238. var versionLoadedByDefault = storage.json().version || 1;
  12239. var state = {
  12240. authenticated: auth.isAuthenticated(),
  12241. email: '',
  12242. passwordStatus: 'CLEAN',
  12243. passwords: [],
  12244. baseURL: 'https://lesspass.com',
  12245. password: getDefaultPasswordProfile(versionLoadedByDefault),
  12246. version: versionLoadedByDefault
  12247. };
  12248. var mutations = {
  12249. LOGOUT: function LOGOUT(state) {
  12250. state.authenticated = false;
  12251. },
  12252. USER_AUTHENTICATED: function USER_AUTHENTICATED(state, user) {
  12253. state.authenticated = true;
  12254. state.email = user.email;
  12255. },
  12256. SET_PASSWORDS: function SET_PASSWORDS(state, passwords) {
  12257. state.passwords = passwords;
  12258. },
  12259. SET_PASSWORD: function SET_PASSWORD(state, _ref) {
  12260. var password = _ref.password;
  12261. state.password = password;
  12262. },
  12263. DELETE_PASSWORD: function DELETE_PASSWORD(state, _ref2) {
  12264. var id = _ref2.id;
  12265. var passwords = state.passwords;
  12266. state.passwords = passwords.filter(function (password) {
  12267. return password.id !== id;
  12268. });
  12269. if (state.password.id === id) {
  12270. state.password = state.defaultPassword;
  12271. }
  12272. },
  12273. PASSWORD_CLEAN: function PASSWORD_CLEAN(state) {
  12274. setTimeout(function () {
  12275. state.passwordStatus = 'CLEAN';
  12276. }, 5000);
  12277. },
  12278. CHANGE_PASSWORD_STATUS: function CHANGE_PASSWORD_STATUS(state, status) {
  12279. state.passwordStatus = status;
  12280. },
  12281. SET_DEFAULT_PASSWORD: function SET_DEFAULT_PASSWORD(state) {
  12282. state.password = (0, _assign2.default)({}, defaultPassword);
  12283. },
  12284. UPDATE_SITE: function UPDATE_SITE(state, _ref3) {
  12285. var site = _ref3.site;
  12286. state.password.site = site;
  12287. },
  12288. UPDATE_BASE_URL: function UPDATE_BASE_URL(state, _ref4) {
  12289. var baseURL = _ref4.baseURL;
  12290. state.baseURL = baseURL;
  12291. },
  12292. UPDATE_EMAIL: function UPDATE_EMAIL(state, _ref5) {
  12293. var email = _ref5.email;
  12294. state.email = email;
  12295. },
  12296. CHANGE_VERSION: function CHANGE_VERSION(state, _ref6) {
  12297. var version = _ref6.version;
  12298. state.password = getDefaultPasswordProfile(version, state.password);
  12299. state.version = version;
  12300. },
  12301. SAVE_DEFAULT_OPTIONS: function SAVE_DEFAULT_OPTIONS(state) {
  12302. var password = new _password2.default(state.password);
  12303. var jsonPassword = password.json();
  12304. storage.save({ password: jsonPassword, version: jsonPassword.version });
  12305. }
  12306. };
  12307. var actions = {
  12308. USER_AUTHENTICATED: function USER_AUTHENTICATED(_ref7, user) {
  12309. var commit = _ref7.commit;
  12310. return commit('USER_AUTHENTICATED', user);
  12311. },
  12312. LOGOUT: function LOGOUT(_ref8) {
  12313. var commit = _ref8.commit;
  12314. auth.logout();
  12315. commit('LOGOUT');
  12316. },
  12317. SAVE_OR_UPDATE_PASSWORD: function SAVE_OR_UPDATE_PASSWORD(_ref9) {
  12318. var commit = _ref9.commit,
  12319. state = _ref9.state,
  12320. dispatch = _ref9.dispatch;
  12321. var password = new _password2.default(state.password);
  12322. if (password.isNewPassword(state.passwords)) {
  12323. PasswordsAPI.create(password.json()).then(function () {
  12324. commit('CHANGE_PASSWORD_STATUS', 'CREATED');
  12325. commit('PASSWORD_CLEAN');
  12326. dispatch('FETCH_PASSWORDS');
  12327. });
  12328. } else {
  12329. PasswordsAPI.update(password.json()).then(function () {
  12330. commit('CHANGE_PASSWORD_STATUS', 'UPDATED');
  12331. commit('PASSWORD_CLEAN');
  12332. dispatch('FETCH_PASSWORDS');
  12333. });
  12334. }
  12335. },
  12336. REFRESH_TOKEN: function REFRESH_TOKEN(_ref10) {
  12337. var commit = _ref10.commit;
  12338. if (auth.isAuthenticated()) {
  12339. auth.refreshToken().catch(function () {
  12340. commit('LOGOUT');
  12341. });
  12342. }
  12343. },
  12344. PASSWORD_CHANGE: function PASSWORD_CHANGE(_ref11, _ref12) {
  12345. var commit = _ref11.commit;
  12346. var password = _ref12.password;
  12347. commit('SET_PASSWORD', { password: password });
  12348. },
  12349. PASSWORD_GENERATED: function PASSWORD_GENERATED(_ref13) {
  12350. var commit = _ref13.commit;
  12351. commit('CHANGE_PASSWORD_STATUS', 'DIRTY');
  12352. },
  12353. FETCH_PASSWORDS: function FETCH_PASSWORDS(_ref14) {
  12354. var commit = _ref14.commit;
  12355. if (auth.isAuthenticated()) {
  12356. PasswordsAPI.all().then(function (response) {
  12357. return commit('SET_PASSWORDS', response.data.results);
  12358. });
  12359. }
  12360. },
  12361. FETCH_PASSWORD: function FETCH_PASSWORD(_ref15, _ref16) {
  12362. var commit = _ref15.commit;
  12363. var id = _ref16.id;
  12364. PasswordsAPI.get({ id: id }).then(function (response) {
  12365. return commit('SET_PASSWORD', { password: response.data });
  12366. });
  12367. },
  12368. DELETE_PASSWORD: function DELETE_PASSWORD(_ref17, _ref18) {
  12369. var commit = _ref17.commit;
  12370. var id = _ref18.id;
  12371. PasswordsAPI.remove({ id: id }).then(function () {
  12372. commit('DELETE_PASSWORD', { id: id });
  12373. });
  12374. },
  12375. LOAD_DEFAULT_PASSWORD: function LOAD_DEFAULT_PASSWORD(_ref19) {
  12376. var commit = _ref19.commit;
  12377. commit('SET_DEFAULT_PASSWORD');
  12378. }
  12379. };
  12380. var getters = {
  12381. passwords: function passwords(state) {
  12382. return state.passwords;
  12383. },
  12384. password: function password(state) {
  12385. return state.password;
  12386. },
  12387. isAuthenticated: function isAuthenticated(state) {
  12388. return state.authenticated;
  12389. },
  12390. isGuest: function isGuest(state) {
  12391. return !state.authenticated;
  12392. },
  12393. passwordStatus: function passwordStatus(state) {
  12394. return state.passwordStatus;
  12395. },
  12396. email: function email(state) {
  12397. return state.email;
  12398. },
  12399. version: function version(state) {
  12400. return state.version;
  12401. }
  12402. };
  12403. exports.default = new _vuex2.default.Store({
  12404. state: (0, _assign2.default)(state, storage.json()),
  12405. getters: getters,
  12406. actions: actions,
  12407. mutations: mutations
  12408. });
  12409. /***/ },
  12410. /* 81 */
  12411. /***/ function(module, exports) {
  12412. // removed by extract-text-webpack-plugin
  12413. /***/ },
  12414. /* 82 */
  12415. 81,
  12416. /* 83 */
  12417. 81,
  12418. /* 84 */
  12419. /***/ function(module, exports, __webpack_require__) {
  12420. var __vue_exports__, __vue_options__
  12421. var __vue_styles__ = {}
  12422. /* styles */
  12423. __webpack_require__(219)
  12424. /* script */
  12425. __vue_exports__ = __webpack_require__(102)
  12426. /* template */
  12427. var __vue_template__ = __webpack_require__(211)
  12428. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  12429. if (
  12430. typeof __vue_exports__.default === "object" ||
  12431. typeof __vue_exports__.default === "function"
  12432. ) {
  12433. __vue_options__ = __vue_exports__ = __vue_exports__.default
  12434. }
  12435. if (typeof __vue_options__ === "function") {
  12436. __vue_options__ = __vue_options__.options
  12437. }
  12438. __vue_options__.render = __vue_template__.render
  12439. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  12440. module.exports = __vue_exports__
  12441. /***/ },
  12442. /* 85 */
  12443. /***/ function(module, exports, __webpack_require__) {
  12444. "use strict";
  12445. 'use strict';
  12446. var utils = __webpack_require__(2);
  12447. var bind = __webpack_require__(55);
  12448. var Axios = __webpack_require__(87);
  12449. var defaults = __webpack_require__(34);
  12450. /**
  12451. * Create an instance of Axios
  12452. *
  12453. * @param {Object} defaultConfig The default config for the instance
  12454. * @return {Axios} A new instance of Axios
  12455. */
  12456. function createInstance(defaultConfig) {
  12457. var context = new Axios(defaultConfig);
  12458. var instance = bind(Axios.prototype.request, context);
  12459. // Copy axios.prototype to instance
  12460. utils.extend(instance, Axios.prototype, context);
  12461. // Copy context to instance
  12462. utils.extend(instance, context);
  12463. return instance;
  12464. }
  12465. // Create the default instance to be exported
  12466. var axios = createInstance(defaults);
  12467. // Expose Axios class to allow class inheritance
  12468. axios.Axios = Axios;
  12469. // Factory for creating new instances
  12470. axios.create = function create(instanceConfig) {
  12471. return createInstance(utils.merge(defaults, instanceConfig));
  12472. };
  12473. // Expose Cancel & CancelToken
  12474. axios.Cancel = __webpack_require__(52);
  12475. axios.CancelToken = __webpack_require__(86);
  12476. axios.isCancel = __webpack_require__(53);
  12477. // Expose all/spread
  12478. axios.all = function all(promises) {
  12479. return Promise.all(promises);
  12480. };
  12481. axios.spread = __webpack_require__(101);
  12482. module.exports = axios;
  12483. // Allow use of default import syntax in TypeScript
  12484. module.exports.default = axios;
  12485. /***/ },
  12486. /* 86 */
  12487. /***/ function(module, exports, __webpack_require__) {
  12488. "use strict";
  12489. 'use strict';
  12490. var Cancel = __webpack_require__(52);
  12491. /**
  12492. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  12493. *
  12494. * @class
  12495. * @param {Function} executor The executor function.
  12496. */
  12497. function CancelToken(executor) {
  12498. if (typeof executor !== 'function') {
  12499. throw new TypeError('executor must be a function.');
  12500. }
  12501. var resolvePromise;
  12502. this.promise = new Promise(function promiseExecutor(resolve) {
  12503. resolvePromise = resolve;
  12504. });
  12505. var token = this;
  12506. executor(function cancel(message) {
  12507. if (token.reason) {
  12508. // Cancellation has already been requested
  12509. return;
  12510. }
  12511. token.reason = new Cancel(message);
  12512. resolvePromise(token.reason);
  12513. });
  12514. }
  12515. /**
  12516. * Throws a `Cancel` if cancellation has been requested.
  12517. */
  12518. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  12519. if (this.reason) {
  12520. throw this.reason;
  12521. }
  12522. };
  12523. /**
  12524. * Returns an object that contains a new `CancelToken` and a function that, when called,
  12525. * cancels the `CancelToken`.
  12526. */
  12527. CancelToken.source = function source() {
  12528. var cancel;
  12529. var token = new CancelToken(function executor(c) {
  12530. cancel = c;
  12531. });
  12532. return {
  12533. token: token,
  12534. cancel: cancel
  12535. };
  12536. };
  12537. module.exports = CancelToken;
  12538. /***/ },
  12539. /* 87 */
  12540. /***/ function(module, exports, __webpack_require__) {
  12541. "use strict";
  12542. 'use strict';
  12543. var defaults = __webpack_require__(34);
  12544. var utils = __webpack_require__(2);
  12545. var InterceptorManager = __webpack_require__(88);
  12546. var dispatchRequest = __webpack_require__(89);
  12547. var isAbsoluteURL = __webpack_require__(97);
  12548. var combineURLs = __webpack_require__(95);
  12549. /**
  12550. * Create a new instance of Axios
  12551. *
  12552. * @param {Object} instanceConfig The default config for the instance
  12553. */
  12554. function Axios(instanceConfig) {
  12555. this.defaults = instanceConfig;
  12556. this.interceptors = {
  12557. request: new InterceptorManager(),
  12558. response: new InterceptorManager()
  12559. };
  12560. }
  12561. /**
  12562. * Dispatch a request
  12563. *
  12564. * @param {Object} config The config specific for this request (merged with this.defaults)
  12565. */
  12566. Axios.prototype.request = function request(config) {
  12567. /*eslint no-param-reassign:0*/
  12568. // Allow for axios('example/url'[, config]) a la fetch API
  12569. if (typeof config === 'string') {
  12570. config = utils.merge({
  12571. url: arguments[0]
  12572. }, arguments[1]);
  12573. }
  12574. config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
  12575. // Support baseURL config
  12576. if (config.baseURL && !isAbsoluteURL(config.url)) {
  12577. config.url = combineURLs(config.baseURL, config.url);
  12578. }
  12579. // Hook up interceptors middleware
  12580. var chain = [dispatchRequest, undefined];
  12581. var promise = Promise.resolve(config);
  12582. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  12583. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  12584. });
  12585. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  12586. chain.push(interceptor.fulfilled, interceptor.rejected);
  12587. });
  12588. while (chain.length) {
  12589. promise = promise.then(chain.shift(), chain.shift());
  12590. }
  12591. return promise;
  12592. };
  12593. // Provide aliases for supported request methods
  12594. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  12595. /*eslint func-names:0*/
  12596. Axios.prototype[method] = function(url, config) {
  12597. return this.request(utils.merge(config || {}, {
  12598. method: method,
  12599. url: url
  12600. }));
  12601. };
  12602. });
  12603. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  12604. /*eslint func-names:0*/
  12605. Axios.prototype[method] = function(url, data, config) {
  12606. return this.request(utils.merge(config || {}, {
  12607. method: method,
  12608. url: url,
  12609. data: data
  12610. }));
  12611. };
  12612. });
  12613. module.exports = Axios;
  12614. /***/ },
  12615. /* 88 */
  12616. /***/ function(module, exports, __webpack_require__) {
  12617. "use strict";
  12618. 'use strict';
  12619. var utils = __webpack_require__(2);
  12620. function InterceptorManager() {
  12621. this.handlers = [];
  12622. }
  12623. /**
  12624. * Add a new interceptor to the stack
  12625. *
  12626. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  12627. * @param {Function} rejected The function to handle `reject` for a `Promise`
  12628. *
  12629. * @return {Number} An ID used to remove interceptor later
  12630. */
  12631. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  12632. this.handlers.push({
  12633. fulfilled: fulfilled,
  12634. rejected: rejected
  12635. });
  12636. return this.handlers.length - 1;
  12637. };
  12638. /**
  12639. * Remove an interceptor from the stack
  12640. *
  12641. * @param {Number} id The ID that was returned by `use`
  12642. */
  12643. InterceptorManager.prototype.eject = function eject(id) {
  12644. if (this.handlers[id]) {
  12645. this.handlers[id] = null;
  12646. }
  12647. };
  12648. /**
  12649. * Iterate over all the registered interceptors
  12650. *
  12651. * This method is particularly useful for skipping over any
  12652. * interceptors that may have become `null` calling `eject`.
  12653. *
  12654. * @param {Function} fn The function to call for each interceptor
  12655. */
  12656. InterceptorManager.prototype.forEach = function forEach(fn) {
  12657. utils.forEach(this.handlers, function forEachHandler(h) {
  12658. if (h !== null) {
  12659. fn(h);
  12660. }
  12661. });
  12662. };
  12663. module.exports = InterceptorManager;
  12664. /***/ },
  12665. /* 89 */
  12666. /***/ function(module, exports, __webpack_require__) {
  12667. "use strict";
  12668. 'use strict';
  12669. var utils = __webpack_require__(2);
  12670. var transformData = __webpack_require__(92);
  12671. var isCancel = __webpack_require__(53);
  12672. var defaults = __webpack_require__(34);
  12673. /**
  12674. * Throws a `Cancel` if cancellation has been requested.
  12675. */
  12676. function throwIfCancellationRequested(config) {
  12677. if (config.cancelToken) {
  12678. config.cancelToken.throwIfRequested();
  12679. }
  12680. }
  12681. /**
  12682. * Dispatch a request to the server using the configured adapter.
  12683. *
  12684. * @param {object} config The config that is to be used for the request
  12685. * @returns {Promise} The Promise to be fulfilled
  12686. */
  12687. module.exports = function dispatchRequest(config) {
  12688. throwIfCancellationRequested(config);
  12689. // Ensure headers exist
  12690. config.headers = config.headers || {};
  12691. // Transform request data
  12692. config.data = transformData(
  12693. config.data,
  12694. config.headers,
  12695. config.transformRequest
  12696. );
  12697. // Flatten headers
  12698. config.headers = utils.merge(
  12699. config.headers.common || {},
  12700. config.headers[config.method] || {},
  12701. config.headers || {}
  12702. );
  12703. utils.forEach(
  12704. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  12705. function cleanHeaderConfig(method) {
  12706. delete config.headers[method];
  12707. }
  12708. );
  12709. var adapter = config.adapter || defaults.adapter;
  12710. return adapter(config).then(function onAdapterResolution(response) {
  12711. throwIfCancellationRequested(config);
  12712. // Transform response data
  12713. response.data = transformData(
  12714. response.data,
  12715. response.headers,
  12716. config.transformResponse
  12717. );
  12718. return response;
  12719. }, function onAdapterRejection(reason) {
  12720. if (!isCancel(reason)) {
  12721. throwIfCancellationRequested(config);
  12722. // Transform response data
  12723. if (reason && reason.response) {
  12724. reason.response.data = transformData(
  12725. reason.response.data,
  12726. reason.response.headers,
  12727. config.transformResponse
  12728. );
  12729. }
  12730. }
  12731. return Promise.reject(reason);
  12732. });
  12733. };
  12734. /***/ },
  12735. /* 90 */
  12736. /***/ function(module, exports) {
  12737. "use strict";
  12738. 'use strict';
  12739. /**
  12740. * Update an Error with the specified config, error code, and response.
  12741. *
  12742. * @param {Error} error The error to update.
  12743. * @param {Object} config The config.
  12744. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  12745. @ @param {Object} [response] The response.
  12746. * @returns {Error} The error.
  12747. */
  12748. module.exports = function enhanceError(error, config, code, response) {
  12749. error.config = config;
  12750. if (code) {
  12751. error.code = code;
  12752. }
  12753. error.response = response;
  12754. return error;
  12755. };
  12756. /***/ },
  12757. /* 91 */
  12758. /***/ function(module, exports, __webpack_require__) {
  12759. "use strict";
  12760. 'use strict';
  12761. var createError = __webpack_require__(54);
  12762. /**
  12763. * Resolve or reject a Promise based on response status.
  12764. *
  12765. * @param {Function} resolve A function that resolves the promise.
  12766. * @param {Function} reject A function that rejects the promise.
  12767. * @param {object} response The response.
  12768. */
  12769. module.exports = function settle(resolve, reject, response) {
  12770. var validateStatus = response.config.validateStatus;
  12771. // Note: status is not exposed by XDomainRequest
  12772. if (!response.status || !validateStatus || validateStatus(response.status)) {
  12773. resolve(response);
  12774. } else {
  12775. reject(createError(
  12776. 'Request failed with status code ' + response.status,
  12777. response.config,
  12778. null,
  12779. response
  12780. ));
  12781. }
  12782. };
  12783. /***/ },
  12784. /* 92 */
  12785. /***/ function(module, exports, __webpack_require__) {
  12786. "use strict";
  12787. 'use strict';
  12788. var utils = __webpack_require__(2);
  12789. /**
  12790. * Transform the data for a request or a response
  12791. *
  12792. * @param {Object|String} data The data to be transformed
  12793. * @param {Array} headers The headers for the request or response
  12794. * @param {Array|Function} fns A single function or Array of functions
  12795. * @returns {*} The resulting transformed data
  12796. */
  12797. module.exports = function transformData(data, headers, fns) {
  12798. /*eslint no-param-reassign:0*/
  12799. utils.forEach(fns, function transform(fn) {
  12800. data = fn(data, headers);
  12801. });
  12802. return data;
  12803. };
  12804. /***/ },
  12805. /* 93 */
  12806. /***/ function(module, exports) {
  12807. "use strict";
  12808. 'use strict';
  12809. // btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
  12810. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  12811. function E() {
  12812. this.message = 'String contains an invalid character';
  12813. }
  12814. E.prototype = new Error;
  12815. E.prototype.code = 5;
  12816. E.prototype.name = 'InvalidCharacterError';
  12817. function btoa(input) {
  12818. var str = String(input);
  12819. var output = '';
  12820. for (
  12821. // initialize result and counter
  12822. var block, charCode, idx = 0, map = chars;
  12823. // if the next str index does not exist:
  12824. // change the mapping table to "="
  12825. // check if d has no fractional digits
  12826. str.charAt(idx | 0) || (map = '=', idx % 1);
  12827. // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
  12828. output += map.charAt(63 & block >> 8 - idx % 1 * 8)
  12829. ) {
  12830. charCode = str.charCodeAt(idx += 3 / 4);
  12831. if (charCode > 0xFF) {
  12832. throw new E();
  12833. }
  12834. block = block << 8 | charCode;
  12835. }
  12836. return output;
  12837. }
  12838. module.exports = btoa;
  12839. /***/ },
  12840. /* 94 */
  12841. /***/ function(module, exports, __webpack_require__) {
  12842. "use strict";
  12843. 'use strict';
  12844. var utils = __webpack_require__(2);
  12845. function encode(val) {
  12846. return encodeURIComponent(val).
  12847. replace(/%40/gi, '@').
  12848. replace(/%3A/gi, ':').
  12849. replace(/%24/g, '$').
  12850. replace(/%2C/gi, ',').
  12851. replace(/%20/g, '+').
  12852. replace(/%5B/gi, '[').
  12853. replace(/%5D/gi, ']');
  12854. }
  12855. /**
  12856. * Build a URL by appending params to the end
  12857. *
  12858. * @param {string} url The base of the url (e.g., http://www.google.com)
  12859. * @param {object} [params] The params to be appended
  12860. * @returns {string} The formatted url
  12861. */
  12862. module.exports = function buildURL(url, params, paramsSerializer) {
  12863. /*eslint no-param-reassign:0*/
  12864. if (!params) {
  12865. return url;
  12866. }
  12867. var serializedParams;
  12868. if (paramsSerializer) {
  12869. serializedParams = paramsSerializer(params);
  12870. } else if (utils.isURLSearchParams(params)) {
  12871. serializedParams = params.toString();
  12872. } else {
  12873. var parts = [];
  12874. utils.forEach(params, function serialize(val, key) {
  12875. if (val === null || typeof val === 'undefined') {
  12876. return;
  12877. }
  12878. if (utils.isArray(val)) {
  12879. key = key + '[]';
  12880. }
  12881. if (!utils.isArray(val)) {
  12882. val = [val];
  12883. }
  12884. utils.forEach(val, function parseValue(v) {
  12885. if (utils.isDate(v)) {
  12886. v = v.toISOString();
  12887. } else if (utils.isObject(v)) {
  12888. v = JSON.stringify(v);
  12889. }
  12890. parts.push(encode(key) + '=' + encode(v));
  12891. });
  12892. });
  12893. serializedParams = parts.join('&');
  12894. }
  12895. if (serializedParams) {
  12896. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  12897. }
  12898. return url;
  12899. };
  12900. /***/ },
  12901. /* 95 */
  12902. /***/ function(module, exports) {
  12903. "use strict";
  12904. 'use strict';
  12905. /**
  12906. * Creates a new URL by combining the specified URLs
  12907. *
  12908. * @param {string} baseURL The base URL
  12909. * @param {string} relativeURL The relative URL
  12910. * @returns {string} The combined URL
  12911. */
  12912. module.exports = function combineURLs(baseURL, relativeURL) {
  12913. return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
  12914. };
  12915. /***/ },
  12916. /* 96 */
  12917. /***/ function(module, exports, __webpack_require__) {
  12918. "use strict";
  12919. 'use strict';
  12920. var utils = __webpack_require__(2);
  12921. module.exports = (
  12922. utils.isStandardBrowserEnv() ?
  12923. // Standard browser envs support document.cookie
  12924. (function standardBrowserEnv() {
  12925. return {
  12926. write: function write(name, value, expires, path, domain, secure) {
  12927. var cookie = [];
  12928. cookie.push(name + '=' + encodeURIComponent(value));
  12929. if (utils.isNumber(expires)) {
  12930. cookie.push('expires=' + new Date(expires).toGMTString());
  12931. }
  12932. if (utils.isString(path)) {
  12933. cookie.push('path=' + path);
  12934. }
  12935. if (utils.isString(domain)) {
  12936. cookie.push('domain=' + domain);
  12937. }
  12938. if (secure === true) {
  12939. cookie.push('secure');
  12940. }
  12941. document.cookie = cookie.join('; ');
  12942. },
  12943. read: function read(name) {
  12944. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  12945. return (match ? decodeURIComponent(match[3]) : null);
  12946. },
  12947. remove: function remove(name) {
  12948. this.write(name, '', Date.now() - 86400000);
  12949. }
  12950. };
  12951. })() :
  12952. // Non standard browser env (web workers, react-native) lack needed support.
  12953. (function nonStandardBrowserEnv() {
  12954. return {
  12955. write: function write() {},
  12956. read: function read() { return null; },
  12957. remove: function remove() {}
  12958. };
  12959. })()
  12960. );
  12961. /***/ },
  12962. /* 97 */
  12963. /***/ function(module, exports) {
  12964. "use strict";
  12965. 'use strict';
  12966. /**
  12967. * Determines whether the specified URL is absolute
  12968. *
  12969. * @param {string} url The URL to test
  12970. * @returns {boolean} True if the specified URL is absolute, otherwise false
  12971. */
  12972. module.exports = function isAbsoluteURL(url) {
  12973. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  12974. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  12975. // by any combination of letters, digits, plus, period, or hyphen.
  12976. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  12977. };
  12978. /***/ },
  12979. /* 98 */
  12980. /***/ function(module, exports, __webpack_require__) {
  12981. "use strict";
  12982. 'use strict';
  12983. var utils = __webpack_require__(2);
  12984. module.exports = (
  12985. utils.isStandardBrowserEnv() ?
  12986. // Standard browser envs have full support of the APIs needed to test
  12987. // whether the request URL is of the same origin as current location.
  12988. (function standardBrowserEnv() {
  12989. var msie = /(msie|trident)/i.test(navigator.userAgent);
  12990. var urlParsingNode = document.createElement('a');
  12991. var originURL;
  12992. /**
  12993. * Parse a URL to discover it's components
  12994. *
  12995. * @param {String} url The URL to be parsed
  12996. * @returns {Object}
  12997. */
  12998. function resolveURL(url) {
  12999. var href = url;
  13000. if (msie) {
  13001. // IE needs attribute set twice to normalize properties
  13002. urlParsingNode.setAttribute('href', href);
  13003. href = urlParsingNode.href;
  13004. }
  13005. urlParsingNode.setAttribute('href', href);
  13006. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  13007. return {
  13008. href: urlParsingNode.href,
  13009. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  13010. host: urlParsingNode.host,
  13011. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  13012. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  13013. hostname: urlParsingNode.hostname,
  13014. port: urlParsingNode.port,
  13015. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  13016. urlParsingNode.pathname :
  13017. '/' + urlParsingNode.pathname
  13018. };
  13019. }
  13020. originURL = resolveURL(window.location.href);
  13021. /**
  13022. * Determine if a URL shares the same origin as the current location
  13023. *
  13024. * @param {String} requestURL The URL to test
  13025. * @returns {boolean} True if URL shares the same origin, otherwise false
  13026. */
  13027. return function isURLSameOrigin(requestURL) {
  13028. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  13029. return (parsed.protocol === originURL.protocol &&
  13030. parsed.host === originURL.host);
  13031. };
  13032. })() :
  13033. // Non standard browser envs (web workers, react-native) lack needed support.
  13034. (function nonStandardBrowserEnv() {
  13035. return function isURLSameOrigin() {
  13036. return true;
  13037. };
  13038. })()
  13039. );
  13040. /***/ },
  13041. /* 99 */
  13042. /***/ function(module, exports, __webpack_require__) {
  13043. "use strict";
  13044. 'use strict';
  13045. var utils = __webpack_require__(2);
  13046. module.exports = function normalizeHeaderName(headers, normalizedName) {
  13047. utils.forEach(headers, function processHeader(value, name) {
  13048. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  13049. headers[normalizedName] = value;
  13050. delete headers[name];
  13051. }
  13052. });
  13053. };
  13054. /***/ },
  13055. /* 100 */
  13056. /***/ function(module, exports, __webpack_require__) {
  13057. "use strict";
  13058. 'use strict';
  13059. var utils = __webpack_require__(2);
  13060. /**
  13061. * Parse headers into an object
  13062. *
  13063. * ```
  13064. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  13065. * Content-Type: application/json
  13066. * Connection: keep-alive
  13067. * Transfer-Encoding: chunked
  13068. * ```
  13069. *
  13070. * @param {String} headers Headers needing to be parsed
  13071. * @returns {Object} Headers parsed into an object
  13072. */
  13073. module.exports = function parseHeaders(headers) {
  13074. var parsed = {};
  13075. var key;
  13076. var val;
  13077. var i;
  13078. if (!headers) { return parsed; }
  13079. utils.forEach(headers.split('\n'), function parser(line) {
  13080. i = line.indexOf(':');
  13081. key = utils.trim(line.substr(0, i)).toLowerCase();
  13082. val = utils.trim(line.substr(i + 1));
  13083. if (key) {
  13084. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  13085. }
  13086. });
  13087. return parsed;
  13088. };
  13089. /***/ },
  13090. /* 101 */
  13091. /***/ function(module, exports) {
  13092. "use strict";
  13093. 'use strict';
  13094. /**
  13095. * Syntactic sugar for invoking a function and expanding an array for arguments.
  13096. *
  13097. * Common use case would be to use `Function.prototype.apply`.
  13098. *
  13099. * ```js
  13100. * function f(x, y, z) {}
  13101. * var args = [1, 2, 3];
  13102. * f.apply(null, args);
  13103. * ```
  13104. *
  13105. * With `spread` this example can be re-written.
  13106. *
  13107. * ```js
  13108. * spread(function(x, y, z) {})([1, 2, 3]);
  13109. * ```
  13110. *
  13111. * @param {Function} callback
  13112. * @returns {Function}
  13113. */
  13114. module.exports = function spread(callback) {
  13115. return function wrap(arr) {
  13116. return callback.apply(null, arr);
  13117. };
  13118. };
  13119. /***/ },
  13120. /* 102 */
  13121. /***/ function(module, exports, __webpack_require__) {
  13122. "use strict";
  13123. 'use strict';
  13124. Object.defineProperty(exports, "__esModule", {
  13125. value: true
  13126. });
  13127. var _Menu = __webpack_require__(199);
  13128. var _Menu2 = _interopRequireDefault(_Menu);
  13129. var _vuex = __webpack_require__(7);
  13130. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13131. exports.default = {
  13132. name: 'LessPass',
  13133. components: {
  13134. 'lesspass-menu': _Menu2.default
  13135. },
  13136. computed: (0, _vuex.mapGetters)(['version']),
  13137. created: function created() {
  13138. var _this = this;
  13139. var fiveMinutes = 1000 * 60 * 5;
  13140. this.$store.dispatch('REFRESH_TOKEN');
  13141. setInterval(function () {
  13142. _this.$store.dispatch('REFRESH_TOKEN');
  13143. }, fiveMinutes);
  13144. }
  13145. };
  13146. /***/ },
  13147. /* 103 */
  13148. /***/ function(module, exports) {
  13149. "use strict";
  13150. 'use strict';
  13151. Object.defineProperty(exports, "__esModule", {
  13152. value: true
  13153. });
  13154. exports.default = {
  13155. data: function data() {
  13156. return {
  13157. confirm: false
  13158. };
  13159. },
  13160. props: {
  13161. confirmText: {
  13162. type: String,
  13163. default: 'Are you sure you want to delete this?'
  13164. },
  13165. confirmButton: {
  13166. type: String,
  13167. default: 'Sure delete it'
  13168. },
  13169. cancelButton: {
  13170. type: String,
  13171. default: 'Oups no!'
  13172. }
  13173. },
  13174. methods: {
  13175. confirmDelete: function confirmDelete() {
  13176. this.confirm = false;
  13177. this.$emit('remove');
  13178. }
  13179. }
  13180. };
  13181. /***/ },
  13182. /* 104 */
  13183. /***/ function(module, exports, __webpack_require__) {
  13184. "use strict";
  13185. 'use strict';
  13186. Object.defineProperty(exports, "__esModule", {
  13187. value: true
  13188. });
  13189. var _lesspass = __webpack_require__(44);
  13190. var _lesspass2 = _interopRequireDefault(_lesspass);
  13191. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13192. exports.default = {
  13193. data: function data() {
  13194. return {
  13195. icon1: '',
  13196. icon2: '',
  13197. icon3: '',
  13198. color1: '',
  13199. color2: '',
  13200. color3: ''
  13201. };
  13202. },
  13203. props: ['fingerprint'],
  13204. watch: {
  13205. fingerprint: function fingerprint(newFingerprint) {
  13206. var _this = this;
  13207. if (!newFingerprint) {
  13208. return;
  13209. }
  13210. _lesspass2.default.createFingerprint(newFingerprint).then(function (sha256) {
  13211. var hash1 = sha256.substring(0, 6);
  13212. var hash2 = sha256.substring(6, 12);
  13213. var hash3 = sha256.substring(12, 18);
  13214. _this.icon1 = _this.getIcon(hash1);
  13215. _this.icon2 = _this.getIcon(hash2);
  13216. _this.icon3 = _this.getIcon(hash3);
  13217. _this.color1 = _this.getColor(hash1);
  13218. _this.color2 = _this.getColor(hash2);
  13219. _this.color3 = _this.getColor(hash3);
  13220. });
  13221. }
  13222. },
  13223. methods: {
  13224. getColor: function getColor(color) {
  13225. var colors = ['#000000', '#074750', '#009191', '#FF6CB6', '#FFB5DA', '#490092', '#006CDB', '#B66DFF', '#6DB5FE', '#B5DAFE', '#920000', '#924900', '#DB6D00', '#24FE23'];
  13226. var index = parseInt(color, 16) % colors.length;
  13227. return colors[index];
  13228. },
  13229. getIcon: function getIcon(hash) {
  13230. var icons = ['fa-hashtag', 'fa-heart', 'fa-hotel', 'fa-university', 'fa-plug', 'fa-ambulance', 'fa-bus', 'fa-car', 'fa-plane', 'fa-rocket', 'fa-ship', 'fa-subway', 'fa-truck', 'fa-jpy', 'fa-eur', 'fa-btc', 'fa-usd', 'fa-gbp', 'fa-archive', 'fa-area-chart', 'fa-bed', 'fa-beer', 'fa-bell', 'fa-binoculars', 'fa-birthday-cake', 'fa-bomb', 'fa-briefcase', 'fa-bug', 'fa-camera', 'fa-cart-plus', 'fa-certificate', 'fa-coffee', 'fa-cloud', 'fa-coffee', 'fa-comment', 'fa-cube', 'fa-cutlery', 'fa-database', 'fa-diamond', 'fa-exclamation-circle', 'fa-eye', 'fa-flag', 'fa-flask', 'fa-futbol-o', 'fa-gamepad', 'fa-graduation-cap'];
  13231. var index = parseInt(hash, 16) % icons.length;
  13232. return icons[index];
  13233. }
  13234. }
  13235. };
  13236. /***/ },
  13237. /* 105 */
  13238. /***/ function(module, exports, __webpack_require__) {
  13239. "use strict";
  13240. 'use strict';
  13241. Object.defineProperty(exports, "__esModule", {
  13242. value: true
  13243. });
  13244. var _vuex = __webpack_require__(7);
  13245. exports.default = {
  13246. methods: {
  13247. logout: function logout() {
  13248. this.$store.dispatch('LOGOUT');
  13249. this.$router.push({ name: 'home' });
  13250. },
  13251. saveOrUpdatePassword: function saveOrUpdatePassword() {
  13252. this.$store.dispatch('SAVE_OR_UPDATE_PASSWORD');
  13253. }
  13254. },
  13255. computed: (0, _vuex.mapGetters)(['isAuthenticated', 'isGuest', 'passwordStatus', 'version'])
  13256. };
  13257. /***/ },
  13258. /* 106 */
  13259. /***/ function(module, exports, __webpack_require__) {
  13260. "use strict";
  13261. 'use strict';
  13262. Object.defineProperty(exports, "__esModule", {
  13263. value: true
  13264. });
  13265. var _extends2 = __webpack_require__(9);
  13266. var _extends3 = _interopRequireDefault(_extends2);
  13267. var _lesspass = __webpack_require__(44);
  13268. var _lesspass2 = _interopRequireDefault(_lesspass);
  13269. var _auth = __webpack_require__(22);
  13270. var _auth2 = _interopRequireDefault(_auth);
  13271. var _storage = __webpack_require__(15);
  13272. var _storage2 = _interopRequireDefault(_storage);
  13273. var _vuex = __webpack_require__(7);
  13274. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13275. var defaultErrors = {
  13276. userNameAlreadyExist: false,
  13277. emailInvalid: false,
  13278. baseURLRequired: false,
  13279. emailRequired: false,
  13280. passwordRequired: false
  13281. };
  13282. exports.default = {
  13283. data: function data() {
  13284. var storage = new _storage2.default();
  13285. var auth = new _auth2.default(storage);
  13286. return {
  13287. auth: auth,
  13288. storage: storage,
  13289. password: '',
  13290. useMasterPassword: false,
  13291. seeMasterPasswordHelp: false,
  13292. showError: false,
  13293. errorMessage: '',
  13294. loadingRegister: false,
  13295. loadingSignIn: false,
  13296. errors: (0, _extends3.default)({}, defaultErrors),
  13297. showOptions: false
  13298. };
  13299. },
  13300. methods: {
  13301. noErrors: function noErrors() {
  13302. return !(this.errors.userNameAlreadyExist || this.errors.emailInvalid || this.errors.emailRequired || this.errors.passwordRequired || this.errors.baseURLRequired || this.showError);
  13303. },
  13304. formIsValid: function formIsValid() {
  13305. this.cleanErrors();
  13306. var formIsValid = true;
  13307. if (!this.email) {
  13308. this.errors.emailRequired = true;
  13309. formIsValid = false;
  13310. }
  13311. if (!this.password) {
  13312. this.errors.passwordRequired = true;
  13313. formIsValid = false;
  13314. }
  13315. if (!this.baseURL) {
  13316. this.errors.baseURLRequired = true;
  13317. formIsValid = false;
  13318. }
  13319. return formIsValid;
  13320. },
  13321. cleanErrors: function cleanErrors() {
  13322. this.loadingRegister = false;
  13323. this.loadingSignIn = false;
  13324. this.showError = false;
  13325. this.errorMessage = '';
  13326. this.errors = (0, _extends3.default)({}, defaultErrors);
  13327. },
  13328. signIn: function signIn() {
  13329. var _this = this;
  13330. if (this.formIsValid()) {
  13331. (function () {
  13332. _this.loadingSignIn = true;
  13333. var email = _this.email;
  13334. var password = _this.password;
  13335. var baseURL = _this.baseURL;
  13336. _this.auth.login({ email: email, password: password }, baseURL).then(function () {
  13337. _this.loadingSignIn = false;
  13338. _this.storage.save({ baseURL: baseURL, email: email });
  13339. _this.$store.dispatch('USER_AUTHENTICATED', { email: email });
  13340. _this.$router.push({ name: 'home' });
  13341. }).catch(function (err) {
  13342. _this.cleanErrors();
  13343. if (err.response === undefined) {
  13344. if (baseURL === "https://lesspass.com") {
  13345. _this.showErrorMessage();
  13346. } else {
  13347. _this.showErrorMessage('Your LessPass Database is not running');
  13348. }
  13349. } else if (err.response.status === 400) {
  13350. _this.showErrorMessage('Your email and/or password is not good. Do you have an account?');
  13351. } else {
  13352. _this.showErrorMessage();
  13353. }
  13354. });
  13355. })();
  13356. }
  13357. },
  13358. register: function register() {
  13359. var _this2 = this;
  13360. if (this.formIsValid()) {
  13361. this.loadingRegister = true;
  13362. var email = this.email;
  13363. var password = this.password;
  13364. var baseURL = this.baseURL;
  13365. this.auth.register({ email: email, password: password }, baseURL).then(function () {
  13366. _this2.loadingRegister = false;
  13367. _this2.signIn();
  13368. }).catch(function (err) {
  13369. _this2.cleanErrors();
  13370. if (err.response && typeof err.response.data.email !== 'undefined') {
  13371. if (err.response.data.email[0].indexOf('already exists') !== -1) {
  13372. _this2.errors.userNameAlreadyExist = true;
  13373. }
  13374. if (err.response.data.email[0].indexOf('valid email') !== -1) {
  13375. _this2.errors.emailInvalid = true;
  13376. }
  13377. } else {
  13378. _this2.showErrorMessage();
  13379. }
  13380. });
  13381. }
  13382. },
  13383. showErrorMessage: function showErrorMessage() {
  13384. var errorMessage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Oops! Something went wrong. Retry in a few minutes.';
  13385. this.errorMessage = errorMessage;
  13386. this.showError = true;
  13387. },
  13388. toggleVersion: function toggleVersion() {
  13389. if (this.version === 1) {
  13390. this.$store.commit('CHANGE_VERSION', { version: 2 });
  13391. } else {
  13392. this.$store.commit('CHANGE_VERSION', { version: 1 });
  13393. }
  13394. }
  13395. },
  13396. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['version']), {
  13397. baseURL: {
  13398. get: function get() {
  13399. return this.$store.state.baseURL;
  13400. },
  13401. set: function set(baseURL) {
  13402. this.$store.commit('UPDATE_BASE_URL', { baseURL: baseURL });
  13403. }
  13404. },
  13405. email: {
  13406. get: function get() {
  13407. return this.$store.state.email;
  13408. },
  13409. set: function set(email) {
  13410. this.$store.commit('UPDATE_EMAIL', { email: email });
  13411. }
  13412. }
  13413. }),
  13414. watch: {
  13415. 'useMasterPassword': function useMasterPassword(_useMasterPassword) {
  13416. var _this3 = this;
  13417. if (!this.email || !this.password) {
  13418. return;
  13419. }
  13420. if (!_useMasterPassword) {
  13421. this.password = '';
  13422. return;
  13423. }
  13424. var passwordProfiles = {
  13425. 1: {
  13426. lowercase: true,
  13427. uppercase: true,
  13428. numbers: true,
  13429. symbols: true,
  13430. length: 12,
  13431. counter: 1,
  13432. version: 1
  13433. },
  13434. 2: {
  13435. lowercase: true,
  13436. uppercase: true,
  13437. numbers: true,
  13438. symbols: true,
  13439. length: 16,
  13440. counter: 1,
  13441. version: 2
  13442. }
  13443. };
  13444. return _lesspass2.default.generatePassword('lesspass.com', this.email, this.password, passwordProfiles[this.version]).then(function (generatedPassword) {
  13445. _this3.password = generatedPassword;
  13446. });
  13447. }
  13448. }
  13449. };
  13450. /***/ },
  13451. /* 107 */
  13452. /***/ function(module, exports, __webpack_require__) {
  13453. "use strict";
  13454. 'use strict';
  13455. Object.defineProperty(exports, "__esModule", {
  13456. value: true
  13457. });
  13458. var _extends2 = __webpack_require__(9);
  13459. var _extends3 = _interopRequireDefault(_extends2);
  13460. var _lesspass = __webpack_require__(44);
  13461. var _lesspass2 = _interopRequireDefault(_lesspass);
  13462. var _vuex = __webpack_require__(7);
  13463. var _clipboard = __webpack_require__(121);
  13464. var _clipboard2 = _interopRequireDefault(_clipboard);
  13465. var _lodash = __webpack_require__(177);
  13466. var _lodash2 = _interopRequireDefault(_lodash);
  13467. var _tooltip = __webpack_require__(113);
  13468. var _password = __webpack_require__(56);
  13469. var _password2 = _interopRequireDefault(_password);
  13470. var _urlParser = __webpack_require__(114);
  13471. var _RemoveAutoComplete = __webpack_require__(200);
  13472. var _RemoveAutoComplete2 = _interopRequireDefault(_RemoveAutoComplete);
  13473. var _Fingerprint = __webpack_require__(198);
  13474. var _Fingerprint2 = _interopRequireDefault(_Fingerprint);
  13475. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13476. function fetchPasswords(store) {
  13477. return store.dispatch('FETCH_PASSWORDS');
  13478. }
  13479. exports.default = {
  13480. name: 'password-generator-view',
  13481. components: {
  13482. RemoveAutoComplete: _RemoveAutoComplete2.default,
  13483. Fingerprint: _Fingerprint2.default
  13484. },
  13485. computed: (0, _vuex.mapGetters)(['passwords', 'password', 'version']),
  13486. preFetch: fetchPasswords,
  13487. beforeMount: function beforeMount() {
  13488. var _this = this;
  13489. var id = this.$route.params.id;
  13490. if (id) {
  13491. this.$store.dispatch('FETCH_PASSWORD', { id: id });
  13492. } else {
  13493. fetchPasswords(this.$store);
  13494. }
  13495. (0, _urlParser.getSite)(this.version).then(function (site) {
  13496. if (site) {
  13497. _this.$store.commit('UPDATE_SITE', { site: site });
  13498. }
  13499. });
  13500. var clipboard = new _clipboard2.default('#copyPasswordButton');
  13501. clipboard.on('success', function (event) {
  13502. if (event.text) {
  13503. (0, _tooltip.showTooltip)(event.trigger, 'copied !');
  13504. setTimeout(function () {
  13505. _this.cleanFormInSeconds(10);
  13506. }, 2000);
  13507. }
  13508. });
  13509. },
  13510. data: function data() {
  13511. return {
  13512. masterPassword: '',
  13513. fingerprint: '',
  13514. generatedPassword: '',
  13515. cleanTimeout: null,
  13516. showOptions: false,
  13517. showError: false,
  13518. generatingPassword: false,
  13519. optionsSaved: false
  13520. };
  13521. },
  13522. watch: {
  13523. 'password.site': function passwordSite(newValue) {
  13524. this.cleanErrors();
  13525. var values = newValue.split(" | ");
  13526. if (values.length === 2) {
  13527. var site = values[0];
  13528. var login = values[1];
  13529. var passwords = this.passwords;
  13530. for (var i = 0; i < passwords.length; i++) {
  13531. var password = passwords[i];
  13532. if (password.site === site && password.login === login) {
  13533. this.$store.dispatch('PASSWORD_CHANGE', { password: (0, _extends3.default)({}, password) });
  13534. this.$refs.masterPassword.focus();
  13535. break;
  13536. }
  13537. }
  13538. }
  13539. },
  13540. 'password.login': function passwordLogin() {
  13541. this.cleanErrors();
  13542. },
  13543. 'password.uppercase': function passwordUppercase() {
  13544. this.cleanErrors();
  13545. },
  13546. 'password.lowercase': function passwordLowercase() {
  13547. this.cleanErrors();
  13548. },
  13549. 'password.numbers': function passwordNumbers() {
  13550. this.cleanErrors();
  13551. },
  13552. 'password.symbols': function passwordSymbols() {
  13553. this.cleanErrors();
  13554. },
  13555. 'password.length': function passwordLength() {
  13556. this.cleanErrors();
  13557. },
  13558. 'password.counter': function passwordCounter() {
  13559. this.cleanErrors();
  13560. },
  13561. 'generatedPassword': function generatedPassword() {
  13562. this.cleanFormInSeconds(30);
  13563. },
  13564. 'masterPassword': function masterPassword() {
  13565. this.cleanErrors();
  13566. this.cleanFormInSeconds(30);
  13567. this.showFingerprint();
  13568. }
  13569. },
  13570. methods: {
  13571. showFingerprint: (0, _lodash2.default)(function () {
  13572. this.fingerprint = this.masterPassword;
  13573. }, 1000),
  13574. togglePasswordType: function togglePasswordType(element) {
  13575. if (element.type === 'password') {
  13576. element.type = 'text';
  13577. } else {
  13578. element.type = 'password';
  13579. }
  13580. },
  13581. cleanErrors: function cleanErrors() {
  13582. clearTimeout(this.cleanTimeout);
  13583. this.generatedPassword = '';
  13584. this.showError = false;
  13585. },
  13586. cleanFormInSeconds: function cleanFormInSeconds(seconds) {
  13587. var _this2 = this;
  13588. clearTimeout(this.cleanTimeout);
  13589. this.cleanTimeout = setTimeout(function () {
  13590. _this2.masterPassword = '';
  13591. _this2.generatedPassword = '';
  13592. _this2.fingerprint = '';
  13593. _this2.$store.commit('PASSWORD_CLEAN');
  13594. }, 1000 * seconds);
  13595. },
  13596. generatePassword: function generatePassword() {
  13597. var _this3 = this;
  13598. var site = this.password.site;
  13599. var login = this.password.login;
  13600. var masterPassword = this.masterPassword;
  13601. if (!site || !login || !masterPassword) {
  13602. this.showOptions = false;
  13603. this.showError = true;
  13604. return;
  13605. }
  13606. this.generatingPassword = true;
  13607. this.cleanErrors();
  13608. this.fingerprint = this.masterPassword;
  13609. var passwordProfile = {
  13610. lowercase: this.password.lowercase,
  13611. uppercase: this.password.uppercase,
  13612. numbers: this.password.numbers,
  13613. symbols: this.password.symbols,
  13614. length: this.password.length,
  13615. counter: this.password.counter,
  13616. version: this.password.version || this.version
  13617. };
  13618. return _lesspass2.default.generatePassword(site, login, masterPassword, passwordProfile).then(function (generatedPassword) {
  13619. _this3.generatingPassword = false;
  13620. _this3.generatedPassword = generatedPassword;
  13621. window.document.getElementById('copyPasswordButton').setAttribute('data-clipboard-text', generatedPassword);
  13622. _this3.$store.dispatch('PASSWORD_GENERATED');
  13623. });
  13624. },
  13625. setDefaultVersion: function setDefaultVersion(version) {
  13626. this.$store.commit('CHANGE_VERSION', { version: version });
  13627. },
  13628. toggleVersion: function toggleVersion() {
  13629. if (this.password.version === 1) {
  13630. this.password.version = 2;
  13631. } else {
  13632. this.password.version = 1;
  13633. }
  13634. this.$store.commit('CHANGE_VERSION', { version: this.password.version });
  13635. },
  13636. getDayBeforeV2: function getDayBeforeV2() {
  13637. var oneDay = 24 * 60 * 60 * 1000;
  13638. var now = new Date();
  13639. var v2DefaultDate = new Date(2017, 1, 10);
  13640. return Math.round(Math.abs((now.getTime() - v2DefaultDate.getTime()) / oneDay));
  13641. },
  13642. decrementPasswordLength: function decrementPasswordLength() {
  13643. if (this.password.length > 4) {
  13644. this.password.length -= 1;
  13645. }
  13646. },
  13647. incrementPasswordLength: function incrementPasswordLength() {
  13648. this.password.length += 1;
  13649. },
  13650. decrementCounter: function decrementCounter() {
  13651. if (this.password.counter > 1) {
  13652. this.password.counter -= 1;
  13653. }
  13654. },
  13655. incrementCounter: function incrementCounter() {
  13656. this.password.counter += 1;
  13657. },
  13658. saveDefault: function saveDefault() {
  13659. var _this4 = this;
  13660. this.$store.commit('SAVE_DEFAULT_OPTIONS');
  13661. this.optionsSaved = true;
  13662. setTimeout(function () {
  13663. _this4.optionsSaved = false;
  13664. }, 3000);
  13665. }
  13666. }
  13667. };
  13668. /***/ },
  13669. /* 108 */
  13670. /***/ function(module, exports, __webpack_require__) {
  13671. "use strict";
  13672. 'use strict';
  13673. Object.defineProperty(exports, "__esModule", {
  13674. value: true
  13675. });
  13676. var _extends2 = __webpack_require__(9);
  13677. var _extends3 = _interopRequireDefault(_extends2);
  13678. var _auth = __webpack_require__(22);
  13679. var _auth2 = _interopRequireDefault(_auth);
  13680. var _storage = __webpack_require__(15);
  13681. var _storage2 = _interopRequireDefault(_storage);
  13682. var _vuex = __webpack_require__(7);
  13683. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13684. exports.default = {
  13685. data: function data() {
  13686. var storage = new _storage2.default();
  13687. var auth = new _auth2.default(storage);
  13688. return {
  13689. auth: auth,
  13690. storage: storage,
  13691. email: '',
  13692. emailRequired: false,
  13693. showError: false,
  13694. loading: false,
  13695. successMessage: false
  13696. };
  13697. },
  13698. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['version'])),
  13699. methods: {
  13700. cleanErrors: function cleanErrors() {
  13701. this.loading = false;
  13702. this.emailRequired = false;
  13703. this.showError = false;
  13704. this.successMessage = false;
  13705. },
  13706. noErrors: function noErrors() {
  13707. return !(this.emailRequired || this.showError);
  13708. },
  13709. resetPassword: function resetPassword() {
  13710. var _this = this;
  13711. this.cleanErrors();
  13712. if (!this.email) {
  13713. this.emailRequired = true;
  13714. return;
  13715. }
  13716. this.loading = true;
  13717. this.auth.resetPassword({ email: this.email }).then(function () {
  13718. _this.cleanErrors();
  13719. _this.successMessage = true;
  13720. }).catch(function () {
  13721. _this.cleanErrors();
  13722. _this.showError = true;
  13723. });
  13724. }
  13725. }
  13726. };
  13727. /***/ },
  13728. /* 109 */
  13729. /***/ function(module, exports, __webpack_require__) {
  13730. "use strict";
  13731. 'use strict';
  13732. Object.defineProperty(exports, "__esModule", {
  13733. value: true
  13734. });
  13735. var _extends2 = __webpack_require__(9);
  13736. var _extends3 = _interopRequireDefault(_extends2);
  13737. var _auth = __webpack_require__(22);
  13738. var _auth2 = _interopRequireDefault(_auth);
  13739. var _storage = __webpack_require__(15);
  13740. var _storage2 = _interopRequireDefault(_storage);
  13741. var _vuex = __webpack_require__(7);
  13742. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13743. exports.default = {
  13744. data: function data() {
  13745. var storage = new _storage2.default();
  13746. var auth = new _auth2.default(storage);
  13747. return {
  13748. auth: auth,
  13749. storage: storage,
  13750. new_password: '',
  13751. passwordRequired: false,
  13752. showError: false,
  13753. successMessage: false,
  13754. errorMessage: 'Oops! Something went wrong. Retry in a few minutes.'
  13755. };
  13756. },
  13757. methods: {
  13758. cleanErrors: function cleanErrors() {
  13759. this.passwordRequired = false;
  13760. this.showError = false;
  13761. this.successMessage = false;
  13762. },
  13763. noErrors: function noErrors() {
  13764. return !(this.passwordRequired || this.showError);
  13765. },
  13766. resetPasswordConfirm: function resetPasswordConfirm() {
  13767. var _this = this;
  13768. this.cleanErrors();
  13769. if (!this.new_password) {
  13770. this.passwordRequired = true;
  13771. return;
  13772. }
  13773. this.auth.confirmResetPassword({
  13774. uid: this.$route.params.uid,
  13775. token: this.$route.params.token,
  13776. new_password: this.new_password
  13777. }).then(function () {
  13778. _this.successMessage = true;
  13779. }).catch(function (err) {
  13780. if (err.response.status === 400) {
  13781. _this.errorMessage = 'This password reset link become invalid.';
  13782. }
  13783. _this.showError = true;
  13784. });
  13785. }
  13786. },
  13787. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['version']))
  13788. };
  13789. /***/ },
  13790. /* 110 */
  13791. /***/ function(module, exports, __webpack_require__) {
  13792. "use strict";
  13793. 'use strict';
  13794. Object.defineProperty(exports, "__esModule", {
  13795. value: true
  13796. });
  13797. var _extends2 = __webpack_require__(9);
  13798. var _extends3 = _interopRequireDefault(_extends2);
  13799. var _DeleteButton = __webpack_require__(197);
  13800. var _DeleteButton2 = _interopRequireDefault(_DeleteButton);
  13801. var _vuex = __webpack_require__(7);
  13802. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13803. function fetchPasswords(store) {
  13804. return store.dispatch('FETCH_PASSWORDS');
  13805. }
  13806. exports.default = {
  13807. name: 'passwords-view',
  13808. data: function data() {
  13809. return {
  13810. searchQuery: ''
  13811. };
  13812. },
  13813. components: { DeleteButton: _DeleteButton2.default },
  13814. computed: (0, _extends3.default)({}, (0, _vuex.mapGetters)(['passwords', 'email']), {
  13815. filteredPasswords: function filteredPasswords() {
  13816. var _this = this;
  13817. return this.passwords.filter(function (password) {
  13818. return password.site.indexOf(_this.searchQuery) > -1 || password.login.indexOf(_this.searchQuery) > -1;
  13819. });
  13820. }
  13821. }),
  13822. preFetch: fetchPasswords,
  13823. beforeMount: function beforeMount() {
  13824. fetchPasswords(this.$store);
  13825. },
  13826. methods: {
  13827. deletePassword: function deletePassword(password) {
  13828. return this.$store.dispatch('DELETE_PASSWORD', { id: password.id });
  13829. }
  13830. }
  13831. };
  13832. /***/ },
  13833. /* 111 */
  13834. /***/ function(module, exports, __webpack_require__) {
  13835. "use strict";
  13836. 'use strict';
  13837. Object.defineProperty(exports, "__esModule", {
  13838. value: true
  13839. });
  13840. var _extends2 = __webpack_require__(9);
  13841. var _extends3 = _interopRequireDefault(_extends2);
  13842. var _classCallCheck2 = __webpack_require__(16);
  13843. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  13844. var _createClass2 = __webpack_require__(17);
  13845. var _createClass3 = _interopRequireDefault(_createClass2);
  13846. var _axios = __webpack_require__(50);
  13847. var _axios2 = _interopRequireDefault(_axios);
  13848. var _storage = __webpack_require__(15);
  13849. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13850. var HTTP = function () {
  13851. function HTTP(resource, storage) {
  13852. (0, _classCallCheck3.default)(this, HTTP);
  13853. this.storage = storage;
  13854. this.resource = resource;
  13855. }
  13856. (0, _createClass3.default)(HTTP, [{
  13857. key: 'getRequestConfig',
  13858. value: function getRequestConfig() {
  13859. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13860. var config = this.storage.json();
  13861. return (0, _extends3.default)({}, params, {
  13862. baseURL: config.baseURL,
  13863. headers: { Authorization: 'JWT ' + config[_storage.TOKEN_KEY] }
  13864. });
  13865. }
  13866. }, {
  13867. key: 'create',
  13868. value: function create(resource) {
  13869. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13870. return _axios2.default.post('/api/' + this.resource + '/', resource, this.getRequestConfig(params));
  13871. }
  13872. }, {
  13873. key: 'all',
  13874. value: function all() {
  13875. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  13876. return _axios2.default.get('/api/' + this.resource + '/', this.getRequestConfig(params));
  13877. }
  13878. }, {
  13879. key: 'get',
  13880. value: function get(resource) {
  13881. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13882. return _axios2.default.get('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  13883. }
  13884. }, {
  13885. key: 'update',
  13886. value: function update(resource) {
  13887. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13888. return _axios2.default.put('/api/' + this.resource + '/' + resource.id + '/', resource, this.getRequestConfig(params));
  13889. }
  13890. }, {
  13891. key: 'remove',
  13892. value: function remove(resource) {
  13893. var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  13894. return _axios2.default.delete('/api/' + this.resource + '/' + resource.id + '/', this.getRequestConfig(params));
  13895. }
  13896. }]);
  13897. return HTTP;
  13898. }();
  13899. exports.default = HTTP;
  13900. /***/ },
  13901. /* 112 */
  13902. /***/ function(module, exports, __webpack_require__) {
  13903. "use strict";
  13904. 'use strict';
  13905. Object.defineProperty(exports, "__esModule", {
  13906. value: true
  13907. });
  13908. exports.TOKEN_KEY = undefined;
  13909. var _classCallCheck2 = __webpack_require__(16);
  13910. var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
  13911. var _createClass2 = __webpack_require__(17);
  13912. var _createClass3 = _interopRequireDefault(_createClass2);
  13913. var _jwtDecode = __webpack_require__(174);
  13914. var _jwtDecode2 = _interopRequireDefault(_jwtDecode);
  13915. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13916. var TOKEN_KEY = exports.TOKEN_KEY = 'jwt';
  13917. var Token = function () {
  13918. function Token(tokenName) {
  13919. (0, _classCallCheck3.default)(this, Token);
  13920. this.name = tokenName;
  13921. }
  13922. (0, _createClass3.default)(Token, [{
  13923. key: 'stillValid',
  13924. value: function stillValid() {
  13925. var now = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
  13926. try {
  13927. return this._expirationDateSuperiorTo(now);
  13928. } catch (err) {
  13929. return false;
  13930. }
  13931. }
  13932. }, {
  13933. key: 'expiresInMinutes',
  13934. value: function expiresInMinutes(minutes) {
  13935. var now = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date();
  13936. try {
  13937. var nowPlusDuration = new Date(now.getTime() + minutes * 60000);
  13938. return this._expirationDateInferiorTo(nowPlusDuration);
  13939. } catch (err) {
  13940. return false;
  13941. }
  13942. }
  13943. }, {
  13944. key: '_expirationDateInferiorTo',
  13945. value: function _expirationDateInferiorTo(date) {
  13946. var expireDate = this._getTokenExpirationDate();
  13947. return expireDate < date;
  13948. }
  13949. }, {
  13950. key: '_expirationDateSuperiorTo',
  13951. value: function _expirationDateSuperiorTo(date) {
  13952. return !this._expirationDateInferiorTo(date);
  13953. }
  13954. }, {
  13955. key: '_getTokenExpirationDate',
  13956. value: function _getTokenExpirationDate() {
  13957. var decodedToken = (0, _jwtDecode2.default)(this.name);
  13958. return new Date(decodedToken.exp * 1000);
  13959. }
  13960. }]);
  13961. return Token;
  13962. }();
  13963. exports.default = Token;
  13964. /***/ },
  13965. /* 113 */
  13966. /***/ function(module, exports) {
  13967. "use strict";
  13968. 'use strict';
  13969. Object.defineProperty(exports, "__esModule", {
  13970. value: true
  13971. });
  13972. exports.showTooltip = showTooltip;
  13973. function showTooltip(elem, msg) {
  13974. var classNames = elem.className;
  13975. elem.setAttribute('class', classNames + ' hint--right');
  13976. elem.setAttribute('aria-label', msg);
  13977. setTimeout(function () {
  13978. elem.setAttribute('class', classNames);
  13979. }, 2000);
  13980. }
  13981. /***/ },
  13982. /* 114 */
  13983. /***/ function(module, exports, __webpack_require__) {
  13984. "use strict";
  13985. 'use strict';
  13986. Object.defineProperty(exports, "__esModule", {
  13987. value: true
  13988. });
  13989. exports.getSite = exports.getCurrentUrl = exports.isWebExtension = exports._ipIsValid = exports.getDomainName = undefined;
  13990. var _promise = __webpack_require__(58);
  13991. var _promise2 = _interopRequireDefault(_promise);
  13992. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13993. function _ipIsValid(ipAddress) {
  13994. return Boolean(/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipAddress));
  13995. }
  13996. function getDomainNamev1(urlStr) {
  13997. var matchesDomainName = urlStr.match(/^(?:https?\:\/\/)([^\/?#]+)(?:[\/?#]|$)/i);
  13998. return matchesDomainName && matchesDomainName[1];
  13999. }
  14000. function getDomainNamev2(urlStr) {
  14001. var domainName = getDomainNamev1(urlStr);
  14002. var matchIp = domainName.match(/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\:?([0-9]+)?/i);
  14003. if (matchIp) {
  14004. return matchIp[0];
  14005. }
  14006. var matchesTLD = domainName.match(/([^.]*\.[^.]{2,3})(?:\.[^.]{2,3})?$/i);
  14007. return matchesTLD && matchesTLD[0];
  14008. }
  14009. function getDomainName(urlStr) {
  14010. var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  14011. if (version === 1) {
  14012. return getDomainNamev1(urlStr);
  14013. }
  14014. return getDomainNamev2(urlStr);
  14015. }
  14016. function isWebExtension() {
  14017. if (typeof chrome !== 'undefined' && typeof chrome.tabs !== 'undefined') {
  14018. return typeof chrome.tabs.query === 'function';
  14019. }
  14020. return false;
  14021. }
  14022. function getCurrentUrl() {
  14023. return new _promise2.default(function (resolve) {
  14024. chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
  14025. resolve(tabs[0].url);
  14026. });
  14027. });
  14028. }
  14029. function getSite() {
  14030. var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
  14031. if (isWebExtension()) {
  14032. return getCurrentUrl(version).then(function (currentUrl) {
  14033. return getDomainName(currentUrl);
  14034. });
  14035. }
  14036. return new _promise2.default(function (resolve) {
  14037. resolve('');
  14038. });
  14039. }
  14040. exports.getDomainName = getDomainName;
  14041. exports._ipIsValid = _ipIsValid;
  14042. exports.isWebExtension = isWebExtension;
  14043. exports.getCurrentUrl = getCurrentUrl;
  14044. exports.getSite = getSite;
  14045. /***/ },
  14046. /* 115 */
  14047. /***/ function(module, exports, __webpack_require__) {
  14048. module.exports = { "default": __webpack_require__(122), __esModule: true };
  14049. /***/ },
  14050. /* 116 */
  14051. /***/ function(module, exports, __webpack_require__) {
  14052. "use strict";
  14053. "use strict";
  14054. exports.__esModule = true;
  14055. var _defineProperty = __webpack_require__(57);
  14056. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  14057. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14058. exports.default = function (obj, key, value) {
  14059. if (key in obj) {
  14060. (0, _defineProperty2.default)(obj, key, {
  14061. value: value,
  14062. enumerable: true,
  14063. configurable: true,
  14064. writable: true
  14065. });
  14066. } else {
  14067. obj[key] = value;
  14068. }
  14069. return obj;
  14070. };
  14071. /***/ },
  14072. /* 117 */
  14073. /***/ function(module, exports) {
  14074. "use strict";
  14075. 'use strict'
  14076. exports.byteLength = byteLength
  14077. exports.toByteArray = toByteArray
  14078. exports.fromByteArray = fromByteArray
  14079. var lookup = []
  14080. var revLookup = []
  14081. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  14082. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  14083. for (var i = 0, len = code.length; i < len; ++i) {
  14084. lookup[i] = code[i]
  14085. revLookup[code.charCodeAt(i)] = i
  14086. }
  14087. revLookup['-'.charCodeAt(0)] = 62
  14088. revLookup['_'.charCodeAt(0)] = 63
  14089. function placeHoldersCount (b64) {
  14090. var len = b64.length
  14091. if (len % 4 > 0) {
  14092. throw new Error('Invalid string. Length must be a multiple of 4')
  14093. }
  14094. // the number of equal signs (place holders)
  14095. // if there are two placeholders, than the two characters before it
  14096. // represent one byte
  14097. // if there is only one, then the three characters before it represent 2 bytes
  14098. // this is just a cheap hack to not do indexOf twice
  14099. return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
  14100. }
  14101. function byteLength (b64) {
  14102. // base64 is 4/3 + up to two characters of the original data
  14103. return b64.length * 3 / 4 - placeHoldersCount(b64)
  14104. }
  14105. function toByteArray (b64) {
  14106. var i, j, l, tmp, placeHolders, arr
  14107. var len = b64.length
  14108. placeHolders = placeHoldersCount(b64)
  14109. arr = new Arr(len * 3 / 4 - placeHolders)
  14110. // if there are placeholders, only get up to the last complete 4 chars
  14111. l = placeHolders > 0 ? len - 4 : len
  14112. var L = 0
  14113. for (i = 0, j = 0; i < l; i += 4, j += 3) {
  14114. tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
  14115. arr[L++] = (tmp >> 16) & 0xFF
  14116. arr[L++] = (tmp >> 8) & 0xFF
  14117. arr[L++] = tmp & 0xFF
  14118. }
  14119. if (placeHolders === 2) {
  14120. tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
  14121. arr[L++] = tmp & 0xFF
  14122. } else if (placeHolders === 1) {
  14123. tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
  14124. arr[L++] = (tmp >> 8) & 0xFF
  14125. arr[L++] = tmp & 0xFF
  14126. }
  14127. return arr
  14128. }
  14129. function tripletToBase64 (num) {
  14130. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
  14131. }
  14132. function encodeChunk (uint8, start, end) {
  14133. var tmp
  14134. var output = []
  14135. for (var i = start; i < end; i += 3) {
  14136. tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  14137. output.push(tripletToBase64(tmp))
  14138. }
  14139. return output.join('')
  14140. }
  14141. function fromByteArray (uint8) {
  14142. var tmp
  14143. var len = uint8.length
  14144. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  14145. var output = ''
  14146. var parts = []
  14147. var maxChunkLength = 16383 // must be multiple of 3
  14148. // go through the array every three bytes, we'll deal with trailing stuff later
  14149. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  14150. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  14151. }
  14152. // pad the end with zeros, but make sure to not forget the extra bytes
  14153. if (extraBytes === 1) {
  14154. tmp = uint8[len - 1]
  14155. output += lookup[tmp >> 2]
  14156. output += lookup[(tmp << 4) & 0x3F]
  14157. output += '=='
  14158. } else if (extraBytes === 2) {
  14159. tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
  14160. output += lookup[tmp >> 10]
  14161. output += lookup[(tmp >> 4) & 0x3F]
  14162. output += lookup[(tmp << 2) & 0x3F]
  14163. output += '='
  14164. }
  14165. parts.push(output)
  14166. return parts.join('')
  14167. }
  14168. /***/ },
  14169. /* 118 */
  14170. /***/ function(module, exports, __webpack_require__) {
  14171. /* WEBPACK VAR INJECTION */(function(module) {var bigInt = (function (undefined) {
  14172. "use strict";
  14173. var BASE = 1e7,
  14174. LOG_BASE = 7,
  14175. MAX_INT = 9007199254740992,
  14176. MAX_INT_ARR = smallToArray(MAX_INT),
  14177. LOG_MAX_INT = Math.log(MAX_INT);
  14178. function Integer(v, radix) {
  14179. if (typeof v === "undefined") return Integer[0];
  14180. if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix);
  14181. return parseValue(v);
  14182. }
  14183. function BigInteger(value, sign) {
  14184. this.value = value;
  14185. this.sign = sign;
  14186. this.isSmall = false;
  14187. }
  14188. BigInteger.prototype = Object.create(Integer.prototype);
  14189. function SmallInteger(value) {
  14190. this.value = value;
  14191. this.sign = value < 0;
  14192. this.isSmall = true;
  14193. }
  14194. SmallInteger.prototype = Object.create(Integer.prototype);
  14195. function isPrecise(n) {
  14196. return -MAX_INT < n && n < MAX_INT;
  14197. }
  14198. function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes
  14199. if (n < 1e7)
  14200. return [n];
  14201. if (n < 1e14)
  14202. return [n % 1e7, Math.floor(n / 1e7)];
  14203. return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];
  14204. }
  14205. function arrayToSmall(arr) { // If BASE changes this function may need to change
  14206. trim(arr);
  14207. var length = arr.length;
  14208. if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {
  14209. switch (length) {
  14210. case 0: return 0;
  14211. case 1: return arr[0];
  14212. case 2: return arr[0] + arr[1] * BASE;
  14213. default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;
  14214. }
  14215. }
  14216. return arr;
  14217. }
  14218. function trim(v) {
  14219. var i = v.length;
  14220. while (v[--i] === 0);
  14221. v.length = i + 1;
  14222. }
  14223. function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger
  14224. var x = new Array(length);
  14225. var i = -1;
  14226. while (++i < length) {
  14227. x[i] = 0;
  14228. }
  14229. return x;
  14230. }
  14231. function truncate(n) {
  14232. if (n > 0) return Math.floor(n);
  14233. return Math.ceil(n);
  14234. }
  14235. function add(a, b) { // assumes a and b are arrays with a.length >= b.length
  14236. var l_a = a.length,
  14237. l_b = b.length,
  14238. r = new Array(l_a),
  14239. carry = 0,
  14240. base = BASE,
  14241. sum, i;
  14242. for (i = 0; i < l_b; i++) {
  14243. sum = a[i] + b[i] + carry;
  14244. carry = sum >= base ? 1 : 0;
  14245. r[i] = sum - carry * base;
  14246. }
  14247. while (i < l_a) {
  14248. sum = a[i] + carry;
  14249. carry = sum === base ? 1 : 0;
  14250. r[i++] = sum - carry * base;
  14251. }
  14252. if (carry > 0) r.push(carry);
  14253. return r;
  14254. }
  14255. function addAny(a, b) {
  14256. if (a.length >= b.length) return add(a, b);
  14257. return add(b, a);
  14258. }
  14259. function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT
  14260. var l = a.length,
  14261. r = new Array(l),
  14262. base = BASE,
  14263. sum, i;
  14264. for (i = 0; i < l; i++) {
  14265. sum = a[i] - base + carry;
  14266. carry = Math.floor(sum / base);
  14267. r[i] = sum - carry * base;
  14268. carry += 1;
  14269. }
  14270. while (carry > 0) {
  14271. r[i++] = carry % base;
  14272. carry = Math.floor(carry / base);
  14273. }
  14274. return r;
  14275. }
  14276. BigInteger.prototype.add = function (v) {
  14277. var value, n = parseValue(v);
  14278. if (this.sign !== n.sign) {
  14279. return this.subtract(n.negate());
  14280. }
  14281. var a = this.value, b = n.value;
  14282. if (n.isSmall) {
  14283. return new BigInteger(addSmall(a, Math.abs(b)), this.sign);
  14284. }
  14285. return new BigInteger(addAny(a, b), this.sign);
  14286. };
  14287. BigInteger.prototype.plus = BigInteger.prototype.add;
  14288. SmallInteger.prototype.add = function (v) {
  14289. var n = parseValue(v);
  14290. var a = this.value;
  14291. if (a < 0 !== n.sign) {
  14292. return this.subtract(n.negate());
  14293. }
  14294. var b = n.value;
  14295. if (n.isSmall) {
  14296. if (isPrecise(a + b)) return new SmallInteger(a + b);
  14297. b = smallToArray(Math.abs(b));
  14298. }
  14299. return new BigInteger(addSmall(b, Math.abs(a)), a < 0);
  14300. };
  14301. SmallInteger.prototype.plus = SmallInteger.prototype.add;
  14302. function subtract(a, b) { // assumes a and b are arrays with a >= b
  14303. var a_l = a.length,
  14304. b_l = b.length,
  14305. r = new Array(a_l),
  14306. borrow = 0,
  14307. base = BASE,
  14308. i, difference;
  14309. for (i = 0; i < b_l; i++) {
  14310. difference = a[i] - borrow - b[i];
  14311. if (difference < 0) {
  14312. difference += base;
  14313. borrow = 1;
  14314. } else borrow = 0;
  14315. r[i] = difference;
  14316. }
  14317. for (i = b_l; i < a_l; i++) {
  14318. difference = a[i] - borrow;
  14319. if (difference < 0) difference += base;
  14320. else {
  14321. r[i++] = difference;
  14322. break;
  14323. }
  14324. r[i] = difference;
  14325. }
  14326. for (; i < a_l; i++) {
  14327. r[i] = a[i];
  14328. }
  14329. trim(r);
  14330. return r;
  14331. }
  14332. function subtractAny(a, b, sign) {
  14333. var value, isSmall;
  14334. if (compareAbs(a, b) >= 0) {
  14335. value = subtract(a,b);
  14336. } else {
  14337. value = subtract(b, a);
  14338. sign = !sign;
  14339. }
  14340. value = arrayToSmall(value);
  14341. if (typeof value === "number") {
  14342. if (sign) value = -value;
  14343. return new SmallInteger(value);
  14344. }
  14345. return new BigInteger(value, sign);
  14346. }
  14347. function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT
  14348. var l = a.length,
  14349. r = new Array(l),
  14350. carry = -b,
  14351. base = BASE,
  14352. i, difference;
  14353. for (i = 0; i < l; i++) {
  14354. difference = a[i] + carry;
  14355. carry = Math.floor(difference / base);
  14356. difference %= base;
  14357. r[i] = difference < 0 ? difference + base : difference;
  14358. }
  14359. r = arrayToSmall(r);
  14360. if (typeof r === "number") {
  14361. if (sign) r = -r;
  14362. return new SmallInteger(r);
  14363. } return new BigInteger(r, sign);
  14364. }
  14365. BigInteger.prototype.subtract = function (v) {
  14366. var n = parseValue(v);
  14367. if (this.sign !== n.sign) {
  14368. return this.add(n.negate());
  14369. }
  14370. var a = this.value, b = n.value;
  14371. if (n.isSmall)
  14372. return subtractSmall(a, Math.abs(b), this.sign);
  14373. return subtractAny(a, b, this.sign);
  14374. };
  14375. BigInteger.prototype.minus = BigInteger.prototype.subtract;
  14376. SmallInteger.prototype.subtract = function (v) {
  14377. var n = parseValue(v);
  14378. var a = this.value;
  14379. if (a < 0 !== n.sign) {
  14380. return this.add(n.negate());
  14381. }
  14382. var b = n.value;
  14383. if (n.isSmall) {
  14384. return new SmallInteger(a - b);
  14385. }
  14386. return subtractSmall(b, Math.abs(a), a >= 0);
  14387. };
  14388. SmallInteger.prototype.minus = SmallInteger.prototype.subtract;
  14389. BigInteger.prototype.negate = function () {
  14390. return new BigInteger(this.value, !this.sign);
  14391. };
  14392. SmallInteger.prototype.negate = function () {
  14393. var sign = this.sign;
  14394. var small = new SmallInteger(-this.value);
  14395. small.sign = !sign;
  14396. return small;
  14397. };
  14398. BigInteger.prototype.abs = function () {
  14399. return new BigInteger(this.value, false);
  14400. };
  14401. SmallInteger.prototype.abs = function () {
  14402. return new SmallInteger(Math.abs(this.value));
  14403. };
  14404. function multiplyLong(a, b) {
  14405. var a_l = a.length,
  14406. b_l = b.length,
  14407. l = a_l + b_l,
  14408. r = createArray(l),
  14409. base = BASE,
  14410. product, carry, i, a_i, b_j;
  14411. for (i = 0; i < a_l; ++i) {
  14412. a_i = a[i];
  14413. for (var j = 0; j < b_l; ++j) {
  14414. b_j = b[j];
  14415. product = a_i * b_j + r[i + j];
  14416. carry = Math.floor(product / base);
  14417. r[i + j] = product - carry * base;
  14418. r[i + j + 1] += carry;
  14419. }
  14420. }
  14421. trim(r);
  14422. return r;
  14423. }
  14424. function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE
  14425. var l = a.length,
  14426. r = new Array(l),
  14427. base = BASE,
  14428. carry = 0,
  14429. product, i;
  14430. for (i = 0; i < l; i++) {
  14431. product = a[i] * b + carry;
  14432. carry = Math.floor(product / base);
  14433. r[i] = product - carry * base;
  14434. }
  14435. while (carry > 0) {
  14436. r[i++] = carry % base;
  14437. carry = Math.floor(carry / base);
  14438. }
  14439. return r;
  14440. }
  14441. function shiftLeft(x, n) {
  14442. var r = [];
  14443. while (n-- > 0) r.push(0);
  14444. return r.concat(x);
  14445. }
  14446. function multiplyKaratsuba(x, y) {
  14447. var n = Math.max(x.length, y.length);
  14448. if (n <= 30) return multiplyLong(x, y);
  14449. n = Math.ceil(n / 2);
  14450. var b = x.slice(n),
  14451. a = x.slice(0, n),
  14452. d = y.slice(n),
  14453. c = y.slice(0, n);
  14454. var ac = multiplyKaratsuba(a, c),
  14455. bd = multiplyKaratsuba(b, d),
  14456. abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));
  14457. var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));
  14458. trim(product);
  14459. return product;
  14460. }
  14461. // The following function is derived from a surface fit of a graph plotting the performance difference
  14462. // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.
  14463. function useKaratsuba(l1, l2) {
  14464. return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;
  14465. }
  14466. BigInteger.prototype.multiply = function (v) {
  14467. var value, n = parseValue(v),
  14468. a = this.value, b = n.value,
  14469. sign = this.sign !== n.sign,
  14470. abs;
  14471. if (n.isSmall) {
  14472. if (b === 0) return Integer[0];
  14473. if (b === 1) return this;
  14474. if (b === -1) return this.negate();
  14475. abs = Math.abs(b);
  14476. if (abs < BASE) {
  14477. return new BigInteger(multiplySmall(a, abs), sign);
  14478. }
  14479. b = smallToArray(abs);
  14480. }
  14481. if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes
  14482. return new BigInteger(multiplyKaratsuba(a, b), sign);
  14483. return new BigInteger(multiplyLong(a, b), sign);
  14484. };
  14485. BigInteger.prototype.times = BigInteger.prototype.multiply;
  14486. function multiplySmallAndArray(a, b, sign) { // a >= 0
  14487. if (a < BASE) {
  14488. return new BigInteger(multiplySmall(b, a), sign);
  14489. }
  14490. return new BigInteger(multiplyLong(b, smallToArray(a)), sign);
  14491. }
  14492. SmallInteger.prototype._multiplyBySmall = function (a) {
  14493. if (isPrecise(a.value * this.value)) {
  14494. return new SmallInteger(a.value * this.value);
  14495. }
  14496. return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);
  14497. };
  14498. BigInteger.prototype._multiplyBySmall = function (a) {
  14499. if (a.value === 0) return Integer[0];
  14500. if (a.value === 1) return this;
  14501. if (a.value === -1) return this.negate();
  14502. return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);
  14503. };
  14504. SmallInteger.prototype.multiply = function (v) {
  14505. return parseValue(v)._multiplyBySmall(this);
  14506. };
  14507. SmallInteger.prototype.times = SmallInteger.prototype.multiply;
  14508. function square(a) {
  14509. var l = a.length,
  14510. r = createArray(l + l),
  14511. base = BASE,
  14512. product, carry, i, a_i, a_j;
  14513. for (i = 0; i < l; i++) {
  14514. a_i = a[i];
  14515. for (var j = 0; j < l; j++) {
  14516. a_j = a[j];
  14517. product = a_i * a_j + r[i + j];
  14518. carry = Math.floor(product / base);
  14519. r[i + j] = product - carry * base;
  14520. r[i + j + 1] += carry;
  14521. }
  14522. }
  14523. trim(r);
  14524. return r;
  14525. }
  14526. BigInteger.prototype.square = function () {
  14527. return new BigInteger(square(this.value), false);
  14528. };
  14529. SmallInteger.prototype.square = function () {
  14530. var value = this.value * this.value;
  14531. if (isPrecise(value)) return new SmallInteger(value);
  14532. return new BigInteger(square(smallToArray(Math.abs(this.value))), false);
  14533. };
  14534. function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.
  14535. var a_l = a.length,
  14536. b_l = b.length,
  14537. base = BASE,
  14538. result = createArray(b.length),
  14539. divisorMostSignificantDigit = b[b_l - 1],
  14540. // normalization
  14541. lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),
  14542. remainder = multiplySmall(a, lambda),
  14543. divisor = multiplySmall(b, lambda),
  14544. quotientDigit, shift, carry, borrow, i, l, q;
  14545. if (remainder.length <= a_l) remainder.push(0);
  14546. divisor.push(0);
  14547. divisorMostSignificantDigit = divisor[b_l - 1];
  14548. for (shift = a_l - b_l; shift >= 0; shift--) {
  14549. quotientDigit = base - 1;
  14550. if (remainder[shift + b_l] !== divisorMostSignificantDigit) {
  14551. quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);
  14552. }
  14553. // quotientDigit <= base - 1
  14554. carry = 0;
  14555. borrow = 0;
  14556. l = divisor.length;
  14557. for (i = 0; i < l; i++) {
  14558. carry += quotientDigit * divisor[i];
  14559. q = Math.floor(carry / base);
  14560. borrow += remainder[shift + i] - (carry - q * base);
  14561. carry = q;
  14562. if (borrow < 0) {
  14563. remainder[shift + i] = borrow + base;
  14564. borrow = -1;
  14565. } else {
  14566. remainder[shift + i] = borrow;
  14567. borrow = 0;
  14568. }
  14569. }
  14570. while (borrow !== 0) {
  14571. quotientDigit -= 1;
  14572. carry = 0;
  14573. for (i = 0; i < l; i++) {
  14574. carry += remainder[shift + i] - base + divisor[i];
  14575. if (carry < 0) {
  14576. remainder[shift + i] = carry + base;
  14577. carry = 0;
  14578. } else {
  14579. remainder[shift + i] = carry;
  14580. carry = 1;
  14581. }
  14582. }
  14583. borrow += carry;
  14584. }
  14585. result[shift] = quotientDigit;
  14586. }
  14587. // denormalization
  14588. remainder = divModSmall(remainder, lambda)[0];
  14589. return [arrayToSmall(result), arrayToSmall(remainder)];
  14590. }
  14591. function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/
  14592. // Performs faster than divMod1 on larger input sizes.
  14593. var a_l = a.length,
  14594. b_l = b.length,
  14595. result = [],
  14596. part = [],
  14597. base = BASE,
  14598. guess, xlen, highx, highy, check;
  14599. while (a_l) {
  14600. part.unshift(a[--a_l]);
  14601. if (compareAbs(part, b) < 0) {
  14602. result.push(0);
  14603. continue;
  14604. }
  14605. xlen = part.length;
  14606. highx = part[xlen - 1] * base + part[xlen - 2];
  14607. highy = b[b_l - 1] * base + b[b_l - 2];
  14608. if (xlen > b_l) {
  14609. highx = (highx + 1) * base;
  14610. }
  14611. guess = Math.ceil(highx / highy);
  14612. do {
  14613. check = multiplySmall(b, guess);
  14614. if (compareAbs(check, part) <= 0) break;
  14615. guess--;
  14616. } while (guess);
  14617. result.push(guess);
  14618. part = subtract(part, check);
  14619. }
  14620. result.reverse();
  14621. return [arrayToSmall(result), arrayToSmall(part)];
  14622. }
  14623. function divModSmall(value, lambda) {
  14624. var length = value.length,
  14625. quotient = createArray(length),
  14626. base = BASE,
  14627. i, q, remainder, divisor;
  14628. remainder = 0;
  14629. for (i = length - 1; i >= 0; --i) {
  14630. divisor = remainder * base + value[i];
  14631. q = truncate(divisor / lambda);
  14632. remainder = divisor - q * lambda;
  14633. quotient[i] = q | 0;
  14634. }
  14635. return [quotient, remainder | 0];
  14636. }
  14637. function divModAny(self, v) {
  14638. var value, n = parseValue(v);
  14639. var a = self.value, b = n.value;
  14640. var quotient;
  14641. if (b === 0) throw new Error("Cannot divide by zero");
  14642. if (self.isSmall) {
  14643. if (n.isSmall) {
  14644. return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];
  14645. }
  14646. return [Integer[0], self];
  14647. }
  14648. if (n.isSmall) {
  14649. if (b === 1) return [self, Integer[0]];
  14650. if (b == -1) return [self.negate(), Integer[0]];
  14651. var abs = Math.abs(b);
  14652. if (abs < BASE) {
  14653. value = divModSmall(a, abs);
  14654. quotient = arrayToSmall(value[0]);
  14655. var remainder = value[1];
  14656. if (self.sign) remainder = -remainder;
  14657. if (typeof quotient === "number") {
  14658. if (self.sign !== n.sign) quotient = -quotient;
  14659. return [new SmallInteger(quotient), new SmallInteger(remainder)];
  14660. }
  14661. return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];
  14662. }
  14663. b = smallToArray(abs);
  14664. }
  14665. var comparison = compareAbs(a, b);
  14666. if (comparison === -1) return [Integer[0], self];
  14667. if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];
  14668. // divMod1 is faster on smaller input sizes
  14669. if (a.length + b.length <= 200)
  14670. value = divMod1(a, b);
  14671. else value = divMod2(a, b);
  14672. quotient = value[0];
  14673. var qSign = self.sign !== n.sign,
  14674. mod = value[1],
  14675. mSign = self.sign;
  14676. if (typeof quotient === "number") {
  14677. if (qSign) quotient = -quotient;
  14678. quotient = new SmallInteger(quotient);
  14679. } else quotient = new BigInteger(quotient, qSign);
  14680. if (typeof mod === "number") {
  14681. if (mSign) mod = -mod;
  14682. mod = new SmallInteger(mod);
  14683. } else mod = new BigInteger(mod, mSign);
  14684. return [quotient, mod];
  14685. }
  14686. BigInteger.prototype.divmod = function (v) {
  14687. var result = divModAny(this, v);
  14688. return {
  14689. quotient: result[0],
  14690. remainder: result[1]
  14691. };
  14692. };
  14693. SmallInteger.prototype.divmod = BigInteger.prototype.divmod;
  14694. BigInteger.prototype.divide = function (v) {
  14695. return divModAny(this, v)[0];
  14696. };
  14697. SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;
  14698. BigInteger.prototype.mod = function (v) {
  14699. return divModAny(this, v)[1];
  14700. };
  14701. SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;
  14702. BigInteger.prototype.pow = function (v) {
  14703. var n = parseValue(v),
  14704. a = this.value,
  14705. b = n.value,
  14706. value, x, y;
  14707. if (b === 0) return Integer[1];
  14708. if (a === 0) return Integer[0];
  14709. if (a === 1) return Integer[1];
  14710. if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];
  14711. if (n.sign) {
  14712. return Integer[0];
  14713. }
  14714. if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large.");
  14715. if (this.isSmall) {
  14716. if (isPrecise(value = Math.pow(a, b)))
  14717. return new SmallInteger(truncate(value));
  14718. }
  14719. x = this;
  14720. y = Integer[1];
  14721. while (true) {
  14722. if (b & 1 === 1) {
  14723. y = y.times(x);
  14724. --b;
  14725. }
  14726. if (b === 0) break;
  14727. b /= 2;
  14728. x = x.square();
  14729. }
  14730. return y;
  14731. };
  14732. SmallInteger.prototype.pow = BigInteger.prototype.pow;
  14733. BigInteger.prototype.modPow = function (exp, mod) {
  14734. exp = parseValue(exp);
  14735. mod = parseValue(mod);
  14736. if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0");
  14737. var r = Integer[1],
  14738. base = this.mod(mod);
  14739. while (exp.isPositive()) {
  14740. if (base.isZero()) return Integer[0];
  14741. if (exp.isOdd()) r = r.multiply(base).mod(mod);
  14742. exp = exp.divide(2);
  14743. base = base.square().mod(mod);
  14744. }
  14745. return r;
  14746. };
  14747. SmallInteger.prototype.modPow = BigInteger.prototype.modPow;
  14748. function compareAbs(a, b) {
  14749. if (a.length !== b.length) {
  14750. return a.length > b.length ? 1 : -1;
  14751. }
  14752. for (var i = a.length - 1; i >= 0; i--) {
  14753. if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;
  14754. }
  14755. return 0;
  14756. }
  14757. BigInteger.prototype.compareAbs = function (v) {
  14758. var n = parseValue(v),
  14759. a = this.value,
  14760. b = n.value;
  14761. if (n.isSmall) return 1;
  14762. return compareAbs(a, b);
  14763. };
  14764. SmallInteger.prototype.compareAbs = function (v) {
  14765. var n = parseValue(v),
  14766. a = Math.abs(this.value),
  14767. b = n.value;
  14768. if (n.isSmall) {
  14769. b = Math.abs(b);
  14770. return a === b ? 0 : a > b ? 1 : -1;
  14771. }
  14772. return -1;
  14773. };
  14774. BigInteger.prototype.compare = function (v) {
  14775. // See discussion about comparison with Infinity:
  14776. // https://github.com/peterolson/BigInteger.js/issues/61
  14777. if (v === Infinity) {
  14778. return -1;
  14779. }
  14780. if (v === -Infinity) {
  14781. return 1;
  14782. }
  14783. var n = parseValue(v),
  14784. a = this.value,
  14785. b = n.value;
  14786. if (this.sign !== n.sign) {
  14787. return n.sign ? 1 : -1;
  14788. }
  14789. if (n.isSmall) {
  14790. return this.sign ? -1 : 1;
  14791. }
  14792. return compareAbs(a, b) * (this.sign ? -1 : 1);
  14793. };
  14794. BigInteger.prototype.compareTo = BigInteger.prototype.compare;
  14795. SmallInteger.prototype.compare = function (v) {
  14796. if (v === Infinity) {
  14797. return -1;
  14798. }
  14799. if (v === -Infinity) {
  14800. return 1;
  14801. }
  14802. var n = parseValue(v),
  14803. a = this.value,
  14804. b = n.value;
  14805. if (n.isSmall) {
  14806. return a == b ? 0 : a > b ? 1 : -1;
  14807. }
  14808. if (a < 0 !== n.sign) {
  14809. return a < 0 ? -1 : 1;
  14810. }
  14811. return a < 0 ? 1 : -1;
  14812. };
  14813. SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;
  14814. BigInteger.prototype.equals = function (v) {
  14815. return this.compare(v) === 0;
  14816. };
  14817. SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;
  14818. BigInteger.prototype.notEquals = function (v) {
  14819. return this.compare(v) !== 0;
  14820. };
  14821. SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;
  14822. BigInteger.prototype.greater = function (v) {
  14823. return this.compare(v) > 0;
  14824. };
  14825. SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;
  14826. BigInteger.prototype.lesser = function (v) {
  14827. return this.compare(v) < 0;
  14828. };
  14829. SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;
  14830. BigInteger.prototype.greaterOrEquals = function (v) {
  14831. return this.compare(v) >= 0;
  14832. };
  14833. SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;
  14834. BigInteger.prototype.lesserOrEquals = function (v) {
  14835. return this.compare(v) <= 0;
  14836. };
  14837. SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;
  14838. BigInteger.prototype.isEven = function () {
  14839. return (this.value[0] & 1) === 0;
  14840. };
  14841. SmallInteger.prototype.isEven = function () {
  14842. return (this.value & 1) === 0;
  14843. };
  14844. BigInteger.prototype.isOdd = function () {
  14845. return (this.value[0] & 1) === 1;
  14846. };
  14847. SmallInteger.prototype.isOdd = function () {
  14848. return (this.value & 1) === 1;
  14849. };
  14850. BigInteger.prototype.isPositive = function () {
  14851. return !this.sign;
  14852. };
  14853. SmallInteger.prototype.isPositive = function () {
  14854. return this.value > 0;
  14855. };
  14856. BigInteger.prototype.isNegative = function () {
  14857. return this.sign;
  14858. };
  14859. SmallInteger.prototype.isNegative = function () {
  14860. return this.value < 0;
  14861. };
  14862. BigInteger.prototype.isUnit = function () {
  14863. return false;
  14864. };
  14865. SmallInteger.prototype.isUnit = function () {
  14866. return Math.abs(this.value) === 1;
  14867. };
  14868. BigInteger.prototype.isZero = function () {
  14869. return false;
  14870. };
  14871. SmallInteger.prototype.isZero = function () {
  14872. return this.value === 0;
  14873. };
  14874. BigInteger.prototype.isDivisibleBy = function (v) {
  14875. var n = parseValue(v);
  14876. var value = n.value;
  14877. if (value === 0) return false;
  14878. if (value === 1) return true;
  14879. if (value === 2) return this.isEven();
  14880. return this.mod(n).equals(Integer[0]);
  14881. };
  14882. SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;
  14883. function isBasicPrime(v) {
  14884. var n = v.abs();
  14885. if (n.isUnit()) return false;
  14886. if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
  14887. if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
  14888. if (n.lesser(25)) return true;
  14889. // we don't know if it's prime: let the other functions figure it out
  14890. }
  14891. BigInteger.prototype.isPrime = function () {
  14892. var isPrime = isBasicPrime(this);
  14893. if (isPrime !== undefined) return isPrime;
  14894. var n = this.abs(),
  14895. nPrev = n.prev();
  14896. var a = [2, 3, 5, 7, 11, 13, 17, 19],
  14897. b = nPrev,
  14898. d, t, i, x;
  14899. while (b.isEven()) b = b.divide(2);
  14900. for (i = 0; i < a.length; i++) {
  14901. x = bigInt(a[i]).modPow(b, n);
  14902. if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
  14903. for (t = true, d = b; t && d.lesser(nPrev) ; d = d.multiply(2)) {
  14904. x = x.square().mod(n);
  14905. if (x.equals(nPrev)) t = false;
  14906. }
  14907. if (t) return false;
  14908. }
  14909. return true;
  14910. };
  14911. SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
  14912. BigInteger.prototype.isProbablePrime = function (iterations) {
  14913. var isPrime = isBasicPrime(this);
  14914. if (isPrime !== undefined) return isPrime;
  14915. var n = this.abs();
  14916. var t = iterations === undefined ? 5 : iterations;
  14917. // use the Fermat primality test
  14918. for (var i = 0; i < t; i++) {
  14919. var a = bigInt.randBetween(2, n.minus(2));
  14920. if (!a.modPow(n.prev(), n).isUnit()) return false; // definitely composite
  14921. }
  14922. return true; // large chance of being prime
  14923. };
  14924. SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
  14925. BigInteger.prototype.modInv = function (n) {
  14926. var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;
  14927. while (!newR.equals(bigInt.zero)) {
  14928. q = r.divide(newR);
  14929. lastT = t;
  14930. lastR = r;
  14931. t = newT;
  14932. r = newR;
  14933. newT = lastT.subtract(q.multiply(newT));
  14934. newR = lastR.subtract(q.multiply(newR));
  14935. }
  14936. if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime");
  14937. if (t.compare(0) === -1) {
  14938. t = t.add(n);
  14939. }
  14940. return t;
  14941. }
  14942. SmallInteger.prototype.modInv = BigInteger.prototype.modInv;
  14943. BigInteger.prototype.next = function () {
  14944. var value = this.value;
  14945. if (this.sign) {
  14946. return subtractSmall(value, 1, this.sign);
  14947. }
  14948. return new BigInteger(addSmall(value, 1), this.sign);
  14949. };
  14950. SmallInteger.prototype.next = function () {
  14951. var value = this.value;
  14952. if (value + 1 < MAX_INT) return new SmallInteger(value + 1);
  14953. return new BigInteger(MAX_INT_ARR, false);
  14954. };
  14955. BigInteger.prototype.prev = function () {
  14956. var value = this.value;
  14957. if (this.sign) {
  14958. return new BigInteger(addSmall(value, 1), true);
  14959. }
  14960. return subtractSmall(value, 1, this.sign);
  14961. };
  14962. SmallInteger.prototype.prev = function () {
  14963. var value = this.value;
  14964. if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);
  14965. return new BigInteger(MAX_INT_ARR, true);
  14966. };
  14967. var powersOfTwo = [1];
  14968. while (powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);
  14969. var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];
  14970. function shift_isSmall(n) {
  14971. return ((typeof n === "number" || typeof n === "string") && +Math.abs(n) <= BASE) ||
  14972. (n instanceof BigInteger && n.value.length <= 1);
  14973. }
  14974. BigInteger.prototype.shiftLeft = function (n) {
  14975. if (!shift_isSmall(n)) {
  14976. throw new Error(String(n) + " is too large for shifting.");
  14977. }
  14978. n = +n;
  14979. if (n < 0) return this.shiftRight(-n);
  14980. var result = this;
  14981. while (n >= powers2Length) {
  14982. result = result.multiply(highestPower2);
  14983. n -= powers2Length - 1;
  14984. }
  14985. return result.multiply(powersOfTwo[n]);
  14986. };
  14987. SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;
  14988. BigInteger.prototype.shiftRight = function (n) {
  14989. var remQuo;
  14990. if (!shift_isSmall(n)) {
  14991. throw new Error(String(n) + " is too large for shifting.");
  14992. }
  14993. n = +n;
  14994. if (n < 0) return this.shiftLeft(-n);
  14995. var result = this;
  14996. while (n >= powers2Length) {
  14997. if (result.isZero()) return result;
  14998. remQuo = divModAny(result, highestPower2);
  14999. result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
  15000. n -= powers2Length - 1;
  15001. }
  15002. remQuo = divModAny(result, powersOfTwo[n]);
  15003. return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];
  15004. };
  15005. SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;
  15006. function bitwise(x, y, fn) {
  15007. y = parseValue(y);
  15008. var xSign = x.isNegative(), ySign = y.isNegative();
  15009. var xRem = xSign ? x.not() : x,
  15010. yRem = ySign ? y.not() : y;
  15011. var xBits = [], yBits = [];
  15012. var xStop = false, yStop = false;
  15013. while (!xStop || !yStop) {
  15014. if (xRem.isZero()) { // virtual sign extension for simulating two's complement
  15015. xStop = true;
  15016. xBits.push(xSign ? 1 : 0);
  15017. }
  15018. else if (xSign) xBits.push(xRem.isEven() ? 1 : 0); // two's complement for negative numbers
  15019. else xBits.push(xRem.isEven() ? 0 : 1);
  15020. if (yRem.isZero()) {
  15021. yStop = true;
  15022. yBits.push(ySign ? 1 : 0);
  15023. }
  15024. else if (ySign) yBits.push(yRem.isEven() ? 1 : 0);
  15025. else yBits.push(yRem.isEven() ? 0 : 1);
  15026. xRem = xRem.over(2);
  15027. yRem = yRem.over(2);
  15028. }
  15029. var result = [];
  15030. for (var i = 0; i < xBits.length; i++) result.push(fn(xBits[i], yBits[i]));
  15031. var sum = bigInt(result.pop()).negate().times(bigInt(2).pow(result.length));
  15032. while (result.length) {
  15033. sum = sum.add(bigInt(result.pop()).times(bigInt(2).pow(result.length)));
  15034. }
  15035. return sum;
  15036. }
  15037. BigInteger.prototype.not = function () {
  15038. return this.negate().prev();
  15039. };
  15040. SmallInteger.prototype.not = BigInteger.prototype.not;
  15041. BigInteger.prototype.and = function (n) {
  15042. return bitwise(this, n, function (a, b) { return a & b; });
  15043. };
  15044. SmallInteger.prototype.and = BigInteger.prototype.and;
  15045. BigInteger.prototype.or = function (n) {
  15046. return bitwise(this, n, function (a, b) { return a | b; });
  15047. };
  15048. SmallInteger.prototype.or = BigInteger.prototype.or;
  15049. BigInteger.prototype.xor = function (n) {
  15050. return bitwise(this, n, function (a, b) { return a ^ b; });
  15051. };
  15052. SmallInteger.prototype.xor = BigInteger.prototype.xor;
  15053. var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;
  15054. function roughLOB(n) { // get lowestOneBit (rough)
  15055. // SmallInteger: return Min(lowestOneBit(n), 1 << 30)
  15056. // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]
  15057. var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI;
  15058. return x & -x;
  15059. }
  15060. function max(a, b) {
  15061. a = parseValue(a);
  15062. b = parseValue(b);
  15063. return a.greater(b) ? a : b;
  15064. }
  15065. function min(a,b) {
  15066. a = parseValue(a);
  15067. b = parseValue(b);
  15068. return a.lesser(b) ? a : b;
  15069. }
  15070. function gcd(a, b) {
  15071. a = parseValue(a).abs();
  15072. b = parseValue(b).abs();
  15073. if (a.equals(b)) return a;
  15074. if (a.isZero()) return b;
  15075. if (b.isZero()) return a;
  15076. var c = Integer[1], d, t;
  15077. while (a.isEven() && b.isEven()) {
  15078. d = Math.min(roughLOB(a), roughLOB(b));
  15079. a = a.divide(d);
  15080. b = b.divide(d);
  15081. c = c.multiply(d);
  15082. }
  15083. while (a.isEven()) {
  15084. a = a.divide(roughLOB(a));
  15085. }
  15086. do {
  15087. while (b.isEven()) {
  15088. b = b.divide(roughLOB(b));
  15089. }
  15090. if (a.greater(b)) {
  15091. t = b; b = a; a = t;
  15092. }
  15093. b = b.subtract(a);
  15094. } while (!b.isZero());
  15095. return c.isUnit() ? a : a.multiply(c);
  15096. }
  15097. function lcm(a, b) {
  15098. a = parseValue(a).abs();
  15099. b = parseValue(b).abs();
  15100. return a.divide(gcd(a, b)).multiply(b);
  15101. }
  15102. function randBetween(a, b) {
  15103. a = parseValue(a);
  15104. b = parseValue(b);
  15105. var low = min(a, b), high = max(a, b);
  15106. var range = high.subtract(low);
  15107. if (range.isSmall) return low.add(Math.round(Math.random() * range));
  15108. var length = range.value.length - 1;
  15109. var result = [], restricted = true;
  15110. for (var i = length; i >= 0; i--) {
  15111. var top = restricted ? range.value[i] : BASE;
  15112. var digit = truncate(Math.random() * top);
  15113. result.unshift(digit);
  15114. if (digit < top) restricted = false;
  15115. }
  15116. result = arrayToSmall(result);
  15117. return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false));
  15118. }
  15119. var parseBase = function (text, base) {
  15120. var val = Integer[0], pow = Integer[1],
  15121. length = text.length;
  15122. if (2 <= base && base <= 36) {
  15123. if (length <= LOG_MAX_INT / Math.log(base)) {
  15124. return new SmallInteger(parseInt(text, base));
  15125. }
  15126. }
  15127. base = parseValue(base);
  15128. var digits = [];
  15129. var i;
  15130. var isNegative = text[0] === "-";
  15131. for (i = isNegative ? 1 : 0; i < text.length; i++) {
  15132. var c = text[i].toLowerCase(),
  15133. charCode = c.charCodeAt(0);
  15134. if (48 <= charCode && charCode <= 57) digits.push(parseValue(c));
  15135. else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87));
  15136. else if (c === "<") {
  15137. var start = i;
  15138. do { i++; } while (text[i] !== ">");
  15139. digits.push(parseValue(text.slice(start + 1, i)));
  15140. }
  15141. else throw new Error(c + " is not a valid character");
  15142. }
  15143. digits.reverse();
  15144. for (i = 0; i < digits.length; i++) {
  15145. val = val.add(digits[i].times(pow));
  15146. pow = pow.times(base);
  15147. }
  15148. return isNegative ? val.negate() : val;
  15149. };
  15150. function stringify(digit) {
  15151. var v = digit.value;
  15152. if (typeof v === "number") v = [v];
  15153. if (v.length === 1 && v[0] <= 35) {
  15154. return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0]);
  15155. }
  15156. return "<" + v + ">";
  15157. }
  15158. function toBase(n, base) {
  15159. base = bigInt(base);
  15160. if (base.isZero()) {
  15161. if (n.isZero()) return "0";
  15162. throw new Error("Cannot convert nonzero numbers to base 0.");
  15163. }
  15164. if (base.equals(-1)) {
  15165. if (n.isZero()) return "0";
  15166. if (n.isNegative()) return new Array(1 - n).join("10");
  15167. return "1" + new Array(+n).join("01");
  15168. }
  15169. var minusSign = "";
  15170. if (n.isNegative() && base.isPositive()) {
  15171. minusSign = "-";
  15172. n = n.abs();
  15173. }
  15174. if (base.equals(1)) {
  15175. if (n.isZero()) return "0";
  15176. return minusSign + new Array(+n + 1).join(1);
  15177. }
  15178. var out = [];
  15179. var left = n, divmod;
  15180. while (left.isNegative() || left.compareAbs(base) >= 0) {
  15181. divmod = left.divmod(base);
  15182. left = divmod.quotient;
  15183. var digit = divmod.remainder;
  15184. if (digit.isNegative()) {
  15185. digit = base.minus(digit).abs();
  15186. left = left.next();
  15187. }
  15188. out.push(stringify(digit));
  15189. }
  15190. out.push(stringify(left));
  15191. return minusSign + out.reverse().join("");
  15192. }
  15193. BigInteger.prototype.toString = function (radix) {
  15194. if (radix === undefined) radix = 10;
  15195. if (radix !== 10) return toBase(this, radix);
  15196. var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit;
  15197. while (--l >= 0) {
  15198. digit = String(v[l]);
  15199. str += zeros.slice(digit.length) + digit;
  15200. }
  15201. var sign = this.sign ? "-" : "";
  15202. return sign + str;
  15203. };
  15204. SmallInteger.prototype.toString = function (radix) {
  15205. if (radix === undefined) radix = 10;
  15206. if (radix != 10) return toBase(this, radix);
  15207. return String(this.value);
  15208. };
  15209. BigInteger.prototype.valueOf = function () {
  15210. return +this.toString();
  15211. };
  15212. BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;
  15213. SmallInteger.prototype.valueOf = function () {
  15214. return this.value;
  15215. };
  15216. SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;
  15217. function parseStringValue(v) {
  15218. if (isPrecise(+v)) {
  15219. var x = +v;
  15220. if (x === truncate(x))
  15221. return new SmallInteger(x);
  15222. throw "Invalid integer: " + v;
  15223. }
  15224. var sign = v[0] === "-";
  15225. if (sign) v = v.slice(1);
  15226. var split = v.split(/e/i);
  15227. if (split.length > 2) throw new Error("Invalid integer: " + split.join("e"));
  15228. if (split.length === 2) {
  15229. var exp = split[1];
  15230. if (exp[0] === "+") exp = exp.slice(1);
  15231. exp = +exp;
  15232. if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent.");
  15233. var text = split[0];
  15234. var decimalPlace = text.indexOf(".");
  15235. if (decimalPlace >= 0) {
  15236. exp -= text.length - decimalPlace - 1;
  15237. text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);
  15238. }
  15239. if (exp < 0) throw new Error("Cannot include negative exponent part for integers");
  15240. text += (new Array(exp + 1)).join("0");
  15241. v = text;
  15242. }
  15243. var isValid = /^([0-9][0-9]*)$/.test(v);
  15244. if (!isValid) throw new Error("Invalid integer: " + v);
  15245. var r = [], max = v.length, l = LOG_BASE, min = max - l;
  15246. while (max > 0) {
  15247. r.push(+v.slice(min, max));
  15248. min -= l;
  15249. if (min < 0) min = 0;
  15250. max -= l;
  15251. }
  15252. trim(r);
  15253. return new BigInteger(r, sign);
  15254. }
  15255. function parseNumberValue(v) {
  15256. if (isPrecise(v)) {
  15257. if (v !== truncate(v)) throw new Error(v + " is not an integer.");
  15258. return new SmallInteger(v);
  15259. }
  15260. return parseStringValue(v.toString());
  15261. }
  15262. function parseValue(v) {
  15263. if (typeof v === "number") {
  15264. return parseNumberValue(v);
  15265. }
  15266. if (typeof v === "string") {
  15267. return parseStringValue(v);
  15268. }
  15269. return v;
  15270. }
  15271. // Pre-define numbers in range [-999,999]
  15272. for (var i = 0; i < 1000; i++) {
  15273. Integer[i] = new SmallInteger(i);
  15274. if (i > 0) Integer[-i] = new SmallInteger(-i);
  15275. }
  15276. // Backwards compatibility
  15277. Integer.one = Integer[1];
  15278. Integer.zero = Integer[0];
  15279. Integer.minusOne = Integer[-1];
  15280. Integer.max = max;
  15281. Integer.min = min;
  15282. Integer.gcd = gcd;
  15283. Integer.lcm = lcm;
  15284. Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; };
  15285. Integer.randBetween = randBetween;
  15286. return Integer;
  15287. })();
  15288. // Node.js check
  15289. if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
  15290. module.exports = bigInt;
  15291. }
  15292. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(221)(module)))
  15293. /***/ },
  15294. /* 119 */
  15295. /***/ function(module, exports, __webpack_require__) {
  15296. /* WEBPACK VAR INJECTION */(function(Buffer) {var Transform = __webpack_require__(21).Transform
  15297. var inherits = __webpack_require__(1)
  15298. var StringDecoder = __webpack_require__(49).StringDecoder
  15299. module.exports = CipherBase
  15300. inherits(CipherBase, Transform)
  15301. function CipherBase (hashMode) {
  15302. Transform.call(this)
  15303. this.hashMode = typeof hashMode === 'string'
  15304. if (this.hashMode) {
  15305. this[hashMode] = this._finalOrDigest
  15306. } else {
  15307. this.final = this._finalOrDigest
  15308. }
  15309. this._decoder = null
  15310. this._encoding = null
  15311. }
  15312. CipherBase.prototype.update = function (data, inputEnc, outputEnc) {
  15313. if (typeof data === 'string') {
  15314. data = new Buffer(data, inputEnc)
  15315. }
  15316. var outData = this._update(data)
  15317. if (this.hashMode) {
  15318. return this
  15319. }
  15320. if (outputEnc) {
  15321. outData = this._toString(outData, outputEnc)
  15322. }
  15323. return outData
  15324. }
  15325. CipherBase.prototype.setAutoPadding = function () {}
  15326. CipherBase.prototype.getAuthTag = function () {
  15327. throw new Error('trying to get auth tag in unsupported state')
  15328. }
  15329. CipherBase.prototype.setAuthTag = function () {
  15330. throw new Error('trying to set auth tag in unsupported state')
  15331. }
  15332. CipherBase.prototype.setAAD = function () {
  15333. throw new Error('trying to set aad in unsupported state')
  15334. }
  15335. CipherBase.prototype._transform = function (data, _, next) {
  15336. var err
  15337. try {
  15338. if (this.hashMode) {
  15339. this._update(data)
  15340. } else {
  15341. this.push(this._update(data))
  15342. }
  15343. } catch (e) {
  15344. err = e
  15345. } finally {
  15346. next(err)
  15347. }
  15348. }
  15349. CipherBase.prototype._flush = function (done) {
  15350. var err
  15351. try {
  15352. this.push(this._final())
  15353. } catch (e) {
  15354. err = e
  15355. } finally {
  15356. done(err)
  15357. }
  15358. }
  15359. CipherBase.prototype._finalOrDigest = function (outputEnc) {
  15360. var outData = this._final() || new Buffer('')
  15361. if (outputEnc) {
  15362. outData = this._toString(outData, outputEnc, true)
  15363. }
  15364. return outData
  15365. }
  15366. CipherBase.prototype._toString = function (value, enc, fin) {
  15367. if (!this._decoder) {
  15368. this._decoder = new StringDecoder(enc)
  15369. this._encoding = enc
  15370. }
  15371. if (this._encoding !== enc) {
  15372. throw new Error('can\'t switch encodings')
  15373. }
  15374. var out = this._decoder.write(value)
  15375. if (fin) {
  15376. out += this._decoder.end()
  15377. }
  15378. return out
  15379. }
  15380. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  15381. /***/ },
  15382. /* 120 */
  15383. /***/ function(module, exports, __webpack_require__) {
  15384. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  15385. if (true) {
  15386. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(189)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  15387. } else if (typeof exports !== "undefined") {
  15388. factory(module, require('select'));
  15389. } else {
  15390. var mod = {
  15391. exports: {}
  15392. };
  15393. factory(mod, global.select);
  15394. global.clipboardAction = mod.exports;
  15395. }
  15396. })(this, function (module, _select) {
  15397. 'use strict';
  15398. var _select2 = _interopRequireDefault(_select);
  15399. function _interopRequireDefault(obj) {
  15400. return obj && obj.__esModule ? obj : {
  15401. default: obj
  15402. };
  15403. }
  15404. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  15405. return typeof obj;
  15406. } : function (obj) {
  15407. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  15408. };
  15409. function _classCallCheck(instance, Constructor) {
  15410. if (!(instance instanceof Constructor)) {
  15411. throw new TypeError("Cannot call a class as a function");
  15412. }
  15413. }
  15414. var _createClass = function () {
  15415. function defineProperties(target, props) {
  15416. for (var i = 0; i < props.length; i++) {
  15417. var descriptor = props[i];
  15418. descriptor.enumerable = descriptor.enumerable || false;
  15419. descriptor.configurable = true;
  15420. if ("value" in descriptor) descriptor.writable = true;
  15421. Object.defineProperty(target, descriptor.key, descriptor);
  15422. }
  15423. }
  15424. return function (Constructor, protoProps, staticProps) {
  15425. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  15426. if (staticProps) defineProperties(Constructor, staticProps);
  15427. return Constructor;
  15428. };
  15429. }();
  15430. var ClipboardAction = function () {
  15431. /**
  15432. * @param {Object} options
  15433. */
  15434. function ClipboardAction(options) {
  15435. _classCallCheck(this, ClipboardAction);
  15436. this.resolveOptions(options);
  15437. this.initSelection();
  15438. }
  15439. /**
  15440. * Defines base properties passed from constructor.
  15441. * @param {Object} options
  15442. */
  15443. _createClass(ClipboardAction, [{
  15444. key: 'resolveOptions',
  15445. value: function resolveOptions() {
  15446. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15447. this.action = options.action;
  15448. this.emitter = options.emitter;
  15449. this.target = options.target;
  15450. this.text = options.text;
  15451. this.trigger = options.trigger;
  15452. this.selectedText = '';
  15453. }
  15454. }, {
  15455. key: 'initSelection',
  15456. value: function initSelection() {
  15457. if (this.text) {
  15458. this.selectFake();
  15459. } else if (this.target) {
  15460. this.selectTarget();
  15461. }
  15462. }
  15463. }, {
  15464. key: 'selectFake',
  15465. value: function selectFake() {
  15466. var _this = this;
  15467. var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
  15468. this.removeFake();
  15469. this.fakeHandlerCallback = function () {
  15470. return _this.removeFake();
  15471. };
  15472. this.fakeHandler = document.body.addEventListener('click', this.fakeHandlerCallback) || true;
  15473. this.fakeElem = document.createElement('textarea');
  15474. // Prevent zooming on iOS
  15475. this.fakeElem.style.fontSize = '12pt';
  15476. // Reset box model
  15477. this.fakeElem.style.border = '0';
  15478. this.fakeElem.style.padding = '0';
  15479. this.fakeElem.style.margin = '0';
  15480. // Move element out of screen horizontally
  15481. this.fakeElem.style.position = 'absolute';
  15482. this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
  15483. // Move element to the same position vertically
  15484. var yPosition = window.pageYOffset || document.documentElement.scrollTop;
  15485. this.fakeElem.addEventListener('focus', window.scrollTo(0, yPosition));
  15486. this.fakeElem.style.top = yPosition + 'px';
  15487. this.fakeElem.setAttribute('readonly', '');
  15488. this.fakeElem.value = this.text;
  15489. document.body.appendChild(this.fakeElem);
  15490. this.selectedText = (0, _select2.default)(this.fakeElem);
  15491. this.copyText();
  15492. }
  15493. }, {
  15494. key: 'removeFake',
  15495. value: function removeFake() {
  15496. if (this.fakeHandler) {
  15497. document.body.removeEventListener('click', this.fakeHandlerCallback);
  15498. this.fakeHandler = null;
  15499. this.fakeHandlerCallback = null;
  15500. }
  15501. if (this.fakeElem) {
  15502. document.body.removeChild(this.fakeElem);
  15503. this.fakeElem = null;
  15504. }
  15505. }
  15506. }, {
  15507. key: 'selectTarget',
  15508. value: function selectTarget() {
  15509. this.selectedText = (0, _select2.default)(this.target);
  15510. this.copyText();
  15511. }
  15512. }, {
  15513. key: 'copyText',
  15514. value: function copyText() {
  15515. var succeeded = void 0;
  15516. try {
  15517. succeeded = document.execCommand(this.action);
  15518. } catch (err) {
  15519. succeeded = false;
  15520. }
  15521. this.handleResult(succeeded);
  15522. }
  15523. }, {
  15524. key: 'handleResult',
  15525. value: function handleResult(succeeded) {
  15526. this.emitter.emit(succeeded ? 'success' : 'error', {
  15527. action: this.action,
  15528. text: this.selectedText,
  15529. trigger: this.trigger,
  15530. clearSelection: this.clearSelection.bind(this)
  15531. });
  15532. }
  15533. }, {
  15534. key: 'clearSelection',
  15535. value: function clearSelection() {
  15536. if (this.target) {
  15537. this.target.blur();
  15538. }
  15539. window.getSelection().removeAllRanges();
  15540. }
  15541. }, {
  15542. key: 'destroy',
  15543. value: function destroy() {
  15544. this.removeFake();
  15545. }
  15546. }, {
  15547. key: 'action',
  15548. set: function set() {
  15549. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
  15550. this._action = action;
  15551. if (this._action !== 'copy' && this._action !== 'cut') {
  15552. throw new Error('Invalid "action" value, use either "copy" or "cut"');
  15553. }
  15554. },
  15555. get: function get() {
  15556. return this._action;
  15557. }
  15558. }, {
  15559. key: 'target',
  15560. set: function set(target) {
  15561. if (target !== undefined) {
  15562. if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
  15563. if (this.action === 'copy' && target.hasAttribute('disabled')) {
  15564. throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
  15565. }
  15566. if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
  15567. throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
  15568. }
  15569. this._target = target;
  15570. } else {
  15571. throw new Error('Invalid "target" value, use a valid Element');
  15572. }
  15573. }
  15574. },
  15575. get: function get() {
  15576. return this._target;
  15577. }
  15578. }]);
  15579. return ClipboardAction;
  15580. }();
  15581. module.exports = ClipboardAction;
  15582. });
  15583. /***/ },
  15584. /* 121 */
  15585. /***/ function(module, exports, __webpack_require__) {
  15586. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  15587. if (true) {
  15588. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, __webpack_require__(120), __webpack_require__(195), __webpack_require__(170)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  15589. } else if (typeof exports !== "undefined") {
  15590. factory(module, require('./clipboard-action'), require('tiny-emitter'), require('good-listener'));
  15591. } else {
  15592. var mod = {
  15593. exports: {}
  15594. };
  15595. factory(mod, global.clipboardAction, global.tinyEmitter, global.goodListener);
  15596. global.clipboard = mod.exports;
  15597. }
  15598. })(this, function (module, _clipboardAction, _tinyEmitter, _goodListener) {
  15599. 'use strict';
  15600. var _clipboardAction2 = _interopRequireDefault(_clipboardAction);
  15601. var _tinyEmitter2 = _interopRequireDefault(_tinyEmitter);
  15602. var _goodListener2 = _interopRequireDefault(_goodListener);
  15603. function _interopRequireDefault(obj) {
  15604. return obj && obj.__esModule ? obj : {
  15605. default: obj
  15606. };
  15607. }
  15608. function _classCallCheck(instance, Constructor) {
  15609. if (!(instance instanceof Constructor)) {
  15610. throw new TypeError("Cannot call a class as a function");
  15611. }
  15612. }
  15613. var _createClass = function () {
  15614. function defineProperties(target, props) {
  15615. for (var i = 0; i < props.length; i++) {
  15616. var descriptor = props[i];
  15617. descriptor.enumerable = descriptor.enumerable || false;
  15618. descriptor.configurable = true;
  15619. if ("value" in descriptor) descriptor.writable = true;
  15620. Object.defineProperty(target, descriptor.key, descriptor);
  15621. }
  15622. }
  15623. return function (Constructor, protoProps, staticProps) {
  15624. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  15625. if (staticProps) defineProperties(Constructor, staticProps);
  15626. return Constructor;
  15627. };
  15628. }();
  15629. function _possibleConstructorReturn(self, call) {
  15630. if (!self) {
  15631. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  15632. }
  15633. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  15634. }
  15635. function _inherits(subClass, superClass) {
  15636. if (typeof superClass !== "function" && superClass !== null) {
  15637. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  15638. }
  15639. subClass.prototype = Object.create(superClass && superClass.prototype, {
  15640. constructor: {
  15641. value: subClass,
  15642. enumerable: false,
  15643. writable: true,
  15644. configurable: true
  15645. }
  15646. });
  15647. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  15648. }
  15649. var Clipboard = function (_Emitter) {
  15650. _inherits(Clipboard, _Emitter);
  15651. /**
  15652. * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
  15653. * @param {Object} options
  15654. */
  15655. function Clipboard(trigger, options) {
  15656. _classCallCheck(this, Clipboard);
  15657. var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
  15658. _this.resolveOptions(options);
  15659. _this.listenClick(trigger);
  15660. return _this;
  15661. }
  15662. /**
  15663. * Defines if attributes would be resolved using internal setter functions
  15664. * or custom functions that were passed in the constructor.
  15665. * @param {Object} options
  15666. */
  15667. _createClass(Clipboard, [{
  15668. key: 'resolveOptions',
  15669. value: function resolveOptions() {
  15670. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  15671. this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
  15672. this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
  15673. this.text = typeof options.text === 'function' ? options.text : this.defaultText;
  15674. }
  15675. }, {
  15676. key: 'listenClick',
  15677. value: function listenClick(trigger) {
  15678. var _this2 = this;
  15679. this.listener = (0, _goodListener2.default)(trigger, 'click', function (e) {
  15680. return _this2.onClick(e);
  15681. });
  15682. }
  15683. }, {
  15684. key: 'onClick',
  15685. value: function onClick(e) {
  15686. var trigger = e.delegateTarget || e.currentTarget;
  15687. if (this.clipboardAction) {
  15688. this.clipboardAction = null;
  15689. }
  15690. this.clipboardAction = new _clipboardAction2.default({
  15691. action: this.action(trigger),
  15692. target: this.target(trigger),
  15693. text: this.text(trigger),
  15694. trigger: trigger,
  15695. emitter: this
  15696. });
  15697. }
  15698. }, {
  15699. key: 'defaultAction',
  15700. value: function defaultAction(trigger) {
  15701. return getAttributeValue('action', trigger);
  15702. }
  15703. }, {
  15704. key: 'defaultTarget',
  15705. value: function defaultTarget(trigger) {
  15706. var selector = getAttributeValue('target', trigger);
  15707. if (selector) {
  15708. return document.querySelector(selector);
  15709. }
  15710. }
  15711. }, {
  15712. key: 'defaultText',
  15713. value: function defaultText(trigger) {
  15714. return getAttributeValue('text', trigger);
  15715. }
  15716. }, {
  15717. key: 'destroy',
  15718. value: function destroy() {
  15719. this.listener.destroy();
  15720. if (this.clipboardAction) {
  15721. this.clipboardAction.destroy();
  15722. this.clipboardAction = null;
  15723. }
  15724. }
  15725. }]);
  15726. return Clipboard;
  15727. }(_tinyEmitter2.default);
  15728. /**
  15729. * Helper function to retrieve attribute value.
  15730. * @param {String} suffix
  15731. * @param {Element} element
  15732. */
  15733. function getAttributeValue(suffix, element) {
  15734. var attribute = 'data-clipboard-' + suffix;
  15735. if (!element.hasAttribute(attribute)) {
  15736. return;
  15737. }
  15738. return element.getAttribute(attribute);
  15739. }
  15740. module.exports = Clipboard;
  15741. });
  15742. /***/ },
  15743. /* 122 */
  15744. /***/ function(module, exports, __webpack_require__) {
  15745. var core = __webpack_require__(6)
  15746. , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});
  15747. module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
  15748. return $JSON.stringify.apply($JSON, arguments);
  15749. };
  15750. /***/ },
  15751. /* 123 */
  15752. /***/ function(module, exports, __webpack_require__) {
  15753. __webpack_require__(154);
  15754. module.exports = __webpack_require__(6).Object.assign;
  15755. /***/ },
  15756. /* 124 */
  15757. /***/ function(module, exports, __webpack_require__) {
  15758. __webpack_require__(155);
  15759. var $Object = __webpack_require__(6).Object;
  15760. module.exports = function defineProperty(it, key, desc){
  15761. return $Object.defineProperty(it, key, desc);
  15762. };
  15763. /***/ },
  15764. /* 125 */
  15765. /***/ function(module, exports, __webpack_require__) {
  15766. __webpack_require__(156);
  15767. __webpack_require__(158);
  15768. __webpack_require__(159);
  15769. __webpack_require__(157);
  15770. module.exports = __webpack_require__(6).Promise;
  15771. /***/ },
  15772. /* 126 */
  15773. /***/ function(module, exports) {
  15774. module.exports = function(){ /* empty */ };
  15775. /***/ },
  15776. /* 127 */
  15777. /***/ function(module, exports) {
  15778. module.exports = function(it, Constructor, name, forbiddenField){
  15779. if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
  15780. throw TypeError(name + ': incorrect invocation!');
  15781. } return it;
  15782. };
  15783. /***/ },
  15784. /* 128 */
  15785. /***/ function(module, exports, __webpack_require__) {
  15786. // false -> Array#indexOf
  15787. // true -> Array#includes
  15788. var toIObject = __webpack_require__(43)
  15789. , toLength = __webpack_require__(69)
  15790. , toIndex = __webpack_require__(150);
  15791. module.exports = function(IS_INCLUDES){
  15792. return function($this, el, fromIndex){
  15793. var O = toIObject($this)
  15794. , length = toLength(O.length)
  15795. , index = toIndex(fromIndex, length)
  15796. , value;
  15797. // Array#includes uses SameValueZero equality algorithm
  15798. if(IS_INCLUDES && el != el)while(length > index){
  15799. value = O[index++];
  15800. if(value != value)return true;
  15801. // Array#toIndex ignores holes, Array#includes - not
  15802. } else for(;length > index; index++)if(IS_INCLUDES || index in O){
  15803. if(O[index] === el)return IS_INCLUDES || index || 0;
  15804. } return !IS_INCLUDES && -1;
  15805. };
  15806. };
  15807. /***/ },
  15808. /* 129 */
  15809. /***/ function(module, exports, __webpack_require__) {
  15810. var ctx = __webpack_require__(25)
  15811. , call = __webpack_require__(133)
  15812. , isArrayIter = __webpack_require__(132)
  15813. , anObject = __webpack_require__(10)
  15814. , toLength = __webpack_require__(69)
  15815. , getIterFn = __webpack_require__(152)
  15816. , BREAK = {}
  15817. , RETURN = {};
  15818. var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
  15819. var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
  15820. , f = ctx(fn, that, entries ? 2 : 1)
  15821. , index = 0
  15822. , length, step, iterator, result;
  15823. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  15824. // fast case for arrays with default iterator
  15825. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  15826. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  15827. if(result === BREAK || result === RETURN)return result;
  15828. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  15829. result = call(iterator, f, step.value, entries);
  15830. if(result === BREAK || result === RETURN)return result;
  15831. }
  15832. };
  15833. exports.BREAK = BREAK;
  15834. exports.RETURN = RETURN;
  15835. /***/ },
  15836. /* 130 */
  15837. /***/ function(module, exports, __webpack_require__) {
  15838. module.exports = !__webpack_require__(11) && !__webpack_require__(39)(function(){
  15839. return Object.defineProperty(__webpack_require__(38)('div'), 'a', {get: function(){ return 7; }}).a != 7;
  15840. });
  15841. /***/ },
  15842. /* 131 */
  15843. /***/ function(module, exports) {
  15844. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  15845. module.exports = function(fn, args, that){
  15846. var un = that === undefined;
  15847. switch(args.length){
  15848. case 0: return un ? fn()
  15849. : fn.call(that);
  15850. case 1: return un ? fn(args[0])
  15851. : fn.call(that, args[0]);
  15852. case 2: return un ? fn(args[0], args[1])
  15853. : fn.call(that, args[0], args[1]);
  15854. case 3: return un ? fn(args[0], args[1], args[2])
  15855. : fn.call(that, args[0], args[1], args[2]);
  15856. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  15857. : fn.call(that, args[0], args[1], args[2], args[3]);
  15858. } return fn.apply(that, args);
  15859. };
  15860. /***/ },
  15861. /* 132 */
  15862. /***/ function(module, exports, __webpack_require__) {
  15863. // check on default Array iterator
  15864. var Iterators = __webpack_require__(18)
  15865. , ITERATOR = __webpack_require__(3)('iterator')
  15866. , ArrayProto = Array.prototype;
  15867. module.exports = function(it){
  15868. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  15869. };
  15870. /***/ },
  15871. /* 133 */
  15872. /***/ function(module, exports, __webpack_require__) {
  15873. // call something on iterator step with safe closing on error
  15874. var anObject = __webpack_require__(10);
  15875. module.exports = function(iterator, fn, value, entries){
  15876. try {
  15877. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  15878. // 7.4.6 IteratorClose(iterator, completion)
  15879. } catch(e){
  15880. var ret = iterator['return'];
  15881. if(ret !== undefined)anObject(ret.call(iterator));
  15882. throw e;
  15883. }
  15884. };
  15885. /***/ },
  15886. /* 134 */
  15887. /***/ function(module, exports, __webpack_require__) {
  15888. "use strict";
  15889. 'use strict';
  15890. var create = __webpack_require__(139)
  15891. , descriptor = __webpack_require__(66)
  15892. , setToStringTag = __webpack_require__(40)
  15893. , IteratorPrototype = {};
  15894. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  15895. __webpack_require__(12)(IteratorPrototype, __webpack_require__(3)('iterator'), function(){ return this; });
  15896. module.exports = function(Constructor, NAME, next){
  15897. Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
  15898. setToStringTag(Constructor, NAME + ' Iterator');
  15899. };
  15900. /***/ },
  15901. /* 135 */
  15902. /***/ function(module, exports, __webpack_require__) {
  15903. var ITERATOR = __webpack_require__(3)('iterator')
  15904. , SAFE_CLOSING = false;
  15905. try {
  15906. var riter = [7][ITERATOR]();
  15907. riter['return'] = function(){ SAFE_CLOSING = true; };
  15908. Array.from(riter, function(){ throw 2; });
  15909. } catch(e){ /* empty */ }
  15910. module.exports = function(exec, skipClosing){
  15911. if(!skipClosing && !SAFE_CLOSING)return false;
  15912. var safe = false;
  15913. try {
  15914. var arr = [7]
  15915. , iter = arr[ITERATOR]();
  15916. iter.next = function(){ return {done: safe = true}; };
  15917. arr[ITERATOR] = function(){ return iter; };
  15918. exec(arr);
  15919. } catch(e){ /* empty */ }
  15920. return safe;
  15921. };
  15922. /***/ },
  15923. /* 136 */
  15924. /***/ function(module, exports) {
  15925. module.exports = function(done, value){
  15926. return {value: value, done: !!done};
  15927. };
  15928. /***/ },
  15929. /* 137 */
  15930. /***/ function(module, exports, __webpack_require__) {
  15931. var global = __webpack_require__(4)
  15932. , macrotask = __webpack_require__(68).set
  15933. , Observer = global.MutationObserver || global.WebKitMutationObserver
  15934. , process = global.process
  15935. , Promise = global.Promise
  15936. , isNode = __webpack_require__(24)(process) == 'process';
  15937. module.exports = function(){
  15938. var head, last, notify;
  15939. var flush = function(){
  15940. var parent, fn;
  15941. if(isNode && (parent = process.domain))parent.exit();
  15942. while(head){
  15943. fn = head.fn;
  15944. head = head.next;
  15945. try {
  15946. fn();
  15947. } catch(e){
  15948. if(head)notify();
  15949. else last = undefined;
  15950. throw e;
  15951. }
  15952. } last = undefined;
  15953. if(parent)parent.enter();
  15954. };
  15955. // Node.js
  15956. if(isNode){
  15957. notify = function(){
  15958. process.nextTick(flush);
  15959. };
  15960. // browsers with MutationObserver
  15961. } else if(Observer){
  15962. var toggle = true
  15963. , node = document.createTextNode('');
  15964. new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
  15965. notify = function(){
  15966. node.data = toggle = !toggle;
  15967. };
  15968. // environments with maybe non-completely correct, but existent Promise
  15969. } else if(Promise && Promise.resolve){
  15970. var promise = Promise.resolve();
  15971. notify = function(){
  15972. promise.then(flush);
  15973. };
  15974. // for other environments - macrotask based on:
  15975. // - setImmediate
  15976. // - MessageChannel
  15977. // - window.postMessag
  15978. // - onreadystatechange
  15979. // - setTimeout
  15980. } else {
  15981. notify = function(){
  15982. // strange IE + webpack dev server bug - use .call(global)
  15983. macrotask.call(global, flush);
  15984. };
  15985. }
  15986. return function(fn){
  15987. var task = {fn: fn, next: undefined};
  15988. if(last)last.next = task;
  15989. if(!head){
  15990. head = task;
  15991. notify();
  15992. } last = task;
  15993. };
  15994. };
  15995. /***/ },
  15996. /* 138 */
  15997. /***/ function(module, exports, __webpack_require__) {
  15998. "use strict";
  15999. 'use strict';
  16000. // 19.1.2.1 Object.assign(target, source, ...)
  16001. var getKeys = __webpack_require__(65)
  16002. , gOPS = __webpack_require__(141)
  16003. , pIE = __webpack_require__(144)
  16004. , toObject = __webpack_require__(70)
  16005. , IObject = __webpack_require__(62)
  16006. , $assign = Object.assign;
  16007. // should work with symbols and should have deterministic property order (V8 bug)
  16008. module.exports = !$assign || __webpack_require__(39)(function(){
  16009. var A = {}
  16010. , B = {}
  16011. , S = Symbol()
  16012. , K = 'abcdefghijklmnopqrst';
  16013. A[S] = 7;
  16014. K.split('').forEach(function(k){ B[k] = k; });
  16015. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  16016. }) ? function assign(target, source){ // eslint-disable-line no-unused-vars
  16017. var T = toObject(target)
  16018. , aLen = arguments.length
  16019. , index = 1
  16020. , getSymbols = gOPS.f
  16021. , isEnum = pIE.f;
  16022. while(aLen > index){
  16023. var S = IObject(arguments[index++])
  16024. , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
  16025. , length = keys.length
  16026. , j = 0
  16027. , key;
  16028. while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
  16029. } return T;
  16030. } : $assign;
  16031. /***/ },
  16032. /* 139 */
  16033. /***/ function(module, exports, __webpack_require__) {
  16034. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  16035. var anObject = __webpack_require__(10)
  16036. , dPs = __webpack_require__(140)
  16037. , enumBugKeys = __webpack_require__(60)
  16038. , IE_PROTO = __webpack_require__(41)('IE_PROTO')
  16039. , Empty = function(){ /* empty */ }
  16040. , PROTOTYPE = 'prototype';
  16041. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  16042. var createDict = function(){
  16043. // Thrash, waste and sodomy: IE GC bug
  16044. var iframe = __webpack_require__(38)('iframe')
  16045. , i = enumBugKeys.length
  16046. , lt = '<'
  16047. , gt = '>'
  16048. , iframeDocument;
  16049. iframe.style.display = 'none';
  16050. __webpack_require__(61).appendChild(iframe);
  16051. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  16052. // createDict = iframe.contentWindow.Object;
  16053. // html.removeChild(iframe);
  16054. iframeDocument = iframe.contentWindow.document;
  16055. iframeDocument.open();
  16056. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  16057. iframeDocument.close();
  16058. createDict = iframeDocument.F;
  16059. while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
  16060. return createDict();
  16061. };
  16062. module.exports = Object.create || function create(O, Properties){
  16063. var result;
  16064. if(O !== null){
  16065. Empty[PROTOTYPE] = anObject(O);
  16066. result = new Empty;
  16067. Empty[PROTOTYPE] = null;
  16068. // add "__proto__" for Object.getPrototypeOf polyfill
  16069. result[IE_PROTO] = O;
  16070. } else result = createDict();
  16071. return Properties === undefined ? result : dPs(result, Properties);
  16072. };
  16073. /***/ },
  16074. /* 140 */
  16075. /***/ function(module, exports, __webpack_require__) {
  16076. var dP = __webpack_require__(19)
  16077. , anObject = __webpack_require__(10)
  16078. , getKeys = __webpack_require__(65);
  16079. module.exports = __webpack_require__(11) ? Object.defineProperties : function defineProperties(O, Properties){
  16080. anObject(O);
  16081. var keys = getKeys(Properties)
  16082. , length = keys.length
  16083. , i = 0
  16084. , P;
  16085. while(length > i)dP.f(O, P = keys[i++], Properties[P]);
  16086. return O;
  16087. };
  16088. /***/ },
  16089. /* 141 */
  16090. /***/ function(module, exports) {
  16091. exports.f = Object.getOwnPropertySymbols;
  16092. /***/ },
  16093. /* 142 */
  16094. /***/ function(module, exports, __webpack_require__) {
  16095. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  16096. var has = __webpack_require__(27)
  16097. , toObject = __webpack_require__(70)
  16098. , IE_PROTO = __webpack_require__(41)('IE_PROTO')
  16099. , ObjectProto = Object.prototype;
  16100. module.exports = Object.getPrototypeOf || function(O){
  16101. O = toObject(O);
  16102. if(has(O, IE_PROTO))return O[IE_PROTO];
  16103. if(typeof O.constructor == 'function' && O instanceof O.constructor){
  16104. return O.constructor.prototype;
  16105. } return O instanceof Object ? ObjectProto : null;
  16106. };
  16107. /***/ },
  16108. /* 143 */
  16109. /***/ function(module, exports, __webpack_require__) {
  16110. var has = __webpack_require__(27)
  16111. , toIObject = __webpack_require__(43)
  16112. , arrayIndexOf = __webpack_require__(128)(false)
  16113. , IE_PROTO = __webpack_require__(41)('IE_PROTO');
  16114. module.exports = function(object, names){
  16115. var O = toIObject(object)
  16116. , i = 0
  16117. , result = []
  16118. , key;
  16119. for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
  16120. // Don't enum bug & hidden keys
  16121. while(names.length > i)if(has(O, key = names[i++])){
  16122. ~arrayIndexOf(result, key) || result.push(key);
  16123. }
  16124. return result;
  16125. };
  16126. /***/ },
  16127. /* 144 */
  16128. /***/ function(module, exports) {
  16129. exports.f = {}.propertyIsEnumerable;
  16130. /***/ },
  16131. /* 145 */
  16132. /***/ function(module, exports, __webpack_require__) {
  16133. var hide = __webpack_require__(12);
  16134. module.exports = function(target, src, safe){
  16135. for(var key in src){
  16136. if(safe && target[key])target[key] = src[key];
  16137. else hide(target, key, src[key]);
  16138. } return target;
  16139. };
  16140. /***/ },
  16141. /* 146 */
  16142. /***/ function(module, exports, __webpack_require__) {
  16143. module.exports = __webpack_require__(12);
  16144. /***/ },
  16145. /* 147 */
  16146. /***/ function(module, exports, __webpack_require__) {
  16147. "use strict";
  16148. 'use strict';
  16149. var global = __webpack_require__(4)
  16150. , core = __webpack_require__(6)
  16151. , dP = __webpack_require__(19)
  16152. , DESCRIPTORS = __webpack_require__(11)
  16153. , SPECIES = __webpack_require__(3)('species');
  16154. module.exports = function(KEY){
  16155. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  16156. if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
  16157. configurable: true,
  16158. get: function(){ return this; }
  16159. });
  16160. };
  16161. /***/ },
  16162. /* 148 */
  16163. /***/ function(module, exports, __webpack_require__) {
  16164. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  16165. var anObject = __webpack_require__(10)
  16166. , aFunction = __webpack_require__(36)
  16167. , SPECIES = __webpack_require__(3)('species');
  16168. module.exports = function(O, D){
  16169. var C = anObject(O).constructor, S;
  16170. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  16171. };
  16172. /***/ },
  16173. /* 149 */
  16174. /***/ function(module, exports, __webpack_require__) {
  16175. var toInteger = __webpack_require__(42)
  16176. , defined = __webpack_require__(37);
  16177. // true -> String#at
  16178. // false -> String#codePointAt
  16179. module.exports = function(TO_STRING){
  16180. return function(that, pos){
  16181. var s = String(defined(that))
  16182. , i = toInteger(pos)
  16183. , l = s.length
  16184. , a, b;
  16185. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  16186. a = s.charCodeAt(i);
  16187. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  16188. ? TO_STRING ? s.charAt(i) : a
  16189. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  16190. };
  16191. };
  16192. /***/ },
  16193. /* 150 */
  16194. /***/ function(module, exports, __webpack_require__) {
  16195. var toInteger = __webpack_require__(42)
  16196. , max = Math.max
  16197. , min = Math.min;
  16198. module.exports = function(index, length){
  16199. index = toInteger(index);
  16200. return index < 0 ? max(index + length, 0) : min(index, length);
  16201. };
  16202. /***/ },
  16203. /* 151 */
  16204. /***/ function(module, exports, __webpack_require__) {
  16205. // 7.1.1 ToPrimitive(input [, PreferredType])
  16206. var isObject = __webpack_require__(28);
  16207. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  16208. // and the second argument - flag - preferred type is a string
  16209. module.exports = function(it, S){
  16210. if(!isObject(it))return it;
  16211. var fn, val;
  16212. if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  16213. if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
  16214. if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
  16215. throw TypeError("Can't convert object to primitive value");
  16216. };
  16217. /***/ },
  16218. /* 152 */
  16219. /***/ function(module, exports, __webpack_require__) {
  16220. var classof = __webpack_require__(59)
  16221. , ITERATOR = __webpack_require__(3)('iterator')
  16222. , Iterators = __webpack_require__(18);
  16223. module.exports = __webpack_require__(6).getIteratorMethod = function(it){
  16224. if(it != undefined)return it[ITERATOR]
  16225. || it['@@iterator']
  16226. || Iterators[classof(it)];
  16227. };
  16228. /***/ },
  16229. /* 153 */
  16230. /***/ function(module, exports, __webpack_require__) {
  16231. "use strict";
  16232. 'use strict';
  16233. var addToUnscopables = __webpack_require__(126)
  16234. , step = __webpack_require__(136)
  16235. , Iterators = __webpack_require__(18)
  16236. , toIObject = __webpack_require__(43);
  16237. // 22.1.3.4 Array.prototype.entries()
  16238. // 22.1.3.13 Array.prototype.keys()
  16239. // 22.1.3.29 Array.prototype.values()
  16240. // 22.1.3.30 Array.prototype[@@iterator]()
  16241. module.exports = __webpack_require__(63)(Array, 'Array', function(iterated, kind){
  16242. this._t = toIObject(iterated); // target
  16243. this._i = 0; // next index
  16244. this._k = kind; // kind
  16245. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  16246. }, function(){
  16247. var O = this._t
  16248. , kind = this._k
  16249. , index = this._i++;
  16250. if(!O || index >= O.length){
  16251. this._t = undefined;
  16252. return step(1);
  16253. }
  16254. if(kind == 'keys' )return step(0, index);
  16255. if(kind == 'values')return step(0, O[index]);
  16256. return step(0, [index, O[index]]);
  16257. }, 'values');
  16258. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  16259. Iterators.Arguments = Iterators.Array;
  16260. addToUnscopables('keys');
  16261. addToUnscopables('values');
  16262. addToUnscopables('entries');
  16263. /***/ },
  16264. /* 154 */
  16265. /***/ function(module, exports, __webpack_require__) {
  16266. // 19.1.3.1 Object.assign(target, source)
  16267. var $export = __webpack_require__(26);
  16268. $export($export.S + $export.F, 'Object', {assign: __webpack_require__(138)});
  16269. /***/ },
  16270. /* 155 */
  16271. /***/ function(module, exports, __webpack_require__) {
  16272. var $export = __webpack_require__(26);
  16273. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  16274. $export($export.S + $export.F * !__webpack_require__(11), 'Object', {defineProperty: __webpack_require__(19).f});
  16275. /***/ },
  16276. /* 156 */
  16277. /***/ function(module, exports) {
  16278. /***/ },
  16279. /* 157 */
  16280. /***/ function(module, exports, __webpack_require__) {
  16281. "use strict";
  16282. 'use strict';
  16283. var LIBRARY = __webpack_require__(64)
  16284. , global = __webpack_require__(4)
  16285. , ctx = __webpack_require__(25)
  16286. , classof = __webpack_require__(59)
  16287. , $export = __webpack_require__(26)
  16288. , isObject = __webpack_require__(28)
  16289. , aFunction = __webpack_require__(36)
  16290. , anInstance = __webpack_require__(127)
  16291. , forOf = __webpack_require__(129)
  16292. , speciesConstructor = __webpack_require__(148)
  16293. , task = __webpack_require__(68).set
  16294. , microtask = __webpack_require__(137)()
  16295. , PROMISE = 'Promise'
  16296. , TypeError = global.TypeError
  16297. , process = global.process
  16298. , $Promise = global[PROMISE]
  16299. , process = global.process
  16300. , isNode = classof(process) == 'process'
  16301. , empty = function(){ /* empty */ }
  16302. , Internal, GenericPromiseCapability, Wrapper;
  16303. var USE_NATIVE = !!function(){
  16304. try {
  16305. // correct subclassing with @@species support
  16306. var promise = $Promise.resolve(1)
  16307. , FakePromise = (promise.constructor = {})[__webpack_require__(3)('species')] = function(exec){ exec(empty, empty); };
  16308. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  16309. return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
  16310. } catch(e){ /* empty */ }
  16311. }();
  16312. // helpers
  16313. var sameConstructor = function(a, b){
  16314. // with library wrapper special case
  16315. return a === b || a === $Promise && b === Wrapper;
  16316. };
  16317. var isThenable = function(it){
  16318. var then;
  16319. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  16320. };
  16321. var newPromiseCapability = function(C){
  16322. return sameConstructor($Promise, C)
  16323. ? new PromiseCapability(C)
  16324. : new GenericPromiseCapability(C);
  16325. };
  16326. var PromiseCapability = GenericPromiseCapability = function(C){
  16327. var resolve, reject;
  16328. this.promise = new C(function($$resolve, $$reject){
  16329. if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor');
  16330. resolve = $$resolve;
  16331. reject = $$reject;
  16332. });
  16333. this.resolve = aFunction(resolve);
  16334. this.reject = aFunction(reject);
  16335. };
  16336. var perform = function(exec){
  16337. try {
  16338. exec();
  16339. } catch(e){
  16340. return {error: e};
  16341. }
  16342. };
  16343. var notify = function(promise, isReject){
  16344. if(promise._n)return;
  16345. promise._n = true;
  16346. var chain = promise._c;
  16347. microtask(function(){
  16348. var value = promise._v
  16349. , ok = promise._s == 1
  16350. , i = 0;
  16351. var run = function(reaction){
  16352. var handler = ok ? reaction.ok : reaction.fail
  16353. , resolve = reaction.resolve
  16354. , reject = reaction.reject
  16355. , domain = reaction.domain
  16356. , result, then;
  16357. try {
  16358. if(handler){
  16359. if(!ok){
  16360. if(promise._h == 2)onHandleUnhandled(promise);
  16361. promise._h = 1;
  16362. }
  16363. if(handler === true)result = value;
  16364. else {
  16365. if(domain)domain.enter();
  16366. result = handler(value);
  16367. if(domain)domain.exit();
  16368. }
  16369. if(result === reaction.promise){
  16370. reject(TypeError('Promise-chain cycle'));
  16371. } else if(then = isThenable(result)){
  16372. then.call(result, resolve, reject);
  16373. } else resolve(result);
  16374. } else reject(value);
  16375. } catch(e){
  16376. reject(e);
  16377. }
  16378. };
  16379. while(chain.length > i)run(chain[i++]); // variable length - can't use forEach
  16380. promise._c = [];
  16381. promise._n = false;
  16382. if(isReject && !promise._h)onUnhandled(promise);
  16383. });
  16384. };
  16385. var onUnhandled = function(promise){
  16386. task.call(global, function(){
  16387. var value = promise._v
  16388. , abrupt, handler, console;
  16389. if(isUnhandled(promise)){
  16390. abrupt = perform(function(){
  16391. if(isNode){
  16392. process.emit('unhandledRejection', value, promise);
  16393. } else if(handler = global.onunhandledrejection){
  16394. handler({promise: promise, reason: value});
  16395. } else if((console = global.console) && console.error){
  16396. console.error('Unhandled promise rejection', value);
  16397. }
  16398. });
  16399. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  16400. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  16401. } promise._a = undefined;
  16402. if(abrupt)throw abrupt.error;
  16403. });
  16404. };
  16405. var isUnhandled = function(promise){
  16406. if(promise._h == 1)return false;
  16407. var chain = promise._a || promise._c
  16408. , i = 0
  16409. , reaction;
  16410. while(chain.length > i){
  16411. reaction = chain[i++];
  16412. if(reaction.fail || !isUnhandled(reaction.promise))return false;
  16413. } return true;
  16414. };
  16415. var onHandleUnhandled = function(promise){
  16416. task.call(global, function(){
  16417. var handler;
  16418. if(isNode){
  16419. process.emit('rejectionHandled', promise);
  16420. } else if(handler = global.onrejectionhandled){
  16421. handler({promise: promise, reason: promise._v});
  16422. }
  16423. });
  16424. };
  16425. var $reject = function(value){
  16426. var promise = this;
  16427. if(promise._d)return;
  16428. promise._d = true;
  16429. promise = promise._w || promise; // unwrap
  16430. promise._v = value;
  16431. promise._s = 2;
  16432. if(!promise._a)promise._a = promise._c.slice();
  16433. notify(promise, true);
  16434. };
  16435. var $resolve = function(value){
  16436. var promise = this
  16437. , then;
  16438. if(promise._d)return;
  16439. promise._d = true;
  16440. promise = promise._w || promise; // unwrap
  16441. try {
  16442. if(promise === value)throw TypeError("Promise can't be resolved itself");
  16443. if(then = isThenable(value)){
  16444. microtask(function(){
  16445. var wrapper = {_w: promise, _d: false}; // wrap
  16446. try {
  16447. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  16448. } catch(e){
  16449. $reject.call(wrapper, e);
  16450. }
  16451. });
  16452. } else {
  16453. promise._v = value;
  16454. promise._s = 1;
  16455. notify(promise, false);
  16456. }
  16457. } catch(e){
  16458. $reject.call({_w: promise, _d: false}, e); // wrap
  16459. }
  16460. };
  16461. // constructor polyfill
  16462. if(!USE_NATIVE){
  16463. // 25.4.3.1 Promise(executor)
  16464. $Promise = function Promise(executor){
  16465. anInstance(this, $Promise, PROMISE, '_h');
  16466. aFunction(executor);
  16467. Internal.call(this);
  16468. try {
  16469. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  16470. } catch(err){
  16471. $reject.call(this, err);
  16472. }
  16473. };
  16474. Internal = function Promise(executor){
  16475. this._c = []; // <- awaiting reactions
  16476. this._a = undefined; // <- checked in isUnhandled reactions
  16477. this._s = 0; // <- state
  16478. this._d = false; // <- done
  16479. this._v = undefined; // <- value
  16480. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  16481. this._n = false; // <- notify
  16482. };
  16483. Internal.prototype = __webpack_require__(145)($Promise.prototype, {
  16484. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  16485. then: function then(onFulfilled, onRejected){
  16486. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  16487. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  16488. reaction.fail = typeof onRejected == 'function' && onRejected;
  16489. reaction.domain = isNode ? process.domain : undefined;
  16490. this._c.push(reaction);
  16491. if(this._a)this._a.push(reaction);
  16492. if(this._s)notify(this, false);
  16493. return reaction.promise;
  16494. },
  16495. // 25.4.5.1 Promise.prototype.catch(onRejected)
  16496. 'catch': function(onRejected){
  16497. return this.then(undefined, onRejected);
  16498. }
  16499. });
  16500. PromiseCapability = function(){
  16501. var promise = new Internal;
  16502. this.promise = promise;
  16503. this.resolve = ctx($resolve, promise, 1);
  16504. this.reject = ctx($reject, promise, 1);
  16505. };
  16506. }
  16507. $export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise});
  16508. __webpack_require__(40)($Promise, PROMISE);
  16509. __webpack_require__(147)(PROMISE);
  16510. Wrapper = __webpack_require__(6)[PROMISE];
  16511. // statics
  16512. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  16513. // 25.4.4.5 Promise.reject(r)
  16514. reject: function reject(r){
  16515. var capability = newPromiseCapability(this)
  16516. , $$reject = capability.reject;
  16517. $$reject(r);
  16518. return capability.promise;
  16519. }
  16520. });
  16521. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  16522. // 25.4.4.6 Promise.resolve(x)
  16523. resolve: function resolve(x){
  16524. // instanceof instead of internal slot check because we should fix it without replacement native Promise core
  16525. if(x instanceof $Promise && sameConstructor(x.constructor, this))return x;
  16526. var capability = newPromiseCapability(this)
  16527. , $$resolve = capability.resolve;
  16528. $$resolve(x);
  16529. return capability.promise;
  16530. }
  16531. });
  16532. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(135)(function(iter){
  16533. $Promise.all(iter)['catch'](empty);
  16534. })), PROMISE, {
  16535. // 25.4.4.1 Promise.all(iterable)
  16536. all: function all(iterable){
  16537. var C = this
  16538. , capability = newPromiseCapability(C)
  16539. , resolve = capability.resolve
  16540. , reject = capability.reject;
  16541. var abrupt = perform(function(){
  16542. var values = []
  16543. , index = 0
  16544. , remaining = 1;
  16545. forOf(iterable, false, function(promise){
  16546. var $index = index++
  16547. , alreadyCalled = false;
  16548. values.push(undefined);
  16549. remaining++;
  16550. C.resolve(promise).then(function(value){
  16551. if(alreadyCalled)return;
  16552. alreadyCalled = true;
  16553. values[$index] = value;
  16554. --remaining || resolve(values);
  16555. }, reject);
  16556. });
  16557. --remaining || resolve(values);
  16558. });
  16559. if(abrupt)reject(abrupt.error);
  16560. return capability.promise;
  16561. },
  16562. // 25.4.4.4 Promise.race(iterable)
  16563. race: function race(iterable){
  16564. var C = this
  16565. , capability = newPromiseCapability(C)
  16566. , reject = capability.reject;
  16567. var abrupt = perform(function(){
  16568. forOf(iterable, false, function(promise){
  16569. C.resolve(promise).then(capability.resolve, reject);
  16570. });
  16571. });
  16572. if(abrupt)reject(abrupt.error);
  16573. return capability.promise;
  16574. }
  16575. });
  16576. /***/ },
  16577. /* 158 */
  16578. /***/ function(module, exports, __webpack_require__) {
  16579. "use strict";
  16580. 'use strict';
  16581. var $at = __webpack_require__(149)(true);
  16582. // 21.1.3.27 String.prototype[@@iterator]()
  16583. __webpack_require__(63)(String, 'String', function(iterated){
  16584. this._t = String(iterated); // target
  16585. this._i = 0; // next index
  16586. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  16587. }, function(){
  16588. var O = this._t
  16589. , index = this._i
  16590. , point;
  16591. if(index >= O.length)return {value: undefined, done: true};
  16592. point = $at(O, index);
  16593. this._i += point.length;
  16594. return {value: point, done: false};
  16595. });
  16596. /***/ },
  16597. /* 159 */
  16598. /***/ function(module, exports, __webpack_require__) {
  16599. __webpack_require__(153);
  16600. var global = __webpack_require__(4)
  16601. , hide = __webpack_require__(12)
  16602. , Iterators = __webpack_require__(18)
  16603. , TO_STRING_TAG = __webpack_require__(3)('toStringTag');
  16604. for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
  16605. var NAME = collections[i]
  16606. , Collection = global[NAME]
  16607. , proto = Collection && Collection.prototype;
  16608. if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
  16609. Iterators[NAME] = Iterators.Array;
  16610. }
  16611. /***/ },
  16612. /* 160 */
  16613. /***/ function(module, exports, __webpack_require__) {
  16614. "use strict";
  16615. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  16616. var inherits = __webpack_require__(1)
  16617. var md5 = __webpack_require__(162)
  16618. var rmd160 = __webpack_require__(188)
  16619. var sha = __webpack_require__(190)
  16620. var Base = __webpack_require__(119)
  16621. function HashNoConstructor(hash) {
  16622. Base.call(this, 'digest')
  16623. this._hash = hash
  16624. this.buffers = []
  16625. }
  16626. inherits(HashNoConstructor, Base)
  16627. HashNoConstructor.prototype._update = function (data) {
  16628. this.buffers.push(data)
  16629. }
  16630. HashNoConstructor.prototype._final = function () {
  16631. var buf = Buffer.concat(this.buffers)
  16632. var r = this._hash(buf)
  16633. this.buffers = null
  16634. return r
  16635. }
  16636. function Hash(hash) {
  16637. Base.call(this, 'digest')
  16638. this._hash = hash
  16639. }
  16640. inherits(Hash, Base)
  16641. Hash.prototype._update = function (data) {
  16642. this._hash.update(data)
  16643. }
  16644. Hash.prototype._final = function () {
  16645. return this._hash.digest()
  16646. }
  16647. module.exports = function createHash (alg) {
  16648. alg = alg.toLowerCase()
  16649. if ('md5' === alg) return new HashNoConstructor(md5)
  16650. if ('rmd160' === alg || 'ripemd160' === alg) return new HashNoConstructor(rmd160)
  16651. return new Hash(sha(alg))
  16652. }
  16653. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  16654. /***/ },
  16655. /* 161 */
  16656. /***/ function(module, exports, __webpack_require__) {
  16657. "use strict";
  16658. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  16659. var intSize = 4;
  16660. var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
  16661. var chrsz = 8;
  16662. function toArray(buf, bigEndian) {
  16663. if ((buf.length % intSize) !== 0) {
  16664. var len = buf.length + (intSize - (buf.length % intSize));
  16665. buf = Buffer.concat([buf, zeroBuffer], len);
  16666. }
  16667. var arr = [];
  16668. var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
  16669. for (var i = 0; i < buf.length; i += intSize) {
  16670. arr.push(fn.call(buf, i));
  16671. }
  16672. return arr;
  16673. }
  16674. function toBuffer(arr, size, bigEndian) {
  16675. var buf = new Buffer(size);
  16676. var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
  16677. for (var i = 0; i < arr.length; i++) {
  16678. fn.call(buf, arr[i], i * 4, true);
  16679. }
  16680. return buf;
  16681. }
  16682. function hash(buf, fn, hashSize, bigEndian) {
  16683. if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
  16684. var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
  16685. return toBuffer(arr, hashSize, bigEndian);
  16686. }
  16687. exports.hash = hash;
  16688. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  16689. /***/ },
  16690. /* 162 */
  16691. /***/ function(module, exports, __webpack_require__) {
  16692. "use strict";
  16693. 'use strict';
  16694. /*
  16695. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
  16696. * Digest Algorithm, as defined in RFC 1321.
  16697. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
  16698. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  16699. * Distributed under the BSD License
  16700. * See http://pajhome.org.uk/crypt/md5 for more info.
  16701. */
  16702. var helpers = __webpack_require__(161);
  16703. /*
  16704. * Calculate the MD5 of an array of little-endian words, and a bit length
  16705. */
  16706. function core_md5(x, len)
  16707. {
  16708. /* append padding */
  16709. x[len >> 5] |= 0x80 << ((len) % 32);
  16710. x[(((len + 64) >>> 9) << 4) + 14] = len;
  16711. var a = 1732584193;
  16712. var b = -271733879;
  16713. var c = -1732584194;
  16714. var d = 271733878;
  16715. for(var i = 0; i < x.length; i += 16)
  16716. {
  16717. var olda = a;
  16718. var oldb = b;
  16719. var oldc = c;
  16720. var oldd = d;
  16721. a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
  16722. d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
  16723. c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
  16724. b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
  16725. a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
  16726. d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
  16727. c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
  16728. b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
  16729. a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
  16730. d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
  16731. c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
  16732. b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
  16733. a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
  16734. d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
  16735. c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
  16736. b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
  16737. a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
  16738. d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
  16739. c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
  16740. b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
  16741. a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
  16742. d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
  16743. c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
  16744. b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
  16745. a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
  16746. d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
  16747. c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
  16748. b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
  16749. a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
  16750. d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
  16751. c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
  16752. b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
  16753. a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
  16754. d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
  16755. c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
  16756. b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
  16757. a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
  16758. d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
  16759. c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
  16760. b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
  16761. a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
  16762. d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
  16763. c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
  16764. b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
  16765. a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
  16766. d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
  16767. c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
  16768. b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
  16769. a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
  16770. d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
  16771. c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
  16772. b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
  16773. a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
  16774. d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
  16775. c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
  16776. b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
  16777. a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
  16778. d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
  16779. c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
  16780. b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
  16781. a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
  16782. d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
  16783. c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
  16784. b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
  16785. a = safe_add(a, olda);
  16786. b = safe_add(b, oldb);
  16787. c = safe_add(c, oldc);
  16788. d = safe_add(d, oldd);
  16789. }
  16790. return Array(a, b, c, d);
  16791. }
  16792. /*
  16793. * These functions implement the four basic operations the algorithm uses.
  16794. */
  16795. function md5_cmn(q, a, b, x, s, t)
  16796. {
  16797. return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
  16798. }
  16799. function md5_ff(a, b, c, d, x, s, t)
  16800. {
  16801. return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
  16802. }
  16803. function md5_gg(a, b, c, d, x, s, t)
  16804. {
  16805. return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
  16806. }
  16807. function md5_hh(a, b, c, d, x, s, t)
  16808. {
  16809. return md5_cmn(b ^ c ^ d, a, b, x, s, t);
  16810. }
  16811. function md5_ii(a, b, c, d, x, s, t)
  16812. {
  16813. return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
  16814. }
  16815. /*
  16816. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  16817. * to work around bugs in some JS interpreters.
  16818. */
  16819. function safe_add(x, y)
  16820. {
  16821. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  16822. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  16823. return (msw << 16) | (lsw & 0xFFFF);
  16824. }
  16825. /*
  16826. * Bitwise rotate a 32-bit number to the left.
  16827. */
  16828. function bit_rol(num, cnt)
  16829. {
  16830. return (num << cnt) | (num >>> (32 - cnt));
  16831. }
  16832. module.exports = function md5(buf) {
  16833. return helpers.hash(buf, core_md5, 16);
  16834. };
  16835. /***/ },
  16836. /* 163 */
  16837. /***/ function(module, exports, __webpack_require__) {
  16838. exports = module.exports = __webpack_require__(29)();
  16839. // imports
  16840. // module
  16841. exports.push([module.i, "\n#fingerprint {\n min-width: 90px;\n text-align: center;\n background-color: transparent;\n color: white;\n}\n#fingerprint i {\n color: black;\n position: relative;\n padding: 0;\n text-shadow: 1px 1px 0 white;\n font-size: 1.3em;\n}\n", ""]);
  16842. // exports
  16843. /***/ },
  16844. /* 164 */
  16845. /***/ function(module, exports, __webpack_require__) {
  16846. exports = module.exports = __webpack_require__(29)();
  16847. // imports
  16848. // module
  16849. exports.push([module.i, "\n#password-generator {\n color: #555;\n}\n.inner-addon i {\n position: absolute;\n padding: 10px;\n pointer-events: none;\n z-index: 10;\n}\n.inner-addon {\n position: relative;\n}\n.left-addon i {\n left: 0;\n}\n.right-addon i {\n right: 0;\n}\n.left-addon input {\n padding-left: 30px;\n}\n.right-addon input {\n padding-right: 30px;\n}\n", ""]);
  16850. // exports
  16851. /***/ },
  16852. /* 165 */
  16853. /***/ function(module, exports, __webpack_require__) {
  16854. exports = module.exports = __webpack_require__(29)();
  16855. // imports
  16856. // module
  16857. exports.push([module.i, "\n#lesspass .white-link {\n color: white;\n}\n@media (max-width: 544px) {\n#lesspass.card {\n border: none;\n}\n}\n#lesspass .white-link:hover, #lesspass .white-link:focus, #lesspass .white-link:active {\n text-decoration: none;\n color: white;\n}\n#lesspass, #lesspass * {\n border-radius: 0 !important;\n}\n", ""]);
  16858. // exports
  16859. /***/ },
  16860. /* 166 */
  16861. /***/ function(module, exports, __webpack_require__) {
  16862. exports = module.exports = __webpack_require__(29)();
  16863. // imports
  16864. // module
  16865. exports.push([module.i, "\n.white-link {\n color: white;\n}\n.white-link:hover, .white-link:focus, .white-link:active {\n text-decoration: none;\n color: white;\n}\n.fa-clickable {\n cursor: pointer;\n}\n", ""]);
  16866. // exports
  16867. /***/ },
  16868. /* 167 */
  16869. /***/ function(module, exports) {
  16870. /**
  16871. * A polyfill for Element.matches()
  16872. */
  16873. if (Element && !Element.prototype.matches) {
  16874. var proto = Element.prototype;
  16875. proto.matches = proto.matchesSelector ||
  16876. proto.mozMatchesSelector ||
  16877. proto.msMatchesSelector ||
  16878. proto.oMatchesSelector ||
  16879. proto.webkitMatchesSelector;
  16880. }
  16881. /**
  16882. * Finds the closest parent that matches a selector.
  16883. *
  16884. * @param {Element} element
  16885. * @param {String} selector
  16886. * @return {Function}
  16887. */
  16888. function closest (element, selector) {
  16889. while (element && element !== document) {
  16890. if (element.matches(selector)) return element;
  16891. element = element.parentNode;
  16892. }
  16893. }
  16894. module.exports = closest;
  16895. /***/ },
  16896. /* 168 */
  16897. /***/ function(module, exports, __webpack_require__) {
  16898. var closest = __webpack_require__(167);
  16899. /**
  16900. * Delegates event to a selector.
  16901. *
  16902. * @param {Element} element
  16903. * @param {String} selector
  16904. * @param {String} type
  16905. * @param {Function} callback
  16906. * @param {Boolean} useCapture
  16907. * @return {Object}
  16908. */
  16909. function delegate(element, selector, type, callback, useCapture) {
  16910. var listenerFn = listener.apply(this, arguments);
  16911. element.addEventListener(type, listenerFn, useCapture);
  16912. return {
  16913. destroy: function() {
  16914. element.removeEventListener(type, listenerFn, useCapture);
  16915. }
  16916. }
  16917. }
  16918. /**
  16919. * Finds closest match and invokes callback.
  16920. *
  16921. * @param {Element} element
  16922. * @param {String} selector
  16923. * @param {String} type
  16924. * @param {Function} callback
  16925. * @return {Function}
  16926. */
  16927. function listener(element, selector, type, callback) {
  16928. return function(e) {
  16929. e.delegateTarget = closest(e.target, selector);
  16930. if (e.delegateTarget) {
  16931. callback.call(element, e);
  16932. }
  16933. }
  16934. }
  16935. module.exports = delegate;
  16936. /***/ },
  16937. /* 169 */
  16938. /***/ function(module, exports) {
  16939. /**
  16940. * Check if argument is a HTML element.
  16941. *
  16942. * @param {Object} value
  16943. * @return {Boolean}
  16944. */
  16945. exports.node = function(value) {
  16946. return value !== undefined
  16947. && value instanceof HTMLElement
  16948. && value.nodeType === 1;
  16949. };
  16950. /**
  16951. * Check if argument is a list of HTML elements.
  16952. *
  16953. * @param {Object} value
  16954. * @return {Boolean}
  16955. */
  16956. exports.nodeList = function(value) {
  16957. var type = Object.prototype.toString.call(value);
  16958. return value !== undefined
  16959. && (type === '[object NodeList]' || type === '[object HTMLCollection]')
  16960. && ('length' in value)
  16961. && (value.length === 0 || exports.node(value[0]));
  16962. };
  16963. /**
  16964. * Check if argument is a string.
  16965. *
  16966. * @param {Object} value
  16967. * @return {Boolean}
  16968. */
  16969. exports.string = function(value) {
  16970. return typeof value === 'string'
  16971. || value instanceof String;
  16972. };
  16973. /**
  16974. * Check if argument is a function.
  16975. *
  16976. * @param {Object} value
  16977. * @return {Boolean}
  16978. */
  16979. exports.fn = function(value) {
  16980. var type = Object.prototype.toString.call(value);
  16981. return type === '[object Function]';
  16982. };
  16983. /***/ },
  16984. /* 170 */
  16985. /***/ function(module, exports, __webpack_require__) {
  16986. var is = __webpack_require__(169);
  16987. var delegate = __webpack_require__(168);
  16988. /**
  16989. * Validates all params and calls the right
  16990. * listener function based on its target type.
  16991. *
  16992. * @param {String|HTMLElement|HTMLCollection|NodeList} target
  16993. * @param {String} type
  16994. * @param {Function} callback
  16995. * @return {Object}
  16996. */
  16997. function listen(target, type, callback) {
  16998. if (!target && !type && !callback) {
  16999. throw new Error('Missing required arguments');
  17000. }
  17001. if (!is.string(type)) {
  17002. throw new TypeError('Second argument must be a String');
  17003. }
  17004. if (!is.fn(callback)) {
  17005. throw new TypeError('Third argument must be a Function');
  17006. }
  17007. if (is.node(target)) {
  17008. return listenNode(target, type, callback);
  17009. }
  17010. else if (is.nodeList(target)) {
  17011. return listenNodeList(target, type, callback);
  17012. }
  17013. else if (is.string(target)) {
  17014. return listenSelector(target, type, callback);
  17015. }
  17016. else {
  17017. throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
  17018. }
  17019. }
  17020. /**
  17021. * Adds an event listener to a HTML element
  17022. * and returns a remove listener function.
  17023. *
  17024. * @param {HTMLElement} node
  17025. * @param {String} type
  17026. * @param {Function} callback
  17027. * @return {Object}
  17028. */
  17029. function listenNode(node, type, callback) {
  17030. node.addEventListener(type, callback);
  17031. return {
  17032. destroy: function() {
  17033. node.removeEventListener(type, callback);
  17034. }
  17035. }
  17036. }
  17037. /**
  17038. * Add an event listener to a list of HTML elements
  17039. * and returns a remove listener function.
  17040. *
  17041. * @param {NodeList|HTMLCollection} nodeList
  17042. * @param {String} type
  17043. * @param {Function} callback
  17044. * @return {Object}
  17045. */
  17046. function listenNodeList(nodeList, type, callback) {
  17047. Array.prototype.forEach.call(nodeList, function(node) {
  17048. node.addEventListener(type, callback);
  17049. });
  17050. return {
  17051. destroy: function() {
  17052. Array.prototype.forEach.call(nodeList, function(node) {
  17053. node.removeEventListener(type, callback);
  17054. });
  17055. }
  17056. }
  17057. }
  17058. /**
  17059. * Add an event listener to a selector
  17060. * and returns a remove listener function.
  17061. *
  17062. * @param {String} selector
  17063. * @param {String} type
  17064. * @param {Function} callback
  17065. * @return {Object}
  17066. */
  17067. function listenSelector(selector, type, callback) {
  17068. return delegate(document.body, selector, type, callback);
  17069. }
  17070. module.exports = listen;
  17071. /***/ },
  17072. /* 171 */
  17073. /***/ function(module, exports) {
  17074. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  17075. var e, m
  17076. var eLen = nBytes * 8 - mLen - 1
  17077. var eMax = (1 << eLen) - 1
  17078. var eBias = eMax >> 1
  17079. var nBits = -7
  17080. var i = isLE ? (nBytes - 1) : 0
  17081. var d = isLE ? -1 : 1
  17082. var s = buffer[offset + i]
  17083. i += d
  17084. e = s & ((1 << (-nBits)) - 1)
  17085. s >>= (-nBits)
  17086. nBits += eLen
  17087. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  17088. m = e & ((1 << (-nBits)) - 1)
  17089. e >>= (-nBits)
  17090. nBits += mLen
  17091. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  17092. if (e === 0) {
  17093. e = 1 - eBias
  17094. } else if (e === eMax) {
  17095. return m ? NaN : ((s ? -1 : 1) * Infinity)
  17096. } else {
  17097. m = m + Math.pow(2, mLen)
  17098. e = e - eBias
  17099. }
  17100. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  17101. }
  17102. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  17103. var e, m, c
  17104. var eLen = nBytes * 8 - mLen - 1
  17105. var eMax = (1 << eLen) - 1
  17106. var eBias = eMax >> 1
  17107. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  17108. var i = isLE ? 0 : (nBytes - 1)
  17109. var d = isLE ? 1 : -1
  17110. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  17111. value = Math.abs(value)
  17112. if (isNaN(value) || value === Infinity) {
  17113. m = isNaN(value) ? 1 : 0
  17114. e = eMax
  17115. } else {
  17116. e = Math.floor(Math.log(value) / Math.LN2)
  17117. if (value * (c = Math.pow(2, -e)) < 1) {
  17118. e--
  17119. c *= 2
  17120. }
  17121. if (e + eBias >= 1) {
  17122. value += rt / c
  17123. } else {
  17124. value += rt * Math.pow(2, 1 - eBias)
  17125. }
  17126. if (value * c >= 2) {
  17127. e++
  17128. c /= 2
  17129. }
  17130. if (e + eBias >= eMax) {
  17131. m = 0
  17132. e = eMax
  17133. } else if (e + eBias >= 1) {
  17134. m = (value * c - 1) * Math.pow(2, mLen)
  17135. e = e + eBias
  17136. } else {
  17137. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  17138. e = 0
  17139. }
  17140. }
  17141. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  17142. e = (e << mLen) | m
  17143. eLen += mLen
  17144. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  17145. buffer[offset + i - d] |= s * 128
  17146. }
  17147. /***/ },
  17148. /* 172 */
  17149. /***/ function(module, exports) {
  17150. /**
  17151. * The code was extracted from:
  17152. * https://github.com/davidchambers/Base64.js
  17153. */
  17154. var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  17155. function InvalidCharacterError(message) {
  17156. this.message = message;
  17157. }
  17158. InvalidCharacterError.prototype = new Error();
  17159. InvalidCharacterError.prototype.name = 'InvalidCharacterError';
  17160. function polyfill (input) {
  17161. var str = String(input).replace(/=+$/, '');
  17162. if (str.length % 4 == 1) {
  17163. throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
  17164. }
  17165. for (
  17166. // initialize result and counters
  17167. var bc = 0, bs, buffer, idx = 0, output = '';
  17168. // get next character
  17169. buffer = str.charAt(idx++);
  17170. // character found in table? initialize bit storage and add its ascii value;
  17171. ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
  17172. // and if not first of each 4 characters,
  17173. // convert the first 8 bits to one ascii character
  17174. bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
  17175. ) {
  17176. // try to find character in table (0-63, not found => -1)
  17177. buffer = chars.indexOf(buffer);
  17178. }
  17179. return output;
  17180. }
  17181. module.exports = typeof window !== 'undefined' && window.atob && window.atob.bind(window) || polyfill;
  17182. /***/ },
  17183. /* 173 */
  17184. /***/ function(module, exports, __webpack_require__) {
  17185. var atob = __webpack_require__(172);
  17186. function b64DecodeUnicode(str) {
  17187. return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
  17188. var code = p.charCodeAt(0).toString(16).toUpperCase();
  17189. if (code.length < 2) {
  17190. code = '0' + code;
  17191. }
  17192. return '%' + code;
  17193. }));
  17194. }
  17195. module.exports = function(str) {
  17196. var output = str.replace(/-/g, "+").replace(/_/g, "/");
  17197. switch (output.length % 4) {
  17198. case 0:
  17199. break;
  17200. case 2:
  17201. output += "==";
  17202. break;
  17203. case 3:
  17204. output += "=";
  17205. break;
  17206. default:
  17207. throw "Illegal base64url string!";
  17208. }
  17209. try{
  17210. return b64DecodeUnicode(output);
  17211. } catch (err) {
  17212. return atob(output);
  17213. }
  17214. };
  17215. /***/ },
  17216. /* 174 */
  17217. /***/ function(module, exports, __webpack_require__) {
  17218. "use strict";
  17219. 'use strict';
  17220. var base64_url_decode = __webpack_require__(173);
  17221. module.exports = function (token,options) {
  17222. if (typeof token !== 'string') {
  17223. throw new Error('Invalid token specified');
  17224. }
  17225. options = options || {};
  17226. var pos = options.header === true ? 0 : 1;
  17227. return JSON.parse(base64_url_decode(token.split('.')[pos]));
  17228. };
  17229. /***/ },
  17230. /* 175 */
  17231. /***/ function(module, exports, __webpack_require__) {
  17232. /* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2 = __webpack_require__(45);
  17233. var createHMAC = __webpack_require__(72);
  17234. var Promise = __webpack_require__(74);
  17235. module.exports = {
  17236. encryptLogin: encryptLogin,
  17237. renderPassword: renderPassword,
  17238. createFingerprint: createFingerprint,
  17239. _deriveEncryptedLogin: deriveEncryptedLogin,
  17240. _getPasswordTemplate: getPasswordTemplate,
  17241. _prettyPrint: prettyPrint,
  17242. _string2charCodes: string2charCodes,
  17243. _getCharType: getCharType,
  17244. _getPasswordChar: getPasswordChar,
  17245. _createHmac: createHmac,
  17246. };
  17247. function encryptLogin(login, masterPassword, options) {
  17248. var _options = options !== undefined ? options : {};
  17249. var iterations = _options.iterations || 8192;
  17250. var keylen = _options.keylen || 32;
  17251. return pbkdf2(masterPassword, login, iterations, keylen, 'sha256');
  17252. }
  17253. function renderPassword(encryptedLogin, site, passwordOptions) {
  17254. return deriveEncryptedLogin(encryptedLogin, site, passwordOptions).then(function (derivedEncryptedLogin) {
  17255. var template = passwordOptions.template || getPasswordTemplate(passwordOptions);
  17256. return prettyPrint(derivedEncryptedLogin, template);
  17257. });
  17258. }
  17259. function createHmac(encryptedLogin, salt) {
  17260. return new Promise(function (resolve) {
  17261. resolve(createHMAC('sha256', new Buffer(encryptedLogin)).update(salt).digest('hex'));
  17262. });
  17263. }
  17264. function deriveEncryptedLogin(encryptedLogin, site, options) {
  17265. var _options = options !== undefined ? options : {};
  17266. var length = _options.length || 12;
  17267. var counter = _options.counter || 1;
  17268. var salt = site + counter.toString();
  17269. return createHmac(encryptedLogin, salt).then(function (derivedHash) {
  17270. return derivedHash.substring(0, length);
  17271. });
  17272. }
  17273. function getPasswordTemplate(passwordTypes) {
  17274. var templates = {
  17275. lowercase: 'vc',
  17276. uppercase: 'VC',
  17277. numbers: 'n',
  17278. symbols: 's',
  17279. };
  17280. var returnedTemplate = '';
  17281. Object.keys(templates).forEach(function (template) {
  17282. if (passwordTypes.hasOwnProperty(template) && passwordTypes[template]) {
  17283. returnedTemplate += templates[template]
  17284. }
  17285. });
  17286. return returnedTemplate;
  17287. }
  17288. function prettyPrint(hash, template) {
  17289. var password = '';
  17290. string2charCodes(hash).forEach(function (charCode, index) {
  17291. var charType = getCharType(template, index);
  17292. password += getPasswordChar(charType, charCode);
  17293. });
  17294. return password;
  17295. }
  17296. function string2charCodes(text) {
  17297. var charCodes = [];
  17298. for (var i = 0; i < text.length; i++) {
  17299. charCodes.push(text.charCodeAt(i));
  17300. }
  17301. return charCodes;
  17302. }
  17303. function getCharType(template, index) {
  17304. return template[index % template.length];
  17305. }
  17306. function getPasswordChar(charType, index) {
  17307. var passwordsChars = {
  17308. V: 'AEIOUY',
  17309. C: 'BCDFGHJKLMNPQRSTVWXZ',
  17310. v: 'aeiouy',
  17311. c: 'bcdfghjklmnpqrstvwxz',
  17312. A: 'AEIOUYBCDFGHJKLMNPQRSTVWXZ',
  17313. a: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz',
  17314. n: '0123456789',
  17315. s: '@&%?,=[]_:-+*$#!\'^~;()/.',
  17316. x: 'AEIOUYaeiouyBCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz0123456789@&%?,=[]_:-+*$#!\'^~;()/.'
  17317. };
  17318. var passwordChar = passwordsChars[charType];
  17319. return passwordChar[index % passwordChar.length];
  17320. }
  17321. function createFingerprint(str) {
  17322. return new Promise(function (resolve) {
  17323. resolve(createHMAC('sha256', new Buffer(str)).digest('hex'))
  17324. });
  17325. }
  17326. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  17327. /***/ },
  17328. /* 176 */
  17329. /***/ function(module, exports, __webpack_require__) {
  17330. var pbkdf2 = __webpack_require__(45);
  17331. var bigInt = __webpack_require__(118);
  17332. module.exports = {
  17333. generatePassword: generatePassword,
  17334. _calcEntropy: calcEntropy,
  17335. _consumeEntropy: consumeEntropy,
  17336. _getSetOfCharacters: getSetOfCharacters,
  17337. _getConfiguredRules: getConfiguredRules,
  17338. _insertStringPseudoRandomly: insertStringPseudoRandomly,
  17339. _getOneCharPerRule: getOneCharPerRule,
  17340. _renderPassword: renderPassword
  17341. };
  17342. function generatePassword(site, login, masterPassword, passwordProfile) {
  17343. return calcEntropy(site, login, masterPassword, passwordProfile).then(function (entropy) {
  17344. return renderPassword(entropy, passwordProfile);
  17345. });
  17346. }
  17347. function calcEntropy(site, login, masterPassword, passwordProfile) {
  17348. var salt = site + login + passwordProfile.counter.toString(16);
  17349. return pbkdf2(masterPassword, salt, passwordProfile.iterations, passwordProfile.keylen, passwordProfile.digest);
  17350. }
  17351. var characterSubsets = {
  17352. lowercase: 'abcdefghijklmnopqrstuvwxyz',
  17353. uppercase: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
  17354. numbers: '0123456789',
  17355. symbols: '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
  17356. };
  17357. function getSetOfCharacters(rules) {
  17358. if (typeof rules === 'undefined') {
  17359. return characterSubsets.lowercase + characterSubsets.uppercase + characterSubsets.numbers + characterSubsets.symbols;
  17360. }
  17361. var setOfChars = '';
  17362. rules.forEach(function (rule) {
  17363. setOfChars += characterSubsets[rule];
  17364. });
  17365. return setOfChars;
  17366. }
  17367. function consumeEntropy(generatedPassword, quotient, setOfCharacters, maxLength) {
  17368. if (generatedPassword.length >= maxLength) {
  17369. return {value: generatedPassword, entropy: quotient};
  17370. }
  17371. var longDivision = quotient.divmod(setOfCharacters.length);
  17372. generatedPassword += setOfCharacters[longDivision.remainder];
  17373. return consumeEntropy(generatedPassword, longDivision.quotient, setOfCharacters, maxLength);
  17374. }
  17375. function insertStringPseudoRandomly(generatedPassword, entropy, string) {
  17376. for (var i = 0; i < string.length; i++) {
  17377. var longDivision = entropy.divmod(generatedPassword.length);
  17378. generatedPassword = generatedPassword.slice(0, longDivision.remainder) + string[i] + generatedPassword.slice(longDivision.remainder);
  17379. entropy = longDivision.quotient;
  17380. }
  17381. return generatedPassword;
  17382. }
  17383. function getOneCharPerRule(entropy, rules) {
  17384. var oneCharPerRules = '';
  17385. rules.forEach(function (rule) {
  17386. var password = consumeEntropy('', entropy, characterSubsets[rule], 1);
  17387. oneCharPerRules += password.value;
  17388. entropy = password.entropy;
  17389. });
  17390. return {value: oneCharPerRules, entropy: entropy};
  17391. }
  17392. function getConfiguredRules(passwordProfile) {
  17393. return ['lowercase', 'uppercase', 'numbers', 'symbols'].filter(function (rule) {
  17394. return passwordProfile[rule];
  17395. });
  17396. }
  17397. function renderPassword(entropy, passwordProfile) {
  17398. var rules = getConfiguredRules(passwordProfile);
  17399. var setOfCharacters = getSetOfCharacters(rules);
  17400. var password = consumeEntropy('', bigInt(entropy, 16), setOfCharacters, passwordProfile.length - rules.length);
  17401. var charactersToAdd = getOneCharPerRule(password.entropy, rules);
  17402. return insertStringPseudoRandomly(password.value, charactersToAdd.entropy, charactersToAdd.value);
  17403. }
  17404. /***/ },
  17405. /* 177 */
  17406. /***/ function(module, exports, __webpack_require__) {
  17407. /* WEBPACK VAR INJECTION */(function(global) {/**
  17408. * lodash (Custom Build) <https://lodash.com/>
  17409. * Build: `lodash modularize exports="npm" -o ./`
  17410. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  17411. * Released under MIT license <https://lodash.com/license>
  17412. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  17413. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  17414. */
  17415. /** Used as the `TypeError` message for "Functions" methods. */
  17416. var FUNC_ERROR_TEXT = 'Expected a function';
  17417. /** Used as references for various `Number` constants. */
  17418. var NAN = 0 / 0;
  17419. /** `Object#toString` result references. */
  17420. var symbolTag = '[object Symbol]';
  17421. /** Used to match leading and trailing whitespace. */
  17422. var reTrim = /^\s+|\s+$/g;
  17423. /** Used to detect bad signed hexadecimal string values. */
  17424. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  17425. /** Used to detect binary string values. */
  17426. var reIsBinary = /^0b[01]+$/i;
  17427. /** Used to detect octal string values. */
  17428. var reIsOctal = /^0o[0-7]+$/i;
  17429. /** Built-in method references without a dependency on `root`. */
  17430. var freeParseInt = parseInt;
  17431. /** Detect free variable `global` from Node.js. */
  17432. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  17433. /** Detect free variable `self`. */
  17434. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  17435. /** Used as a reference to the global object. */
  17436. var root = freeGlobal || freeSelf || Function('return this')();
  17437. /** Used for built-in method references. */
  17438. var objectProto = Object.prototype;
  17439. /**
  17440. * Used to resolve the
  17441. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  17442. * of values.
  17443. */
  17444. var objectToString = objectProto.toString;
  17445. /* Built-in method references for those with the same name as other `lodash` methods. */
  17446. var nativeMax = Math.max,
  17447. nativeMin = Math.min;
  17448. /**
  17449. * Gets the timestamp of the number of milliseconds that have elapsed since
  17450. * the Unix epoch (1 January 1970 00:00:00 UTC).
  17451. *
  17452. * @static
  17453. * @memberOf _
  17454. * @since 2.4.0
  17455. * @category Date
  17456. * @returns {number} Returns the timestamp.
  17457. * @example
  17458. *
  17459. * _.defer(function(stamp) {
  17460. * console.log(_.now() - stamp);
  17461. * }, _.now());
  17462. * // => Logs the number of milliseconds it took for the deferred invocation.
  17463. */
  17464. var now = function() {
  17465. return root.Date.now();
  17466. };
  17467. /**
  17468. * Creates a debounced function that delays invoking `func` until after `wait`
  17469. * milliseconds have elapsed since the last time the debounced function was
  17470. * invoked. The debounced function comes with a `cancel` method to cancel
  17471. * delayed `func` invocations and a `flush` method to immediately invoke them.
  17472. * Provide `options` to indicate whether `func` should be invoked on the
  17473. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  17474. * with the last arguments provided to the debounced function. Subsequent
  17475. * calls to the debounced function return the result of the last `func`
  17476. * invocation.
  17477. *
  17478. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  17479. * invoked on the trailing edge of the timeout only if the debounced function
  17480. * is invoked more than once during the `wait` timeout.
  17481. *
  17482. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  17483. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  17484. *
  17485. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  17486. * for details over the differences between `_.debounce` and `_.throttle`.
  17487. *
  17488. * @static
  17489. * @memberOf _
  17490. * @since 0.1.0
  17491. * @category Function
  17492. * @param {Function} func The function to debounce.
  17493. * @param {number} [wait=0] The number of milliseconds to delay.
  17494. * @param {Object} [options={}] The options object.
  17495. * @param {boolean} [options.leading=false]
  17496. * Specify invoking on the leading edge of the timeout.
  17497. * @param {number} [options.maxWait]
  17498. * The maximum time `func` is allowed to be delayed before it's invoked.
  17499. * @param {boolean} [options.trailing=true]
  17500. * Specify invoking on the trailing edge of the timeout.
  17501. * @returns {Function} Returns the new debounced function.
  17502. * @example
  17503. *
  17504. * // Avoid costly calculations while the window size is in flux.
  17505. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  17506. *
  17507. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  17508. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  17509. * 'leading': true,
  17510. * 'trailing': false
  17511. * }));
  17512. *
  17513. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  17514. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  17515. * var source = new EventSource('/stream');
  17516. * jQuery(source).on('message', debounced);
  17517. *
  17518. * // Cancel the trailing debounced invocation.
  17519. * jQuery(window).on('popstate', debounced.cancel);
  17520. */
  17521. function debounce(func, wait, options) {
  17522. var lastArgs,
  17523. lastThis,
  17524. maxWait,
  17525. result,
  17526. timerId,
  17527. lastCallTime,
  17528. lastInvokeTime = 0,
  17529. leading = false,
  17530. maxing = false,
  17531. trailing = true;
  17532. if (typeof func != 'function') {
  17533. throw new TypeError(FUNC_ERROR_TEXT);
  17534. }
  17535. wait = toNumber(wait) || 0;
  17536. if (isObject(options)) {
  17537. leading = !!options.leading;
  17538. maxing = 'maxWait' in options;
  17539. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  17540. trailing = 'trailing' in options ? !!options.trailing : trailing;
  17541. }
  17542. function invokeFunc(time) {
  17543. var args = lastArgs,
  17544. thisArg = lastThis;
  17545. lastArgs = lastThis = undefined;
  17546. lastInvokeTime = time;
  17547. result = func.apply(thisArg, args);
  17548. return result;
  17549. }
  17550. function leadingEdge(time) {
  17551. // Reset any `maxWait` timer.
  17552. lastInvokeTime = time;
  17553. // Start the timer for the trailing edge.
  17554. timerId = setTimeout(timerExpired, wait);
  17555. // Invoke the leading edge.
  17556. return leading ? invokeFunc(time) : result;
  17557. }
  17558. function remainingWait(time) {
  17559. var timeSinceLastCall = time - lastCallTime,
  17560. timeSinceLastInvoke = time - lastInvokeTime,
  17561. result = wait - timeSinceLastCall;
  17562. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  17563. }
  17564. function shouldInvoke(time) {
  17565. var timeSinceLastCall = time - lastCallTime,
  17566. timeSinceLastInvoke = time - lastInvokeTime;
  17567. // Either this is the first call, activity has stopped and we're at the
  17568. // trailing edge, the system time has gone backwards and we're treating
  17569. // it as the trailing edge, or we've hit the `maxWait` limit.
  17570. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  17571. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  17572. }
  17573. function timerExpired() {
  17574. var time = now();
  17575. if (shouldInvoke(time)) {
  17576. return trailingEdge(time);
  17577. }
  17578. // Restart the timer.
  17579. timerId = setTimeout(timerExpired, remainingWait(time));
  17580. }
  17581. function trailingEdge(time) {
  17582. timerId = undefined;
  17583. // Only invoke if we have `lastArgs` which means `func` has been
  17584. // debounced at least once.
  17585. if (trailing && lastArgs) {
  17586. return invokeFunc(time);
  17587. }
  17588. lastArgs = lastThis = undefined;
  17589. return result;
  17590. }
  17591. function cancel() {
  17592. if (timerId !== undefined) {
  17593. clearTimeout(timerId);
  17594. }
  17595. lastInvokeTime = 0;
  17596. lastArgs = lastCallTime = lastThis = timerId = undefined;
  17597. }
  17598. function flush() {
  17599. return timerId === undefined ? result : trailingEdge(now());
  17600. }
  17601. function debounced() {
  17602. var time = now(),
  17603. isInvoking = shouldInvoke(time);
  17604. lastArgs = arguments;
  17605. lastThis = this;
  17606. lastCallTime = time;
  17607. if (isInvoking) {
  17608. if (timerId === undefined) {
  17609. return leadingEdge(lastCallTime);
  17610. }
  17611. if (maxing) {
  17612. // Handle invocations in a tight loop.
  17613. timerId = setTimeout(timerExpired, wait);
  17614. return invokeFunc(lastCallTime);
  17615. }
  17616. }
  17617. if (timerId === undefined) {
  17618. timerId = setTimeout(timerExpired, wait);
  17619. }
  17620. return result;
  17621. }
  17622. debounced.cancel = cancel;
  17623. debounced.flush = flush;
  17624. return debounced;
  17625. }
  17626. /**
  17627. * Checks if `value` is the
  17628. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  17629. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  17630. *
  17631. * @static
  17632. * @memberOf _
  17633. * @since 0.1.0
  17634. * @category Lang
  17635. * @param {*} value The value to check.
  17636. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  17637. * @example
  17638. *
  17639. * _.isObject({});
  17640. * // => true
  17641. *
  17642. * _.isObject([1, 2, 3]);
  17643. * // => true
  17644. *
  17645. * _.isObject(_.noop);
  17646. * // => true
  17647. *
  17648. * _.isObject(null);
  17649. * // => false
  17650. */
  17651. function isObject(value) {
  17652. var type = typeof value;
  17653. return !!value && (type == 'object' || type == 'function');
  17654. }
  17655. /**
  17656. * Checks if `value` is object-like. A value is object-like if it's not `null`
  17657. * and has a `typeof` result of "object".
  17658. *
  17659. * @static
  17660. * @memberOf _
  17661. * @since 4.0.0
  17662. * @category Lang
  17663. * @param {*} value The value to check.
  17664. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  17665. * @example
  17666. *
  17667. * _.isObjectLike({});
  17668. * // => true
  17669. *
  17670. * _.isObjectLike([1, 2, 3]);
  17671. * // => true
  17672. *
  17673. * _.isObjectLike(_.noop);
  17674. * // => false
  17675. *
  17676. * _.isObjectLike(null);
  17677. * // => false
  17678. */
  17679. function isObjectLike(value) {
  17680. return !!value && typeof value == 'object';
  17681. }
  17682. /**
  17683. * Checks if `value` is classified as a `Symbol` primitive or object.
  17684. *
  17685. * @static
  17686. * @memberOf _
  17687. * @since 4.0.0
  17688. * @category Lang
  17689. * @param {*} value The value to check.
  17690. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  17691. * @example
  17692. *
  17693. * _.isSymbol(Symbol.iterator);
  17694. * // => true
  17695. *
  17696. * _.isSymbol('abc');
  17697. * // => false
  17698. */
  17699. function isSymbol(value) {
  17700. return typeof value == 'symbol' ||
  17701. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  17702. }
  17703. /**
  17704. * Converts `value` to a number.
  17705. *
  17706. * @static
  17707. * @memberOf _
  17708. * @since 4.0.0
  17709. * @category Lang
  17710. * @param {*} value The value to process.
  17711. * @returns {number} Returns the number.
  17712. * @example
  17713. *
  17714. * _.toNumber(3.2);
  17715. * // => 3.2
  17716. *
  17717. * _.toNumber(Number.MIN_VALUE);
  17718. * // => 5e-324
  17719. *
  17720. * _.toNumber(Infinity);
  17721. * // => Infinity
  17722. *
  17723. * _.toNumber('3.2');
  17724. * // => 3.2
  17725. */
  17726. function toNumber(value) {
  17727. if (typeof value == 'number') {
  17728. return value;
  17729. }
  17730. if (isSymbol(value)) {
  17731. return NAN;
  17732. }
  17733. if (isObject(value)) {
  17734. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  17735. value = isObject(other) ? (other + '') : other;
  17736. }
  17737. if (typeof value != 'string') {
  17738. return value === 0 ? value : +value;
  17739. }
  17740. value = value.replace(reTrim, '');
  17741. var isBinary = reIsBinary.test(value);
  17742. return (isBinary || reIsOctal.test(value))
  17743. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  17744. : (reIsBadHex.test(value) ? NAN : +value);
  17745. }
  17746. module.exports = debounce;
  17747. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  17748. /***/ },
  17749. /* 178 */
  17750. /***/ function(module, exports) {
  17751. "use strict";
  17752. 'use strict';
  17753. /* eslint-disable no-unused-vars */
  17754. var hasOwnProperty = Object.prototype.hasOwnProperty;
  17755. var propIsEnumerable = Object.prototype.propertyIsEnumerable;
  17756. function toObject(val) {
  17757. if (val === null || val === undefined) {
  17758. throw new TypeError('Object.assign cannot be called with null or undefined');
  17759. }
  17760. return Object(val);
  17761. }
  17762. function shouldUseNative() {
  17763. try {
  17764. if (!Object.assign) {
  17765. return false;
  17766. }
  17767. // Detect buggy property enumeration order in older V8 versions.
  17768. // https://bugs.chromium.org/p/v8/issues/detail?id=4118
  17769. var test1 = new String('abc'); // eslint-disable-line
  17770. test1[5] = 'de';
  17771. if (Object.getOwnPropertyNames(test1)[0] === '5') {
  17772. return false;
  17773. }
  17774. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  17775. var test2 = {};
  17776. for (var i = 0; i < 10; i++) {
  17777. test2['_' + String.fromCharCode(i)] = i;
  17778. }
  17779. var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
  17780. return test2[n];
  17781. });
  17782. if (order2.join('') !== '0123456789') {
  17783. return false;
  17784. }
  17785. // https://bugs.chromium.org/p/v8/issues/detail?id=3056
  17786. var test3 = {};
  17787. 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
  17788. test3[letter] = letter;
  17789. });
  17790. if (Object.keys(Object.assign({}, test3)).join('') !==
  17791. 'abcdefghijklmnopqrst') {
  17792. return false;
  17793. }
  17794. return true;
  17795. } catch (e) {
  17796. // We don't expect any of the above to throw, but better to be safe.
  17797. return false;
  17798. }
  17799. }
  17800. module.exports = shouldUseNative() ? Object.assign : function (target, source) {
  17801. var from;
  17802. var to = toObject(target);
  17803. var symbols;
  17804. for (var s = 1; s < arguments.length; s++) {
  17805. from = Object(arguments[s]);
  17806. for (var key in from) {
  17807. if (hasOwnProperty.call(from, key)) {
  17808. to[key] = from[key];
  17809. }
  17810. }
  17811. if (Object.getOwnPropertySymbols) {
  17812. symbols = Object.getOwnPropertySymbols(from);
  17813. for (var i = 0; i < symbols.length; i++) {
  17814. if (propIsEnumerable.call(from, symbols[i])) {
  17815. to[symbols[i]] = from[symbols[i]];
  17816. }
  17817. }
  17818. }
  17819. }
  17820. return to;
  17821. };
  17822. /***/ },
  17823. /* 179 */
  17824. /***/ function(module, exports, __webpack_require__) {
  17825. /* WEBPACK VAR INJECTION */(function(process, Buffer) {var createHmac = __webpack_require__(72)
  17826. var checkParameters = __webpack_require__(180)
  17827. exports.pbkdf2 = function (password, salt, iterations, keylen, digest, callback) {
  17828. if (typeof digest === 'function') {
  17829. callback = digest
  17830. digest = undefined
  17831. }
  17832. checkParameters(iterations, keylen)
  17833. if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')
  17834. setTimeout(function () {
  17835. callback(null, exports.pbkdf2Sync(password, salt, iterations, keylen, digest))
  17836. })
  17837. }
  17838. var defaultEncoding
  17839. if (process.browser) {
  17840. defaultEncoding = 'utf-8'
  17841. } else {
  17842. var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)
  17843. defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'
  17844. }
  17845. exports.pbkdf2Sync = function (password, salt, iterations, keylen, digest) {
  17846. if (!Buffer.isBuffer(password)) password = new Buffer(password, defaultEncoding)
  17847. if (!Buffer.isBuffer(salt)) salt = new Buffer(salt, defaultEncoding)
  17848. checkParameters(iterations, keylen)
  17849. digest = digest || 'sha1'
  17850. var hLen
  17851. var l = 1
  17852. var DK = new Buffer(keylen)
  17853. var block1 = new Buffer(salt.length + 4)
  17854. salt.copy(block1, 0, 0, salt.length)
  17855. var r
  17856. var T
  17857. for (var i = 1; i <= l; i++) {
  17858. block1.writeUInt32BE(i, salt.length)
  17859. var U = createHmac(digest, password).update(block1).digest()
  17860. if (!hLen) {
  17861. hLen = U.length
  17862. T = new Buffer(hLen)
  17863. l = Math.ceil(keylen / hLen)
  17864. r = keylen - (l - 1) * hLen
  17865. }
  17866. U.copy(T, 0, 0, hLen)
  17867. for (var j = 1; j < iterations; j++) {
  17868. U = createHmac(digest, password).update(U).digest()
  17869. for (var k = 0; k < hLen; k++) T[k] ^= U[k]
  17870. }
  17871. var destPos = (i - 1) * hLen
  17872. var len = (i === l ? r : hLen)
  17873. T.copy(DK, destPos, 0, len)
  17874. }
  17875. return DK
  17876. }
  17877. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(0).Buffer))
  17878. /***/ },
  17879. /* 180 */
  17880. /***/ function(module, exports) {
  17881. var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs
  17882. module.exports = function (iterations, keylen) {
  17883. if (typeof iterations !== 'number') {
  17884. throw new TypeError('Iterations not a number')
  17885. }
  17886. if (iterations < 0) {
  17887. throw new TypeError('Bad iterations')
  17888. }
  17889. if (typeof keylen !== 'number') {
  17890. throw new TypeError('Key length not a number')
  17891. }
  17892. if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */
  17893. throw new TypeError('Bad key length')
  17894. }
  17895. }
  17896. /***/ },
  17897. /* 181 */
  17898. /***/ function(module, exports, __webpack_require__) {
  17899. "use strict";
  17900. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {'use strict';
  17901. var PENDING = 'pending';
  17902. var SETTLED = 'settled';
  17903. var FULFILLED = 'fulfilled';
  17904. var REJECTED = 'rejected';
  17905. var NOOP = function () {};
  17906. var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
  17907. var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
  17908. var asyncQueue = [];
  17909. var asyncTimer;
  17910. function asyncFlush() {
  17911. // run promise callbacks
  17912. for (var i = 0; i < asyncQueue.length; i++) {
  17913. asyncQueue[i][0](asyncQueue[i][1]);
  17914. }
  17915. // reset async asyncQueue
  17916. asyncQueue = [];
  17917. asyncTimer = false;
  17918. }
  17919. function asyncCall(callback, arg) {
  17920. asyncQueue.push([callback, arg]);
  17921. if (!asyncTimer) {
  17922. asyncTimer = true;
  17923. asyncSetTimer(asyncFlush, 0);
  17924. }
  17925. }
  17926. function invokeResolver(resolver, promise) {
  17927. function resolvePromise(value) {
  17928. resolve(promise, value);
  17929. }
  17930. function rejectPromise(reason) {
  17931. reject(promise, reason);
  17932. }
  17933. try {
  17934. resolver(resolvePromise, rejectPromise);
  17935. } catch (e) {
  17936. rejectPromise(e);
  17937. }
  17938. }
  17939. function invokeCallback(subscriber) {
  17940. var owner = subscriber.owner;
  17941. var settled = owner._state;
  17942. var value = owner._data;
  17943. var callback = subscriber[settled];
  17944. var promise = subscriber.then;
  17945. if (typeof callback === 'function') {
  17946. settled = FULFILLED;
  17947. try {
  17948. value = callback(value);
  17949. } catch (e) {
  17950. reject(promise, e);
  17951. }
  17952. }
  17953. if (!handleThenable(promise, value)) {
  17954. if (settled === FULFILLED) {
  17955. resolve(promise, value);
  17956. }
  17957. if (settled === REJECTED) {
  17958. reject(promise, value);
  17959. }
  17960. }
  17961. }
  17962. function handleThenable(promise, value) {
  17963. var resolved;
  17964. try {
  17965. if (promise === value) {
  17966. throw new TypeError('A promises callback cannot return that same promise.');
  17967. }
  17968. if (value && (typeof value === 'function' || typeof value === 'object')) {
  17969. // then should be retrieved only once
  17970. var then = value.then;
  17971. if (typeof then === 'function') {
  17972. then.call(value, function (val) {
  17973. if (!resolved) {
  17974. resolved = true;
  17975. if (value === val) {
  17976. fulfill(promise, val);
  17977. } else {
  17978. resolve(promise, val);
  17979. }
  17980. }
  17981. }, function (reason) {
  17982. if (!resolved) {
  17983. resolved = true;
  17984. reject(promise, reason);
  17985. }
  17986. });
  17987. return true;
  17988. }
  17989. }
  17990. } catch (e) {
  17991. if (!resolved) {
  17992. reject(promise, e);
  17993. }
  17994. return true;
  17995. }
  17996. return false;
  17997. }
  17998. function resolve(promise, value) {
  17999. if (promise === value || !handleThenable(promise, value)) {
  18000. fulfill(promise, value);
  18001. }
  18002. }
  18003. function fulfill(promise, value) {
  18004. if (promise._state === PENDING) {
  18005. promise._state = SETTLED;
  18006. promise._data = value;
  18007. asyncCall(publishFulfillment, promise);
  18008. }
  18009. }
  18010. function reject(promise, reason) {
  18011. if (promise._state === PENDING) {
  18012. promise._state = SETTLED;
  18013. promise._data = reason;
  18014. asyncCall(publishRejection, promise);
  18015. }
  18016. }
  18017. function publish(promise) {
  18018. promise._then = promise._then.forEach(invokeCallback);
  18019. }
  18020. function publishFulfillment(promise) {
  18021. promise._state = FULFILLED;
  18022. publish(promise);
  18023. }
  18024. function publishRejection(promise) {
  18025. promise._state = REJECTED;
  18026. publish(promise);
  18027. if (!promise._handled && isNode) {
  18028. global.process.emit('unhandledRejection', promise._data, promise);
  18029. }
  18030. }
  18031. function notifyRejectionHandled(promise) {
  18032. global.process.emit('rejectionHandled', promise);
  18033. }
  18034. /**
  18035. * @class
  18036. */
  18037. function Promise(resolver) {
  18038. if (typeof resolver !== 'function') {
  18039. throw new TypeError('Promise resolver ' + resolver + ' is not a function');
  18040. }
  18041. if (this instanceof Promise === false) {
  18042. throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
  18043. }
  18044. this._then = [];
  18045. invokeResolver(resolver, this);
  18046. }
  18047. Promise.prototype = {
  18048. constructor: Promise,
  18049. _state: PENDING,
  18050. _then: null,
  18051. _data: undefined,
  18052. _handled: false,
  18053. then: function (onFulfillment, onRejection) {
  18054. var subscriber = {
  18055. owner: this,
  18056. then: new this.constructor(NOOP),
  18057. fulfilled: onFulfillment,
  18058. rejected: onRejection
  18059. };
  18060. if ((onRejection || onFulfillment) && !this._handled) {
  18061. this._handled = true;
  18062. if (this._state === REJECTED && isNode) {
  18063. asyncCall(notifyRejectionHandled, this);
  18064. }
  18065. }
  18066. if (this._state === FULFILLED || this._state === REJECTED) {
  18067. // already resolved, call callback async
  18068. asyncCall(invokeCallback, subscriber);
  18069. } else {
  18070. // subscribe
  18071. this._then.push(subscriber);
  18072. }
  18073. return subscriber.then;
  18074. },
  18075. catch: function (onRejection) {
  18076. return this.then(null, onRejection);
  18077. }
  18078. };
  18079. Promise.all = function (promises) {
  18080. if (!Array.isArray(promises)) {
  18081. throw new TypeError('You must pass an array to Promise.all().');
  18082. }
  18083. return new Promise(function (resolve, reject) {
  18084. var results = [];
  18085. var remaining = 0;
  18086. function resolver(index) {
  18087. remaining++;
  18088. return function (value) {
  18089. results[index] = value;
  18090. if (!--remaining) {
  18091. resolve(results);
  18092. }
  18093. };
  18094. }
  18095. for (var i = 0, promise; i < promises.length; i++) {
  18096. promise = promises[i];
  18097. if (promise && typeof promise.then === 'function') {
  18098. promise.then(resolver(i), reject);
  18099. } else {
  18100. results[i] = promise;
  18101. }
  18102. }
  18103. if (!remaining) {
  18104. resolve(results);
  18105. }
  18106. });
  18107. };
  18108. Promise.race = function (promises) {
  18109. if (!Array.isArray(promises)) {
  18110. throw new TypeError('You must pass an array to Promise.race().');
  18111. }
  18112. return new Promise(function (resolve, reject) {
  18113. for (var i = 0, promise; i < promises.length; i++) {
  18114. promise = promises[i];
  18115. if (promise && typeof promise.then === 'function') {
  18116. promise.then(resolve, reject);
  18117. } else {
  18118. resolve(promise);
  18119. }
  18120. }
  18121. });
  18122. };
  18123. Promise.resolve = function (value) {
  18124. if (value && typeof value === 'object' && value.constructor === Promise) {
  18125. return value;
  18126. }
  18127. return new Promise(function (resolve) {
  18128. resolve(value);
  18129. });
  18130. };
  18131. Promise.reject = function (reason) {
  18132. return new Promise(function (resolve, reject) {
  18133. reject(reason);
  18134. });
  18135. };
  18136. module.exports = Promise;
  18137. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14), __webpack_require__(31).setImmediate))
  18138. /***/ },
  18139. /* 182 */
  18140. /***/ function(module, exports, __webpack_require__) {
  18141. module.exports = __webpack_require__(8)
  18142. /***/ },
  18143. /* 183 */
  18144. /***/ function(module, exports, __webpack_require__) {
  18145. "use strict";
  18146. 'use strict';
  18147. var Buffer = __webpack_require__(0).Buffer;
  18148. /*<replacement>*/
  18149. var bufferShim = __webpack_require__(35);
  18150. /*</replacement>*/
  18151. module.exports = BufferList;
  18152. function BufferList() {
  18153. this.head = null;
  18154. this.tail = null;
  18155. this.length = 0;
  18156. }
  18157. BufferList.prototype.push = function (v) {
  18158. var entry = { data: v, next: null };
  18159. if (this.length > 0) this.tail.next = entry;else this.head = entry;
  18160. this.tail = entry;
  18161. ++this.length;
  18162. };
  18163. BufferList.prototype.unshift = function (v) {
  18164. var entry = { data: v, next: this.head };
  18165. if (this.length === 0) this.tail = entry;
  18166. this.head = entry;
  18167. ++this.length;
  18168. };
  18169. BufferList.prototype.shift = function () {
  18170. if (this.length === 0) return;
  18171. var ret = this.head.data;
  18172. if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
  18173. --this.length;
  18174. return ret;
  18175. };
  18176. BufferList.prototype.clear = function () {
  18177. this.head = this.tail = null;
  18178. this.length = 0;
  18179. };
  18180. BufferList.prototype.join = function (s) {
  18181. if (this.length === 0) return '';
  18182. var p = this.head;
  18183. var ret = '' + p.data;
  18184. while (p = p.next) {
  18185. ret += s + p.data;
  18186. }return ret;
  18187. };
  18188. BufferList.prototype.concat = function (n) {
  18189. if (this.length === 0) return bufferShim.alloc(0);
  18190. if (this.length === 1) return this.head.data;
  18191. var ret = bufferShim.allocUnsafe(n >>> 0);
  18192. var p = this.head;
  18193. var i = 0;
  18194. while (p) {
  18195. p.data.copy(ret, i);
  18196. i += p.data.length;
  18197. p = p.next;
  18198. }
  18199. return ret;
  18200. };
  18201. /***/ },
  18202. /* 184 */
  18203. /***/ function(module, exports, __webpack_require__) {
  18204. module.exports = __webpack_require__(75)
  18205. /***/ },
  18206. /* 185 */
  18207. /***/ function(module, exports, __webpack_require__) {
  18208. /* WEBPACK VAR INJECTION */(function(process) {var Stream = (function (){
  18209. try {
  18210. return __webpack_require__(21); // hack to fix a circular dependency issue when used with browserify
  18211. } catch(_){}
  18212. }());
  18213. exports = module.exports = __webpack_require__(76);
  18214. exports.Stream = Stream || exports;
  18215. exports.Readable = exports;
  18216. exports.Writable = __webpack_require__(48);
  18217. exports.Duplex = __webpack_require__(8);
  18218. exports.Transform = __webpack_require__(47);
  18219. exports.PassThrough = __webpack_require__(75);
  18220. if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
  18221. module.exports = Stream;
  18222. }
  18223. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  18224. /***/ },
  18225. /* 186 */
  18226. /***/ function(module, exports, __webpack_require__) {
  18227. module.exports = __webpack_require__(47)
  18228. /***/ },
  18229. /* 187 */
  18230. /***/ function(module, exports, __webpack_require__) {
  18231. module.exports = __webpack_require__(48)
  18232. /***/ },
  18233. /* 188 */
  18234. /***/ function(module, exports, __webpack_require__) {
  18235. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18236. CryptoJS v3.1.2
  18237. code.google.com/p/crypto-js
  18238. (c) 2009-2013 by Jeff Mott. All rights reserved.
  18239. code.google.com/p/crypto-js/wiki/License
  18240. */
  18241. /** @preserve
  18242. (c) 2012 by Cédric Mesnil. All rights reserved.
  18243. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  18244. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  18245. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  18246. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  18247. */
  18248. // constants table
  18249. var zl = [
  18250. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  18251. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  18252. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  18253. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  18254. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
  18255. ]
  18256. var zr = [
  18257. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  18258. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  18259. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  18260. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  18261. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
  18262. ]
  18263. var sl = [
  18264. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  18265. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  18266. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  18267. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  18268. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
  18269. ]
  18270. var sr = [
  18271. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  18272. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  18273. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  18274. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  18275. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
  18276. ]
  18277. var hl = [0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]
  18278. var hr = [0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]
  18279. function bytesToWords (bytes) {
  18280. var words = []
  18281. for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
  18282. words[b >>> 5] |= bytes[i] << (24 - b % 32)
  18283. }
  18284. return words
  18285. }
  18286. function wordsToBytes (words) {
  18287. var bytes = []
  18288. for (var b = 0; b < words.length * 32; b += 8) {
  18289. bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF)
  18290. }
  18291. return bytes
  18292. }
  18293. function processBlock (H, M, offset) {
  18294. // swap endian
  18295. for (var i = 0; i < 16; i++) {
  18296. var offset_i = offset + i
  18297. var M_offset_i = M[offset_i]
  18298. // Swap
  18299. M[offset_i] = (
  18300. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
  18301. (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  18302. )
  18303. }
  18304. // Working variables
  18305. var al, bl, cl, dl, el
  18306. var ar, br, cr, dr, er
  18307. ar = al = H[0]
  18308. br = bl = H[1]
  18309. cr = cl = H[2]
  18310. dr = dl = H[3]
  18311. er = el = H[4]
  18312. // computation
  18313. var t
  18314. for (i = 0; i < 80; i += 1) {
  18315. t = (al + M[offset + zl[i]]) | 0
  18316. if (i < 16) {
  18317. t += f1(bl, cl, dl) + hl[0]
  18318. } else if (i < 32) {
  18319. t += f2(bl, cl, dl) + hl[1]
  18320. } else if (i < 48) {
  18321. t += f3(bl, cl, dl) + hl[2]
  18322. } else if (i < 64) {
  18323. t += f4(bl, cl, dl) + hl[3]
  18324. } else {// if (i<80) {
  18325. t += f5(bl, cl, dl) + hl[4]
  18326. }
  18327. t = t | 0
  18328. t = rotl(t, sl[i])
  18329. t = (t + el) | 0
  18330. al = el
  18331. el = dl
  18332. dl = rotl(cl, 10)
  18333. cl = bl
  18334. bl = t
  18335. t = (ar + M[offset + zr[i]]) | 0
  18336. if (i < 16) {
  18337. t += f5(br, cr, dr) + hr[0]
  18338. } else if (i < 32) {
  18339. t += f4(br, cr, dr) + hr[1]
  18340. } else if (i < 48) {
  18341. t += f3(br, cr, dr) + hr[2]
  18342. } else if (i < 64) {
  18343. t += f2(br, cr, dr) + hr[3]
  18344. } else {// if (i<80) {
  18345. t += f1(br, cr, dr) + hr[4]
  18346. }
  18347. t = t | 0
  18348. t = rotl(t, sr[i])
  18349. t = (t + er) | 0
  18350. ar = er
  18351. er = dr
  18352. dr = rotl(cr, 10)
  18353. cr = br
  18354. br = t
  18355. }
  18356. // intermediate hash value
  18357. t = (H[1] + cl + dr) | 0
  18358. H[1] = (H[2] + dl + er) | 0
  18359. H[2] = (H[3] + el + ar) | 0
  18360. H[3] = (H[4] + al + br) | 0
  18361. H[4] = (H[0] + bl + cr) | 0
  18362. H[0] = t
  18363. }
  18364. function f1 (x, y, z) {
  18365. return ((x) ^ (y) ^ (z))
  18366. }
  18367. function f2 (x, y, z) {
  18368. return (((x) & (y)) | ((~x) & (z)))
  18369. }
  18370. function f3 (x, y, z) {
  18371. return (((x) | (~(y))) ^ (z))
  18372. }
  18373. function f4 (x, y, z) {
  18374. return (((x) & (z)) | ((y) & (~(z))))
  18375. }
  18376. function f5 (x, y, z) {
  18377. return ((x) ^ ((y) | (~(z))))
  18378. }
  18379. function rotl (x, n) {
  18380. return (x << n) | (x >>> (32 - n))
  18381. }
  18382. function ripemd160 (message) {
  18383. var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]
  18384. if (typeof message === 'string') {
  18385. message = new Buffer(message, 'utf8')
  18386. }
  18387. var m = bytesToWords(message)
  18388. var nBitsLeft = message.length * 8
  18389. var nBitsTotal = message.length * 8
  18390. // Add padding
  18391. m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32)
  18392. m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  18393. (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
  18394. (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
  18395. )
  18396. for (var i = 0; i < m.length; i += 16) {
  18397. processBlock(H, m, i)
  18398. }
  18399. // swap endian
  18400. for (i = 0; i < 5; i++) {
  18401. // shortcut
  18402. var H_i = H[i]
  18403. // Swap
  18404. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
  18405. (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00)
  18406. }
  18407. var digestbytes = wordsToBytes(H)
  18408. return new Buffer(digestbytes)
  18409. }
  18410. module.exports = ripemd160
  18411. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18412. /***/ },
  18413. /* 189 */
  18414. /***/ function(module, exports) {
  18415. function select(element) {
  18416. var selectedText;
  18417. if (element.nodeName === 'SELECT') {
  18418. element.focus();
  18419. selectedText = element.value;
  18420. }
  18421. else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
  18422. element.focus();
  18423. element.setSelectionRange(0, element.value.length);
  18424. selectedText = element.value;
  18425. }
  18426. else {
  18427. if (element.hasAttribute('contenteditable')) {
  18428. element.focus();
  18429. }
  18430. var selection = window.getSelection();
  18431. var range = document.createRange();
  18432. range.selectNodeContents(element);
  18433. selection.removeAllRanges();
  18434. selection.addRange(range);
  18435. selectedText = selection.toString();
  18436. }
  18437. return selectedText;
  18438. }
  18439. module.exports = select;
  18440. /***/ },
  18441. /* 190 */
  18442. /***/ function(module, exports, __webpack_require__) {
  18443. var exports = module.exports = function SHA (algorithm) {
  18444. algorithm = algorithm.toLowerCase()
  18445. var Algorithm = exports[algorithm]
  18446. if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')
  18447. return new Algorithm()
  18448. }
  18449. exports.sha = __webpack_require__(191)
  18450. exports.sha1 = __webpack_require__(192)
  18451. exports.sha224 = __webpack_require__(193)
  18452. exports.sha256 = __webpack_require__(77)
  18453. exports.sha384 = __webpack_require__(194)
  18454. exports.sha512 = __webpack_require__(78)
  18455. /***/ },
  18456. /* 191 */
  18457. /***/ function(module, exports, __webpack_require__) {
  18458. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18459. * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined
  18460. * in FIPS PUB 180-1
  18461. * This source code is derived from sha1.js of the same repository.
  18462. * The difference between SHA-0 and SHA-1 is just a bitwise rotate left
  18463. * operation was added.
  18464. */
  18465. var inherits = __webpack_require__(1)
  18466. var Hash = __webpack_require__(13)
  18467. var K = [
  18468. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  18469. ]
  18470. var W = new Array(80)
  18471. function Sha () {
  18472. this.init()
  18473. this._w = W
  18474. Hash.call(this, 64, 56)
  18475. }
  18476. inherits(Sha, Hash)
  18477. Sha.prototype.init = function () {
  18478. this._a = 0x67452301
  18479. this._b = 0xefcdab89
  18480. this._c = 0x98badcfe
  18481. this._d = 0x10325476
  18482. this._e = 0xc3d2e1f0
  18483. return this
  18484. }
  18485. function rotl5 (num) {
  18486. return (num << 5) | (num >>> 27)
  18487. }
  18488. function rotl30 (num) {
  18489. return (num << 30) | (num >>> 2)
  18490. }
  18491. function ft (s, b, c, d) {
  18492. if (s === 0) return (b & c) | ((~b) & d)
  18493. if (s === 2) return (b & c) | (b & d) | (c & d)
  18494. return b ^ c ^ d
  18495. }
  18496. Sha.prototype._update = function (M) {
  18497. var W = this._w
  18498. var a = this._a | 0
  18499. var b = this._b | 0
  18500. var c = this._c | 0
  18501. var d = this._d | 0
  18502. var e = this._e | 0
  18503. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18504. for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]
  18505. for (var j = 0; j < 80; ++j) {
  18506. var s = ~~(j / 20)
  18507. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  18508. e = d
  18509. d = c
  18510. c = rotl30(b)
  18511. b = a
  18512. a = t
  18513. }
  18514. this._a = (a + this._a) | 0
  18515. this._b = (b + this._b) | 0
  18516. this._c = (c + this._c) | 0
  18517. this._d = (d + this._d) | 0
  18518. this._e = (e + this._e) | 0
  18519. }
  18520. Sha.prototype._hash = function () {
  18521. var H = new Buffer(20)
  18522. H.writeInt32BE(this._a | 0, 0)
  18523. H.writeInt32BE(this._b | 0, 4)
  18524. H.writeInt32BE(this._c | 0, 8)
  18525. H.writeInt32BE(this._d | 0, 12)
  18526. H.writeInt32BE(this._e | 0, 16)
  18527. return H
  18528. }
  18529. module.exports = Sha
  18530. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18531. /***/ },
  18532. /* 192 */
  18533. /***/ function(module, exports, __webpack_require__) {
  18534. /* WEBPACK VAR INJECTION */(function(Buffer) {/*
  18535. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  18536. * in FIPS PUB 180-1
  18537. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  18538. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18539. * Distributed under the BSD License
  18540. * See http://pajhome.org.uk/crypt/md5 for details.
  18541. */
  18542. var inherits = __webpack_require__(1)
  18543. var Hash = __webpack_require__(13)
  18544. var K = [
  18545. 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0
  18546. ]
  18547. var W = new Array(80)
  18548. function Sha1 () {
  18549. this.init()
  18550. this._w = W
  18551. Hash.call(this, 64, 56)
  18552. }
  18553. inherits(Sha1, Hash)
  18554. Sha1.prototype.init = function () {
  18555. this._a = 0x67452301
  18556. this._b = 0xefcdab89
  18557. this._c = 0x98badcfe
  18558. this._d = 0x10325476
  18559. this._e = 0xc3d2e1f0
  18560. return this
  18561. }
  18562. function rotl1 (num) {
  18563. return (num << 1) | (num >>> 31)
  18564. }
  18565. function rotl5 (num) {
  18566. return (num << 5) | (num >>> 27)
  18567. }
  18568. function rotl30 (num) {
  18569. return (num << 30) | (num >>> 2)
  18570. }
  18571. function ft (s, b, c, d) {
  18572. if (s === 0) return (b & c) | ((~b) & d)
  18573. if (s === 2) return (b & c) | (b & d) | (c & d)
  18574. return b ^ c ^ d
  18575. }
  18576. Sha1.prototype._update = function (M) {
  18577. var W = this._w
  18578. var a = this._a | 0
  18579. var b = this._b | 0
  18580. var c = this._c | 0
  18581. var d = this._d | 0
  18582. var e = this._e | 0
  18583. for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)
  18584. for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])
  18585. for (var j = 0; j < 80; ++j) {
  18586. var s = ~~(j / 20)
  18587. var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0
  18588. e = d
  18589. d = c
  18590. c = rotl30(b)
  18591. b = a
  18592. a = t
  18593. }
  18594. this._a = (a + this._a) | 0
  18595. this._b = (b + this._b) | 0
  18596. this._c = (c + this._c) | 0
  18597. this._d = (d + this._d) | 0
  18598. this._e = (e + this._e) | 0
  18599. }
  18600. Sha1.prototype._hash = function () {
  18601. var H = new Buffer(20)
  18602. H.writeInt32BE(this._a | 0, 0)
  18603. H.writeInt32BE(this._b | 0, 4)
  18604. H.writeInt32BE(this._c | 0, 8)
  18605. H.writeInt32BE(this._d | 0, 12)
  18606. H.writeInt32BE(this._e | 0, 16)
  18607. return H
  18608. }
  18609. module.exports = Sha1
  18610. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18611. /***/ },
  18612. /* 193 */
  18613. /***/ function(module, exports, __webpack_require__) {
  18614. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  18615. * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
  18616. * in FIPS 180-2
  18617. * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
  18618. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  18619. *
  18620. */
  18621. var inherits = __webpack_require__(1)
  18622. var Sha256 = __webpack_require__(77)
  18623. var Hash = __webpack_require__(13)
  18624. var W = new Array(64)
  18625. function Sha224 () {
  18626. this.init()
  18627. this._w = W // new Array(64)
  18628. Hash.call(this, 64, 56)
  18629. }
  18630. inherits(Sha224, Sha256)
  18631. Sha224.prototype.init = function () {
  18632. this._a = 0xc1059ed8
  18633. this._b = 0x367cd507
  18634. this._c = 0x3070dd17
  18635. this._d = 0xf70e5939
  18636. this._e = 0xffc00b31
  18637. this._f = 0x68581511
  18638. this._g = 0x64f98fa7
  18639. this._h = 0xbefa4fa4
  18640. return this
  18641. }
  18642. Sha224.prototype._hash = function () {
  18643. var H = new Buffer(28)
  18644. H.writeInt32BE(this._a, 0)
  18645. H.writeInt32BE(this._b, 4)
  18646. H.writeInt32BE(this._c, 8)
  18647. H.writeInt32BE(this._d, 12)
  18648. H.writeInt32BE(this._e, 16)
  18649. H.writeInt32BE(this._f, 20)
  18650. H.writeInt32BE(this._g, 24)
  18651. return H
  18652. }
  18653. module.exports = Sha224
  18654. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18655. /***/ },
  18656. /* 194 */
  18657. /***/ function(module, exports, __webpack_require__) {
  18658. /* WEBPACK VAR INJECTION */(function(Buffer) {var inherits = __webpack_require__(1)
  18659. var SHA512 = __webpack_require__(78)
  18660. var Hash = __webpack_require__(13)
  18661. var W = new Array(160)
  18662. function Sha384 () {
  18663. this.init()
  18664. this._w = W
  18665. Hash.call(this, 128, 112)
  18666. }
  18667. inherits(Sha384, SHA512)
  18668. Sha384.prototype.init = function () {
  18669. this._ah = 0xcbbb9d5d
  18670. this._bh = 0x629a292a
  18671. this._ch = 0x9159015a
  18672. this._dh = 0x152fecd8
  18673. this._eh = 0x67332667
  18674. this._fh = 0x8eb44a87
  18675. this._gh = 0xdb0c2e0d
  18676. this._hh = 0x47b5481d
  18677. this._al = 0xc1059ed8
  18678. this._bl = 0x367cd507
  18679. this._cl = 0x3070dd17
  18680. this._dl = 0xf70e5939
  18681. this._el = 0xffc00b31
  18682. this._fl = 0x68581511
  18683. this._gl = 0x64f98fa7
  18684. this._hl = 0xbefa4fa4
  18685. return this
  18686. }
  18687. Sha384.prototype._hash = function () {
  18688. var H = new Buffer(48)
  18689. function writeInt64BE (h, l, offset) {
  18690. H.writeInt32BE(h, offset)
  18691. H.writeInt32BE(l, offset + 4)
  18692. }
  18693. writeInt64BE(this._ah, this._al, 0)
  18694. writeInt64BE(this._bh, this._bl, 8)
  18695. writeInt64BE(this._ch, this._cl, 16)
  18696. writeInt64BE(this._dh, this._dl, 24)
  18697. writeInt64BE(this._eh, this._el, 32)
  18698. writeInt64BE(this._fh, this._fl, 40)
  18699. return H
  18700. }
  18701. module.exports = Sha384
  18702. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))
  18703. /***/ },
  18704. /* 195 */
  18705. /***/ function(module, exports) {
  18706. function E () {
  18707. // Keep this empty so it's easier to inherit from
  18708. // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
  18709. }
  18710. E.prototype = {
  18711. on: function (name, callback, ctx) {
  18712. var e = this.e || (this.e = {});
  18713. (e[name] || (e[name] = [])).push({
  18714. fn: callback,
  18715. ctx: ctx
  18716. });
  18717. return this;
  18718. },
  18719. once: function (name, callback, ctx) {
  18720. var self = this;
  18721. function listener () {
  18722. self.off(name, listener);
  18723. callback.apply(ctx, arguments);
  18724. };
  18725. listener._ = callback
  18726. return this.on(name, listener, ctx);
  18727. },
  18728. emit: function (name) {
  18729. var data = [].slice.call(arguments, 1);
  18730. var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
  18731. var i = 0;
  18732. var len = evtArr.length;
  18733. for (i; i < len; i++) {
  18734. evtArr[i].fn.apply(evtArr[i].ctx, data);
  18735. }
  18736. return this;
  18737. },
  18738. off: function (name, callback) {
  18739. var e = this.e || (this.e = {});
  18740. var evts = e[name];
  18741. var liveEvents = [];
  18742. if (evts && callback) {
  18743. for (var i = 0, len = evts.length; i < len; i++) {
  18744. if (evts[i].fn !== callback && evts[i].fn._ !== callback)
  18745. liveEvents.push(evts[i]);
  18746. }
  18747. }
  18748. // Remove event from queue to prevent memory leak
  18749. // Suggested by https://github.com/lazd
  18750. // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
  18751. (liveEvents.length)
  18752. ? e[name] = liveEvents
  18753. : delete e[name];
  18754. return this;
  18755. }
  18756. };
  18757. module.exports = E;
  18758. /***/ },
  18759. /* 196 */
  18760. /***/ function(module, exports, __webpack_require__) {
  18761. /* WEBPACK VAR INJECTION */(function(global) {
  18762. /**
  18763. * Module exports.
  18764. */
  18765. module.exports = deprecate;
  18766. /**
  18767. * Mark that a method should not be used.
  18768. * Returns a modified function which warns once by default.
  18769. *
  18770. * If `localStorage.noDeprecation = true` is set, then it is a no-op.
  18771. *
  18772. * If `localStorage.throwDeprecation = true` is set, then deprecated functions
  18773. * will throw an Error when invoked.
  18774. *
  18775. * If `localStorage.traceDeprecation = true` is set, then deprecated functions
  18776. * will invoke `console.trace()` instead of `console.error()`.
  18777. *
  18778. * @param {Function} fn - the function to deprecate
  18779. * @param {String} msg - the string to print to the console when `fn` is invoked
  18780. * @returns {Function} a new "deprecated" version of `fn`
  18781. * @api public
  18782. */
  18783. function deprecate (fn, msg) {
  18784. if (config('noDeprecation')) {
  18785. return fn;
  18786. }
  18787. var warned = false;
  18788. function deprecated() {
  18789. if (!warned) {
  18790. if (config('throwDeprecation')) {
  18791. throw new Error(msg);
  18792. } else if (config('traceDeprecation')) {
  18793. console.trace(msg);
  18794. } else {
  18795. console.warn(msg);
  18796. }
  18797. warned = true;
  18798. }
  18799. return fn.apply(this, arguments);
  18800. }
  18801. return deprecated;
  18802. }
  18803. /**
  18804. * Checks `localStorage` for boolean values for the given `name`.
  18805. *
  18806. * @param {String} name
  18807. * @returns {Boolean}
  18808. * @api private
  18809. */
  18810. function config (name) {
  18811. // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  18812. try {
  18813. if (!global.localStorage) return false;
  18814. } catch (_) {
  18815. return false;
  18816. }
  18817. var val = global.localStorage[name];
  18818. if (null == val) return false;
  18819. return String(val).toLowerCase() === 'true';
  18820. }
  18821. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  18822. /***/ },
  18823. /* 197 */
  18824. /***/ function(module, exports, __webpack_require__) {
  18825. var __vue_exports__, __vue_options__
  18826. var __vue_styles__ = {}
  18827. /* script */
  18828. __vue_exports__ = __webpack_require__(103)
  18829. /* template */
  18830. var __vue_template__ = __webpack_require__(213)
  18831. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18832. if (
  18833. typeof __vue_exports__.default === "object" ||
  18834. typeof __vue_exports__.default === "function"
  18835. ) {
  18836. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18837. }
  18838. if (typeof __vue_options__ === "function") {
  18839. __vue_options__ = __vue_options__.options
  18840. }
  18841. __vue_options__.render = __vue_template__.render
  18842. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18843. module.exports = __vue_exports__
  18844. /***/ },
  18845. /* 198 */
  18846. /***/ function(module, exports, __webpack_require__) {
  18847. var __vue_exports__, __vue_options__
  18848. var __vue_styles__ = {}
  18849. /* styles */
  18850. __webpack_require__(217)
  18851. /* script */
  18852. __vue_exports__ = __webpack_require__(104)
  18853. /* template */
  18854. var __vue_template__ = __webpack_require__(208)
  18855. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18856. if (
  18857. typeof __vue_exports__.default === "object" ||
  18858. typeof __vue_exports__.default === "function"
  18859. ) {
  18860. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18861. }
  18862. if (typeof __vue_options__ === "function") {
  18863. __vue_options__ = __vue_options__.options
  18864. }
  18865. __vue_options__.render = __vue_template__.render
  18866. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18867. module.exports = __vue_exports__
  18868. /***/ },
  18869. /* 199 */
  18870. /***/ function(module, exports, __webpack_require__) {
  18871. var __vue_exports__, __vue_options__
  18872. var __vue_styles__ = {}
  18873. /* styles */
  18874. __webpack_require__(220)
  18875. /* script */
  18876. __vue_exports__ = __webpack_require__(105)
  18877. /* template */
  18878. var __vue_template__ = __webpack_require__(215)
  18879. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18880. if (
  18881. typeof __vue_exports__.default === "object" ||
  18882. typeof __vue_exports__.default === "function"
  18883. ) {
  18884. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18885. }
  18886. if (typeof __vue_options__ === "function") {
  18887. __vue_options__ = __vue_options__.options
  18888. }
  18889. __vue_options__.render = __vue_template__.render
  18890. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18891. module.exports = __vue_exports__
  18892. /***/ },
  18893. /* 200 */
  18894. /***/ function(module, exports, __webpack_require__) {
  18895. var __vue_exports__, __vue_options__
  18896. var __vue_styles__ = {}
  18897. /* template */
  18898. var __vue_template__ = __webpack_require__(206)
  18899. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18900. if (
  18901. typeof __vue_exports__.default === "object" ||
  18902. typeof __vue_exports__.default === "function"
  18903. ) {
  18904. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18905. }
  18906. if (typeof __vue_options__ === "function") {
  18907. __vue_options__ = __vue_options__.options
  18908. }
  18909. __vue_options__.render = __vue_template__.render
  18910. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18911. module.exports = __vue_exports__
  18912. /***/ },
  18913. /* 201 */
  18914. /***/ function(module, exports, __webpack_require__) {
  18915. var __vue_exports__, __vue_options__
  18916. var __vue_styles__ = {}
  18917. /* script */
  18918. __vue_exports__ = __webpack_require__(106)
  18919. /* template */
  18920. var __vue_template__ = __webpack_require__(207)
  18921. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18922. if (
  18923. typeof __vue_exports__.default === "object" ||
  18924. typeof __vue_exports__.default === "function"
  18925. ) {
  18926. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18927. }
  18928. if (typeof __vue_options__ === "function") {
  18929. __vue_options__ = __vue_options__.options
  18930. }
  18931. __vue_options__.render = __vue_template__.render
  18932. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18933. module.exports = __vue_exports__
  18934. /***/ },
  18935. /* 202 */
  18936. /***/ function(module, exports, __webpack_require__) {
  18937. var __vue_exports__, __vue_options__
  18938. var __vue_styles__ = {}
  18939. /* styles */
  18940. __webpack_require__(218)
  18941. /* script */
  18942. __vue_exports__ = __webpack_require__(107)
  18943. /* template */
  18944. var __vue_template__ = __webpack_require__(210)
  18945. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18946. if (
  18947. typeof __vue_exports__.default === "object" ||
  18948. typeof __vue_exports__.default === "function"
  18949. ) {
  18950. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18951. }
  18952. if (typeof __vue_options__ === "function") {
  18953. __vue_options__ = __vue_options__.options
  18954. }
  18955. __vue_options__.render = __vue_template__.render
  18956. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18957. module.exports = __vue_exports__
  18958. /***/ },
  18959. /* 203 */
  18960. /***/ function(module, exports, __webpack_require__) {
  18961. var __vue_exports__, __vue_options__
  18962. var __vue_styles__ = {}
  18963. /* script */
  18964. __vue_exports__ = __webpack_require__(108)
  18965. /* template */
  18966. var __vue_template__ = __webpack_require__(212)
  18967. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18968. if (
  18969. typeof __vue_exports__.default === "object" ||
  18970. typeof __vue_exports__.default === "function"
  18971. ) {
  18972. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18973. }
  18974. if (typeof __vue_options__ === "function") {
  18975. __vue_options__ = __vue_options__.options
  18976. }
  18977. __vue_options__.render = __vue_template__.render
  18978. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  18979. module.exports = __vue_exports__
  18980. /***/ },
  18981. /* 204 */
  18982. /***/ function(module, exports, __webpack_require__) {
  18983. var __vue_exports__, __vue_options__
  18984. var __vue_styles__ = {}
  18985. /* script */
  18986. __vue_exports__ = __webpack_require__(109)
  18987. /* template */
  18988. var __vue_template__ = __webpack_require__(214)
  18989. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  18990. if (
  18991. typeof __vue_exports__.default === "object" ||
  18992. typeof __vue_exports__.default === "function"
  18993. ) {
  18994. __vue_options__ = __vue_exports__ = __vue_exports__.default
  18995. }
  18996. if (typeof __vue_options__ === "function") {
  18997. __vue_options__ = __vue_options__.options
  18998. }
  18999. __vue_options__.render = __vue_template__.render
  19000. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  19001. module.exports = __vue_exports__
  19002. /***/ },
  19003. /* 205 */
  19004. /***/ function(module, exports, __webpack_require__) {
  19005. var __vue_exports__, __vue_options__
  19006. var __vue_styles__ = {}
  19007. /* script */
  19008. __vue_exports__ = __webpack_require__(110)
  19009. /* template */
  19010. var __vue_template__ = __webpack_require__(209)
  19011. __vue_options__ = __vue_exports__ = __vue_exports__ || {}
  19012. if (
  19013. typeof __vue_exports__.default === "object" ||
  19014. typeof __vue_exports__.default === "function"
  19015. ) {
  19016. __vue_options__ = __vue_exports__ = __vue_exports__.default
  19017. }
  19018. if (typeof __vue_options__ === "function") {
  19019. __vue_options__ = __vue_options__.options
  19020. }
  19021. __vue_options__.render = __vue_template__.render
  19022. __vue_options__.staticRenderFns = __vue_template__.staticRenderFns
  19023. module.exports = __vue_exports__
  19024. /***/ },
  19025. /* 206 */
  19026. /***/ function(module, exports) {
  19027. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19028. return _vm._m(0)
  19029. },staticRenderFns: [function (){var _vm=this;var _h=_vm.$createElement;
  19030. return _h('div', {
  19031. staticStyle: {
  19032. "display": "none"
  19033. }
  19034. }, [_h('label', {
  19035. attrs: {
  19036. "for": "username"
  19037. }
  19038. }, [_h('input', {
  19039. attrs: {
  19040. "type": "text",
  19041. "id": "username",
  19042. "name": "username",
  19043. "autocomplete": "username"
  19044. }
  19045. })]), " ", _h('label', {
  19046. attrs: {
  19047. "for": "password"
  19048. }
  19049. }, [_h('input', {
  19050. attrs: {
  19051. "type": "password",
  19052. "id": "password",
  19053. "name": "password",
  19054. "autocomplete": "current-password"
  19055. }
  19056. })])])
  19057. }]}
  19058. /***/ },
  19059. /* 207 */
  19060. /***/ function(module, exports) {
  19061. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19062. return _h('form', [_h('div', {
  19063. staticClass: "form-group row"
  19064. }, [_h('div', {
  19065. staticClass: "col-xs-12"
  19066. }, [_h('div', {
  19067. staticClass: "inner-addon left-addon"
  19068. }, [_h('i', {
  19069. staticClass: "fa fa-user"
  19070. }), " ", _h('input', {
  19071. directives: [{
  19072. name: "model",
  19073. rawName: "v-model",
  19074. value: (_vm.email),
  19075. expression: "email"
  19076. }],
  19077. staticClass: "form-control",
  19078. attrs: {
  19079. "id": "email",
  19080. "name": "login",
  19081. "type": "email",
  19082. "placeholder": "Email",
  19083. "required": ""
  19084. },
  19085. domProps: {
  19086. "value": _vm._s(_vm.email)
  19087. },
  19088. on: {
  19089. "input": function($event) {
  19090. if ($event.target.composing) { return; }
  19091. _vm.email = $event.target.value
  19092. }
  19093. }
  19094. }), " ", _h('small', {
  19095. staticClass: "form-text text-muted text-danger"
  19096. }, [(_vm.errors.userNameAlreadyExist) ? _h('span', ["Someone already use that username. Do you want to sign in ?"]) : _vm._e(), " ", (_vm.errors.emailInvalid) ? _h('span', ["Please enter a valid email"]) : _vm._e(), " ", (_vm.errors.emailRequired) ? _h('span', ["An email is required"]) : _vm._e()])])])]), " ", _h('div', {
  19097. staticClass: "form-group row"
  19098. }, [_h('div', {
  19099. staticClass: "col-xs-12"
  19100. }, [_h('div', {
  19101. staticClass: "inner-addon left-addon"
  19102. }, [_h('i', {
  19103. staticClass: "fa fa-lock"
  19104. }), " ", _h('input', {
  19105. directives: [{
  19106. name: "model",
  19107. rawName: "v-model",
  19108. value: (_vm.password),
  19109. expression: "password"
  19110. }],
  19111. staticClass: "form-control",
  19112. attrs: {
  19113. "id": "password",
  19114. "name": "password",
  19115. "type": "password",
  19116. "required": "",
  19117. "placeholder": "LessPass password"
  19118. },
  19119. domProps: {
  19120. "value": _vm._s(_vm.password)
  19121. },
  19122. on: {
  19123. "keyup": function($event) {
  19124. if ($event.keyCode !== 13) { return; }
  19125. $event.preventDefault();
  19126. _vm.signIn($event)
  19127. },
  19128. "input": function($event) {
  19129. if ($event.target.composing) { return; }
  19130. _vm.password = $event.target.value
  19131. }
  19132. }
  19133. }), " ", _h('small', {
  19134. staticClass: "form-text text-muted"
  19135. }, [(_vm.errors.passwordRequired) ? _h('span', {
  19136. staticClass: "text-danger"
  19137. }, ["A password is required"]) : _vm._e(), " ", _h('label', {
  19138. staticClass: "form-check-label"
  19139. }, [_h('input', {
  19140. directives: [{
  19141. name: "model",
  19142. rawName: "v-model",
  19143. value: (_vm.useMasterPassword),
  19144. expression: "useMasterPassword"
  19145. }],
  19146. staticClass: "form-check-input",
  19147. attrs: {
  19148. "type": "checkbox"
  19149. },
  19150. domProps: {
  19151. "checked": Array.isArray(_vm.useMasterPassword) ? _vm._i(_vm.useMasterPassword, null) > -1 : _vm._q(_vm.useMasterPassword, true)
  19152. },
  19153. on: {
  19154. "change": function($event) {
  19155. var $$a = _vm.useMasterPassword,
  19156. $$el = $event.target,
  19157. $$c = $$el.checked ? (true) : (false);
  19158. if (Array.isArray($$a)) {
  19159. var $$v = null,
  19160. $$i = _vm._i($$a, $$v);
  19161. if ($$c) {
  19162. $$i < 0 && (_vm.useMasterPassword = $$a.concat($$v))
  19163. } else {
  19164. $$i > -1 && (_vm.useMasterPassword = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19165. }
  19166. } else {
  19167. _vm.useMasterPassword = $$c
  19168. }
  19169. }
  19170. }
  19171. }), "\n Check me if you want to use your master password here.\n ", _h('span', {
  19172. staticClass: "tag tag-warning",
  19173. on: {
  19174. "click": function($event) {
  19175. $event.preventDefault();
  19176. _vm.seeMasterPasswordHelp = !_vm.seeMasterPasswordHelp
  19177. }
  19178. }
  19179. }, ["\n ?\n "]), " ", (_vm.seeMasterPasswordHelp) ? _h('span', {
  19180. staticClass: "text-warning"
  19181. }, [_h('br'), " Your master password ", _h('b', ["should not be saved"]), " on a database even encrypted.\n If you want to use your master password here, you can check the option.\n It will replace your master password with a LessPass generated password.\n "]) : _vm._e()])])])])]), " ", _h('div', {
  19182. staticClass: "form-group row"
  19183. }, [_h('div', {
  19184. directives: [{
  19185. name: "show",
  19186. rawName: "v-show",
  19187. value: (!_vm.generatedPassword),
  19188. expression: "!generatedPassword"
  19189. }],
  19190. staticClass: "col-xs-8"
  19191. }, [_h('button', {
  19192. staticClass: "btn",
  19193. class: {
  19194. 'btn-warning': _vm.version === 1, 'btn-primary': _vm.version === 2
  19195. },
  19196. attrs: {
  19197. "id": "signInButton",
  19198. "type": "button"
  19199. },
  19200. on: {
  19201. "click": _vm.signIn
  19202. }
  19203. }, [(_vm.loadingSignIn) ? _h('span', [_h('i', {
  19204. staticClass: "fa fa-spinner fa-pulse fa-fw"
  19205. })]) : _vm._e(), "\n Sign In\n "]), " ", _h('button', {
  19206. staticClass: "btn btn-secondary",
  19207. attrs: {
  19208. "id": "registerButton",
  19209. "type": "button"
  19210. },
  19211. on: {
  19212. "click": _vm.register
  19213. }
  19214. }, [(_vm.loadingRegister) ? _h('span', [_h('i', {
  19215. staticClass: "fa fa-spinner fa-pulse fa-fw"
  19216. })]) : _vm._e(), "\n Register\n "])]), " ", _h('div', {
  19217. staticClass: "col-xs-4 text-xs-right"
  19218. }, [_h('button', {
  19219. staticClass: "btn btn-secondary",
  19220. class: {
  19221. 'btn-outline-warning': _vm.version === 1, 'btn-outline-primary': _vm.version === 2
  19222. },
  19223. attrs: {
  19224. "type": "button"
  19225. },
  19226. on: {
  19227. "click": _vm.toggleVersion
  19228. }
  19229. }, [_h('small', {
  19230. directives: [{
  19231. name: "show",
  19232. rawName: "v-show",
  19233. value: (_vm.version === 1),
  19234. expression: "version===1"
  19235. }]
  19236. }, ["v1"]), " ", _h('small', {
  19237. directives: [{
  19238. name: "show",
  19239. rawName: "v-show",
  19240. value: (_vm.version === 2),
  19241. expression: "version===2"
  19242. }]
  19243. }, ["v2"])]), " ", _h('button', {
  19244. staticClass: "btn btn-secondary",
  19245. attrs: {
  19246. "type": "button"
  19247. },
  19248. on: {
  19249. "click": function($event) {
  19250. _vm.showOptions = !_vm.showOptions
  19251. }
  19252. }
  19253. }, [_h('i', {
  19254. staticClass: "fa fa-sliders",
  19255. attrs: {
  19256. "aria-hidden": "true"
  19257. }
  19258. })])])]), " ", (_vm.showError) ? _h('div', {
  19259. staticClass: "form-group"
  19260. }, [_h('div', {
  19261. staticClass: "alert alert-danger",
  19262. attrs: {
  19263. "role": "alert"
  19264. }
  19265. }, ["\n " + _vm._s(_vm.errorMessage) + "\n "])]) : _vm._e(), " ", (_vm.showOptions) ? _h('div', {
  19266. staticClass: "form-group"
  19267. }, [_h('label', {
  19268. attrs: {
  19269. "for": "baseURL"
  19270. }
  19271. }, ["Self Hosted Url"]), " ", _h('div', {
  19272. staticClass: "inner-addon left-addon"
  19273. }, [_h('i', {
  19274. staticClass: "fa fa-globe"
  19275. }), " ", _h('input', {
  19276. directives: [{
  19277. name: "model",
  19278. rawName: "v-model",
  19279. value: (_vm.baseURL),
  19280. expression: "baseURL"
  19281. }],
  19282. staticClass: "form-control",
  19283. attrs: {
  19284. "id": "baseURL",
  19285. "type": "text",
  19286. "placeholder": "LessPass Database (https://...)"
  19287. },
  19288. domProps: {
  19289. "value": _vm._s(_vm.baseURL)
  19290. },
  19291. on: {
  19292. "input": function($event) {
  19293. if ($event.target.composing) { return; }
  19294. _vm.baseURL = $event.target.value
  19295. }
  19296. }
  19297. }), " ", _h('small', {
  19298. staticClass: "form-text text-muted"
  19299. }, [(_vm.noErrors()) ? _h('span', ["You can use your self hosted LessPass Database"]) : _vm._e(), " ", (_vm.errors.baseURLRequired) ? _h('span', {
  19300. staticClass: "text-danger"
  19301. }, ["\n A LessPass database url is required\n "]) : _vm._e()])])]) : _vm._e(), " ", _h('div', {
  19302. staticClass: "form-group mb-0"
  19303. }, [_h('router-link', {
  19304. attrs: {
  19305. "to": {
  19306. name: 'passwordReset'
  19307. }
  19308. }
  19309. }, [_h('small', ["Forgot your password?"])])])])
  19310. },staticRenderFns: []}
  19311. /***/ },
  19312. /* 208 */
  19313. /***/ function(module, exports) {
  19314. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19315. return (_vm.fingerprint) ? _h('span', {
  19316. staticClass: "input-group-btn"
  19317. }, [_h('button', {
  19318. staticClass: "btn",
  19319. attrs: {
  19320. "id": "fingerprint",
  19321. "type": "button",
  19322. "tabindex": "-1"
  19323. }
  19324. }, [_h('small', {
  19325. staticClass: "hint--left",
  19326. attrs: {
  19327. "aria-label": "master password fingerprint"
  19328. }
  19329. }, [_h('i', {
  19330. staticClass: "fa fa-fw",
  19331. class: [_vm.icon1],
  19332. style: ({
  19333. color: _vm.color1
  19334. })
  19335. }), " ", _h('i', {
  19336. staticClass: "fa fa-fw",
  19337. class: [_vm.icon2],
  19338. style: ({
  19339. color: _vm.color2
  19340. })
  19341. }), " ", _h('i', {
  19342. staticClass: "fa fa-fw",
  19343. class: [_vm.icon3],
  19344. style: ({
  19345. color: _vm.color3
  19346. })
  19347. })])])]) : _vm._e()
  19348. },staticRenderFns: []}
  19349. /***/ },
  19350. /* 209 */
  19351. /***/ function(module, exports) {
  19352. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19353. return _h('div', [_h('div', {
  19354. staticClass: "form-group row"
  19355. }, [_h('div', {
  19356. staticClass: "col-xs-12"
  19357. }, [_h('div', {
  19358. staticClass: "inner-addon left-addon"
  19359. }, [_h('i', {
  19360. staticClass: "fa fa-search"
  19361. }), " ", _h('input', {
  19362. directives: [{
  19363. name: "model",
  19364. rawName: "v-model",
  19365. value: (_vm.searchQuery),
  19366. expression: "searchQuery"
  19367. }],
  19368. staticClass: "form-control",
  19369. attrs: {
  19370. "name": "search",
  19371. "placeholder": "Search"
  19372. },
  19373. domProps: {
  19374. "value": _vm._s(_vm.searchQuery)
  19375. },
  19376. on: {
  19377. "input": function($event) {
  19378. if ($event.target.composing) { return; }
  19379. _vm.searchQuery = $event.target.value
  19380. }
  19381. }
  19382. })])])]), " ", _h('ul', {
  19383. staticClass: "list-group"
  19384. }, [(_vm.passwords.length === 0) ? _h('li', {
  19385. staticClass: "list-group-item"
  19386. }, ["\n You don't have any passwords saved in your database.\n ", _h('router-link', {
  19387. attrs: {
  19388. "to": {
  19389. name: 'home'
  19390. }
  19391. }
  19392. }, ["Would you like to create one ?"])]) : _vm._e(), " ", _vm._l((_vm.filteredPasswords), function(password) {
  19393. return _h('li', {
  19394. staticClass: "list-group-item"
  19395. }, [_h('delete-button', {
  19396. staticClass: "float-xs-right mt-1 text-xs-right",
  19397. attrs: {
  19398. "confirmText": "Are you sure you want to delete this password profile?",
  19399. "confirmButton": "Sure delete it",
  19400. "cancelButton": "Oups no!"
  19401. },
  19402. on: {
  19403. "remove": function($event) {
  19404. _vm.deletePassword(password)
  19405. }
  19406. }
  19407. }), " ", _h('ul', {
  19408. staticClass: "list-unstyled"
  19409. }, [_h('li', [_h('router-link', {
  19410. attrs: {
  19411. "to": {
  19412. name: 'password',
  19413. params: {
  19414. id: password.id
  19415. }
  19416. }
  19417. }
  19418. }, ["\n " + _vm._s(password.site) + "\n "])]), " ", _h('li', ["\n " + _vm._s(password.login) + "\n "])])])
  19419. })])])
  19420. },staticRenderFns: []}
  19421. /***/ },
  19422. /* 210 */
  19423. /***/ function(module, exports) {
  19424. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19425. return _h('form', {
  19426. attrs: {
  19427. "id": "password-generator"
  19428. }
  19429. }, [_h('div', {
  19430. staticClass: "form-group"
  19431. }, [_h('div', {
  19432. staticClass: "inner-addon left-addon"
  19433. }, [_h('label', {
  19434. staticClass: "sr-only",
  19435. attrs: {
  19436. "for": "site"
  19437. }
  19438. }, ["Site"]), " ", _h('i', {
  19439. staticClass: "fa fa-globe"
  19440. }), " ", _h('input', {
  19441. directives: [{
  19442. name: "model",
  19443. rawName: "v-model",
  19444. value: (_vm.password.site),
  19445. expression: "password.site"
  19446. }],
  19447. ref: "site",
  19448. staticClass: "form-control",
  19449. attrs: {
  19450. "id": "site",
  19451. "name": "site",
  19452. "type": "text",
  19453. "placeholder": "Site",
  19454. "list": "savedSites",
  19455. "autocorrect": "off",
  19456. "autocapitalize": "off"
  19457. },
  19458. domProps: {
  19459. "value": _vm._s(_vm.password.site)
  19460. },
  19461. on: {
  19462. "input": function($event) {
  19463. if ($event.target.composing) { return; }
  19464. _vm.password.site = $event.target.value
  19465. }
  19466. }
  19467. }), " ", _h('datalist', {
  19468. attrs: {
  19469. "id": "savedSites"
  19470. }
  19471. }, [_vm._l((_vm.passwords), function(pwd) {
  19472. return _h('option', ["\n " + _vm._s(pwd.site) + " | " + _vm._s(pwd.login) + "\n "])
  19473. })])])]), " ", _h('remove-auto-complete'), " ", _h('div', {
  19474. staticClass: "form-group"
  19475. }, [_h('div', {
  19476. staticClass: "inner-addon left-addon"
  19477. }, [_h('label', {
  19478. staticClass: "sr-only",
  19479. attrs: {
  19480. "for": "login"
  19481. }
  19482. }, ["Login"]), " ", _h('i', {
  19483. staticClass: "fa fa-user"
  19484. }), " ", _h('input', {
  19485. directives: [{
  19486. name: "model",
  19487. rawName: "v-model",
  19488. value: (_vm.password.login),
  19489. expression: "password.login"
  19490. }],
  19491. staticClass: "form-control",
  19492. attrs: {
  19493. "id": "login",
  19494. "name": "login",
  19495. "type": "text",
  19496. "placeholder": "Login",
  19497. "autocomplete": "off",
  19498. "autocorrect": "off",
  19499. "autocapitalize": "off"
  19500. },
  19501. domProps: {
  19502. "value": _vm._s(_vm.password.login)
  19503. },
  19504. on: {
  19505. "input": function($event) {
  19506. if ($event.target.composing) { return; }
  19507. _vm.password.login = $event.target.value
  19508. }
  19509. }
  19510. })])]), " ", _h('div', {
  19511. staticClass: "form-group"
  19512. }, [_h('div', {
  19513. staticClass: "inner-addon left-addon input-group"
  19514. }, [_h('label', {
  19515. staticClass: "sr-only",
  19516. attrs: {
  19517. "for": "masterPassword"
  19518. }
  19519. }, ["Master Password"]), " ", _h('i', {
  19520. staticClass: "fa fa-lock"
  19521. }), " ", _h('input', {
  19522. directives: [{
  19523. name: "model",
  19524. rawName: "v-model",
  19525. value: (_vm.masterPassword),
  19526. expression: "masterPassword"
  19527. }],
  19528. ref: "masterPassword",
  19529. staticClass: "form-control",
  19530. attrs: {
  19531. "id": "masterPassword",
  19532. "name": "masterPassword",
  19533. "type": "password",
  19534. "placeholder": "Master password",
  19535. "autocomplete": "new-password",
  19536. "autocorrect": "off",
  19537. "autocapitalize": "off"
  19538. },
  19539. domProps: {
  19540. "value": _vm._s(_vm.masterPassword)
  19541. },
  19542. on: {
  19543. "keyup": function($event) {
  19544. if ($event.keyCode !== 13) { return; }
  19545. $event.preventDefault();
  19546. _vm.generatePassword($event)
  19547. },
  19548. "input": function($event) {
  19549. if ($event.target.composing) { return; }
  19550. _vm.masterPassword = $event.target.value
  19551. }
  19552. }
  19553. }), " ", _h('fingerprint', {
  19554. attrs: {
  19555. "fingerprint": _vm.fingerprint
  19556. },
  19557. nativeOn: {
  19558. "click": function($event) {
  19559. _vm.togglePasswordType(_vm.$refs.masterPassword)
  19560. }
  19561. }
  19562. })])]), " ", _h('div', {
  19563. staticClass: "form-group row"
  19564. }, [_h('div', {
  19565. directives: [{
  19566. name: "show",
  19567. rawName: "v-show",
  19568. value: (_vm.generatedPassword),
  19569. expression: "generatedPassword"
  19570. }],
  19571. staticClass: "col-xs-9"
  19572. }, [_h('div', {
  19573. staticClass: "input-group"
  19574. }, [_h('span', {
  19575. staticClass: "input-group-btn"
  19576. }, [_h('button', {
  19577. ref: "copyPasswordButton",
  19578. staticClass: "btn",
  19579. class: {
  19580. 'btn-warning': _vm.password.version === 1, 'btn-primary': _vm.password.version === 2
  19581. },
  19582. attrs: {
  19583. "id": "copyPasswordButton",
  19584. "type": "button",
  19585. "data-clipboard-text": ""
  19586. }
  19587. }, [_h('i', {
  19588. staticClass: "fa fa-clipboard",
  19589. attrs: {
  19590. "aria-hidden": "true"
  19591. }
  19592. })])]), " ", _h('input', {
  19593. ref: "generatedPassword",
  19594. staticClass: "form-control",
  19595. class: {
  19596. 'btn-outline-warning': _vm.password.version === 1, 'btn-outline-primary': _vm.password.version === 2
  19597. },
  19598. attrs: {
  19599. "type": "password",
  19600. "tabindex": "-1"
  19601. },
  19602. domProps: {
  19603. "value": _vm.generatedPassword
  19604. }
  19605. }), " ", _h('span', {
  19606. staticClass: "input-group-btn"
  19607. }, [_h('button', {
  19608. staticClass: "btn",
  19609. class: {
  19610. 'btn-outline-warning': _vm.password.version === 1, 'btn-outline-primary': _vm.password.version === 2
  19611. },
  19612. attrs: {
  19613. "id": "revealGeneratedPassword",
  19614. "type": "button"
  19615. },
  19616. on: {
  19617. "click": function($event) {
  19618. _vm.togglePasswordType(_vm.$refs.generatedPassword)
  19619. }
  19620. }
  19621. }, [_h('i', {
  19622. staticClass: "fa fa-eye",
  19623. attrs: {
  19624. "aria-hidden": "true"
  19625. }
  19626. })])])])]), " ", _h('div', {
  19627. directives: [{
  19628. name: "show",
  19629. rawName: "v-show",
  19630. value: (!_vm.generatedPassword),
  19631. expression: "!generatedPassword"
  19632. }],
  19633. staticClass: "col-xs-9"
  19634. }, [_h('button', {
  19635. staticClass: "btn",
  19636. class: {
  19637. 'btn-warning': _vm.password.version === 1, 'btn-primary': _vm.password.version === 2
  19638. },
  19639. attrs: {
  19640. "type": "button"
  19641. },
  19642. on: {
  19643. "click": _vm.generatePassword
  19644. }
  19645. }, [(!_vm.generatingPassword) ? _h('span', ["Generate"]) : _vm._e(), " ", (_vm.generatingPassword) ? _h('span', ["Generating..."]) : _vm._e()]), " ", _h('button', {
  19646. staticClass: "btn btn-secondary",
  19647. class: {
  19648. 'btn-outline-warning': _vm.password.version === 1, 'btn-outline-primary': _vm.password.version === 2
  19649. },
  19650. attrs: {
  19651. "type": "button"
  19652. },
  19653. on: {
  19654. "click": _vm.toggleVersion
  19655. }
  19656. }, [_h('small', {
  19657. directives: [{
  19658. name: "show",
  19659. rawName: "v-show",
  19660. value: (_vm.password.version === 1),
  19661. expression: "password.version===1"
  19662. }]
  19663. }, ["v1"]), " ", _h('small', {
  19664. directives: [{
  19665. name: "show",
  19666. rawName: "v-show",
  19667. value: (_vm.password.version === 2),
  19668. expression: "password.version===2"
  19669. }]
  19670. }, ["v2"])])]), " ", _h('div', {
  19671. staticClass: "col-xs-3"
  19672. }, [_h('div', {
  19673. staticClass: "btn-group float-xs-right",
  19674. attrs: {
  19675. "role": "group"
  19676. }
  19677. }, [_h('button', {
  19678. staticClass: "btn btn-secondary",
  19679. attrs: {
  19680. "type": "button"
  19681. },
  19682. on: {
  19683. "click": function($event) {
  19684. _vm.showOptions = !_vm.showOptions
  19685. }
  19686. }
  19687. }, [_h('i', {
  19688. staticClass: "fa fa-sliders",
  19689. attrs: {
  19690. "aria-hidden": "true"
  19691. }
  19692. })])])])]), " ", (_vm.showOptions) ? _h('div', {
  19693. staticClass: "form-group pt-1"
  19694. }, [_h('label', {
  19695. staticClass: "form-check-inline"
  19696. }, [_h('input', {
  19697. directives: [{
  19698. name: "model",
  19699. rawName: "v-model",
  19700. value: (_vm.password.lowercase),
  19701. expression: "password.lowercase"
  19702. }],
  19703. staticClass: "form-check-input",
  19704. attrs: {
  19705. "type": "checkbox",
  19706. "id": "lowercase"
  19707. },
  19708. domProps: {
  19709. "checked": Array.isArray(_vm.password.lowercase) ? _vm._i(_vm.password.lowercase, null) > -1 : _vm._q(_vm.password.lowercase, true)
  19710. },
  19711. on: {
  19712. "change": function($event) {
  19713. var $$a = _vm.password.lowercase,
  19714. $$el = $event.target,
  19715. $$c = $$el.checked ? (true) : (false);
  19716. if (Array.isArray($$a)) {
  19717. var $$v = null,
  19718. $$i = _vm._i($$a, $$v);
  19719. if ($$c) {
  19720. $$i < 0 && (_vm.password.lowercase = $$a.concat($$v))
  19721. } else {
  19722. $$i > -1 && (_vm.password.lowercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19723. }
  19724. } else {
  19725. _vm.password.lowercase = $$c
  19726. }
  19727. }
  19728. }
  19729. }), " abc\n "]), " ", _h('label', {
  19730. staticClass: "form-check-inline"
  19731. }, [_h('input', {
  19732. directives: [{
  19733. name: "model",
  19734. rawName: "v-model",
  19735. value: (_vm.password.uppercase),
  19736. expression: "password.uppercase"
  19737. }],
  19738. staticClass: "form-check-input",
  19739. attrs: {
  19740. "type": "checkbox",
  19741. "id": "uppercase"
  19742. },
  19743. domProps: {
  19744. "checked": Array.isArray(_vm.password.uppercase) ? _vm._i(_vm.password.uppercase, null) > -1 : _vm._q(_vm.password.uppercase, true)
  19745. },
  19746. on: {
  19747. "change": function($event) {
  19748. var $$a = _vm.password.uppercase,
  19749. $$el = $event.target,
  19750. $$c = $$el.checked ? (true) : (false);
  19751. if (Array.isArray($$a)) {
  19752. var $$v = null,
  19753. $$i = _vm._i($$a, $$v);
  19754. if ($$c) {
  19755. $$i < 0 && (_vm.password.uppercase = $$a.concat($$v))
  19756. } else {
  19757. $$i > -1 && (_vm.password.uppercase = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19758. }
  19759. } else {
  19760. _vm.password.uppercase = $$c
  19761. }
  19762. }
  19763. }
  19764. }), " ABC\n "]), " ", _h('label', {
  19765. staticClass: "form-check-inline"
  19766. }, [_h('input', {
  19767. directives: [{
  19768. name: "model",
  19769. rawName: "v-model",
  19770. value: (_vm.password.numbers),
  19771. expression: "password.numbers"
  19772. }],
  19773. staticClass: "form-check-input",
  19774. attrs: {
  19775. "type": "checkbox",
  19776. "id": "numbers"
  19777. },
  19778. domProps: {
  19779. "checked": Array.isArray(_vm.password.numbers) ? _vm._i(_vm.password.numbers, null) > -1 : _vm._q(_vm.password.numbers, true)
  19780. },
  19781. on: {
  19782. "change": function($event) {
  19783. var $$a = _vm.password.numbers,
  19784. $$el = $event.target,
  19785. $$c = $$el.checked ? (true) : (false);
  19786. if (Array.isArray($$a)) {
  19787. var $$v = null,
  19788. $$i = _vm._i($$a, $$v);
  19789. if ($$c) {
  19790. $$i < 0 && (_vm.password.numbers = $$a.concat($$v))
  19791. } else {
  19792. $$i > -1 && (_vm.password.numbers = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19793. }
  19794. } else {
  19795. _vm.password.numbers = $$c
  19796. }
  19797. }
  19798. }
  19799. }), "\n 123\n "]), " ", _h('label', {
  19800. staticClass: "form-check-inline"
  19801. }, [_h('input', {
  19802. directives: [{
  19803. name: "model",
  19804. rawName: "v-model",
  19805. value: (_vm.password.symbols),
  19806. expression: "password.symbols"
  19807. }],
  19808. staticClass: "form-check-input",
  19809. attrs: {
  19810. "type": "checkbox",
  19811. "id": "symbols"
  19812. },
  19813. domProps: {
  19814. "checked": Array.isArray(_vm.password.symbols) ? _vm._i(_vm.password.symbols, null) > -1 : _vm._q(_vm.password.symbols, true)
  19815. },
  19816. on: {
  19817. "change": function($event) {
  19818. var $$a = _vm.password.symbols,
  19819. $$el = $event.target,
  19820. $$c = $$el.checked ? (true) : (false);
  19821. if (Array.isArray($$a)) {
  19822. var $$v = null,
  19823. $$i = _vm._i($$a, $$v);
  19824. if ($$c) {
  19825. $$i < 0 && (_vm.password.symbols = $$a.concat($$v))
  19826. } else {
  19827. $$i > -1 && (_vm.password.symbols = $$a.slice(0, $$i).concat($$a.slice($$i + 1)))
  19828. }
  19829. } else {
  19830. _vm.password.symbols = $$c
  19831. }
  19832. }
  19833. }
  19834. }), "\n %!@\n "])]) : _vm._e(), " ", (_vm.showOptions) ? _h('div', {
  19835. staticClass: "form-group row"
  19836. }, [_h('div', {
  19837. staticClass: "col-xs-6"
  19838. }, [_h('label', {
  19839. attrs: {
  19840. "for": "passwordLength"
  19841. }
  19842. }, ["Length"]), " ", _h('div', {
  19843. staticClass: "input-group"
  19844. }, [_h('input', {
  19845. directives: [{
  19846. name: "model",
  19847. rawName: "v-model",
  19848. value: (_vm.password.length),
  19849. expression: "password.length"
  19850. }],
  19851. staticClass: "form-control",
  19852. attrs: {
  19853. "type": "number",
  19854. "id": "passwordLength",
  19855. "min": "4"
  19856. },
  19857. domProps: {
  19858. "value": _vm._s(_vm.password.length)
  19859. },
  19860. on: {
  19861. "input": function($event) {
  19862. if ($event.target.composing) { return; }
  19863. _vm.password.length = _vm._n($event.target.value)
  19864. }
  19865. }
  19866. }), " ", _h('span', {
  19867. staticClass: "input-group-addon",
  19868. on: {
  19869. "click": function($event) {
  19870. $event.preventDefault();
  19871. _vm.decrementPasswordLength($event)
  19872. }
  19873. }
  19874. }, [_h('i', {
  19875. staticClass: "fa fa-minus",
  19876. attrs: {
  19877. "aria-hidden": "true"
  19878. }
  19879. })]), " ", _h('span', {
  19880. staticClass: "input-group-addon",
  19881. on: {
  19882. "click": function($event) {
  19883. $event.preventDefault();
  19884. _vm.incrementPasswordLength($event)
  19885. }
  19886. }
  19887. }, [_h('i', {
  19888. staticClass: "fa fa-plus",
  19889. attrs: {
  19890. "aria-hidden": "true"
  19891. }
  19892. })])])]), " ", _h('div', {
  19893. staticClass: "col-xs-6"
  19894. }, [_h('label', {
  19895. attrs: {
  19896. "for": "passwordCounter"
  19897. }
  19898. }, ["Counter"]), " ", _h('div', {
  19899. staticClass: "input-group"
  19900. }, [_h('input', {
  19901. directives: [{
  19902. name: "model",
  19903. rawName: "v-model",
  19904. value: (_vm.password.counter),
  19905. expression: "password.counter"
  19906. }],
  19907. staticClass: "form-control",
  19908. attrs: {
  19909. "type": "number",
  19910. "id": "passwordCounter",
  19911. "min": "1"
  19912. },
  19913. domProps: {
  19914. "value": _vm._s(_vm.password.counter)
  19915. },
  19916. on: {
  19917. "input": function($event) {
  19918. if ($event.target.composing) { return; }
  19919. _vm.password.counter = _vm._n($event.target.value)
  19920. }
  19921. }
  19922. }), " ", _h('span', {
  19923. staticClass: "input-group-addon",
  19924. on: {
  19925. "click": function($event) {
  19926. $event.preventDefault();
  19927. _vm.decrementCounter($event)
  19928. }
  19929. }
  19930. }, [_h('i', {
  19931. staticClass: "fa fa-minus",
  19932. attrs: {
  19933. "aria-hidden": "true"
  19934. }
  19935. })]), " ", _h('span', {
  19936. staticClass: "input-group-addon",
  19937. on: {
  19938. "click": function($event) {
  19939. $event.preventDefault();
  19940. _vm.incrementCounter($event)
  19941. }
  19942. }
  19943. }, [_h('i', {
  19944. staticClass: "fa fa-plus",
  19945. attrs: {
  19946. "aria-hidden": "true"
  19947. }
  19948. })])])])]) : _vm._e(), " ", (_vm.showOptions) ? _h('div', {
  19949. staticClass: "form-group"
  19950. }, [_h('button', {
  19951. staticClass: "btn btn-secondary btn-sm",
  19952. attrs: {
  19953. "type": "button"
  19954. },
  19955. on: {
  19956. "click": _vm.saveDefault
  19957. }
  19958. }, ["\n save as default\n "]), " ", (_vm.optionsSaved) ? _h('span', {
  19959. staticClass: "text-success"
  19960. }, [_h('i', {
  19961. staticClass: "fa fa-check",
  19962. attrs: {
  19963. "aria-hidden": "true"
  19964. }
  19965. })]) : _vm._e()]) : _vm._e(), " ", (_vm.showError) ? _h('div', {
  19966. staticClass: "form-group"
  19967. }, [_h('div', {
  19968. staticClass: "alert alert-danger",
  19969. attrs: {
  19970. "role": "alert"
  19971. }
  19972. }, ["\n site, login and master password fields are mandatory\n "])]) : _vm._e(), " ", (_vm.version === 1 && !_vm.showError && !_vm.showOptions) ? _h('div', {
  19973. staticClass: "form-group mb-0"
  19974. }, [_h('div', {
  19975. staticClass: "alert alert-warning mb-0",
  19976. attrs: {
  19977. "role": "alert"
  19978. }
  19979. }, [_h('small', [_h('i', {
  19980. staticClass: "fa fa-exclamation-triangle",
  19981. attrs: {
  19982. "aria-hidden": "true"
  19983. }
  19984. }), "\n You are using a deprecated version of LessPass.\n The default version will be version 2 in\n ", _h('strong', {
  19985. staticClass: "hint--right",
  19986. attrs: {
  19987. "aria-label": "10 jan 2017"
  19988. }
  19989. }, [_vm._s(_vm.getDayBeforeV2()) + " days"]), ".\n You can continue to use version 1, but we strongly advise you to migrate your passwords to\n version 2.\n "])])]) : _vm._e()])
  19990. },staticRenderFns: []}
  19991. /***/ },
  19992. /* 211 */
  19993. /***/ function(module, exports) {
  19994. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  19995. return _h('div', {
  19996. staticClass: "card",
  19997. class: {
  19998. 'v1': _vm.version === 1, 'v2': _vm.version === 2
  19999. },
  20000. staticStyle: {
  20001. "max-width": "470px"
  20002. },
  20003. attrs: {
  20004. "id": "lesspass"
  20005. }
  20006. }, [_h('lesspass-menu'), " ", _h('div', {
  20007. staticClass: "card-block"
  20008. }, [_h('router-view')])])
  20009. },staticRenderFns: []}
  20010. /***/ },
  20011. /* 212 */
  20012. /***/ function(module, exports) {
  20013. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  20014. return _h('form', {
  20015. on: {
  20016. "submit": function($event) {
  20017. $event.preventDefault();
  20018. _vm.resetPassword($event)
  20019. }
  20020. }
  20021. }, [(_vm.showError) ? _h('div', {
  20022. staticClass: "form-group row"
  20023. }, [_h('div', {
  20024. staticClass: "col-xs-12 text-muted text-danger"
  20025. }, ["\n Oops! Something went wrong. Retry in a few minutes.\n "])]) : _vm._e(), " ", (_vm.successMessage) ? _h('div', {
  20026. staticClass: "form-group row"
  20027. }, [_h('div', {
  20028. staticClass: "col-xs-12 text-muted text-success"
  20029. }, ["\n If a matching account was found an email was sent to allow you to reset your password.\n "])]) : _vm._e(), " ", _h('div', {
  20030. staticClass: "form-group row"
  20031. }, [_h('div', {
  20032. staticClass: "col-xs-12"
  20033. }, [_h('div', {
  20034. staticClass: "inner-addon left-addon"
  20035. }, [_h('i', {
  20036. staticClass: "fa fa-user"
  20037. }), " ", _h('input', {
  20038. directives: [{
  20039. name: "model",
  20040. rawName: "v-model",
  20041. value: (_vm.email),
  20042. expression: "email"
  20043. }],
  20044. staticClass: "form-control",
  20045. attrs: {
  20046. "id": "email",
  20047. "name": "email",
  20048. "type": "email",
  20049. "placeholder": "Email"
  20050. },
  20051. domProps: {
  20052. "value": _vm._s(_vm.email)
  20053. },
  20054. on: {
  20055. "input": function($event) {
  20056. if ($event.target.composing) { return; }
  20057. _vm.email = $event.target.value
  20058. }
  20059. }
  20060. }), " ", _h('small', {
  20061. staticClass: "form-text text-muted text-danger"
  20062. }, [(_vm.emailRequired) ? _h('span', ["An email is required"]) : _vm._e()])])])]), " ", _h('div', {
  20063. staticClass: "form-group row"
  20064. }, [_h('div', {
  20065. staticClass: "col-xs-12"
  20066. }, [_h('button', {
  20067. staticClass: "btn",
  20068. class: {
  20069. 'btn-warning': _vm.version === 1, 'btn-primary': _vm.version === 2
  20070. },
  20071. attrs: {
  20072. "id": "loginButton",
  20073. "type": "submit"
  20074. }
  20075. }, [(_vm.loading) ? _h('span', [_h('i', {
  20076. staticClass: "fa fa-spinner fa-pulse fa-fw"
  20077. })]) : _vm._e(), "\n Send me a reset link\n "])])])])
  20078. },staticRenderFns: []}
  20079. /***/ },
  20080. /* 213 */
  20081. /***/ function(module, exports) {
  20082. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  20083. return _h('div', {
  20084. attrs: {
  20085. "id": "delete-button"
  20086. }
  20087. }, [(_vm.confirm) ? _h('div', {
  20088. staticClass: "form-group has-danger"
  20089. }, [_h('button', {
  20090. staticClass: "btn btn-danger btn-sm",
  20091. attrs: {
  20092. "type": "button"
  20093. },
  20094. on: {
  20095. "click": function($event) {
  20096. $event.preventDefault();
  20097. _vm.confirmDelete($event)
  20098. }
  20099. }
  20100. }, ["\n " + _vm._s(_vm.confirmButton) + "\n "]), " ", _h('button', {
  20101. staticClass: "btn btn-secondary btn-sm",
  20102. attrs: {
  20103. "type": "button"
  20104. },
  20105. on: {
  20106. "click": function($event) {
  20107. $event.preventDefault();
  20108. _vm.confirm = false
  20109. }
  20110. }
  20111. }, ["\n " + _vm._s(_vm.cancelButton) + "\n "]), " ", _h('div', {
  20112. staticClass: "form-control-feedback"
  20113. }, [_vm._s(_vm.confirmText)])]) : _vm._e(), " ", (!_vm.confirm) ? _h('button', {
  20114. staticClass: "btn btn-outline-danger btn-sm",
  20115. attrs: {
  20116. "type": "button"
  20117. },
  20118. on: {
  20119. "click": function($event) {
  20120. $event.preventDefault();
  20121. _vm.confirm = true
  20122. }
  20123. }
  20124. }, [_h('i', {
  20125. staticClass: "fa fa-trash fa-fw"
  20126. })]) : _vm._e()])
  20127. },staticRenderFns: []}
  20128. /***/ },
  20129. /* 214 */
  20130. /***/ function(module, exports) {
  20131. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  20132. return _h('form', {
  20133. on: {
  20134. "submit": function($event) {
  20135. $event.preventDefault();
  20136. _vm.resetPasswordConfirm($event)
  20137. }
  20138. }
  20139. }, [(_vm.showError) ? _h('div', {
  20140. staticClass: "form-group row"
  20141. }, [_h('div', {
  20142. staticClass: "col-xs-12 text-muted text-danger"
  20143. }, ["\n " + _vm._s(_vm.errorMessage) + "\n "])]) : _vm._e(), " ", (_vm.successMessage) ? _h('div', {
  20144. staticClass: "form-group row"
  20145. }, [_h('div', {
  20146. staticClass: "col-xs-12 text-muted text-success"
  20147. }, ["\n You're password was reset successfully.\n ", _h('router-link', {
  20148. attrs: {
  20149. "to": {
  20150. name: 'login'
  20151. }
  20152. }
  20153. }, ["Do you want to login ?"])])]) : _vm._e(), " ", _h('div', {
  20154. staticClass: "form-group row"
  20155. }, [_h('div', {
  20156. staticClass: "col-xs-12"
  20157. }, [_h('div', {
  20158. staticClass: "inner-addon left-addon"
  20159. }, [_h('i', {
  20160. staticClass: "fa fa-lock"
  20161. }), " ", _h('input', {
  20162. directives: [{
  20163. name: "model",
  20164. rawName: "v-model",
  20165. value: (_vm.new_password),
  20166. expression: "new_password"
  20167. }],
  20168. staticClass: "form-control",
  20169. attrs: {
  20170. "id": "new-password",
  20171. "name": "new-password",
  20172. "type": "password",
  20173. "autocomplete": "new-password",
  20174. "placeholder": "New Password"
  20175. },
  20176. domProps: {
  20177. "value": _vm._s(_vm.new_password)
  20178. },
  20179. on: {
  20180. "input": function($event) {
  20181. if ($event.target.composing) { return; }
  20182. _vm.new_password = $event.target.value
  20183. }
  20184. }
  20185. }), " ", _h('small', {
  20186. staticClass: "form-text text-muted text-danger"
  20187. }, [(_vm.passwordRequired) ? _h('span', ["A password is required"]) : _vm._e()])])])]), " ", _h('div', {
  20188. staticClass: "form-group row"
  20189. }, [_h('div', {
  20190. staticClass: "col-xs-12"
  20191. }, [_h('button', {
  20192. staticClass: "btn",
  20193. class: {
  20194. 'btn-warning': _vm.version === 1, 'btn-primary': _vm.version === 2
  20195. },
  20196. attrs: {
  20197. "id": "loginButton",
  20198. "type": "submit"
  20199. }
  20200. }, ["\n Reset my password\n "])])])])
  20201. },staticRenderFns: []}
  20202. /***/ },
  20203. /* 215 */
  20204. /***/ function(module, exports) {
  20205. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;
  20206. return _h('div', {
  20207. attrs: {
  20208. "id": "menu"
  20209. }
  20210. }, [_h('div', {
  20211. directives: [{
  20212. name: "show",
  20213. rawName: "v-show",
  20214. value: (_vm.isAuthenticated),
  20215. expression: "isAuthenticated"
  20216. }],
  20217. staticClass: "card-header",
  20218. class: {
  20219. 'card-warning': _vm.version === 1, 'card-primary': _vm.version === 2
  20220. }
  20221. }, [_h('div', {
  20222. staticClass: "row"
  20223. }, [_h('div', {
  20224. staticClass: "col-xs-6"
  20225. }, [_h('router-link', {
  20226. staticClass: "white-link",
  20227. attrs: {
  20228. "to": {
  20229. name: 'home'
  20230. }
  20231. }
  20232. }, ["LessPass"]), " ", _h('span', {
  20233. staticClass: "white-link",
  20234. on: {
  20235. "click": _vm.saveOrUpdatePassword
  20236. }
  20237. }, [(_vm.passwordStatus == 'DIRTY') ? _h('i', {
  20238. staticClass: "fa fa-save ml-1 fa-clickable"
  20239. }) : _vm._e()]), " ", (_vm.passwordStatus == 'CREATED' || _vm.passwordStatus == 'UPDATED') ? _h('span', {
  20240. staticClass: "text-success"
  20241. }, [_h('i', {
  20242. staticClass: "fa fa-check ml-1 text-success"
  20243. })]) : _vm._e()]), " ", _h('div', {
  20244. staticClass: "col-xs-6 text-xs-right"
  20245. }, [_h('router-link', {
  20246. staticClass: "white-link ml-1",
  20247. attrs: {
  20248. "to": {
  20249. name: 'passwords'
  20250. }
  20251. }
  20252. }, [_h('i', {
  20253. staticClass: "fa fa-key",
  20254. attrs: {
  20255. "aria-hidden": "true"
  20256. }
  20257. })]), " ", _h('button', {
  20258. staticClass: "white-link ml-1 btn btn-link p-0 m-0",
  20259. attrs: {
  20260. "type": "button"
  20261. },
  20262. on: {
  20263. "click": _vm.logout
  20264. }
  20265. }, [_h('i', {
  20266. staticClass: "fa fa-sign-out",
  20267. attrs: {
  20268. "aria-hidden": "true"
  20269. }
  20270. })])])])]), " ", _h('div', {
  20271. directives: [{
  20272. name: "show",
  20273. rawName: "v-show",
  20274. value: (_vm.isGuest),
  20275. expression: "isGuest"
  20276. }],
  20277. staticClass: "card-header",
  20278. class: {
  20279. 'card-warning': _vm.version === 1, 'card-primary': _vm.version === 2
  20280. }
  20281. }, [_h('div', {
  20282. staticClass: "row"
  20283. }, [_h('div', {
  20284. staticClass: "index-header"
  20285. }, [_h('div', {
  20286. staticClass: "col-xs-6"
  20287. }, [_h('router-link', {
  20288. staticClass: "white-link",
  20289. attrs: {
  20290. "to": {
  20291. name: 'home'
  20292. }
  20293. }
  20294. }, ["LessPass"])]), " ", _h('div', {
  20295. staticClass: "col-xs-6 text-xs-right"
  20296. }, [_h('router-link', {
  20297. staticClass: "white-link pl-1",
  20298. attrs: {
  20299. "to": {
  20300. name: 'login'
  20301. }
  20302. }
  20303. }, [_h('i', {
  20304. staticClass: "fa fa-user-secret fa-clickable",
  20305. attrs: {
  20306. "aria-hidden": "true"
  20307. }
  20308. })])])])])])])
  20309. },staticRenderFns: []}
  20310. /***/ },
  20311. /* 216 */
  20312. /***/ function(module, exports, __webpack_require__) {
  20313. "use strict";
  20314. /* WEBPACK VAR INJECTION */(function(process) {/**
  20315. * vue-router v2.1.0
  20316. * (c) 2016 Evan You
  20317. * @license MIT
  20318. */
  20319. 'use strict';
  20320. var View = {
  20321. name: 'router-view',
  20322. functional: true,
  20323. props: {
  20324. name: {
  20325. type: String,
  20326. default: 'default'
  20327. }
  20328. },
  20329. render: function render (h, ref) {
  20330. var props = ref.props;
  20331. var children = ref.children;
  20332. var parent = ref.parent;
  20333. var data = ref.data;
  20334. data.routerView = true
  20335. var route = parent.$route
  20336. var cache = parent._routerViewCache || (parent._routerViewCache = {})
  20337. var depth = 0
  20338. var inactive = false
  20339. while (parent) {
  20340. if (parent.$vnode && parent.$vnode.data.routerView) {
  20341. depth++
  20342. }
  20343. if (parent._inactive) {
  20344. inactive = true
  20345. }
  20346. parent = parent.$parent
  20347. }
  20348. data.routerViewDepth = depth
  20349. var matched = route.matched[depth]
  20350. if (!matched) {
  20351. return h()
  20352. }
  20353. var name = props.name
  20354. var component = inactive
  20355. ? cache[name]
  20356. : (cache[name] = matched.components[name])
  20357. if (!inactive) {
  20358. var hooks = data.hook || (data.hook = {})
  20359. hooks.init = function (vnode) {
  20360. matched.instances[name] = vnode.child
  20361. }
  20362. hooks.prepatch = function (oldVnode, vnode) {
  20363. matched.instances[name] = vnode.child
  20364. }
  20365. hooks.destroy = function (vnode) {
  20366. if (matched.instances[name] === vnode.child) {
  20367. matched.instances[name] = undefined
  20368. }
  20369. }
  20370. }
  20371. return h(component, data, children)
  20372. }
  20373. }
  20374. /* */
  20375. function assert (condition, message) {
  20376. if (!condition) {
  20377. throw new Error(("[vue-router] " + message))
  20378. }
  20379. }
  20380. function warn (condition, message) {
  20381. if (!condition) {
  20382. typeof console !== 'undefined' && console.warn(("[vue-router] " + message))
  20383. }
  20384. }
  20385. /* */
  20386. var encode = encodeURIComponent
  20387. var decode = decodeURIComponent
  20388. function resolveQuery (
  20389. query,
  20390. extraQuery
  20391. ) {
  20392. if ( extraQuery === void 0 ) extraQuery = {};
  20393. if (query) {
  20394. var parsedQuery
  20395. try {
  20396. parsedQuery = parseQuery(query)
  20397. } catch (e) {
  20398. process.env.NODE_ENV !== 'production' && warn(false, e.message)
  20399. parsedQuery = {}
  20400. }
  20401. for (var key in extraQuery) {
  20402. parsedQuery[key] = extraQuery[key]
  20403. }
  20404. return parsedQuery
  20405. } else {
  20406. return extraQuery
  20407. }
  20408. }
  20409. function parseQuery (query) {
  20410. var res = {}
  20411. query = query.trim().replace(/^(\?|#|&)/, '')
  20412. if (!query) {
  20413. return res
  20414. }
  20415. query.split('&').forEach(function (param) {
  20416. var parts = param.replace(/\+/g, ' ').split('=')
  20417. var key = decode(parts.shift())
  20418. var val = parts.length > 0
  20419. ? decode(parts.join('='))
  20420. : null
  20421. if (res[key] === undefined) {
  20422. res[key] = val
  20423. } else if (Array.isArray(res[key])) {
  20424. res[key].push(val)
  20425. } else {
  20426. res[key] = [res[key], val]
  20427. }
  20428. })
  20429. return res
  20430. }
  20431. function stringifyQuery (obj) {
  20432. var res = obj ? Object.keys(obj).map(function (key) {
  20433. var val = obj[key]
  20434. if (val === undefined) {
  20435. return ''
  20436. }
  20437. if (val === null) {
  20438. return encode(key)
  20439. }
  20440. if (Array.isArray(val)) {
  20441. var result = []
  20442. val.slice().forEach(function (val2) {
  20443. if (val2 === undefined) {
  20444. return
  20445. }
  20446. if (val2 === null) {
  20447. result.push(encode(key))
  20448. } else {
  20449. result.push(encode(key) + '=' + encode(val2))
  20450. }
  20451. })
  20452. return result.join('&')
  20453. }
  20454. return encode(key) + '=' + encode(val)
  20455. }).filter(function (x) { return x.length > 0; }).join('&') : null
  20456. return res ? ("?" + res) : ''
  20457. }
  20458. /* */
  20459. function createRoute (
  20460. record,
  20461. location,
  20462. redirectedFrom
  20463. ) {
  20464. var route = {
  20465. name: location.name || (record && record.name),
  20466. meta: (record && record.meta) || {},
  20467. path: location.path || '/',
  20468. hash: location.hash || '',
  20469. query: location.query || {},
  20470. params: location.params || {},
  20471. fullPath: getFullPath(location),
  20472. matched: record ? formatMatch(record) : []
  20473. }
  20474. if (redirectedFrom) {
  20475. route.redirectedFrom = getFullPath(redirectedFrom)
  20476. }
  20477. return Object.freeze(route)
  20478. }
  20479. // the starting route that represents the initial state
  20480. var START = createRoute(null, {
  20481. path: '/'
  20482. })
  20483. function formatMatch (record) {
  20484. var res = []
  20485. while (record) {
  20486. res.unshift(record)
  20487. record = record.parent
  20488. }
  20489. return res
  20490. }
  20491. function getFullPath (ref) {
  20492. var path = ref.path;
  20493. var query = ref.query; if ( query === void 0 ) query = {};
  20494. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  20495. return (path || '/') + stringifyQuery(query) + hash
  20496. }
  20497. var trailingSlashRE = /\/$/
  20498. function isSameRoute (a, b) {
  20499. if (b === START) {
  20500. return a === b
  20501. } else if (!b) {
  20502. return false
  20503. } else if (a.path && b.path) {
  20504. return (
  20505. a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') &&
  20506. a.hash === b.hash &&
  20507. isObjectEqual(a.query, b.query)
  20508. )
  20509. } else if (a.name && b.name) {
  20510. return (
  20511. a.name === b.name &&
  20512. a.hash === b.hash &&
  20513. isObjectEqual(a.query, b.query) &&
  20514. isObjectEqual(a.params, b.params)
  20515. )
  20516. } else {
  20517. return false
  20518. }
  20519. }
  20520. function isObjectEqual (a, b) {
  20521. if ( a === void 0 ) a = {};
  20522. if ( b === void 0 ) b = {};
  20523. var aKeys = Object.keys(a)
  20524. var bKeys = Object.keys(b)
  20525. if (aKeys.length !== bKeys.length) {
  20526. return false
  20527. }
  20528. return aKeys.every(function (key) { return String(a[key]) === String(b[key]); })
  20529. }
  20530. function isIncludedRoute (current, target) {
  20531. return (
  20532. current.path.indexOf(target.path.replace(/\/$/, '')) === 0 &&
  20533. (!target.hash || current.hash === target.hash) &&
  20534. queryIncludes(current.query, target.query)
  20535. )
  20536. }
  20537. function queryIncludes (current, target) {
  20538. for (var key in target) {
  20539. if (!(key in current)) {
  20540. return false
  20541. }
  20542. }
  20543. return true
  20544. }
  20545. /* */
  20546. // work around weird flow bug
  20547. var toTypes = [String, Object]
  20548. var Link = {
  20549. name: 'router-link',
  20550. props: {
  20551. to: {
  20552. type: toTypes,
  20553. required: true
  20554. },
  20555. tag: {
  20556. type: String,
  20557. default: 'a'
  20558. },
  20559. exact: Boolean,
  20560. append: Boolean,
  20561. replace: Boolean,
  20562. activeClass: String,
  20563. event: {
  20564. type: [String, Array],
  20565. default: 'click'
  20566. }
  20567. },
  20568. render: function render (h) {
  20569. var this$1 = this;
  20570. var router = this.$router
  20571. var current = this.$route
  20572. var ref = router.resolve(this.to, current, this.append);
  20573. var normalizedTo = ref.normalizedTo;
  20574. var resolved = ref.resolved;
  20575. var href = ref.href;
  20576. var classes = {}
  20577. var activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'
  20578. var compareTarget = normalizedTo.path ? createRoute(null, normalizedTo) : resolved
  20579. classes[activeClass] = this.exact
  20580. ? isSameRoute(current, compareTarget)
  20581. : isIncludedRoute(current, compareTarget)
  20582. var handler = function (e) {
  20583. if (guardEvent(e)) {
  20584. if (this$1.replace) {
  20585. router.replace(normalizedTo)
  20586. } else {
  20587. router.push(normalizedTo)
  20588. }
  20589. }
  20590. }
  20591. var on = { click: guardEvent }
  20592. if (Array.isArray(this.event)) {
  20593. this.event.forEach(function (e) { on[e] = handler })
  20594. } else {
  20595. on[this.event] = handler
  20596. }
  20597. var data = {
  20598. class: classes
  20599. }
  20600. if (this.tag === 'a') {
  20601. data.on = on
  20602. data.attrs = { href: href }
  20603. } else {
  20604. // find the first <a> child and apply listener and href
  20605. var a = findAnchor(this.$slots.default)
  20606. if (a) {
  20607. // in case the <a> is a static node
  20608. a.isStatic = false
  20609. var extend = _Vue.util.extend
  20610. var aData = a.data = extend({}, a.data)
  20611. aData.on = on
  20612. var aAttrs = a.data.attrs = extend({}, a.data.attrs)
  20613. aAttrs.href = href
  20614. } else {
  20615. // doesn't have <a> child, apply listener to self
  20616. data.on = on
  20617. }
  20618. }
  20619. return h(this.tag, data, this.$slots.default)
  20620. }
  20621. }
  20622. function guardEvent (e) {
  20623. // don't redirect with control keys
  20624. /* istanbul ignore if */
  20625. if (e.metaKey || e.ctrlKey || e.shiftKey) { return }
  20626. // don't redirect when preventDefault called
  20627. /* istanbul ignore if */
  20628. if (e.defaultPrevented) { return }
  20629. // don't redirect on right click
  20630. /* istanbul ignore if */
  20631. if (e.button !== 0) { return }
  20632. // don't redirect if `target="_blank"`
  20633. /* istanbul ignore if */
  20634. var target = e.target.getAttribute('target')
  20635. if (/\b_blank\b/i.test(target)) { return }
  20636. e.preventDefault()
  20637. return true
  20638. }
  20639. function findAnchor (children) {
  20640. if (children) {
  20641. var child
  20642. for (var i = 0; i < children.length; i++) {
  20643. child = children[i]
  20644. if (child.tag === 'a') {
  20645. return child
  20646. }
  20647. if (child.children && (child = findAnchor(child.children))) {
  20648. return child
  20649. }
  20650. }
  20651. }
  20652. }
  20653. var _Vue
  20654. function install (Vue) {
  20655. if (install.installed) { return }
  20656. install.installed = true
  20657. _Vue = Vue
  20658. Object.defineProperty(Vue.prototype, '$router', {
  20659. get: function get () { return this.$root._router }
  20660. })
  20661. Object.defineProperty(Vue.prototype, '$route', {
  20662. get: function get$1 () { return this.$root._route }
  20663. })
  20664. Vue.mixin({
  20665. beforeCreate: function beforeCreate () {
  20666. if (this.$options.router) {
  20667. this._router = this.$options.router
  20668. this._router.init(this)
  20669. Vue.util.defineReactive(this, '_route', this._router.history.current)
  20670. }
  20671. }
  20672. })
  20673. Vue.component('router-view', View)
  20674. Vue.component('router-link', Link)
  20675. var strats = Vue.config.optionMergeStrategies
  20676. // use the same hook merging strategy for route hooks
  20677. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.created
  20678. }
  20679. /* */
  20680. function resolvePath (
  20681. relative,
  20682. base,
  20683. append
  20684. ) {
  20685. if (relative.charAt(0) === '/') {
  20686. return relative
  20687. }
  20688. if (relative.charAt(0) === '?' || relative.charAt(0) === '#') {
  20689. return base + relative
  20690. }
  20691. var stack = base.split('/')
  20692. // remove trailing segment if:
  20693. // - not appending
  20694. // - appending to trailing slash (last segment is empty)
  20695. if (!append || !stack[stack.length - 1]) {
  20696. stack.pop()
  20697. }
  20698. // resolve relative path
  20699. var segments = relative.replace(/^\//, '').split('/')
  20700. for (var i = 0; i < segments.length; i++) {
  20701. var segment = segments[i]
  20702. if (segment === '.') {
  20703. continue
  20704. } else if (segment === '..') {
  20705. stack.pop()
  20706. } else {
  20707. stack.push(segment)
  20708. }
  20709. }
  20710. // ensure leading slash
  20711. if (stack[0] !== '') {
  20712. stack.unshift('')
  20713. }
  20714. return stack.join('/')
  20715. }
  20716. function parsePath (path) {
  20717. var hash = ''
  20718. var query = ''
  20719. var hashIndex = path.indexOf('#')
  20720. if (hashIndex >= 0) {
  20721. hash = path.slice(hashIndex)
  20722. path = path.slice(0, hashIndex)
  20723. }
  20724. var queryIndex = path.indexOf('?')
  20725. if (queryIndex >= 0) {
  20726. query = path.slice(queryIndex + 1)
  20727. path = path.slice(0, queryIndex)
  20728. }
  20729. return {
  20730. path: path,
  20731. query: query,
  20732. hash: hash
  20733. }
  20734. }
  20735. function cleanPath (path) {
  20736. return path.replace(/\/\//g, '/')
  20737. }
  20738. /* */
  20739. function createRouteMap (routes) {
  20740. var pathMap = Object.create(null)
  20741. var nameMap = Object.create(null)
  20742. routes.forEach(function (route) {
  20743. addRouteRecord(pathMap, nameMap, route)
  20744. })
  20745. return {
  20746. pathMap: pathMap,
  20747. nameMap: nameMap
  20748. }
  20749. }
  20750. function addRouteRecord (
  20751. pathMap,
  20752. nameMap,
  20753. route,
  20754. parent,
  20755. matchAs
  20756. ) {
  20757. var path = route.path;
  20758. var name = route.name;
  20759. if (process.env.NODE_ENV !== 'production') {
  20760. assert(path != null, "\"path\" is required in a route configuration.")
  20761. assert(
  20762. typeof route.component !== 'string',
  20763. "route config \"component\" for path: " + (String(path || name)) + " cannot be a " +
  20764. "string id. Use an actual component instead."
  20765. )
  20766. }
  20767. var record = {
  20768. path: normalizePath(path, parent),
  20769. components: route.components || { default: route.component },
  20770. instances: {},
  20771. name: name,
  20772. parent: parent,
  20773. matchAs: matchAs,
  20774. redirect: route.redirect,
  20775. beforeEnter: route.beforeEnter,
  20776. meta: route.meta || {}
  20777. }
  20778. if (route.children) {
  20779. // Warn if route is named and has a default child route.
  20780. // If users navigate to this route by name, the default child will
  20781. // not be rendered (GH Issue #629)
  20782. if (process.env.NODE_ENV !== 'production') {
  20783. if (route.name && route.children.some(function (child) { return /^\/?$/.test(child.path); })) {
  20784. warn(false, ("Named Route '" + (route.name) + "' has a default child route.\n When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), the default child route will not be rendered.\n Remove the name from this route and use the name of the default child route for named links instead.")
  20785. )
  20786. }
  20787. }
  20788. route.children.forEach(function (child) {
  20789. addRouteRecord(pathMap, nameMap, child, record)
  20790. })
  20791. }
  20792. if (route.alias !== undefined) {
  20793. if (Array.isArray(route.alias)) {
  20794. route.alias.forEach(function (alias) {
  20795. addRouteRecord(pathMap, nameMap, { path: alias }, parent, record.path)
  20796. })
  20797. } else {
  20798. addRouteRecord(pathMap, nameMap, { path: route.alias }, parent, record.path)
  20799. }
  20800. }
  20801. if (!pathMap[record.path]) {
  20802. pathMap[record.path] = record
  20803. }
  20804. if (name) {
  20805. if (!nameMap[name]) {
  20806. nameMap[name] = record
  20807. } else if (process.env.NODE_ENV !== 'production') {
  20808. warn(false, ("Duplicate named routes definition: { name: \"" + name + "\", path: \"" + (record.path) + "\" }"))
  20809. }
  20810. }
  20811. }
  20812. function normalizePath (path, parent) {
  20813. path = path.replace(/\/$/, '')
  20814. if (path[0] === '/') { return path }
  20815. if (parent == null) { return path }
  20816. return cleanPath(((parent.path) + "/" + path))
  20817. }
  20818. var __moduleExports = Array.isArray || function (arr) {
  20819. return Object.prototype.toString.call(arr) == '[object Array]';
  20820. };
  20821. var isarray = __moduleExports
  20822. /**
  20823. * Expose `pathToRegexp`.
  20824. */
  20825. var index = pathToRegexp
  20826. var parse_1 = parse
  20827. var compile_1 = compile
  20828. var tokensToFunction_1 = tokensToFunction
  20829. var tokensToRegExp_1 = tokensToRegExp
  20830. /**
  20831. * The main path matching regexp utility.
  20832. *
  20833. * @type {RegExp}
  20834. */
  20835. var PATH_REGEXP = new RegExp([
  20836. // Match escaped characters that would otherwise appear in future matches.
  20837. // This allows the user to escape special characters that won't transform.
  20838. '(\\\\.)',
  20839. // Match Express-style parameters and un-named parameters with a prefix
  20840. // and optional suffixes. Matches appear as:
  20841. //
  20842. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  20843. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  20844. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  20845. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  20846. ].join('|'), 'g')
  20847. /**
  20848. * Parse a string for the raw tokens.
  20849. *
  20850. * @param {string} str
  20851. * @param {Object=} options
  20852. * @return {!Array}
  20853. */
  20854. function parse (str, options) {
  20855. var tokens = []
  20856. var key = 0
  20857. var index = 0
  20858. var path = ''
  20859. var defaultDelimiter = options && options.delimiter || '/'
  20860. var res
  20861. while ((res = PATH_REGEXP.exec(str)) != null) {
  20862. var m = res[0]
  20863. var escaped = res[1]
  20864. var offset = res.index
  20865. path += str.slice(index, offset)
  20866. index = offset + m.length
  20867. // Ignore already escaped sequences.
  20868. if (escaped) {
  20869. path += escaped[1]
  20870. continue
  20871. }
  20872. var next = str[index]
  20873. var prefix = res[2]
  20874. var name = res[3]
  20875. var capture = res[4]
  20876. var group = res[5]
  20877. var modifier = res[6]
  20878. var asterisk = res[7]
  20879. // Push the current path onto the tokens.
  20880. if (path) {
  20881. tokens.push(path)
  20882. path = ''
  20883. }
  20884. var partial = prefix != null && next != null && next !== prefix
  20885. var repeat = modifier === '+' || modifier === '*'
  20886. var optional = modifier === '?' || modifier === '*'
  20887. var delimiter = res[2] || defaultDelimiter
  20888. var pattern = capture || group
  20889. tokens.push({
  20890. name: name || key++,
  20891. prefix: prefix || '',
  20892. delimiter: delimiter,
  20893. optional: optional,
  20894. repeat: repeat,
  20895. partial: partial,
  20896. asterisk: !!asterisk,
  20897. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  20898. })
  20899. }
  20900. // Match any characters still remaining.
  20901. if (index < str.length) {
  20902. path += str.substr(index)
  20903. }
  20904. // If the path exists, push it onto the end.
  20905. if (path) {
  20906. tokens.push(path)
  20907. }
  20908. return tokens
  20909. }
  20910. /**
  20911. * Compile a string to a template function for the path.
  20912. *
  20913. * @param {string} str
  20914. * @param {Object=} options
  20915. * @return {!function(Object=, Object=)}
  20916. */
  20917. function compile (str, options) {
  20918. return tokensToFunction(parse(str, options))
  20919. }
  20920. /**
  20921. * Prettier encoding of URI path segments.
  20922. *
  20923. * @param {string}
  20924. * @return {string}
  20925. */
  20926. function encodeURIComponentPretty (str) {
  20927. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  20928. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  20929. })
  20930. }
  20931. /**
  20932. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  20933. *
  20934. * @param {string}
  20935. * @return {string}
  20936. */
  20937. function encodeAsterisk (str) {
  20938. return encodeURI(str).replace(/[?#]/g, function (c) {
  20939. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  20940. })
  20941. }
  20942. /**
  20943. * Expose a method for transforming tokens into the path function.
  20944. */
  20945. function tokensToFunction (tokens) {
  20946. // Compile all the tokens into regexps.
  20947. var matches = new Array(tokens.length)
  20948. // Compile all the patterns before compilation.
  20949. for (var i = 0; i < tokens.length; i++) {
  20950. if (typeof tokens[i] === 'object') {
  20951. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
  20952. }
  20953. }
  20954. return function (obj, opts) {
  20955. var path = ''
  20956. var data = obj || {}
  20957. var options = opts || {}
  20958. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
  20959. for (var i = 0; i < tokens.length; i++) {
  20960. var token = tokens[i]
  20961. if (typeof token === 'string') {
  20962. path += token
  20963. continue
  20964. }
  20965. var value = data[token.name]
  20966. var segment
  20967. if (value == null) {
  20968. if (token.optional) {
  20969. // Prepend partial segment prefixes.
  20970. if (token.partial) {
  20971. path += token.prefix
  20972. }
  20973. continue
  20974. } else {
  20975. throw new TypeError('Expected "' + token.name + '" to be defined')
  20976. }
  20977. }
  20978. if (isarray(value)) {
  20979. if (!token.repeat) {
  20980. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  20981. }
  20982. if (value.length === 0) {
  20983. if (token.optional) {
  20984. continue
  20985. } else {
  20986. throw new TypeError('Expected "' + token.name + '" to not be empty')
  20987. }
  20988. }
  20989. for (var j = 0; j < value.length; j++) {
  20990. segment = encode(value[j])
  20991. if (!matches[i].test(segment)) {
  20992. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  20993. }
  20994. path += (j === 0 ? token.prefix : token.delimiter) + segment
  20995. }
  20996. continue
  20997. }
  20998. segment = token.asterisk ? encodeAsterisk(value) : encode(value)
  20999. if (!matches[i].test(segment)) {
  21000. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  21001. }
  21002. path += token.prefix + segment
  21003. }
  21004. return path
  21005. }
  21006. }
  21007. /**
  21008. * Escape a regular expression string.
  21009. *
  21010. * @param {string} str
  21011. * @return {string}
  21012. */
  21013. function escapeString (str) {
  21014. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  21015. }
  21016. /**
  21017. * Escape the capturing group by escaping special characters and meaning.
  21018. *
  21019. * @param {string} group
  21020. * @return {string}
  21021. */
  21022. function escapeGroup (group) {
  21023. return group.replace(/([=!:$\/()])/g, '\\$1')
  21024. }
  21025. /**
  21026. * Attach the keys as a property of the regexp.
  21027. *
  21028. * @param {!RegExp} re
  21029. * @param {Array} keys
  21030. * @return {!RegExp}
  21031. */
  21032. function attachKeys (re, keys) {
  21033. re.keys = keys
  21034. return re
  21035. }
  21036. /**
  21037. * Get the flags for a regexp from the options.
  21038. *
  21039. * @param {Object} options
  21040. * @return {string}
  21041. */
  21042. function flags (options) {
  21043. return options.sensitive ? '' : 'i'
  21044. }
  21045. /**
  21046. * Pull out keys from a regexp.
  21047. *
  21048. * @param {!RegExp} path
  21049. * @param {!Array} keys
  21050. * @return {!RegExp}
  21051. */
  21052. function regexpToRegexp (path, keys) {
  21053. // Use a negative lookahead to match only capturing groups.
  21054. var groups = path.source.match(/\((?!\?)/g)
  21055. if (groups) {
  21056. for (var i = 0; i < groups.length; i++) {
  21057. keys.push({
  21058. name: i,
  21059. prefix: null,
  21060. delimiter: null,
  21061. optional: false,
  21062. repeat: false,
  21063. partial: false,
  21064. asterisk: false,
  21065. pattern: null
  21066. })
  21067. }
  21068. }
  21069. return attachKeys(path, keys)
  21070. }
  21071. /**
  21072. * Transform an array into a regexp.
  21073. *
  21074. * @param {!Array} path
  21075. * @param {Array} keys
  21076. * @param {!Object} options
  21077. * @return {!RegExp}
  21078. */
  21079. function arrayToRegexp (path, keys, options) {
  21080. var parts = []
  21081. for (var i = 0; i < path.length; i++) {
  21082. parts.push(pathToRegexp(path[i], keys, options).source)
  21083. }
  21084. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
  21085. return attachKeys(regexp, keys)
  21086. }
  21087. /**
  21088. * Create a path regexp from string input.
  21089. *
  21090. * @param {string} path
  21091. * @param {!Array} keys
  21092. * @param {!Object} options
  21093. * @return {!RegExp}
  21094. */
  21095. function stringToRegexp (path, keys, options) {
  21096. return tokensToRegExp(parse(path, options), keys, options)
  21097. }
  21098. /**
  21099. * Expose a function for taking tokens and returning a RegExp.
  21100. *
  21101. * @param {!Array} tokens
  21102. * @param {(Array|Object)=} keys
  21103. * @param {Object=} options
  21104. * @return {!RegExp}
  21105. */
  21106. function tokensToRegExp (tokens, keys, options) {
  21107. if (!isarray(keys)) {
  21108. options = /** @type {!Object} */ (keys || options)
  21109. keys = []
  21110. }
  21111. options = options || {}
  21112. var strict = options.strict
  21113. var end = options.end !== false
  21114. var route = ''
  21115. // Iterate over the tokens and create our regexp string.
  21116. for (var i = 0; i < tokens.length; i++) {
  21117. var token = tokens[i]
  21118. if (typeof token === 'string') {
  21119. route += escapeString(token)
  21120. } else {
  21121. var prefix = escapeString(token.prefix)
  21122. var capture = '(?:' + token.pattern + ')'
  21123. keys.push(token)
  21124. if (token.repeat) {
  21125. capture += '(?:' + prefix + capture + ')*'
  21126. }
  21127. if (token.optional) {
  21128. if (!token.partial) {
  21129. capture = '(?:' + prefix + '(' + capture + '))?'
  21130. } else {
  21131. capture = prefix + '(' + capture + ')?'
  21132. }
  21133. } else {
  21134. capture = prefix + '(' + capture + ')'
  21135. }
  21136. route += capture
  21137. }
  21138. }
  21139. var delimiter = escapeString(options.delimiter || '/')
  21140. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
  21141. // In non-strict mode we allow a slash at the end of match. If the path to
  21142. // match already ends with a slash, we remove it for consistency. The slash
  21143. // is valid at the end of a path match, not in the middle. This is important
  21144. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  21145. if (!strict) {
  21146. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
  21147. }
  21148. if (end) {
  21149. route += '$'
  21150. } else {
  21151. // In non-ending mode, we need the capturing groups to match as much as
  21152. // possible by using a positive lookahead to the end or next path segment.
  21153. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
  21154. }
  21155. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  21156. }
  21157. /**
  21158. * Normalize the given path string, returning a regular expression.
  21159. *
  21160. * An empty array can be passed in for the keys, which will hold the
  21161. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  21162. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  21163. *
  21164. * @param {(string|RegExp|Array)} path
  21165. * @param {(Array|Object)=} keys
  21166. * @param {Object=} options
  21167. * @return {!RegExp}
  21168. */
  21169. function pathToRegexp (path, keys, options) {
  21170. if (!isarray(keys)) {
  21171. options = /** @type {!Object} */ (keys || options)
  21172. keys = []
  21173. }
  21174. options = options || {}
  21175. if (path instanceof RegExp) {
  21176. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  21177. }
  21178. if (isarray(path)) {
  21179. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  21180. }
  21181. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  21182. }
  21183. index.parse = parse_1;
  21184. index.compile = compile_1;
  21185. index.tokensToFunction = tokensToFunction_1;
  21186. index.tokensToRegExp = tokensToRegExp_1;
  21187. /* */
  21188. var regexpCache = Object.create(null)
  21189. function getRouteRegex (path) {
  21190. var hit = regexpCache[path]
  21191. var keys, regexp
  21192. if (hit) {
  21193. keys = hit.keys
  21194. regexp = hit.regexp
  21195. } else {
  21196. keys = []
  21197. regexp = index(path, keys)
  21198. regexpCache[path] = { keys: keys, regexp: regexp }
  21199. }
  21200. return { keys: keys, regexp: regexp }
  21201. }
  21202. var regexpCompileCache = Object.create(null)
  21203. function fillParams (
  21204. path,
  21205. params,
  21206. routeMsg
  21207. ) {
  21208. try {
  21209. var filler =
  21210. regexpCompileCache[path] ||
  21211. (regexpCompileCache[path] = index.compile(path))
  21212. return filler(params || {}, { pretty: true })
  21213. } catch (e) {
  21214. if (process.env.NODE_ENV !== 'production') {
  21215. warn(false, ("missing param for " + routeMsg + ": " + (e.message)))
  21216. }
  21217. return ''
  21218. }
  21219. }
  21220. /* */
  21221. function normalizeLocation (
  21222. raw,
  21223. current,
  21224. append
  21225. ) {
  21226. var next = typeof raw === 'string' ? { path: raw } : raw
  21227. // named target
  21228. if (next.name || next._normalized) {
  21229. return next
  21230. }
  21231. // relative params
  21232. if (!next.path && next.params && current) {
  21233. next = assign({}, next)
  21234. next._normalized = true
  21235. var params = assign(assign({}, current.params), next.params)
  21236. if (current.name) {
  21237. next.name = current.name
  21238. next.params = params
  21239. } else if (current.matched) {
  21240. var rawPath = current.matched[current.matched.length - 1].path
  21241. next.path = fillParams(rawPath, params, ("path " + (current.path)))
  21242. } else if (process.env.NODE_ENV !== 'production') {
  21243. warn(false, "relative params navigation requires a current route.")
  21244. }
  21245. return next
  21246. }
  21247. var parsedPath = parsePath(next.path || '')
  21248. var basePath = (current && current.path) || '/'
  21249. var path = parsedPath.path
  21250. ? resolvePath(parsedPath.path, basePath, append || next.append)
  21251. : (current && current.path) || '/'
  21252. var query = resolveQuery(parsedPath.query, next.query)
  21253. var hash = next.hash || parsedPath.hash
  21254. if (hash && hash.charAt(0) !== '#') {
  21255. hash = "#" + hash
  21256. }
  21257. return {
  21258. _normalized: true,
  21259. path: path,
  21260. query: query,
  21261. hash: hash
  21262. }
  21263. }
  21264. function assign (a, b) {
  21265. for (var key in b) {
  21266. a[key] = b[key]
  21267. }
  21268. return a
  21269. }
  21270. /* */
  21271. function createMatcher (routes) {
  21272. var ref = createRouteMap(routes);
  21273. var pathMap = ref.pathMap;
  21274. var nameMap = ref.nameMap;
  21275. function match (
  21276. raw,
  21277. currentRoute,
  21278. redirectedFrom
  21279. ) {
  21280. var location = normalizeLocation(raw, currentRoute)
  21281. var name = location.name;
  21282. if (name) {
  21283. var record = nameMap[name]
  21284. var paramNames = getRouteRegex(record.path).keys
  21285. .filter(function (key) { return !key.optional; })
  21286. .map(function (key) { return key.name; })
  21287. if (typeof location.params !== 'object') {
  21288. location.params = {}
  21289. }
  21290. if (currentRoute && typeof currentRoute.params === 'object') {
  21291. for (var key in currentRoute.params) {
  21292. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  21293. location.params[key] = currentRoute.params[key]
  21294. }
  21295. }
  21296. }
  21297. if (record) {
  21298. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""))
  21299. return _createRoute(record, location, redirectedFrom)
  21300. }
  21301. } else if (location.path) {
  21302. location.params = {}
  21303. for (var path in pathMap) {
  21304. if (matchRoute(path, location.params, location.path)) {
  21305. return _createRoute(pathMap[path], location, redirectedFrom)
  21306. }
  21307. }
  21308. }
  21309. // no match
  21310. return _createRoute(null, location)
  21311. }
  21312. function redirect (
  21313. record,
  21314. location
  21315. ) {
  21316. var originalRedirect = record.redirect
  21317. var redirect = typeof originalRedirect === 'function'
  21318. ? originalRedirect(createRoute(record, location))
  21319. : originalRedirect
  21320. if (typeof redirect === 'string') {
  21321. redirect = { path: redirect }
  21322. }
  21323. if (!redirect || typeof redirect !== 'object') {
  21324. process.env.NODE_ENV !== 'production' && warn(
  21325. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  21326. )
  21327. return _createRoute(null, location)
  21328. }
  21329. var re = redirect
  21330. var name = re.name;
  21331. var path = re.path;
  21332. var query = location.query;
  21333. var hash = location.hash;
  21334. var params = location.params;
  21335. query = re.hasOwnProperty('query') ? re.query : query
  21336. hash = re.hasOwnProperty('hash') ? re.hash : hash
  21337. params = re.hasOwnProperty('params') ? re.params : params
  21338. if (name) {
  21339. // resolved named direct
  21340. var targetRecord = nameMap[name]
  21341. if (process.env.NODE_ENV !== 'production') {
  21342. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."))
  21343. }
  21344. return match({
  21345. _normalized: true,
  21346. name: name,
  21347. query: query,
  21348. hash: hash,
  21349. params: params
  21350. }, undefined, location)
  21351. } else if (path) {
  21352. // 1. resolve relative redirect
  21353. var rawPath = resolveRecordPath(path, record)
  21354. // 2. resolve params
  21355. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""))
  21356. // 3. rematch with existing query and hash
  21357. return match({
  21358. _normalized: true,
  21359. path: resolvedPath,
  21360. query: query,
  21361. hash: hash
  21362. }, undefined, location)
  21363. } else {
  21364. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))))
  21365. return _createRoute(null, location)
  21366. }
  21367. }
  21368. function alias (
  21369. record,
  21370. location,
  21371. matchAs
  21372. ) {
  21373. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""))
  21374. var aliasedMatch = match({
  21375. _normalized: true,
  21376. path: aliasedPath
  21377. })
  21378. if (aliasedMatch) {
  21379. var matched = aliasedMatch.matched
  21380. var aliasedRecord = matched[matched.length - 1]
  21381. location.params = aliasedMatch.params
  21382. return _createRoute(aliasedRecord, location)
  21383. }
  21384. return _createRoute(null, location)
  21385. }
  21386. function _createRoute (
  21387. record,
  21388. location,
  21389. redirectedFrom
  21390. ) {
  21391. if (record && record.redirect) {
  21392. return redirect(record, redirectedFrom || location)
  21393. }
  21394. if (record && record.matchAs) {
  21395. return alias(record, location, record.matchAs)
  21396. }
  21397. return createRoute(record, location, redirectedFrom)
  21398. }
  21399. return match
  21400. }
  21401. function matchRoute (
  21402. path,
  21403. params,
  21404. pathname
  21405. ) {
  21406. var ref = getRouteRegex(path);
  21407. var regexp = ref.regexp;
  21408. var keys = ref.keys;
  21409. var m = pathname.match(regexp)
  21410. if (!m) {
  21411. return false
  21412. } else if (!params) {
  21413. return true
  21414. }
  21415. for (var i = 1, len = m.length; i < len; ++i) {
  21416. var key = keys[i - 1]
  21417. var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]
  21418. if (key) { params[key.name] = val }
  21419. }
  21420. return true
  21421. }
  21422. function resolveRecordPath (path, record) {
  21423. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  21424. }
  21425. /* */
  21426. var inBrowser = typeof window !== 'undefined'
  21427. var supportsHistory = inBrowser && (function () {
  21428. var ua = window.navigator.userAgent
  21429. if (
  21430. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  21431. ua.indexOf('Mobile Safari') !== -1 &&
  21432. ua.indexOf('Chrome') === -1 &&
  21433. ua.indexOf('Windows Phone') === -1
  21434. ) {
  21435. return false
  21436. }
  21437. return window.history && 'pushState' in window.history
  21438. })()
  21439. /* */
  21440. function runQueue (queue, fn, cb) {
  21441. var step = function (index) {
  21442. if (index >= queue.length) {
  21443. cb()
  21444. } else {
  21445. if (queue[index]) {
  21446. fn(queue[index], function () {
  21447. step(index + 1)
  21448. })
  21449. } else {
  21450. step(index + 1)
  21451. }
  21452. }
  21453. }
  21454. step(0)
  21455. }
  21456. /* */
  21457. var History = function History (router, base) {
  21458. this.router = router
  21459. this.base = normalizeBase(base)
  21460. // start with a route object that stands for "nowhere"
  21461. this.current = START
  21462. this.pending = null
  21463. };
  21464. History.prototype.listen = function listen (cb) {
  21465. this.cb = cb
  21466. };
  21467. History.prototype.transitionTo = function transitionTo (location, cb) {
  21468. var this$1 = this;
  21469. var route = this.router.match(location, this.current)
  21470. this.confirmTransition(route, function () {
  21471. this$1.updateRoute(route)
  21472. cb && cb(route)
  21473. this$1.ensureURL()
  21474. })
  21475. };
  21476. History.prototype.confirmTransition = function confirmTransition (route, cb) {
  21477. var this$1 = this;
  21478. var current = this.current
  21479. if (isSameRoute(route, current)) {
  21480. this.ensureURL()
  21481. return
  21482. }
  21483. var ref = resolveQueue(this.current.matched, route.matched);
  21484. var deactivated = ref.deactivated;
  21485. var activated = ref.activated;
  21486. var queue = [].concat(
  21487. // in-component leave guards
  21488. extractLeaveGuards(deactivated),
  21489. // global before hooks
  21490. this.router.beforeHooks,
  21491. // enter guards
  21492. activated.map(function (m) { return m.beforeEnter; }),
  21493. // async components
  21494. resolveAsyncComponents(activated)
  21495. )
  21496. this.pending = route
  21497. var iterator = function (hook, next) {
  21498. if (this$1.pending !== route) { return }
  21499. hook(route, current, function (to) {
  21500. if (to === false) {
  21501. // next(false) -> abort navigation, ensure current URL
  21502. this$1.ensureURL(true)
  21503. } else if (typeof to === 'string' || typeof to === 'object') {
  21504. // next('/') or next({ path: '/' }) -> redirect
  21505. (typeof to === 'object' && to.replace) ? this$1.replace(to) : this$1.push(to)
  21506. } else {
  21507. // confirm transition and pass on the value
  21508. next(to)
  21509. }
  21510. })
  21511. }
  21512. runQueue(queue, iterator, function () {
  21513. var postEnterCbs = []
  21514. var enterGuards = extractEnterGuards(activated, postEnterCbs, function () {
  21515. return this$1.current === route
  21516. })
  21517. // wait until async components are resolved before
  21518. // extracting in-component enter guards
  21519. runQueue(enterGuards, iterator, function () {
  21520. if (this$1.pending === route) {
  21521. this$1.pending = null
  21522. cb(route)
  21523. if (this$1.router.app) {
  21524. this$1.router.app.$nextTick(function () {
  21525. postEnterCbs.forEach(function (cb) { return cb(); })
  21526. })
  21527. }
  21528. }
  21529. })
  21530. })
  21531. };
  21532. History.prototype.updateRoute = function updateRoute (route) {
  21533. var prev = this.current
  21534. this.current = route
  21535. this.cb && this.cb(route)
  21536. this.router.afterHooks.forEach(function (hook) {
  21537. hook && hook(route, prev)
  21538. })
  21539. };
  21540. function normalizeBase (base) {
  21541. if (!base) {
  21542. if (inBrowser) {
  21543. // respect <base> tag
  21544. var baseEl = document.querySelector('base')
  21545. base = baseEl ? baseEl.getAttribute('href') : '/'
  21546. } else {
  21547. base = '/'
  21548. }
  21549. }
  21550. // make sure there's the starting slash
  21551. if (base.charAt(0) !== '/') {
  21552. base = '/' + base
  21553. }
  21554. // remove trailing slash
  21555. return base.replace(/\/$/, '')
  21556. }
  21557. function resolveQueue (
  21558. current,
  21559. next
  21560. ) {
  21561. var i
  21562. var max = Math.max(current.length, next.length)
  21563. for (i = 0; i < max; i++) {
  21564. if (current[i] !== next[i]) {
  21565. break
  21566. }
  21567. }
  21568. return {
  21569. activated: next.slice(i),
  21570. deactivated: current.slice(i)
  21571. }
  21572. }
  21573. function extractGuard (
  21574. def,
  21575. key
  21576. ) {
  21577. if (typeof def !== 'function') {
  21578. // extend now so that global mixins are applied.
  21579. def = _Vue.extend(def)
  21580. }
  21581. return def.options[key]
  21582. }
  21583. function extractLeaveGuards (matched) {
  21584. return flatten(flatMapComponents(matched, function (def, instance) {
  21585. var guard = extractGuard(def, 'beforeRouteLeave')
  21586. if (guard) {
  21587. return Array.isArray(guard)
  21588. ? guard.map(function (guard) { return wrapLeaveGuard(guard, instance); })
  21589. : wrapLeaveGuard(guard, instance)
  21590. }
  21591. }).reverse())
  21592. }
  21593. function wrapLeaveGuard (
  21594. guard,
  21595. instance
  21596. ) {
  21597. return function routeLeaveGuard () {
  21598. return guard.apply(instance, arguments)
  21599. }
  21600. }
  21601. function extractEnterGuards (
  21602. matched,
  21603. cbs,
  21604. isValid
  21605. ) {
  21606. return flatten(flatMapComponents(matched, function (def, _, match, key) {
  21607. var guard = extractGuard(def, 'beforeRouteEnter')
  21608. if (guard) {
  21609. return Array.isArray(guard)
  21610. ? guard.map(function (guard) { return wrapEnterGuard(guard, cbs, match, key, isValid); })
  21611. : wrapEnterGuard(guard, cbs, match, key, isValid)
  21612. }
  21613. }))
  21614. }
  21615. function wrapEnterGuard (
  21616. guard,
  21617. cbs,
  21618. match,
  21619. key,
  21620. isValid
  21621. ) {
  21622. return function routeEnterGuard (to, from, next) {
  21623. return guard(to, from, function (cb) {
  21624. next(cb)
  21625. if (typeof cb === 'function') {
  21626. cbs.push(function () {
  21627. // #750
  21628. // if a router-view is wrapped with an out-in transition,
  21629. // the instance may not have been registered at this time.
  21630. // we will need to poll for registration until current route
  21631. // is no longer valid.
  21632. poll(cb, match.instances, key, isValid)
  21633. })
  21634. }
  21635. })
  21636. }
  21637. }
  21638. function poll (
  21639. cb, // somehow flow cannot infer this is a function
  21640. instances,
  21641. key,
  21642. isValid
  21643. ) {
  21644. if (instances[key]) {
  21645. cb(instances[key])
  21646. } else if (isValid()) {
  21647. setTimeout(function () {
  21648. poll(cb, instances, key, isValid)
  21649. }, 16)
  21650. }
  21651. }
  21652. function resolveAsyncComponents (matched) {
  21653. return flatMapComponents(matched, function (def, _, match, key) {
  21654. // if it's a function and doesn't have Vue options attached,
  21655. // assume it's an async component resolve function.
  21656. // we are not using Vue's default async resolving mechanism because
  21657. // we want to halt the navigation until the incoming component has been
  21658. // resolved.
  21659. if (typeof def === 'function' && !def.options) {
  21660. return function (to, from, next) {
  21661. var resolve = function (resolvedDef) {
  21662. match.components[key] = resolvedDef
  21663. next()
  21664. }
  21665. var reject = function (reason) {
  21666. warn(false, ("Failed to resolve async component " + key + ": " + reason))
  21667. next(false)
  21668. }
  21669. var res = def(resolve, reject)
  21670. if (res && typeof res.then === 'function') {
  21671. res.then(resolve, reject)
  21672. }
  21673. }
  21674. }
  21675. })
  21676. }
  21677. function flatMapComponents (
  21678. matched,
  21679. fn
  21680. ) {
  21681. return flatten(matched.map(function (m) {
  21682. return Object.keys(m.components).map(function (key) { return fn(
  21683. m.components[key],
  21684. m.instances[key],
  21685. m, key
  21686. ); })
  21687. }))
  21688. }
  21689. function flatten (arr) {
  21690. return Array.prototype.concat.apply([], arr)
  21691. }
  21692. /* */
  21693. var positionStore = Object.create(null)
  21694. function saveScrollPosition (key) {
  21695. if (!key) { return }
  21696. positionStore[key] = {
  21697. x: window.pageXOffset,
  21698. y: window.pageYOffset
  21699. }
  21700. }
  21701. function getScrollPosition (key) {
  21702. if (!key) { return }
  21703. return positionStore[key]
  21704. }
  21705. function getElementPosition (el) {
  21706. var docRect = document.documentElement.getBoundingClientRect()
  21707. var elRect = el.getBoundingClientRect()
  21708. return {
  21709. x: elRect.left - docRect.left,
  21710. y: elRect.top - docRect.top
  21711. }
  21712. }
  21713. function isValidPosition (obj) {
  21714. return isNumber(obj.x) || isNumber(obj.y)
  21715. }
  21716. function normalizePosition (obj) {
  21717. return {
  21718. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  21719. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  21720. }
  21721. }
  21722. function isNumber (v) {
  21723. return typeof v === 'number'
  21724. }
  21725. /* */
  21726. var genKey = function () { return String(Date.now()); }
  21727. var _key = genKey()
  21728. var HTML5History = (function (History) {
  21729. function HTML5History (router, base) {
  21730. var this$1 = this;
  21731. History.call(this, router, base)
  21732. var expectScroll = router.options.scrollBehavior
  21733. window.addEventListener('popstate', function (e) {
  21734. _key = e.state && e.state.key
  21735. var current = this$1.current
  21736. this$1.transitionTo(getLocation(this$1.base), function (next) {
  21737. if (expectScroll) {
  21738. this$1.handleScroll(next, current, true)
  21739. }
  21740. })
  21741. })
  21742. if (expectScroll) {
  21743. window.addEventListener('scroll', function () {
  21744. saveScrollPosition(_key)
  21745. })
  21746. }
  21747. }
  21748. if ( History ) HTML5History.__proto__ = History;
  21749. HTML5History.prototype = Object.create( History && History.prototype );
  21750. HTML5History.prototype.constructor = HTML5History;
  21751. HTML5History.prototype.go = function go (n) {
  21752. window.history.go(n)
  21753. };
  21754. HTML5History.prototype.push = function push (location) {
  21755. var this$1 = this;
  21756. var current = this.current
  21757. this.transitionTo(location, function (route) {
  21758. pushState(cleanPath(this$1.base + route.fullPath))
  21759. this$1.handleScroll(route, current, false)
  21760. })
  21761. };
  21762. HTML5History.prototype.replace = function replace (location) {
  21763. var this$1 = this;
  21764. var current = this.current
  21765. this.transitionTo(location, function (route) {
  21766. replaceState(cleanPath(this$1.base + route.fullPath))
  21767. this$1.handleScroll(route, current, false)
  21768. })
  21769. };
  21770. HTML5History.prototype.ensureURL = function ensureURL (push) {
  21771. if (getLocation(this.base) !== this.current.fullPath) {
  21772. var current = cleanPath(this.base + this.current.fullPath)
  21773. push ? pushState(current) : replaceState(current)
  21774. }
  21775. };
  21776. HTML5History.prototype.handleScroll = function handleScroll (to, from, isPop) {
  21777. var router = this.router
  21778. if (!router.app) {
  21779. return
  21780. }
  21781. var behavior = router.options.scrollBehavior
  21782. if (!behavior) {
  21783. return
  21784. }
  21785. if (process.env.NODE_ENV !== 'production') {
  21786. assert(typeof behavior === 'function', "scrollBehavior must be a function")
  21787. }
  21788. // wait until re-render finishes before scrolling
  21789. router.app.$nextTick(function () {
  21790. var position = getScrollPosition(_key)
  21791. var shouldScroll = behavior(to, from, isPop ? position : null)
  21792. if (!shouldScroll) {
  21793. return
  21794. }
  21795. var isObject = typeof shouldScroll === 'object'
  21796. if (isObject && typeof shouldScroll.selector === 'string') {
  21797. var el = document.querySelector(shouldScroll.selector)
  21798. if (el) {
  21799. position = getElementPosition(el)
  21800. } else if (isValidPosition(shouldScroll)) {
  21801. position = normalizePosition(shouldScroll)
  21802. }
  21803. } else if (isObject && isValidPosition(shouldScroll)) {
  21804. position = normalizePosition(shouldScroll)
  21805. }
  21806. if (position) {
  21807. window.scrollTo(position.x, position.y)
  21808. }
  21809. })
  21810. };
  21811. return HTML5History;
  21812. }(History));
  21813. function getLocation (base) {
  21814. var path = window.location.pathname
  21815. if (base && path.indexOf(base) === 0) {
  21816. path = path.slice(base.length)
  21817. }
  21818. return (path || '/') + window.location.search + window.location.hash
  21819. }
  21820. function pushState (url, replace) {
  21821. // try...catch the pushState call to get around Safari
  21822. // DOM Exception 18 where it limits to 100 pushState calls
  21823. var history = window.history
  21824. try {
  21825. if (replace) {
  21826. history.replaceState({ key: _key }, '', url)
  21827. } else {
  21828. _key = genKey()
  21829. history.pushState({ key: _key }, '', url)
  21830. }
  21831. saveScrollPosition(_key)
  21832. } catch (e) {
  21833. window.location[replace ? 'assign' : 'replace'](url)
  21834. }
  21835. }
  21836. function replaceState (url) {
  21837. pushState(url, true)
  21838. }
  21839. /* */
  21840. var HashHistory = (function (History) {
  21841. function HashHistory (router, base, fallback) {
  21842. var this$1 = this;
  21843. History.call(this, router, base)
  21844. window.addEventListener('hashchange', function () {
  21845. this$1.onHashChange()
  21846. })
  21847. // check history fallback deeplinking
  21848. if (fallback && this.checkFallback()) {
  21849. return
  21850. }
  21851. ensureSlash()
  21852. }
  21853. if ( History ) HashHistory.__proto__ = History;
  21854. HashHistory.prototype = Object.create( History && History.prototype );
  21855. HashHistory.prototype.constructor = HashHistory;
  21856. HashHistory.prototype.checkFallback = function checkFallback () {
  21857. var location = getLocation(this.base)
  21858. if (!/^\/#/.test(location)) {
  21859. window.location.replace(
  21860. cleanPath(this.base + '/#' + location)
  21861. )
  21862. return true
  21863. }
  21864. };
  21865. HashHistory.prototype.onHashChange = function onHashChange () {
  21866. if (!ensureSlash()) {
  21867. return
  21868. }
  21869. this.transitionTo(getHash(), function (route) {
  21870. replaceHash(route.fullPath)
  21871. })
  21872. };
  21873. HashHistory.prototype.push = function push (location) {
  21874. this.transitionTo(location, function (route) {
  21875. pushHash(route.fullPath)
  21876. })
  21877. };
  21878. HashHistory.prototype.replace = function replace (location) {
  21879. this.transitionTo(location, function (route) {
  21880. replaceHash(route.fullPath)
  21881. })
  21882. };
  21883. HashHistory.prototype.go = function go (n) {
  21884. window.history.go(n)
  21885. };
  21886. HashHistory.prototype.ensureURL = function ensureURL (push) {
  21887. var current = this.current.fullPath
  21888. if (getHash() !== current) {
  21889. push ? pushHash(current) : replaceHash(current)
  21890. }
  21891. };
  21892. return HashHistory;
  21893. }(History));
  21894. function ensureSlash () {
  21895. var path = getHash()
  21896. if (path.charAt(0) === '/') {
  21897. return true
  21898. }
  21899. replaceHash('/' + path)
  21900. return false
  21901. }
  21902. function getHash () {
  21903. // We can't use window.location.hash here because it's not
  21904. // consistent across browsers - Firefox will pre-decode it!
  21905. var href = window.location.href
  21906. var index = href.indexOf('#')
  21907. return index === -1 ? '' : href.slice(index + 1)
  21908. }
  21909. function pushHash (path) {
  21910. window.location.hash = path
  21911. }
  21912. function replaceHash (path) {
  21913. var i = window.location.href.indexOf('#')
  21914. window.location.replace(
  21915. window.location.href.slice(0, i >= 0 ? i : 0) + '#' + path
  21916. )
  21917. }
  21918. /* */
  21919. var AbstractHistory = (function (History) {
  21920. function AbstractHistory (router) {
  21921. History.call(this, router)
  21922. this.stack = []
  21923. this.index = -1
  21924. }
  21925. if ( History ) AbstractHistory.__proto__ = History;
  21926. AbstractHistory.prototype = Object.create( History && History.prototype );
  21927. AbstractHistory.prototype.constructor = AbstractHistory;
  21928. AbstractHistory.prototype.push = function push (location) {
  21929. var this$1 = this;
  21930. this.transitionTo(location, function (route) {
  21931. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route)
  21932. this$1.index++
  21933. })
  21934. };
  21935. AbstractHistory.prototype.replace = function replace (location) {
  21936. var this$1 = this;
  21937. this.transitionTo(location, function (route) {
  21938. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route)
  21939. })
  21940. };
  21941. AbstractHistory.prototype.go = function go (n) {
  21942. var this$1 = this;
  21943. var targetIndex = this.index + n
  21944. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  21945. return
  21946. }
  21947. var route = this.stack[targetIndex]
  21948. this.confirmTransition(route, function () {
  21949. this$1.index = targetIndex
  21950. this$1.updateRoute(route)
  21951. })
  21952. };
  21953. AbstractHistory.prototype.ensureURL = function ensureURL () {
  21954. // noop
  21955. };
  21956. return AbstractHistory;
  21957. }(History));
  21958. /* */
  21959. var VueRouter = function VueRouter (options) {
  21960. if ( options === void 0 ) options = {};
  21961. this.app = null
  21962. this.options = options
  21963. this.beforeHooks = []
  21964. this.afterHooks = []
  21965. this.match = createMatcher(options.routes || [])
  21966. var mode = options.mode || 'hash'
  21967. this.fallback = mode === 'history' && !supportsHistory
  21968. if (this.fallback) {
  21969. mode = 'hash'
  21970. }
  21971. if (!inBrowser) {
  21972. mode = 'abstract'
  21973. }
  21974. this.mode = mode
  21975. switch (mode) {
  21976. case 'history':
  21977. this.history = new HTML5History(this, options.base)
  21978. break
  21979. case 'hash':
  21980. this.history = new HashHistory(this, options.base, this.fallback)
  21981. break
  21982. case 'abstract':
  21983. this.history = new AbstractHistory(this)
  21984. break
  21985. default:
  21986. process.env.NODE_ENV !== 'production' && assert(false, ("invalid mode: " + mode))
  21987. }
  21988. };
  21989. var prototypeAccessors = { currentRoute: {} };
  21990. prototypeAccessors.currentRoute.get = function () {
  21991. return this.history && this.history.current
  21992. };
  21993. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  21994. var this$1 = this;
  21995. process.env.NODE_ENV !== 'production' && assert(
  21996. install.installed,
  21997. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  21998. "before creating root instance."
  21999. )
  22000. this.app = app
  22001. var history = this.history
  22002. if (history instanceof HTML5History) {
  22003. history.transitionTo(getLocation(history.base))
  22004. } else if (history instanceof HashHistory) {
  22005. history.transitionTo(getHash())
  22006. }
  22007. history.listen(function (route) {
  22008. this$1.app._route = route
  22009. })
  22010. };
  22011. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  22012. this.beforeHooks.push(fn)
  22013. };
  22014. VueRouter.prototype.afterEach = function afterEach (fn) {
  22015. this.afterHooks.push(fn)
  22016. };
  22017. VueRouter.prototype.push = function push (location) {
  22018. this.history.push(location)
  22019. };
  22020. VueRouter.prototype.replace = function replace (location) {
  22021. this.history.replace(location)
  22022. };
  22023. VueRouter.prototype.go = function go (n) {
  22024. this.history.go(n)
  22025. };
  22026. VueRouter.prototype.back = function back () {
  22027. this.go(-1)
  22028. };
  22029. VueRouter.prototype.forward = function forward () {
  22030. this.go(1)
  22031. };
  22032. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  22033. var route = to
  22034. ? this.resolve(to).resolved
  22035. : this.currentRoute
  22036. if (!route) {
  22037. return []
  22038. }
  22039. return [].concat.apply([], route.matched.map(function (m) {
  22040. return Object.keys(m.components).map(function (key) {
  22041. return m.components[key]
  22042. })
  22043. }))
  22044. };
  22045. VueRouter.prototype.resolve = function resolve (
  22046. to,
  22047. current,
  22048. append
  22049. ) {
  22050. var normalizedTo = normalizeLocation(to, current || this.history.current, append)
  22051. var resolved = this.match(normalizedTo, current)
  22052. var fullPath = resolved.redirectedFrom || resolved.fullPath
  22053. var base = this.history.base
  22054. var href = createHref(base, fullPath, this.mode)
  22055. return {
  22056. normalizedTo: normalizedTo,
  22057. resolved: resolved,
  22058. href: href
  22059. }
  22060. };
  22061. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  22062. function createHref (base, fullPath, mode) {
  22063. var path = mode === 'hash' ? '/#' + fullPath : fullPath
  22064. return base ? cleanPath(base + path) : path
  22065. }
  22066. VueRouter.install = install
  22067. if (inBrowser && window.Vue) {
  22068. window.Vue.use(VueRouter)
  22069. }
  22070. module.exports = VueRouter;
  22071. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5)))
  22072. /***/ },
  22073. /* 217 */
  22074. /***/ function(module, exports, __webpack_require__) {
  22075. // style-loader: Adds some css to the DOM by adding a <style> tag
  22076. // load the styles
  22077. var content = __webpack_require__(163);
  22078. if(typeof content === 'string') content = [[module.i, content, '']];
  22079. // add the styles to the DOM
  22080. var update = __webpack_require__(32)(content, {});
  22081. if(content.locals) module.exports = content.locals;
  22082. // Hot Module Replacement
  22083. if(false) {
  22084. // When the styles change, update the <style> tags
  22085. if(!content.locals) {
  22086. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue", function() {
  22087. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-28c275d9!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Fingerprint.vue");
  22088. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  22089. update(newContent);
  22090. });
  22091. }
  22092. // When the module is disposed, remove the <style> tags
  22093. module.hot.dispose(function() { update(); });
  22094. }
  22095. /***/ },
  22096. /* 218 */
  22097. /***/ function(module, exports, __webpack_require__) {
  22098. // style-loader: Adds some css to the DOM by adding a <style> tag
  22099. // load the styles
  22100. var content = __webpack_require__(164);
  22101. if(typeof content === 'string') content = [[module.i, content, '']];
  22102. // add the styles to the DOM
  22103. var update = __webpack_require__(32)(content, {});
  22104. if(content.locals) module.exports = content.locals;
  22105. // Hot Module Replacement
  22106. if(false) {
  22107. // When the styles change, update the <style> tags
  22108. if(!content.locals) {
  22109. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue", function() {
  22110. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-4e146d4e!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./PasswordGenerator.vue");
  22111. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  22112. update(newContent);
  22113. });
  22114. }
  22115. // When the module is disposed, remove the <style> tags
  22116. module.hot.dispose(function() { update(); });
  22117. }
  22118. /***/ },
  22119. /* 219 */
  22120. /***/ function(module, exports, __webpack_require__) {
  22121. // style-loader: Adds some css to the DOM by adding a <style> tag
  22122. // load the styles
  22123. var content = __webpack_require__(165);
  22124. if(typeof content === 'string') content = [[module.i, content, '']];
  22125. // add the styles to the DOM
  22126. var update = __webpack_require__(32)(content, {});
  22127. if(content.locals) module.exports = content.locals;
  22128. // Hot Module Replacement
  22129. if(false) {
  22130. // When the styles change, update the <style> tags
  22131. if(!content.locals) {
  22132. module.hot.accept("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue", function() {
  22133. var newContent = require("!!./../node_modules/css-loader/index.js!./../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-7d2a5ef8!./../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./LessPass.vue");
  22134. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  22135. update(newContent);
  22136. });
  22137. }
  22138. // When the module is disposed, remove the <style> tags
  22139. module.hot.dispose(function() { update(); });
  22140. }
  22141. /***/ },
  22142. /* 220 */
  22143. /***/ function(module, exports, __webpack_require__) {
  22144. // style-loader: Adds some css to the DOM by adding a <style> tag
  22145. // load the styles
  22146. var content = __webpack_require__(166);
  22147. if(typeof content === 'string') content = [[module.i, content, '']];
  22148. // add the styles to the DOM
  22149. var update = __webpack_require__(32)(content, {});
  22150. if(content.locals) module.exports = content.locals;
  22151. // Hot Module Replacement
  22152. if(false) {
  22153. // When the styles change, update the <style> tags
  22154. if(!content.locals) {
  22155. module.hot.accept("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue", function() {
  22156. var newContent = require("!!./../../node_modules/css-loader/index.js!./../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-eabada8c!./../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Menu.vue");
  22157. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  22158. update(newContent);
  22159. });
  22160. }
  22161. // When the module is disposed, remove the <style> tags
  22162. module.hot.dispose(function() { update(); });
  22163. }
  22164. /***/ },
  22165. /* 221 */
  22166. /***/ function(module, exports) {
  22167. module.exports = function(module) {
  22168. if(!module.webpackPolyfill) {
  22169. module.deprecate = function() {};
  22170. module.paths = [];
  22171. // module.parent = undefined by default
  22172. if(!module.children) module.children = [];
  22173. Object.defineProperty(module, "loaded", {
  22174. enumerable: true,
  22175. configurable: false,
  22176. get: function() { return module.l; }
  22177. });
  22178. Object.defineProperty(module, "id", {
  22179. enumerable: true,
  22180. configurable: false,
  22181. get: function() { return module.i; }
  22182. });
  22183. module.webpackPolyfill = 1;
  22184. }
  22185. return module;
  22186. }
  22187. /***/ },
  22188. /* 222 */
  22189. /***/ function(module, exports) {
  22190. /* (ignored) */
  22191. /***/ },
  22192. /* 223 */
  22193. /***/ function(module, exports, __webpack_require__) {
  22194. "use strict";
  22195. 'use strict';
  22196. var _vue = __webpack_require__(33);
  22197. var _vue2 = _interopRequireDefault(_vue);
  22198. __webpack_require__(81);
  22199. __webpack_require__(82);
  22200. __webpack_require__(83);
  22201. var _LessPass = __webpack_require__(84);
  22202. var _LessPass2 = _interopRequireDefault(_LessPass);
  22203. var _store = __webpack_require__(80);
  22204. var _store2 = _interopRequireDefault(_store);
  22205. var _router = __webpack_require__(79);
  22206. var _router2 = _interopRequireDefault(_router);
  22207. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  22208. new _vue2.default({
  22209. el: '#lesspass',
  22210. store: _store2.default,
  22211. router: _router2.default,
  22212. render: function render(h) {
  22213. return h(_LessPass2.default);
  22214. }
  22215. });
  22216. /***/ }
  22217. /******/ ])));