'use strict'
!(function(require, directRequire) {
  var a = String.fromCharCode
  const b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
    c = function(a) {
      const c = a + ''
      let d = ''
      for (
        let e, f, g = 0, h = b;
        c.charAt(0 | g) || ((h = '='), g % 1);
        d += h.charAt(63 & (e >> (8 - 8 * (g % 1))))
      ) {
        if (((f = c.charCodeAt((g += 3 / 4))), 255 < f))
          throw new Error('"btoa" failed')
        e = (e << 8) | f
      }
      return d
    },
    d = function(c) {
      const d = (c + '').replace(/=+$/, '')
      let e = ''
      if (1 == d.length % 4) throw new Error('"atob" failed')
      for (
        let f, g, h = 0, i = 0;
        (g = d.charAt(i++));
        ~g && ((f = h % 4 ? 64 * f + g : g), h++ % 4)
          ? (e += a(255 & (f >> (6 & (-2 * h)))))
          : 0
      )
        g = b.indexOf(g)
      return e
    }
  module.exports = {
    arrayBufferToBase64: function(b) {
      let d = ''
      const e = new Uint8Array(b),
        f = e.byteLength
      for (let c = 0; c < f; c++) d += a(e[c])
      return c(d)
    },
    base64ToArrayBuffer: function(a) {
      const b = d(a),
        c = b.length,
        e = new Uint8Array(c)
      for (let d = 0; d < c; d++) e[d] = b.charCodeAt(d)
      return e.buffer
    }
  }
})(require('lazyload'), require)
