'use strict'
!(function(require, directRequire) {
  function a(a) {
    return 0 > a ? (-a << 1) + 1 : (a << 1) + 0
  }
  function b(a) {
    var b = a >> 1
    return 1 == (1 & a) ? -b : b
  }
  function c(b) {
    var c,
      d = '',
      e = a(b)
    do (c = e & j), (e >>>= h), 0 < e && (c |= k), (d += g.encode(c))
    while (0 < e)
    return d
  }
  function d(a, c) {
    var d,
      e,
      f = 0,
      i = a.length,
      l = 0,
      m = 0
    do {
      if (f >= i) throw new Error('Expected more digits in base 64 VLQ value.')
      ;(e = g.decode(a.charAt(f++))),
        (d = !!(e & k)),
        (e &= j),
        (l += e << m),
        (m += h)
    } while (d)
    ;(c.value = b(l)), (c.rest = a.slice(f))
  }
  var e = {},
    f = {}
  ;[
    'A',
    'B',
    'C',
    'D',
    'E',
    'F',
    'G',
    'H',
    'I',
    'J',
    'K',
    'L',
    'M',
    'N',
    'O',
    'P',
    'Q',
    'R',
    'S',
    'T',
    'U',
    'V',
    'W',
    'X',
    'Y',
    'Z',
    'a',
    'b',
    'c',
    'd',
    'e',
    'f',
    'g',
    'h',
    'i',
    'j',
    'k',
    'l',
    'm',
    'n',
    'o',
    'p',
    'q',
    'r',
    's',
    't',
    'u',
    'v',
    'w',
    'x',
    'y',
    'z',
    '0',
    '1',
    '2',
    '3',
    '4',
    '5',
    '6',
    '7',
    '8',
    '9',
    '+',
    '/'
  ].forEach(function(a, b) {
    ;(e[a] = b), (f[b] = a)
  })
  var g = {
      encode: function(a) {
        if (a in f) return f[a]
        throw new TypeError('Must be between 0 and 63: ' + a)
      },
      decode: function(a) {
        if (a in e) return e[a]
        throw new TypeError('Not a valid base 64 digit: ' + a)
      }
    },
    h = 5,
    i = 1 << h,
    j = i - 1,
    k = i
  ;(exports.encode = function(a) {
    return '[object Array]' == Object.prototype.toString.call(a)
      ? a
          .map(function(a) {
            if ('[object Array]' == Object.prototype.toString.call(a))
              return a
                .map(function(a) {
                  return c(a)
                })
                .join('')
          })
          .join(',')
      : c(a)
  }),
    (exports.decode = function(a) {
      for (var b = [[]], c = 0, e = { rest: a }; e.rest; ) {
        var f = e.rest
        ',' === f.charAt(0) && ((f = f.slice(1)), b.push([]), c++),
          d(f, e),
          b[c].push(e.value)
      }
      return b
    })
})(require('lazyload'), require)
