'use strict'
!(function(require, directRequire) {
  var a = {
      getPlatform: () => {
        return 'wechatdevtools'
      }
    },
    b = { publish: () => {}, subscribe: () => {} }
  module.exports = function(c) {
    var d = Math.floor,
      f = Math.abs,
      e = global.windowMap.get('MAIN').window
    ;(e.exparser = c),
      (function(a) {
        var b = function(a) {
            return {
              animationName: a.animationName,
              elapsedTime: a.elapsedTime
            }
          },
          d = null
        ;[
          'webkitAnimationStart',
          'webkitAnimationIteration',
          'webkitAnimationEnd',
          'animationstart',
          'animationiteration',
          'animationend',
          'webkitTransitionEnd',
          'transitionend'
        ].forEach(function(f) {
          if ((null == d && (d = 'webkit' === f.slice(0, 6)), d)) {
            if ('webkit' !== f.slice(0, 6)) return
            f = f.slice(6).toLowerCase()
          } else if ('webkit' === f.slice(0, 6)) return
          a.addEventListener(
            f,
            function(a) {
              a.target.__wxElement &&
                c.triggerEvent(a.target.__wxElement, f, b(a)),
                document.dispatchEvent(new CustomEvent('pageReRender', {}))
            },
            !0
          )
        })
      })(e),
      (function(a) {
        ;(c.globalOptions.renderingMode = 'native'),
          (c.globalOptions.lazyRegistration = !1),
          (c.globalOptions.classPrefix = ''),
          (c.globalOptions.reflectToAttributes = !0),
          a.addEventListener(
            'change',
            function(a) {
              c.triggerEvent(a.target, 'change', { value: a.target.value })
            },
            !0
          ),
          a.addEventListener(
            'input',
            function(a) {
              c.triggerEvent(a.target, 'input')
            },
            !0
          ),
          a.addEventListener(
            'load',
            function(a) {
              c.triggerEvent(a.target, 'load')
            },
            !0
          ),
          a.addEventListener(
            'error',
            function(a) {
              c.triggerEvent(a.target, 'error')
            },
            !0
          ),
          a.addEventListener(
            'focus',
            function(a) {
              c.triggerEvent(a.target, 'focus'), a.preventDefault()
            },
            !0
          ),
          a.addEventListener(
            'blur',
            function(a) {
              c.triggerEvent(a.target, 'blur')
            },
            !0
          ),
          (e.requestAnimationFrame =
            e.requestAnimationFrame ||
            e.mozRequestAnimationFrame ||
            e.webkitRequestAnimationFrame ||
            e.msRequestAnimationFrame),
          e.requestAnimationFrame ||
            (e.requestAnimationFrame = function(a) {
              'function' == typeof a &&
                setTimeout(function() {
                  a()
                }, 17)
            })
      })(e),
      (function(d) {
        function g(a) {
          'undefined' == typeof b
            ? document.addEventListener('WeixinJSBridgeReady', a, !1)
            : a()
        }
        var h = 'ios' === a.getPlatform(),
          j = function(a, b, d) {
            var f = c.Event.create(b, d, {
              originalEvent: a,
              bubbles: !0,
              capturePhase: !0,
              composed: !0,
              extraFields: {
                touches: a.touches || {},
                changedTouches: a.changedTouches || {}
              }
            })
            return c.Event.dispatchEvent(a.target, f), f
          },
          i = 10,
          k = -50,
          l = function(a, b) {
            return (
              (a[b ? 'changedTouches' : 'touches'] = [
                {
                  identifier: 0,
                  pageX: a.pageX,
                  pageY: a.pageY,
                  clientX: a.clientX,
                  clientY: a.clientY,
                  screenX: a.screenX,
                  screenY: a.screenY,
                  target: a.target
                }
              ]),
              a
            )
          },
          m = !1,
          n = 0,
          o = 0,
          p = 0,
          q = 0,
          r = null,
          s = !1,
          t = !1,
          u = function(a) {
            for (; a; a = a.parentNode) {
              var b = a.__wxElem || a
              if (b.__wxScrolling && Date.now() - b.__wxScrolling < 50)
                return !0
            }
            return !1
          },
          v = function() {
            var a = j(q, 'longtap', { x: o, y: p })
            a._hasListeners &&
              console.warn(
                'For developer:"longtap" event is deprecated. Please use "longpress" event instead.'
              )
            var b = j(q, 'longpress', { x: o, y: p })
            b._hasListeners && (s = !0)
          },
          w = function(a, b, c) {
            return n
              ? void 0
              : a.defaultPrevented
                ? void (n = 0)
                : void ((n = a.timeStamp),
                  (o = b),
                  (p = c),
                  u(a.target)
                    ? ((r = null), (s = !0), j(a, 'canceltap', { x: b, y: c }))
                    : ((r = setTimeout(v, 350)), (s = !1)),
                  (q = a))
          },
          x = function(a, b, c) {
            n &&
              ((f(b - o) < i && f(c - p) < i) ||
                (r && (clearTimeout(r), (r = null)),
                (s = !0),
                j(q, 'canceltap', { x: b, y: c })))
          },
          y = function(a, b, c, d) {
            n &&
              ((n = 0),
              r && (clearTimeout(r), (r = null)),
              d && ((a = q), (b = o), (c = p)),
              !d && !s && (j(q, 'tap', { x: b, y: c }), C(q)))
          },
          z = function(a) {
            for (var b = a.target, d = !1; b && !b.__wxElement; ) {
              if (b._isNativeComp) {
                d = !0
                break
              }
              b = b.parentNode
            }
            for (b = b && b.__wxElement; b && !d; ) {
              if (b instanceof c.Component && b.hasBehavior('wx-native')) {
                d = !0
                break
              }
              b = b.parentNode
            }
            d || a.preventDefault()
          }
        d.addEventListener(
          'scroll',
          function(a) {
            a.target.__wxScrolling = Date.now()
          },
          { capture: !0, passive: !1 }
        )
        var A = !1
        d.addEventListener(
          'touchstart',
          function(a) {
            ;(m = !0), (t = !!u(a.target))
            for (var b = 0; b < a.touches.length; b++)
              if (a.touches[b].pageX < k) return void (A = !0)
            ;(A = !1),
              j(a, 'touchstart'),
              1 === a.touches.length &&
                w(a, a.touches[0].pageX, a.touches[0].pageY)
          },
          { capture: !0, passive: !1 }
        ),
          d.addEventListener(
            'touchmove',
            function(a) {
              if (!A) {
                for (var b = 0; b < a.touches.length; b++)
                  if (a.touches[b].pageX < k)
                    return (A = !0), j(a, 'touchcancel'), void y(null, 0, 0, !0)
                j(a, 'touchmove'),
                  1 === a.touches.length &&
                    x(a, a.touches[0].pageX, a.touches[0].pageY)
              }
            },
            { capture: !0, passive: !1 }
          ),
          d.addEventListener(
            'touchend',
            function(a) {
              if ((t && a.preventDefault(), !A)) {
                for (var b = 0; b < a.touches.length; b++)
                  if (a.touches[b].pageX < k)
                    return (A = !0), j(a, 'touchcancel'), void y(null, 0, 0, !0)
                j(a, 'touchend'),
                  0 === a.touches.length &&
                    y(a, a.changedTouches[0].pageX, a.changedTouches[0].pageY),
                  h && z(a)
              }
            },
            { capture: !0, passive: !1 }
          ),
          d.addEventListener(
            'touchcancel',
            function(a) {
              A || (j(a, 'touchcancel'), y(null, 0, 0, !0))
            },
            { capture: !0, passive: !1 }
          ),
          e.addEventListener('blur', function() {
            y(null, 0, 0, !0)
          }),
          d.addEventListener(
            'mousedown',
            function(a) {
              m || n || (l(a, !1), j(a, 'touchstart'), w(a, a.pageX, a.pageY))
            },
            { capture: !0, passive: !1 }
          ),
          d.addEventListener(
            'mousemove',
            function(a) {
              m || !n || (l(a, !1), j(a, 'touchmove'), x(a, a.pageX, a.pageY))
            },
            { capture: !0, passive: !1 }
          ),
          d.addEventListener(
            'mouseup',
            function(a) {
              m || !n || (l(a, !0), j(a, 'touchend'), y(a, a.pageX, a.pageY))
            },
            { capture: !0, passive: !1 }
          )
        var B = {},
          C = function(a) {
            if (B.selector)
              for (var b = B.selector, c = {}, d = a.target; d; ) {
                if (d.tagName && 0 === d.tagName.indexOf('WX-')) {
                  var e = d.className.split(' ').map(function(a) {
                    return a ? '.' + a : null
                  })
                  ;['#' + d.id].concat(e).forEach(function(a) {
                    b.forEach(function(b) {
                      b === a
                        ? D([d], b)
                        : new RegExp(a + '$').test(b)
                          ? (c[b] = [d])
                          : new RegExp('^' + a + ' ').test(b) && c[b]
                            ? (c[b].unshift(d), D(c[b], b), (c[b] = null))
                            : new RegExp(' ' + a + ' ').test(b) &&
                              c[b] &&
                              c[b].unshift(d)
                    })
                  })
                }
                d = d.parentNode
              }
          },
          D = function(a, c) {
            for (var d = 0; d < B.data.length; d++) {
              var e = B.data[d],
                f = e.element.split(' ')
              if (e.element === c && f.length === a.length) {
                var h = {
                  eventID: e.eventID,
                  page: e.page,
                  element: e.element,
                  action: e.action,
                  dataset: a[a.length - 1] && a[a.length - 1].dataset,
                  time: Date.now()
                }
                0 === c.indexOf('.') &&
                  (h.index = a.map(function(b, c) {
                    var d = 0 === c ? document.body : a[c - 1],
                      e = null
                    try {
                      e = d.querySelectorAll(f[c])
                    } catch (a) {}
                    return e ? Array.prototype.indexOf.call(e, b) : -1
                  })),
                  g(function() {
                    b.publish('analyticsReport', { data: h })
                  })
              }
            }
          }
        g(function() {
          b.subscribe('analyticsConfig', function(a) {
            '[object Array]' !== Object.prototype.toString.call(a.data) ||
              ((B.data = a.data),
              (B.selector = []),
              B.data.forEach(function(a) {
                a.element &&
                  -1 === B.selector.indexOf(a.element) &&
                  B.selector.push(a.element)
              }))
          })
        })
      })(e),
      e.exparser.registerBehavior({
        is: 'wx-base',
        properties: { hidden: { type: Boolean, public: !0 } },
        methods: {
          getNodeId: function() {
            return this.ownerShadowRoot
              ? __virtualDOM__.getNodeId(this.ownerShadowRoot.__wxHost)
              : null
          },
          _isDevTools: function() {
            return /wechatdevtools/.test(e.navigator.userAgent.toLowerCase())
          },
          debounce: function(a, b, c) {
            var d = this
            ;(this.__debouncers = this.__debouncers || {}),
              this.__debouncers[a] && clearTimeout(this.__debouncers[a]),
              (this.__debouncers[a] = setTimeout(function() {
                'function' == typeof b && b(), (d.__debouncers[a] = void 0)
              }, c))
          }
        }
      }),
      e.exparser.registerBehavior({
        is: 'wx-player',
        properties: {
          src: { type: String, observer: '_srcChanged', public: !0 },
          poster: { type: String, observer: '_posterChanged', public: !0 },
          playing: { type: Boolean, value: !1 },
          _buttonType: { type: String, value: 'play' },
          _currentTime: { type: String, value: '00:00' },
          _duration: { type: String, value: '00:00' },
          _isLive: { type: Boolean, value: !1 },
          isBackground: { type: Boolean, value: !1 },
          stopped: { type: Boolean, value: !0 },
          paused: { type: Boolean, value: !0 }
        },
        methods: {
          _formatTime: function(a) {
            if (a === Infinity) return '00:00'
            var b = d(a / 3600),
              c = d((a - 3600 * b) / 60),
              e = a - 3600 * b - 60 * c
            return 0 == b
              ? (10 <= c ? c : '0' + c) + ':' + (10 <= e ? e : '0' + e)
              : (10 <= b ? b : '0' + b) +
                  ':' +
                  (10 <= c ? c : '0' + c) +
                  ':' +
                  (10 <= e ? e : '0' + e)
          },
          _publish: function(a, b) {
            this.triggerEvent(a, b)
          }
        },
        attached: function() {
          var a = this
          if (this.$.player) {
            var b = this.$.player.$$ || this.$.player,
              c = this,
              g = {}
            for (var e in MediaError) g[MediaError[e]] = e
            ;(b.onerror = function(a) {
              if ((a.stopPropagation(), a.srcElement.error)) {
                var b = a.srcElement.error.code
                c._publish('error', { errMsg: g[b] })
              }
            }),
              (b.onplay = function(a) {
                ;(c.playing = !0),
                  a.stopPropagation(),
                  c._publish('play', {}),
                  (c._buttonType = 'pause'),
                  'function' == typeof c.onPlay && c.onPlay(a),
                  (c.paused = !1)
              }),
              (b.onpause = function(a) {
                ;(c.playing = !1),
                  a.stopPropagation(),
                  c._publish('pause', {}),
                  (c._buttonType = 'play'),
                  'function' == typeof c.onPause && c.onPause(a),
                  (c.paused = !0)
              }),
              (b.onended = function(a) {
                ;(c.playing = !1),
                  a.stopPropagation(),
                  c._publish('ended', {}),
                  'function' == typeof c.onEnded && c.onEnded(a)
              }),
              (b.onwaiting = function(a) {
                ;(c.playing = !1),
                  a.stopPropagation(),
                  c._publish('waiting', {})
              }),
              'AUDIO' == b.tagName &&
                (b.onratechange = function(a) {
                  a.stopPropagation(),
                    c._publish('ratechange', { playbackRate: b.playbackRate })
                })
            var h = 0
            b.addEventListener('timeupdate', function(a) {
              a.stopPropagation(),
                1 <= f(b.currentTime - h) % b.duration &&
                  (c._publish('timeupdate', {
                    currentTime: b.currentTime,
                    duration: b.duration
                  }),
                  (h = 1e3 * b.currentTime)),
                c._isLockTimeUpdateProgress ||
                  (c._currentTime = c._formatTime(d(b.currentTime))),
                'function' == typeof c.onTimeUpdate && c.onTimeUpdate(a)
            }),
              b.addEventListener('durationchange', function() {
                ;(a._isLive = b.duration === Infinity),
                  b.duration !== NaN &&
                    0 === a.duration &&
                    (c._duration = c._formatTime(d(b.duration)))
              })
          }
        }
      })
    e.exparser.registerElement({
      is: 'wx-video',
      behaviors: ['wx-base', 'wx-player'],
      options: { renderingMode: 'full' },
      template: function() {
        return [
          {
            t: 1,
            n: 'div',
            cl: { v: 'wx-video-container' },
            a: [],
            c: [
              {
                t: 1,
                n: 'video',
                id: 'player',
                a: [{ n: 'webkit-playsinline', v: '' }],
                c: []
              },
              {
                t: 1,
                n: 'block',
                v: !0,
                a: [
                  {
                    s: [],
                    n: 'if',
                    d: function(a) {
                      return !a.stopped && a.controls
                    },
                    b: [[null, 'stopped'], [null, 'controls']]
                  }
                ],
                c: [
                  {
                    t: 1,
                    n: 'div',
                    id: 'bar',
                    cl: { v: 'wx-video-bar full' },
                    a: [{ n: 'bindtap', v: 'handleTapBar' }],
                    c: [
                      {
                        t: 1,
                        n: 'div',
                        id: 'controls',
                        cl: { v: 'wx-video-controls' },
                        a: [],
                        c: [
                          {
                            t: 1,
                            n: 'div',
                            id: 'controlButton',
                            cl: {
                              e: function(a) {
                                return (
                                  'wx-video-control-button ' +
                                  (a.paused ? 'play' : 'pause')
                                )
                              },
                              b: [[null, 'paused']]
                            },
                            a: [{ n: 'bindtap', v: 'handleTapControlButton' }],
                            c: []
                          },
                          {
                            t: 1,
                            n: 'block',
                            v: !0,
                            a: [
                              {
                                s: [],
                                n: 'if',
                                d: function(a) {
                                  return !a.live
                                },
                                b: [[null, 'live']]
                              }
                            ],
                            c: [
                              {
                                t: 1,
                                n: 'div',
                                cl: { v: 'wx-video-current-time' },
                                a: [{ n: 'parse-text-content', v: '' }],
                                c: [
                                  {
                                    c: '',
                                    e: function(a) {
                                      return a._currentTime
                                    },
                                    b: [[null, '_currentTime']],
                                    t: 3
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            t: 1,
                            n: 'block',
                            v: !0,
                            a: [
                              {
                                s: [],
                                n: 'if',
                                d: function(a) {
                                  return !a.live
                                },
                                b: [[null, 'live']]
                              }
                            ],
                            c: [
                              {
                                t: 1,
                                n: 'div',
                                cl: { v: 'wx-video-progress-container' },
                                a: [{ n: 'bindtap', v: 'handleTapProgress' }],
                                c: [
                                  {
                                    t: 1,
                                    n: 'div',
                                    id: 'progress',
                                    cl: { v: 'wx-video-progress' },
                                    a: [],
                                    c: [
                                      {
                                        t: 1,
                                        n: 'div',
                                        id: 'ball',
                                        cl: { v: 'wx-video-ball' },
                                        st: {
                                          e: function(a) {
                                            return (
                                              'left: ' + a._progressLeft + 'px;'
                                            )
                                          },
                                          b: [[null, '_progressLeft']]
                                        },
                                        a: [
                                          {
                                            n: 'bindtouchstart',
                                            v: 'handleTouchStartBall'
                                          }
                                        ],
                                        c: [
                                          {
                                            t: 1,
                                            n: 'div',
                                            cl: { v: 'wx-video-inner' },
                                            a: [],
                                            c: []
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            t: 1,
                            n: 'block',
                            v: !0,
                            a: [
                              {
                                s: [],
                                n: 'if',
                                d: function(a) {
                                  return !a.live
                                },
                                b: [[null, 'live']]
                              }
                            ],
                            c: [
                              {
                                t: 1,
                                n: 'div',
                                cl: { v: 'wx-video-duration' },
                                a: [{ n: 'parse-text-content', v: '' }],
                                c: [
                                  {
                                    c: '',
                                    e: function(a) {
                                      return a._duration
                                    },
                                    b: [[null, '_duration']],
                                    t: 3
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            t: 1,
                            n: 'block',
                            v: !0,
                            a: [
                              {
                                s: [],
                                n: 'if',
                                d: function(a) {
                                  return a.live
                                },
                                b: [[null, 'live']]
                              }
                            ],
                            c: [
                              {
                                t: 1,
                                n: 'div',
                                cl: { v: 'wx-video-live-button' },
                                a: [],
                                c: [{ c: '\u76F4\u64AD', t: 3 }]
                              }
                            ]
                          }
                        ]
                      },
                      {
                        t: 1,
                        n: 'block',
                        v: !0,
                        a: [
                          {
                            s: [],
                            n: 'if',
                            d: function(a) {
                              return a.danmuBtn
                            },
                            b: [[null, 'danmuBtn']]
                          }
                        ],
                        c: [
                          {
                            t: 1,
                            n: 'div',
                            id: 'danmuBtn',
                            cl: {
                              e: function(a) {
                                return (
                                  'wx-video-danmu-btn ' +
                                  (a.enableDanmu ? 'active' : '')
                                )
                              },
                              b: [[null, 'enableDanmu']]
                            },
                            a: [{ n: 'bindtap', v: 'handleTapDanmuButton' }],
                            c: [{ c: '\u5F39\u5E55', t: 3 }]
                          }
                        ]
                      },
                      {
                        t: 1,
                        n: 'div',
                        id: 'fullscreen',
                        cl: { v: 'wx-video-fullscreen' },
                        a: [{ n: 'bindtap', v: 'handleTapFullscreen' }],
                        c: []
                      }
                    ]
                  }
                ]
              },
              {
                t: 1,
                n: 'block',
                v: !0,
                a: [
                  {
                    s: [],
                    n: 'if',
                    d: function(a) {
                      return a.stopped
                    },
                    b: [[null, 'stopped']]
                  }
                ],
                c: [
                  {
                    t: 1,
                    n: 'div',
                    id: 'cover',
                    cl: { v: 'wx-video-cover' },
                    a: [],
                    c: [
                      {
                        t: 1,
                        n: 'img',
                        id: 'coverPlayBtn',
                        cl: { v: 'wx-video-cover-play-button' },
                        a: [
                          {
                            n: 'src',
                            v:
                              'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAYAAAAy2w7YAAAAAXNSR0IArs4c6QAAAWhJREFUSA1j+P///0cgBoHjQGzCQCsAtgJB/AMy5wCxGNXtQ9iBwvoA5BUCMQvVLEQxHpNzDSjkRhXLMM3GKrIeKKpEkYVYjcUu+AMo3ALE3GRZiN1MvKKPgbIRJFuG10j8koeA0gZEW4jfLIKyf4EqpgOxMEELCRpFnIJ3QGU5QMyM00LizCFa1SWgSkeslhFtBGkKVwGVy6FYSJp+klR/A6quB2JOkIWMIK0oNlOf8xBoZDE9LAI7nYn6HsBq4l96WHQEaLUpAyiOaASeAM2NgvuPBpaACt82IEYtfKls0UagecpwXyAzqGTRdaA57sjmYrAptAjUsCkGYlYMg9EFyLQI1IiZB8Ti6Obh5JNh0QmgHlOcBuKSIMGi50C18UDMiMssvOJEWPQLqKYbiHnxGkRIkoBF24DyaoTMIEoeh0W3geI+RBlArCI0iz4D+RVAzEasfqLVAQ19AcSg5LoYiKWI1kiiQgCMBLnEEcfDSgAAAABJRU5ErkJggg=='
                          },
                          { n: 'bindtap', v: 'handleTapCoverPlayButton' }
                        ],
                        c: []
                      },
                      {
                        t: 1,
                        n: 'block',
                        v: !0,
                        a: [
                          {
                            s: [],
                            n: 'if',
                            d: function(a) {
                              return !a.live
                            },
                            b: [[null, 'live']]
                          }
                        ],
                        c: [
                          {
                            t: 1,
                            n: 'p',
                            cl: { v: 'wx-video-cover-duration' },
                            a: [],
                            c: [
                              {
                                c: '',
                                e: function(a) {
                                  return a._duration
                                },
                                b: [[null, '_duration']],
                                t: 3
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              },
              {
                t: 1,
                n: 'div',
                id: 'danmu',
                cl: { v: 'wx-video-danmu' },
                st: { v: 'z-index: -9999' },
                a: [],
                c: []
              }
            ]
          },
          {
            t: 1,
            n: 'div',
            st: {
              v:
                'position: absolute; top: 0; width: 100%; height: 100%; overflow: hidden;'
            },
            a: [],
            c: [{ t: 1, n: 'slot', v: !0, sn: '', a: [], c: [] }]
          }
        ]
      },
      properties: {
        hidden: {
          type: Boolean,
          value: !1,
          public: !0,
          observer: '_hiddenChanged'
        },
        autoplay: {
          type: Boolean,
          value: !1,
          public: !0,
          observer: function(a) {
            this.$.player.$$.autoplay = a
          }
        },
        danmuBtn: { type: Boolean, value: !1, public: !0 },
        enableDanmu: {
          type: Boolean,
          value: !1,
          observer: '_enableDanmuChanged',
          public: !0
        },
        enableFullScreen: { type: Boolean, value: !1, public: !0 },
        controls: { type: Boolean, value: !0, public: !0 },
        danmuList: {
          type: Array,
          value: [],
          public: !0,
          observer: '_danmuListChanged'
        },
        objectFit: {
          type: String,
          value: 'contain',
          public: !0,
          observer: '_objectFitChanged'
        },
        initialTime: { type: Number, value: 0, public: !0 },
        duration: {
          type: Number,
          value: 0,
          public: !0,
          observer: '_durationChanged'
        },
        live: { type: Boolean, value: !1, public: !0, observer: 'liveChanged' },
        muted: {
          type: Boolean,
          value: !1,
          public: !0,
          observer: function(a) {
            this.$.player.$$.muted = a
          }
        },
        loop: {
          type: Boolean,
          value: !1,
          public: !0,
          observer: function(a) {
            this.$.player.$$.loop = a
          }
        },
        playbackRate: {
          type: Number,
          value: 1,
          public: !0,
          observer: 'playbackRateChanged'
        },
        _isLockTimeUpdateProgress: { type: Boolean, value: !1 },
        _rate: { type: Number, value: 0 },
        _progressLeft: { type: Number, value: -22 },
        _progressLength: { type: Number, value: 0 },
        _danmuStatus: { type: String, value: '' },
        _isBarShow: { type: Boolean, value: !0 },
        _danmuObject: { type: Object, value: {} }
      },
      listeners: {
        tap: function() {
          this._isBarShow ? this._hideBar() : this._showBar()
        }
      },
      methods: {
        onPlay: function() {
          ;(this.stopped = !1), this._showBar()
        },
        onPause: function() {
          this._showBar(), clearTimeout(this._hideBarTimer)
        },
        onTimeUpdate: function() {
          var a = this,
            b = this.$.player.$$.currentTime / this.$.player.$$.duration
          this._isLockTimeUpdateProgress || this._setProgress(b)
          var c = this._danmuObject[parseInt(this.$.player.$$.currentTime)]
          c !== void 0 &&
            0 < c.length &&
            c.forEach(function(b) {
              a._sendDanmu(b)
            })
        },
        onEnded: function() {
          this.stopped = !0
        },
        _srcChanged: function(b) {
          if (
            (this._resetDanmu(),
            (this.$.player.$$.src =
              'wechatdevtools' === a.getPlatform()
                ? b.replace('wxfile://', 'http://wxfile.open.weixin.qq.com/')
                : b),
            this.live || this._seek(this.initialTime),
            'wechatdevtools' === a.getPlatform() &&
              !0 === this.live &&
              'undefined' != typeof Hls)
          ) {
            var c = new Hls()
            c.loadSource(b), c.attachMedia(this.$.player.$$)
          }
        },
        _posterChanged: function(a) {
          this.$.player.$$.poster = a
        },
        _objectFitChanged: function(a) {
          this.$.player.$$.style.objectFit = a
        },
        _durationChanged: function(a) {
          0 < a && (this._duration = this._formatTime(d(a)))
        },
        _hiddenChanged: function() {
          this.$.player.$$.pause()
        },
        _danmuListChanged: function(a) {
          this._danmuObject = a.reduce(function(a, b) {
            return (
              'number' == typeof b.time &&
                0 <= b.time &&
                'string' == typeof b.text &&
                0 < b.text.length &&
                (a[b.time]
                  ? a[b.time].push({
                      text: b.text,
                      color: b.color || '#ffffff'
                    })
                  : (a[b.time] = [
                      { text: b.text, color: b.color || '#ffffff' }
                    ])),
              a
            )
          }, {})
        },
        _enableDanmuChanged: function(a) {
          ;(this._danmuStatus = a ? 'active' : ''),
            (this.$.danmu.$$.style.zIndex = a ? '0' : '-9999')
        },
        _mutedChanged: function() {},
        _seek: function(a) {
          var b = this,
            c = function c() {
              b.$.player.$$.duration === Infinity ||
                !0 === b.live ||
                ((b.$.player.$$.currentTime = a),
                b._resetDanmu(),
                b.$.player.$$.removeEventListener('canplay', c, !1))
            }
          0 === this.$.player.$$.readyState || 1 === this.$.player.$$.readyState
            ? this.$.player.$$.addEventListener('canplay', c, !1)
            : c()
        },
        actionChanged: function(a) {
          var b = this
          if (
            'object' === ('undefined' == typeof a ? 'undefined' : _typeof(a))
          ) {
            var c = a.method,
              d = a.data
            if ('play' === c) this.$.player.$$.play()
            else if ('pause' === c) this.$.player.$$.pause()
            else if ('seek' === c) {
              var e = function a() {
                b.$.player.$$.duration === Infinity ||
                  !0 === b.live ||
                  ((b.$.player.$$.currentTime = d[0]),
                  b._resetDanmu(),
                  b.$.player.$$.removeEventListener('canplay', a, !1))
              }
              0 === this.$.player.$$.readyState ||
              1 === this.$.player.$$.readyState
                ? this.$.player.$$.addEventListener('canplay', e, !1)
                : e()
            } else if ('sendDanmu' === c) {
              var f = _slicedToArray(d, 2),
                g = f[0],
                h = f[1],
                i = parseInt(this.$.player.$$.currentTime)
              this._danmuObject[i]
                ? this._danmuObject[i].push({ text: g, color: h, time: i })
                : (this._danmuObject[i] = [{ text: g, color: h, time: i }])
            } else
              'playbackRate' === c && (this.$.player.$$.playbackRate = d[0])
          }
        },
        handleTapBar: function(a) {
          a.stopPropagation(), this._showBar()
        },
        handleTapCoverPlayButton: function() {
          this.$.player.$$.play()
        },
        handleTapControlButton: function() {
          this.paused ? this.$.player.$$.play() : this.$.player.$$.pause()
        },
        handleTapFullscreen: function() {
          ;(this.enableFullScreen =
            !('android' !== a.getPlatform()) || !this.enableFullScreen),
            this.enableFullScreen && this.$.player.$$.webkitEnterFullscreen(),
            this.triggerEvent('togglefullscreen', {
              enable: this.enableFullScreen
            })
        },
        handleTapProgress: function(a) {
          var b = this,
            c = function c() {
              var d = b._computeRate(a.touches[0].clientX),
                e = b.$.player.$$.duration * d
              !isNaN(parseFloat(e)) &&
                isFinite(e) &&
                (b.$.player.$$.currentTime = e),
                b._resetDanmu(),
                b.$.player.$$.removeEventListener('canplay', c, !1)
            }
          0 === this.$.player.$$.readyState || 1 === this.$.player.$$.readyState
            ? this.$.player.$$.addEventListener('canplay', c, !1)
            : c()
        },
        handleTapDanmuButton: function(a) {
          a.stopPropagation(),
            (this.enableDanmu = !this.enableDanmu),
            this.triggerEvent('toggledanmu', { enable: this.enableDanmu })
        },
        handleTouchStartBall: function() {
          var a = this
          this._isLockTimeUpdateProgress = !0
          var b = function(b) {
            b.preventDefault(),
              a._showBar(),
              (a._rate = a._computeRate(b.touches[0].clientX)),
              (a._currentTime = a._formatTime(
                d(a.$.player.$$.duration * a._rate)
              )),
              a._setProgress(a._rate)
          }
          document.addEventListener('touchmove', b),
            document.addEventListener('touchend', function c() {
              var d = a.$.player.$$.duration * a._rate
              !isNaN(parseFloat(d)) &&
                isFinite(d) &&
                (a.$.player.$$.currentTime = d),
                document.removeEventListener('touchmove', b),
                document.removeEventListener('touchend', c),
                (a._isLockTimeUpdateProgress = !1),
                a._resetDanmu()
            })
        },
        _reset: function() {},
        _computeRate: function(a) {
          var b = this.$.progress.$$.getBoundingClientRect().left,
            c = this.$.progress.$$.offsetWidth,
            d = (a - b) / c
          return 0 > d ? (d = 0) : 1 < d && (d = 1), d
        },
        _setProgress: function(a) {
          this.live ||
            (this.$.progress &&
              ((this._progressLength = d(this.$.progress.$$.offsetWidth * a)),
              (this._progressLeft = this._progressLength - 22)))
        },
        _showBar: function() {
          var a = this
          this.$.bar &&
            ((this._isBarShow = !0),
            (this.$.bar.$$.style.transition = ''),
            (this.$.bar.$$.style.webkitTransition = ''),
            (this.$.bar.$$.style.opacity = '1'),
            (this.$.bar.$$.style.display = ''),
            clearTimeout(this._hideBarTimer),
            (this._hideBarTimer = setTimeout(function() {
              a._hideBar(!0)
            }, 5e3)))
        },
        _hideBar: function() {
          var a = this,
            b = 0 < arguments.length && arguments[0] !== void 0 && arguments[0]
          this._isBarShow = !1
          this.$.bar &&
            (b
              ? ((this.$.bar.$$.style.transition = '400ms'),
                (this.$.bar.$$.style.webkitTransition = '400ms'),
                (this.$.bar.$$.style.opacity = '0'),
                setTimeout(function() {
                  a.$.bar && (a.$.bar.$$.style.display = 'none')
                }, 400))
              : (this.$.bar.$$.style.display = 'none'))
        },
        _sendDanmu: function(a) {
          if (!(this.$.player.$$.paused || a.flag)) {
            a.flag = !0
            var b = document.createElement('p')
            ;(b.className += 'wx-video-danmu-item'),
              (b.textContent = a.text),
              (b.style.top = this._genDanmuPosition() + '%'),
              (b.style.color = a.color),
              this.$.danmu.$$.appendChild(b),
              (b.style.left = '-' + b.offsetWidth + 'px')
          }
        },
        _resetDanmu: function() {
          var a = this
          this.$.danmu &&
            ((this.$.danmu.$$.innerHTML = ''),
            Object.keys(this._danmuObject).forEach(function(b) {
              a._danmuObject[b].forEach(function(a) {
                a.flag = !1
              })
            }))
        },
        _genDanmuPosition: function() {
          if (!this._lastDanmuPosition)
            this._lastDanmuPosition = 100 * Math.random()
          else {
            var a = 100 * Math.random()
            this._lastDanmuPosition =
              10 > f(a - this._lastDanmuPosition)
                ? (this._lastDanmuPosition + 50) % 100
                : a
          }
          return this._lastDanmuPosition
        }
      },
      created: function() {},
      attached: function() {
        var a = this
        b.publish('videoPlayerInsert', { domId: this.id, videoPlayerId: 0 }),
          (this.$.player.$$.autoplay = this.autoplay),
          b.subscribe('video_' + this.id + '_actionChanged', function(b) {
            ;(a.action = b), a.actionChanged(b)
          })
      },
      detached: function() {}
    })
  }
})(require('lazyload'), require)
