xgplayer 2.31.7 → 2.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1221,7 +1221,7 @@ module.exports = exports["default"];
1221
1221
  /* 8 */
1222
1222
  /***/ (function(module) {
1223
1223
 
1224
- module.exports = JSON.parse("{\"version\":\"2.31.7\"}");
1224
+ module.exports = JSON.parse("{\"version\":\"2.32.0\"}");
1225
1225
 
1226
1226
  /***/ }),
1227
1227
  /* 9 */
@@ -11252,6 +11252,7 @@ module.exports = exports['default'];
11252
11252
 
11253
11253
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
11254
11254
 
11255
+ /*! Built @Fri, 02 Sep 2022 13:43:57 GMT */
11255
11256
  !function (e, t) {
11256
11257
  "object" == ( false ? undefined : _typeof(exports)) && "object" == ( false ? undefined : _typeof(module)) ? module.exports = t() : true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (t),
11257
11258
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
@@ -11282,72 +11283,81 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11282
11283
  }, n.p = "", n(n.s = 4);
11283
11284
  }([function (e, t, n) {
11284
11285
  "use strict";
11285
- Object.defineProperty(t, "__esModule", { value: !0 });var i = { createDom: function createDom() {
11286
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div",
11287
- t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
11288
- n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
11289
- i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "",
11290
- o = document.createElement(e);return o.className = i, o.innerHTML = t, Object.keys(n).forEach(function (t) {
11291
- var i = t,
11292
- r = n[t];"video" === e || "audio" === e ? r && o.setAttribute(i, r) : o.setAttribute(i, r);
11293
- }), o;
11294
- }, hasClass: function hasClass(e, t) {
11295
- return e.classList ? Array.prototype.some.call(e.classList, function (e) {
11296
- return e === t;
11297
- }) : !!e.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"));
11298
- }, addClass: function addClass(e, t) {
11299
- e.classList ? t.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function (t) {
11300
- t && e.classList.add(t);
11301
- }) : i.hasClass(e, t) || (e.className += " " + t);
11302
- }, removeClass: function removeClass(e, t) {
11303
- e.classList ? t.split(/\s+/g).forEach(function (t) {
11304
- e.classList.remove(t);
11305
- }) : i.hasClass(e, t) && t.split(/\s+/g).forEach(function (t) {
11306
- var n = new RegExp("(\\s|^)" + t + "(\\s|$)");e.className = e.className.replace(n, " ");
11307
- });
11308
- }, toggleClass: function toggleClass(e, t) {
11309
- t.split(/\s+/g).forEach(function (t) {
11310
- i.hasClass(e, t) ? i.removeClass(e, t) : i.addClass(e, t);
11311
- });
11312
- }, findDom: function findDom() {
11313
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document,
11314
- t = arguments[1],
11315
- n = void 0;try {
11316
- n = e.querySelector(t);
11317
- } catch (i) {
11318
- t.startsWith("#") && (n = e.getElementById(t.slice(1)));
11319
- }return n;
11320
- }, deepCopy: function deepCopy(e, t) {
11321
- if ("Object" === i.typeOf(t) && "Object" === i.typeOf(e)) return Object.keys(t).forEach(function (n) {
11322
- "Object" !== i.typeOf(t[n]) || t[n] instanceof Node ? "Array" === i.typeOf(t[n]) ? e[n] = "Array" === i.typeOf(e[n]) ? e[n].concat(t[n]) : t[n] : e[n] = t[n] : e[n] ? i.deepCopy(e[n], t[n]) : e[n] = t[n];
11323
- }), e;
11324
- }, typeOf: function typeOf(e) {
11325
- return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0];
11326
- }, copyDom: function copyDom(e) {
11327
- if (e && 1 === e.nodeType) {
11328
- var t = document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes, function (e) {
11329
- t.setAttribute(e.name, e.value);
11330
- }), e.innerHTML && (t.innerHTML = e.innerHTML), t;
11331
- }return "";
11332
- }, formatTime: function formatTime(e) {
11333
- var t = Math.floor(e);return 1e3 * t + (e - t);
11334
- }, offInDestroy: function offInDestroy(e, t, n, i) {
11286
+ function i(e, t) {
11287
+ return e.classList ? Array.prototype.some.call(e.classList, function (e) {
11288
+ return e === t;
11289
+ }) : !!e.className.match(new RegExp("(\\s|^)" + t + "(\\s|$)"));
11290
+ }function o(e, t) {
11291
+ e.classList ? t.replace(/(^\s+|\s+$)/g, "").split(/\s+/g).forEach(function (t) {
11292
+ t && e.classList.add(t);
11293
+ }) : i(e, t) || (e.className += " " + t);
11294
+ }function r(e, t) {
11295
+ e.classList ? t.split(/\s+/g).forEach(function (t) {
11296
+ e.classList.remove(t);
11297
+ }) : i(e, t) && t.split(/\s+/g).forEach(function (t) {
11298
+ var n = new RegExp("(\\s|^)" + t + "(\\s|$)");e.className = e.className.replace(n, " ");
11299
+ });
11300
+ }function a(e) {
11301
+ return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0];
11302
+ }Object.defineProperty(t, "__esModule", { value: !0 }), t.createDom = function () {
11303
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "div",
11304
+ t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "",
11305
+ n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {},
11306
+ i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "",
11307
+ o = document.createElement(e);return o.className = i, o.innerHTML = t, Object.keys(n).forEach(function (t) {
11308
+ var i = t,
11309
+ r = n[t];"video" === e || "audio" === e ? r && o.setAttribute(i, r) : o.setAttribute(i, r);
11310
+ }), o;
11311
+ }, t.hasClass = i, t.addClass = o, t.removeClass = r, t.toggleClass = function (e, t) {
11312
+ t.split(/\s+/g).forEach(function (t) {
11313
+ i(e, t) ? r(e, t) : o(e, t);
11314
+ });
11315
+ }, t.findDom = function () {
11316
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : document,
11317
+ t = arguments[1],
11318
+ n = void 0;try {
11319
+ n = e.querySelector(t);
11320
+ } catch (i) {
11321
+ t.startsWith("#") && (n = e.getElementById(t.slice(1)));
11322
+ }return n;
11323
+ }, t.deepCopy = function e(t, n) {
11324
+ if ("Object" === a(n) && "Object" === a(t)) return Object.keys(n).forEach(function (i) {
11325
+ "Object" !== a(n[i]) || n[i] instanceof Node ? "Array" === a(n[i]) ? t[i] = "Array" === a(t[i]) ? t[i].concat(n[i]) : n[i] : t[i] = n[i] : t[i] ? e(t[i], n[i]) : t[i] = n[i];
11326
+ }), t;
11327
+ }, t.typeOf = a, t.copyDom = function (e) {
11328
+ if (e && 1 === e.nodeType) {
11329
+ var t = document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes, function (e) {
11330
+ t.setAttribute(e.name, e.value);
11331
+ }), e.innerHTML && (t.innerHTML = e.innerHTML), t;
11332
+ }return "";
11333
+ }, t.attachEventListener = function (e, t, n, i) {
11334
+ if (i) e.on(t, n), function (e, t, n, i) {
11335
11335
  e.once(i, function o() {
11336
11336
  e.off(t, n), e.off(i, o);
11337
11337
  });
11338
- }, on: function on(e, t, n, o) {
11339
- if (o) e.on(t, n), i.offInDestroy(e, t, n, o);else {
11340
- e.on(t, function i(o) {
11341
- n(o), e.off(t, i);
11342
- });
11343
- }
11344
- }, style: function style(e, t, n) {
11345
- var i = e.style;try {
11346
- i[t] = n;
11347
- } catch (e) {
11348
- i.setProperty(t, n);
11349
- }
11350
- } };t.default = i, e.exports = t.default;
11338
+ }(e, t, n, i);else {
11339
+ e.on(t, function i(o) {
11340
+ n(o), e.off(t, i);
11341
+ });
11342
+ }
11343
+ }, t.styleUtil = function (e, t, n) {
11344
+ var i = e.style;try {
11345
+ i[t] = n;
11346
+ } catch (e) {
11347
+ i.setProperty(t, n);
11348
+ }
11349
+ }, t.isNumber = function (e) {
11350
+ return "number" == typeof e && !Number.isNaN(e);
11351
+ }, t.throttle = function (e, t) {
11352
+ var n = this,
11353
+ i = 0;return function () {
11354
+ for (var o = arguments.length, r = Array(o), a = 0; a < o; a++) {
11355
+ r[a] = arguments[a];
11356
+ }clearTimeout(i), i = setTimeout(function () {
11357
+ return e.apply(n, r);
11358
+ }, t);
11359
+ };
11360
+ };t.hasOwnProperty = Object.prototype.hasOwnProperty;
11351
11361
  }, function (e, t, n) {
11352
11362
  "use strict";
11353
11363
  Object.defineProperty(t, "__esModule", { value: !0 });var i,
@@ -11372,7 +11382,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11372
11382
  }();t.default = s, e.exports = t.default;
11373
11383
  }, function (e, t, n) {
11374
11384
  "use strict";
11375
- var i = n(19)();e.exports = function (e) {
11385
+ var i = n(18)();e.exports = function (e) {
11376
11386
  return e !== i && null !== e;
11377
11387
  };
11378
11388
  }, function (e, t, n) {
@@ -11380,16 +11390,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11380
11390
  e.exports = function (e) {
11381
11391
  return null != e;
11382
11392
  };
11383
- }, function (e, t, n) {
11384
- e.exports = n(5);
11385
11393
  }, function (e, t, n) {
11386
11394
  "use strict";
11387
11395
  Object.defineProperty(t, "__esModule", { value: !0 });var i,
11388
- o = n(6),
11396
+ o = n(5),
11389
11397
  r = (i = o) && i.__esModule ? i : { default: i };n(34), t.default = r.default, e.exports = t.default;
11390
11398
  }, function (e, t, n) {
11391
11399
  "use strict";
11392
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
11400
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.DanmuJs = void 0;var i = function () {
11393
11401
  function e(e, t) {
11394
11402
  for (var n = 0; n < t.length; n++) {
11395
11403
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -11398,103 +11406,147 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11398
11406
  return n && e(t.prototype, n), i && e(t, i), t;
11399
11407
  };
11400
11408
  }(),
11401
- o = f(n(7)),
11402
- r = f(n(1)),
11403
- a = f(n(27)),
11404
- s = f(n(31)),
11405
- l = f(n(0)),
11406
- u = n(32),
11407
- c = n(33);function f(e) {
11409
+ o = f(n(6)),
11410
+ r = n(25),
11411
+ a = f(n(1)),
11412
+ s = f(n(27)),
11413
+ l = f(n(32)),
11414
+ u = n(33),
11415
+ c = n(0);function f(e) {
11408
11416
  return e && e.__esModule ? e : { default: e };
11409
11417
  }function h(e, t) {
11410
11418
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11411
- }var d = function (e) {
11419
+ }var d = t.DanmuJs = function (e) {
11412
11420
  function t(e) {
11413
11421
  !function (e, t) {
11414
11422
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11415
- }(this, t);var n = h(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("danmu"), n.logger && n.logger.info("danmu.js version: " + u.version);var i = n;if (i.config = l.default.deepCopy({ overlap: !1, area: { start: 0, end: 1 }, live: !1, comments: [], direction: "r2l", needResizeObserver: !1 }, e), i.hideArr = [], i.domObj = new s.default(), (0, o.default)(i), i.config.comments.forEach(function (e) {
11423
+ }(this, t);var n = h(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
11424
+ i = n;i.setLogger("danmu"), i.logger && i.logger.info("danmu.js version: " + r.version);var a = i.config = { overlap: !1, area: { start: 0, end: 1, lines: void 0 }, live: !1, comments: [], direction: "r2l", needResizeObserver: !1, dropStaleComments: !1, channelSize: void 0, maxCommentsLength: void 0, bulletOffset: void 0, interval: 2e3 };if ((0, c.deepCopy)(a, e), (0, o.default)(i), i.hideArr = [], i.domObj = new l.default(), i.freezeId = null, a.comments.forEach(function (e) {
11416
11425
  e.duration = e.duration ? e.duration : 5e3, e.mode || (e.mode = "scroll");
11417
- }), !i.config.container || 1 !== i.config.container.nodeType) return i.emit("error", "container id can't be empty"), !1, h(n, !1);if (i.container = i.config.container, i.config.containerStyle) {
11418
- var r = i.config.containerStyle;Object.keys(r).forEach(function (e) {
11419
- i.container.style[e] = r[e];
11426
+ }), i.container = a.container && 1 === a.container.nodeType ? a.container : null, !i.container) return i.emit("error", "container id can't be empty"), !1, h(n, !1);if (a.containerStyle) {
11427
+ var u = a.containerStyle;Object.keys(u).forEach(function (e) {
11428
+ i.container.style[e] = u[e];
11420
11429
  });
11421
- }return i.live = i.config.live, i.player = i.config.player, i.direction = i.config.direction, l.default.addClass(i.container, "danmu"), i.bulletBtn = new a.default(i), i.isReady = !0, i.emit("ready"), n.logger && n.logger.info("ready"), n.addResizeObserver(), n;
11430
+ }return i.live = a.live, i.player = a.player, i.direction = a.direction, (0, c.addClass)(i.container, "danmu"), i.bulletBtn = new s.default(i), i.main = i.bulletBtn.main, i.isReady = !0, i.emit("ready"), n.logger && n.logger.info("ready"), n.addResizeObserver(), n;
11422
11431
  }return function (e, t) {
11423
11432
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11424
11433
  }(t, e), i(t, [{ key: "addResizeObserver", value: function value() {
11425
- var e = this;this.config.needResizeObserver && (0, c.addObserver)(this.container, function () {
11434
+ var e = this;this.config.needResizeObserver && (0, u.addObserver)(this.container, function () {
11426
11435
  e.logger && e.logger.info("needResizeObserver"), e.resize();
11427
11436
  });
11428
11437
  } }, { key: "start", value: function value() {
11429
- this.logger && this.logger.info("start"), this.bulletBtn.main.start();
11438
+ this.logger && this.logger.info("start"), this.main.start();
11430
11439
  } }, { key: "pause", value: function value() {
11431
- this.logger && this.logger.info("pause"), this.bulletBtn.main.pause();
11440
+ this.logger && this.logger.info("pause"), this.main.pause();
11432
11441
  } }, { key: "play", value: function value() {
11433
- this.logger && this.logger.info("play"), this.bulletBtn.main.play();
11442
+ this.logger && this.logger.info("play"), this.main.play();
11434
11443
  } }, { key: "stop", value: function value() {
11435
- this.logger && this.logger.info("stop"), this.bulletBtn.main.stop();
11444
+ this.logger && this.logger.info("stop"), this.main.stop();
11436
11445
  } }, { key: "clear", value: function value() {
11437
- this.logger && this.logger.info("clear"), this.bulletBtn.main.clear();
11446
+ this.logger && this.logger.info("clear"), this.main.clear();
11438
11447
  } }, { key: "destroy", value: function value() {
11439
- for (var e in (0, c.unObserver)(this.container), this.logger && this.logger.info("destroy"), this.stop(), this.bulletBtn.destroy(), this.domObj.destroy(), this) {
11448
+ for (var e in (0, u.unObserver)(this.container), this.logger && this.logger.info("destroy"), this.stop(), this.bulletBtn.destroy(), this.domObj.destroy(), this) {
11440
11449
  delete this[e];
11441
11450
  }this.emit("destroy");
11442
11451
  } }, { key: "sendComment", value: function value(e) {
11443
- this.logger && this.logger.info("sendComment: " + (e.txt || "[DOM Element]")), e.duration || (e.duration = 15e3), e && e.id && e.duration && (e.el || e.txt) && (e.duration = e.duration ? e.duration : 5e3, e.style || (e.style = { opacity: void 0, fontSize: void 0 }), e.style && (this.opacity && this.opacity !== e.style.opacity && (e.style.opacity = this.opacity), this.fontSize && this.fontSize !== e.style.fontSize && (e.style.fontSize = this.fontSize), this.like && (e.like = e.like ? e.like : this.like)), e.prior || e.realTime ? (this.bulletBtn.main.data.unshift(e), e.realTime && (this.bulletBtn.main.readData(), this.bulletBtn.main.dataHandle())) : this.bulletBtn.main.data.push(e));
11452
+ this.logger && this.logger.info("sendComment: " + (e.txt || "[DOM Element]")), e.duration || (e.duration = 15e3), e && e.id && e.duration && (e.el || e.txt) && (e.duration = e.duration ? e.duration : 5e3, e.style || (e.style = { opacity: void 0, fontSize: void 0 }), e.style && (this.opacity && this.opacity !== e.style.opacity && (e.style.opacity = this.opacity), this.fontSize && this.fontSize !== e.style.fontSize && (e.style.fontSize = this.fontSize)), e.prior || e.realTime ? (this.main.data.unshift(e), e.realTime && (this.main.readData(), this.main.dataHandle())) : this.main.data.push(e));
11444
11453
  } }, { key: "setCommentID", value: function value(e, t) {
11445
- var n = this;this.logger && this.logger.info("setCommentID: oldID " + e + " newID " + t);var i = this.container.getBoundingClientRect();e && t && (this.bulletBtn.main.data.some(function (n) {
11454
+ var n = this;this.logger && this.logger.info("setCommentID: oldID " + e + " newID " + t), e && t && (this.main.data.some(function (n) {
11446
11455
  return n.id === e && (n.id = t, !0);
11447
- }), this.bulletBtn.main.queue.some(function (o) {
11448
- return o.id === e && (o.id = t, o.pauseMove(i), "paused" !== n.bulletBtn.main.status && o.startMove(i), !0);
11456
+ }), this.main.queue.some(function (i) {
11457
+ return i.id === e && (i.id = t, i.pauseMove(), "paused" !== n.main.status && i.startMove(), !0);
11449
11458
  }));
11450
11459
  } }, { key: "setCommentDuration", value: function value(e, t) {
11451
- var n = this;this.logger && this.logger.info("setCommentDuration: id " + e + " duration " + t);var i = this.container.getBoundingClientRect();e && t && (t = t || 5e3, this.bulletBtn.main.data.some(function (n) {
11460
+ var n = this;this.logger && this.logger.info("setCommentDuration: id " + e + " duration " + t), e && t && (t = t || 5e3, this.main.data.some(function (n) {
11452
11461
  return n.id === e && (n.duration = t, !0);
11453
- }), this.bulletBtn.main.queue.some(function (o) {
11454
- return o.id === e && (o.duration = t, o.pauseMove(i), "paused" !== n.bulletBtn.main.status && o.startMove(i), !0);
11462
+ }), this.main.queue.some(function (i) {
11463
+ return i.id === e && (i.duration = t, i.pauseMove(), "paused" !== n.main.status && i.startMove(), !0);
11455
11464
  }));
11456
11465
  } }, { key: "setCommentLike", value: function value(e, t) {
11457
- this.logger && this.logger.info("setCommentLike: id " + e + " like " + t);var n = this.container.getBoundingClientRect();this.like = t, e && t && (this.bulletBtn.main.data.some(function (n) {
11466
+ this.logger && this.logger.info("setCommentLike: id " + e + " like " + t), e && t && (this.main.data.some(function (n) {
11458
11467
  return n.id === e && (n.like = t, !0);
11459
- }), this.bulletBtn.main.queue.some(function (i) {
11460
- return i.id === e && (i.pauseMove(n), i.setLikeDom(t.el, t.style), "paused" !== i.danmu.bulletBtn.main.status && i.startMove(n), !0);
11468
+ }), this.main.queue.some(function (n) {
11469
+ return n.id === e && (n.pauseMove(), n.setLikeDom(t.el, t.style), "paused" !== n.danmu.main.status && n.startMove(), !0);
11461
11470
  }));
11462
11471
  } }, { key: "restartComment", value: function value(e) {
11463
- this.logger && this.logger.info("restartComment: id " + e), this.mouseControl = !1;var t = this.container.getBoundingClientRect();e && this.bulletBtn.main.queue.some(function (n) {
11464
- return n.id === e && ("paused" !== n.danmu.bulletBtn.main.status ? n.startMove(t, !0) : n.status = "paused", !0);
11465
- });
11472
+ if (this.logger && this.logger.info("restartComment: id " + e), e) {
11473
+ var t = this.main;if (this._releaseCtrl(e), "closed" === t.status) return;t.queue.some(function (n) {
11474
+ return n.id === e && ("paused" !== t.status ? n.startMove(!0) : n.status = "paused", !0);
11475
+ });
11476
+ }
11477
+ } }, { key: "_releaseCtrl", value: function value(e) {
11478
+ this.freezeId && e == this.freezeId && (this.mouseControl = !1, this.freezeId = null);
11479
+ } }, { key: "_freezeCtrl", value: function value(e) {
11480
+ this.mouseControl = !0, this.freezeId = e;
11466
11481
  } }, { key: "freezeComment", value: function value(e) {
11467
- this.logger && this.logger.info("freezeComment: id " + e), this.mouseControl = !0;var t = this.container.getBoundingClientRect();e && this.bulletBtn.main.queue.some(function (n) {
11468
- return n.id === e && (n.status = "forcedPause", n.pauseMove(t), n.el && n.el.style && l.default.style(n.el, "zIndex", 10), !0);
11469
- });
11482
+ if (this.logger && this.logger.info("freezeComment: id " + e), e) {
11483
+ this._freezeCtrl(e), this.main.queue.some(function (t) {
11484
+ return t.id === e && (t.status = "forcedPause", t.pauseMove(), t.el && t.el.style && (0, c.styleUtil)(t.el, "zIndex", 10), !0);
11485
+ });
11486
+ }
11470
11487
  } }, { key: "removeComment", value: function value(e) {
11471
- this.logger && this.logger.info("removeComment: id " + e), e && (this.bulletBtn.main.queue.some(function (t) {
11472
- return t.id === e && (t.remove(), !0);
11473
- }), this.bulletBtn.main.data = this.bulletBtn.main.data.filter(function (t) {
11474
- return t.id !== e;
11475
- }));
11488
+ if (this.logger && this.logger.info("removeComment: id " + e), e) {
11489
+ this._releaseCtrl(e), this.main.queue.some(function (t) {
11490
+ return t.id === e && (t.remove(), !0);
11491
+ }), this.main.data = this.main.data.filter(function (t) {
11492
+ return t.id !== e;
11493
+ });
11494
+ }
11476
11495
  } }, { key: "updateComments", value: function value(e) {
11477
- var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];t && (this.bulletBtn.main.data = []), this.bulletBtn.main.data = this.bulletBtn.main.data.concat(e);
11496
+ var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1],
11497
+ n = this.config,
11498
+ i = this.main,
11499
+ o = this.player,
11500
+ r = [],
11501
+ a = 0;if (this.logger && this.logger.info("updateComments: " + e.length + ", isClear " + t), "boolean" == typeof t && t && (i.data = []), i.data = i.data.concat(e), i.sortData(), "number" == typeof n.maxCommentsLength && i.data.length > n.maxCommentsLength) {
11502
+ a = i.data.length - n.maxCommentsLength;for (var s, l = 0; l < a; l++) {
11503
+ (s = i.data[l]).prior && !s.attached_ && r.push(i.data[l]);
11504
+ }
11505
+ } else if (n.dropStaleComments && o && o.currentTime) {
11506
+ var u = Math.floor(1e3 * o.currentTime),
11507
+ c = u - n.interval;if (c > 0) for (var f, h = 0; h < i.data.length; h++) {
11508
+ if ((f = i.data[h]).prior && !f.attached_ && r.push(i.data[h]), f.start > c) {
11509
+ a = h;break;
11510
+ }
11511
+ }a > 0 && (i.data.splice(0, a), i.data = r.concat(i.data));
11512
+ }
11513
+ } }, { key: "willChange", value: function value() {
11514
+ var e = this.container,
11515
+ t = this.main;e.style.willChange = "opacity", t.willChanges.push("contents"), t.queue.forEach(function (e) {
11516
+ e.willChange();
11517
+ });
11518
+ } }, { key: "stopWillChange", value: function value() {
11519
+ this.container.style.willChange = "", this.main.willChanges.splice(0), this.main.queue.forEach(function (e) {
11520
+ e.willChange();
11521
+ });
11478
11522
  } }, { key: "setAllDuration", value: function value() {
11479
11523
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll",
11480
- t = arguments[1],
11481
- n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];this.logger && this.logger.info("setAllDuration: mode " + e + " duration " + t + " force " + n);var i = this.container.getBoundingClientRect();t && (t = t || 5e3, n && (this.bulletBtn.main.forceDuration = t), this.bulletBtn.main.data.forEach(function (n) {
11482
- e === n.mode && (n.duration = t);
11483
- }), this.bulletBtn.main.queue.forEach(function (n) {
11484
- e === n.mode && (n.duration = t, n.pauseMove(i), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(i));
11524
+ t = this,
11525
+ n = arguments[1],
11526
+ i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];this.logger && this.logger.info("setAllDuration: mode " + e + " duration " + n + " force " + i), n && (n = n || 5e3, i && (this.main.forceDuration = n), this.main.data.forEach(function (t) {
11527
+ e === t.mode && (t.duration = n);
11528
+ }), this.main.queue.forEach(function (i) {
11529
+ e === i.mode && (i.duration = n, i.pauseMove(), "paused" !== t.main.status && i.startMove());
11530
+ }));
11531
+ } }, { key: "setPlayRate", value: function value() {
11532
+ var e = this,
11533
+ t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll",
11534
+ n = arguments[1];this.logger && this.logger.info("setPlayRate: " + n), (0, c.isNumber)(n) && n > 0 && (this.main.playRate = n, this.main.queue.forEach(function (n) {
11535
+ t === n.mode && (n.pauseMove(), "paused" !== e.main.status && n.startMove());
11485
11536
  }));
11486
11537
  } }, { key: "setOpacity", value: function value(e) {
11487
11538
  this.logger && this.logger.info("setOpacity: opacity " + e), this.container.style.opacity = e;
11488
11539
  } }, { key: "setFontSize", value: function value(e, t) {
11489
- var n = this;this.logger && this.logger.info("setFontSize: size " + e + " channelSize " + t), this.fontSize = e + "px", e && (this.bulletBtn.main.data.forEach(function (e) {
11540
+ var n = this,
11541
+ i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { reflow: !0 };this.logger && this.logger.info("setFontSize: size " + e + " channelSize " + t), this.fontSize = e + "px", e && (this.main.data.forEach(function (e) {
11490
11542
  e.style && (e.style.fontSize = n.fontSize);
11491
- }), this.bulletBtn.main.queue.forEach(function (e) {
11543
+ }), this.main.queue.forEach(function (e) {
11492
11544
  e.options.style || (e.options.style = {}), e.options.style.fontSize = n.fontSize, e.setFontSize(n.fontSize), t && (e.top = e.channel_id[0] * t, e.topInit());
11493
- })), t && (this.config.channelSize = t, this.bulletBtn.main.channel.resize(!0));
11545
+ })), t && (this.config.channelSize = t, i.reflow && this.main.channel.resizeSync());
11494
11546
  } }, { key: "setArea", value: function value(e) {
11495
- this.logger && this.logger.info("setArea: area " + e), this.config.area = e, this.bulletBtn.main.channel.resize(!0);
11547
+ this.logger && this.logger.info("setArea: area " + e), this.config.area = e, !1 !== e.reflow && this.main.channel.resizeSync();
11496
11548
  } }, { key: "hide", value: function value() {
11497
- var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll";this.logger && this.logger.info("hide: mode " + e), this.hideArr.indexOf(e) < 0 && this.hideArr.push(e);var t = this.bulletBtn.main.queue.filter(function (t) {
11549
+ var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "scroll";this.logger && this.logger.info("hide: mode " + e), this.hideArr.indexOf(e) < 0 && this.hideArr.push(e);var t = this.main.queue.filter(function (t) {
11498
11550
  return e === t.mode || "color" === e && t.color;
11499
11551
  });t.forEach(function (e) {
11500
11552
  return e.remove();
@@ -11505,8 +11557,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11505
11557
  var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "r2l";this.logger && this.logger.info("setDirection: direction " + e), this.emit("changeDirection", e);
11506
11558
  } }, { key: "resize", value: function value() {
11507
11559
  this.logger && this.logger.info("resize"), this.emit("channel_resize");
11560
+ } }, { key: "status", get: function get() {
11561
+ return this.main.status;
11562
+ } }, { key: "state", get: function get() {
11563
+ var e = this.main;return { status: e.status, comments: e.data, bullets: e.queue };
11564
+ } }, { key: "containerPos", get: function get() {
11565
+ return this.main.channel.containerPos;
11508
11566
  } }]), t;
11509
- }(r.default);t.default = d, e.exports = t.default;
11567
+ }(a.default);t.default = d;
11510
11568
  }, function (e, t, n) {
11511
11569
  "use strict";
11512
11570
  var i,
@@ -11516,20 +11574,20 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11516
11574
  s,
11517
11575
  l,
11518
11576
  u,
11519
- c = n(8),
11520
- f = n(25),
11577
+ c = n(7),
11578
+ f = n(24),
11521
11579
  h = Function.prototype.apply,
11522
11580
  d = Function.prototype.call,
11523
- g = Object.create,
11524
- p = Object.defineProperty,
11581
+ p = Object.create,
11582
+ g = Object.defineProperty,
11525
11583
  m = Object.defineProperties,
11526
11584
  v = Object.prototype.hasOwnProperty,
11527
- b = { configurable: !0, enumerable: !1, writable: !0 };o = function o(e, t) {
11585
+ y = { configurable: !0, enumerable: !1, writable: !0 };o = function o(e, t) {
11528
11586
  var _n, o;return f(t), o = this, i.call(this, e, _n = function n() {
11529
11587
  r.call(o, e, _n), h.call(t, this, arguments);
11530
11588
  }), _n.__eeOnceListener__ = t, this;
11531
11589
  }, s = { on: i = function i(e, t) {
11532
- var n;return f(t), v.call(this, "__ee__") ? n = this.__ee__ : (n = b.value = g(null), p(this, "__ee__", b), b.value = null), n[e] ? "object" == _typeof(n[e]) ? n[e].push(t) : n[e] = [n[e], t] : n[e] = t, this;
11590
+ var n;return f(t), v.call(this, "__ee__") ? n = this.__ee__ : (n = y.value = p(null), g(this, "__ee__", y), y.value = null), n[e] ? "object" == _typeof(n[e]) ? n[e].push(t) : n[e] = [n[e], t] : n[e] = t, this;
11533
11591
  }, once: o, off: r = function r(e, t) {
11534
11592
  var n, i, o, r;if (f(t), !v.call(this, "__ee__")) return this;if (!(n = this.__ee__)[e]) return this;if ("object" == _typeof(i = n[e])) for (r = 0; o = i[r]; ++r) {
11535
11593
  o !== t && o.__eeOnceListener__ !== t || (2 === i.length ? n[e] = i[r ? 0 : 1] : i.splice(r, 1));
@@ -11549,29 +11607,29 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11549
11607
  r[t - 1] = arguments[t];
11550
11608
  }h.call(o, this, r);}
11551
11609
  } }, l = { on: c(i), once: c(o), off: c(r), emit: c(a) }, u = m({}, l), e.exports = t = function t(e) {
11552
- return null == e ? g(u) : m(Object(e), l);
11610
+ return null == e ? p(u) : m(Object(e), l);
11553
11611
  }, t.methods = s;
11554
11612
  }, function (e, t, n) {
11555
11613
  "use strict";
11556
11614
  var i = n(3),
11557
- o = n(9),
11558
- r = n(13),
11559
- a = n(21),
11560
- s = n(22);(e.exports = function (e, t) {
11615
+ o = n(8),
11616
+ r = n(12),
11617
+ a = n(20),
11618
+ s = n(21);(e.exports = function (e, t) {
11561
11619
  var n, o, l, u, c;return arguments.length < 2 || "string" != typeof e ? (u = t, t = e, e = null) : u = arguments[2], i(e) ? (n = s.call(e, "c"), o = s.call(e, "e"), l = s.call(e, "w")) : (n = l = !0, o = !1), c = { value: t, configurable: n, enumerable: o, writable: l }, u ? r(a(u), c) : c;
11562
11620
  }).gs = function (e, t, n) {
11563
11621
  var l, u, c, f;return "string" != typeof e ? (c = n, n = t, t = e, e = null) : c = arguments[3], i(t) ? o(t) ? i(n) ? o(n) || (c = n, n = void 0) : n = void 0 : (c = t, t = n = void 0) : t = void 0, i(e) ? (l = s.call(e, "c"), u = s.call(e, "e")) : (l = !0, u = !1), f = { get: t, set: n, configurable: l, enumerable: u }, c ? r(a(c), f) : f;
11564
11622
  };
11565
11623
  }, function (e, t, n) {
11566
11624
  "use strict";
11567
- var i = n(10),
11625
+ var i = n(9),
11568
11626
  o = /^\s*class[\s{/}]/,
11569
11627
  r = Function.prototype.toString;e.exports = function (e) {
11570
11628
  return !!i(e) && !o.test(r.call(e));
11571
11629
  };
11572
11630
  }, function (e, t, n) {
11573
11631
  "use strict";
11574
- var i = n(11);e.exports = function (e) {
11632
+ var i = n(10);e.exports = function (e) {
11575
11633
  if ("function" != typeof e) return !1;if (!hasOwnProperty.call(e, "length")) return !1;try {
11576
11634
  if ("number" != typeof e.length) return !1;if ("function" != typeof e.call) return !1;if ("function" != typeof e.apply) return !1;
11577
11635
  } catch (e) {
@@ -11580,7 +11638,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11580
11638
  };
11581
11639
  }, function (e, t, n) {
11582
11640
  "use strict";
11583
- var i = n(12);e.exports = function (e) {
11641
+ var i = n(11);e.exports = function (e) {
11584
11642
  if (!i(e)) return !1;try {
11585
11643
  return !!e.constructor && e.constructor.prototype === e;
11586
11644
  } catch (e) {
@@ -11595,7 +11653,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11595
11653
  };
11596
11654
  }, function (e, t, n) {
11597
11655
  "use strict";
11598
- e.exports = n(14)() ? Object.assign : n(15);
11656
+ e.exports = n(13)() ? Object.assign : n(14);
11599
11657
  }, function (e, t, n) {
11600
11658
  "use strict";
11601
11659
  e.exports = function () {
@@ -11604,8 +11662,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11604
11662
  };
11605
11663
  }, function (e, t, n) {
11606
11664
  "use strict";
11607
- var i = n(16),
11608
- o = n(20),
11665
+ var i = n(15),
11666
+ o = n(19),
11609
11667
  r = Math.max;e.exports = function (e, t) {
11610
11668
  var n,
11611
11669
  a,
@@ -11622,7 +11680,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11622
11680
  };
11623
11681
  }, function (e, t, n) {
11624
11682
  "use strict";
11625
- e.exports = n(17)() ? Object.keys : n(18);
11683
+ e.exports = n(16)() ? Object.keys : n(17);
11626
11684
  }, function (e, t, n) {
11627
11685
  "use strict";
11628
11686
  e.exports = function () {
@@ -11662,7 +11720,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11662
11720
  };
11663
11721
  }, function (e, t, n) {
11664
11722
  "use strict";
11665
- e.exports = n(23)() ? String.prototype.contains : n(24);
11723
+ e.exports = n(22)() ? String.prototype.contains : n(23);
11666
11724
  }, function (e, t, n) {
11667
11725
  "use strict";
11668
11726
  var i = "razdwatrzy";e.exports = function () {
@@ -11678,6 +11736,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11678
11736
  e.exports = function (e) {
11679
11737
  if ("function" != typeof e) throw new TypeError(e + " is not a function");return e;
11680
11738
  };
11739
+ }, function (e) {
11740
+ e.exports = JSON.parse('{"version":"1.1.1"}');
11681
11741
  }, function (e, t, n) {
11682
11742
  "use strict";
11683
11743
  Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
@@ -11712,8 +11772,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11712
11772
  };
11713
11773
  }(),
11714
11774
  o = s(n(1)),
11715
- r = s(n(0)),
11716
- a = s(n(28));function s(e) {
11775
+ r = s(n(28)),
11776
+ a = n(0);function s(e) {
11717
11777
  return e && e.__esModule ? e : { default: e };
11718
11778
  }var l = function (e) {
11719
11779
  function t(e) {
@@ -11721,14 +11781,14 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11721
11781
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11722
11782
  }(this, t);var n = function (e, t) {
11723
11783
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11724
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("control"), n.danmu = e, n.main = new a.default(e), e.config.defaultOff || n.main.start(), n;
11784
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("control"), n.danmu = e, n.main = new r.default(e), e.config.defaultOff || n.main.start(), n;
11725
11785
  }return function (e, t) {
11726
11786
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11727
11787
  }(t, e), i(t, [{ key: "createSwitch", value: function value() {
11728
- var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];return this.logger && this.logger.info("createSwitch"), this.switchBtn = r.default.createDom("dk-switch", '<span class="txt">弹</span>', {}, "danmu-switch " + (e ? "danmu-switch-active" : "")), this.switchBtn;
11788
+ var e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0];return this.logger && this.logger.info("createSwitch"), this.switchBtn = (0, a.createDom)("dk-switch", '<span class="txt">弹</span>', {}, "danmu-switch " + (e ? "danmu-switch-active" : "")), this.switchBtn;
11729
11789
  } }, { key: "destroy", value: function value() {
11730
11790
  for (var e in this.logger && this.logger.info("destroy"), this.main.destroy(), this) {
11731
- delete this[e];
11791
+ a.hasOwnProperty.call(this, e) && delete this[e];
11732
11792
  }
11733
11793
  } }]), t;
11734
11794
  }(o.default);t.default = l, e.exports = t.default;
@@ -11746,7 +11806,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11746
11806
  o = l(n(1)),
11747
11807
  r = l(n(29)),
11748
11808
  a = l(n(30)),
11749
- s = l(n(0));function l(e) {
11809
+ s = n(0);function l(e) {
11750
11810
  return e && e.__esModule ? e : { default: e };
11751
11811
  }var u = function (e) {
11752
11812
  function t(e) {
@@ -11754,80 +11814,97 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11754
11814
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11755
11815
  }(this, t);var n = function (e, t) {
11756
11816
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11757
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("main"), n.danmu = e, n.container = e.container, n.channel = new r.default(e), n.data = [].concat(e.config.comments), n.playedData = [], n.queue = [], n.timer = null, n.retryTimer = null, n.retryStatus = "normal", n.interval = e.config.interval || 2e3, n.status = "idle", s.default.on(e, "bullet_remove", n.updateQueue.bind(n), "destroy");var i = n;return s.default.on(n.danmu, "changeDirection", function (e) {
11758
- i.danmu.direction = e;
11817
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));return n.setLogger("main"), n.danmu = e, n.container = e.container, n.channel = new a.default(e), n.data = [].concat(e.config.comments), n.playedData = [], n.queue = [], n.timer = null, n.playRate = 1, n.retryStatus = "normal", n.interval = e.config.interval, n.willChanges = [], n._status = "idle", (0, s.attachEventListener)(e, "bullet_remove", n.updateQueue.bind(n), "destroy"), (0, s.attachEventListener)(e, "changeDirection", function (e) {
11818
+ n.danmu.direction = e;
11759
11819
  }, "destroy"), n.nums = 0, n;
11760
11820
  }return function (e, t) {
11761
11821
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11762
- }(t, e), i(t, [{ key: "destroy", value: function value() {
11763
- for (var e in this.logger && this.logger.info("destroy"), clearTimeout(this.dataHandleTimer), this.channel.destroy(), this.data = [], this) {
11822
+ }(t, e), i(t, [{ key: "_cancelDataHandleTimer", value: function value() {
11823
+ this.handleId && (clearTimeout(this.handleId), this.handleId = null), this.handleTimer && (clearTimeout(this.handleTimer), this.handleTimer = null);
11824
+ } }, { key: "destroy", value: function value() {
11825
+ for (var e in this.logger && this.logger.info("destroy"), this._cancelDataHandleTimer(), this.channel.destroy(), this.data = [], this) {
11764
11826
  delete this[e];
11765
11827
  }
11766
11828
  } }, { key: "updateQueue", value: function value(e) {
11767
11829
  this.logger && this.logger.info("updateQueue");var t = this;t.queue.some(function (n, i) {
11768
11830
  return n.id === e.bullet.id && (t.queue.splice(i, 1), !0);
11769
- }), t.data.some(function (t, n) {
11770
- return t.id === e.bullet.id && (t.hasAttached = !1, !0);
11831
+ }), t.data.some(function (t) {
11832
+ return t.id === e.bullet.id && (t.attached_ = !1, !0);
11771
11833
  });
11772
- } }, { key: "init", value: function value(e, t) {
11773
- t.logger && t.logger.info("init"), t || (t = this), t.retryStatus = "normal", t.data.sort(function (e, t) {
11774
- return e.start - t.start;
11775
- });t.retryTimer || function e() {
11776
- "closed" === t.status && "stop" === t.retryStatus || ("playing" === t.status && (t.readData(), t.dataHandle()), "stop" === t.retryStatus && "paused" !== t.status || (t.dataHandleTimer = setTimeout(function () {
11777
- e();
11778
- }, t.interval - 1e3)));
11834
+ } }, { key: "init", value: function value() {
11835
+ var e = this;e.logger && e.logger.info("init"), e.retryStatus = "normal", e.sortData(), function t() {
11836
+ "closed" !== e._status || "stop" !== e.retryStatus ? ("playing" === e._status && (e.readData(), e.dataHandle()), "stop" === e.retryStatus && "paused" !== e._status || (e.handleTimer = setTimeout(function () {
11837
+ e.handleId = requestAnimationFrame(function () {
11838
+ t();
11839
+ });
11840
+ }, 250))) : e._cancelDataHandleTimer();
11779
11841
  }();
11780
11842
  } }, { key: "start", value: function value() {
11781
- this.logger && this.logger.info("start");this.status = "playing", this.queue = [], this.container.innerHTML = "", this.channel.resetWithCb(this.init, this);
11843
+ this.logger && this.logger.info("start");this._status = "playing", this.queue = [], this.container.innerHTML = "", this.channel.reset(), this.init();
11782
11844
  } }, { key: "stop", value: function value() {
11783
- this.logger && this.logger.info("stop");this.status = "closed", this.retryTimer = null, this.retryStatus = "stop", this.channel.reset(), this.queue = [], this.container.innerHTML = "";
11845
+ this.logger && this.logger.info("stop");this._status = "closed", this.retryStatus = "stop", this.queue = [], this.container.innerHTML = "", this.channel.reset();
11784
11846
  } }, { key: "clear", value: function value() {
11785
11847
  this.logger && this.logger.info("clear"), this.channel.reset(), this.data = [], this.queue = [], this.container.innerHTML = "";
11786
11848
  } }, { key: "play", value: function value() {
11787
- var e = this;this.logger && this.logger.info("play"), this.status = "playing";var t = this.channel.channels,
11788
- n = this.danmu.container.getBoundingClientRect();t && t.length > 0 && ["scroll", "top", "bottom"].forEach(function (i) {
11789
- e.queue.forEach(function (e) {
11790
- e.startMove(n), e.resized = !0;
11791
- });for (var o = 0; o < t.length; o++) {
11792
- t[o].queue[i].forEach(function (e) {
11793
- e.resized = !1;
11794
- });
11795
- }
11796
- });
11849
+ var e = this;if ("closed" !== this._status) {
11850
+ this.logger && this.logger.info("play"), this._status = "playing";var t = this.channel.channels;t && t.length > 0 && ["scroll", "top", "bottom"].forEach(function (n) {
11851
+ e.queue.forEach(function (e) {
11852
+ e.startMove(), e.resized = !0;
11853
+ });for (var i = 0; i < t.length; i++) {
11854
+ t[i].queue[n].forEach(function (e) {
11855
+ e.resized = !1;
11856
+ });
11857
+ }
11858
+ });
11859
+ } else this.logger && this.logger.info("play ignored");
11797
11860
  } }, { key: "pause", value: function value() {
11798
- this.logger && this.logger.info("pause"), this.status = "paused";var e = this.channel.channels,
11799
- t = this.danmu.container.getBoundingClientRect();e && e.length > 0 && this.queue.forEach(function (e) {
11800
- e.pauseMove(t);
11801
- });
11861
+ if ("closed" !== this._status) {
11862
+ this.logger && this.logger.info("pause"), this._status = "paused";var e = this.channel.channels;e && e.length > 0 && this.queue.forEach(function (e) {
11863
+ e.pauseMove();
11864
+ });
11865
+ } else this.logger && this.logger.info("pause ignored");
11802
11866
  } }, { key: "dataHandle", value: function value() {
11803
- var e = this;"paused" !== this.status && "closed" !== this.status && e.queue.length && e.queue.forEach(function (t) {
11804
- "waiting" === t.status && t.startMove(e.channel.containerPos);
11867
+ "paused" !== this._status && "closed" !== this._status && this.queue.length && this.queue.forEach(function (e) {
11868
+ "waiting" === e.status && e.startMove();
11805
11869
  });
11806
11870
  } }, { key: "readData", value: function value() {
11807
- var e = this,
11808
- t = this.danmu;if (t.isReady) {
11809
- var n = 0;t.player && t.player.currentTime && (n = s.default.formatTime(t.player.currentTime));var i = void 0,
11810
- o = e.interval,
11811
- r = e.channel,
11812
- l = void 0;t.player ? (l = e.data.filter(function (t) {
11813
- return !t.start && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && (t.start = n), e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && t.start - o <= n && n <= t.start + o;
11814
- }), t.live && (e.data = [])) : 0 === (l = e.data.splice(0, 1)).length && (l = e.playedData.splice(0, 1)), l.length > 0 && l.forEach(function (n) {
11815
- if (e.forceDuration && e.forceDuration != n.duration && (n.duration = e.forceDuration), i = new a.default(t, n), n.hasAttached) {
11816
- for (var o in i.detach(), i) {
11817
- delete i[o];
11818
- }i = null, n.hasAttached = !1, n.noDiscard && (n.prior ? e.data.unshift(n) : e.data.push(n));
11819
- } else if (i.attach(), n.hasAttached = !0, r.addBullet(i).result) e.queue.push(i), e.nums++, i.topInit();else {
11820
- for (var s in i.detach(), i) {
11821
- delete i[s];
11822
- }i = null, n.hasAttached = !1, n.noDiscard && (n.prior ? e.data.unshift(n) : e.data.push(n));
11871
+ if (this.danmu.isReady) {
11872
+ var e = this,
11873
+ t = this.danmu,
11874
+ n = t.player,
11875
+ i = e.interval,
11876
+ o = e.channel,
11877
+ a = void 0,
11878
+ l = void 0;if (n) {
11879
+ var u = n.currentTime ? Math.floor(1e3 * n.currentTime) : 0;l = e.data.filter(function (t) {
11880
+ return !t.start && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && (t.start = u), !t.attached_ && e.danmu.hideArr.indexOf(t.mode) < 0 && (!t.color || e.danmu.hideArr.indexOf("color") < 0) && t.start - i <= u && u <= t.start + i;
11881
+ }), t.live && (e.data = []);
11882
+ } else 0 === (l = e.data.splice(0, 1)).length && (l = e.playedData.splice(0, 1));if (l.length > 0) {
11883
+ o.updatePos();var c = 2;e: for (var f, h = 0; h < l.length; h++) {
11884
+ if (f = l[h], e.forceDuration && e.forceDuration != f.duration && (f.duration = e.forceDuration), (a = new r.default(t, f)) && !a.bulletCreateFail) {
11885
+ if (a.attach(), f.attached_ = !0, o.addBullet(a).result) e.queue.push(a), e.nums++, a.topInit(), c = 2;else {
11886
+ for (var d in a.detach(), a) {
11887
+ s.hasOwnProperty.call(a, d) && delete a[d];
11888
+ }if (a = null, f.attached_ = !1, f.noDiscard && (f.prior ? e.data.unshift(f) : e.data.push(f)), 0 === c) break e;c--;
11889
+ }
11890
+ } else {
11891
+ if (0 === c) break e;c--;
11892
+ }
11823
11893
  }
11824
- });
11894
+ }
11825
11895
  }
11896
+ } }, { key: "sortData", value: function value() {
11897
+ this.data.sort(function (e, t) {
11898
+ return (e.start || -1) - (t.start || -1);
11899
+ });
11900
+ } }, { key: "status", get: function get() {
11901
+ return this._status;
11826
11902
  } }]), t;
11827
11903
  }(o.default);t.default = u, e.exports = t.default;
11828
11904
  }, function (e, t, n) {
11829
11905
  "use strict";
11830
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
11906
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.Bullet = void 0;var i,
11907
+ o = function () {
11831
11908
  function e(e, t) {
11832
11909
  for (var n = 0; n < t.length; n++) {
11833
11910
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -11836,86 +11913,125 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11836
11913
  return n && e(t.prototype, n), i && e(t, i), t;
11837
11914
  };
11838
11915
  }(),
11839
- o = a(n(1)),
11840
- r = a(n(0));function a(e) {
11841
- return e && e.__esModule ? e : { default: e };
11842
- }var s = function (e) {
11916
+ r = n(1),
11917
+ a = (i = r) && i.__esModule ? i : { default: i },
11918
+ s = n(0);function l(e, t) {
11919
+ if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11920
+ }var u = t.Bullet = function (e) {
11921
+ function t(e, n) {
11922
+ !function (e, t) {
11923
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11924
+ }(this, t);var i = l(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
11925
+ o = i,
11926
+ r = void 0;if (i.setLogger("bullet"), i.danmu = e, i.options = n, i.duration = n.duration, i.id = n.id, i.container = e.container, i.start = n.start, i.prior = n.prior, i.realTime = n.realTime, i.color = n.color, i.bookChannelId = n.bookChannelId, i.direction = e.direction, i.reuseDOM = !0, i.willChanges = [], i.domObj = e.domObj, n.el && 1 === n.el.nodeType) {
11927
+ if (n.el.parentNode) return l(i, { bulletCreateFail: !0 });if (e.config.disableCopyDOM) r = n.el, i.reuseDOM = !1;else {
11928
+ r = i.domObj.use();var a = (0, s.copyDom)(n.el);n.eventListeners && n.eventListeners.length > 0 && n.eventListeners.forEach(function (e) {
11929
+ a.addEventListener(e.event, e.listener, e.useCapture || !1);
11930
+ }), r.appendChild(a);
11931
+ }
11932
+ } else (r = i.domObj.use()).textContent = n.txt;if (i.onChangeDirection = function (e) {
11933
+ o.direction = e;
11934
+ }, i.danmu.on("changeDirection", i.onChangeDirection), n.style) {
11935
+ var u = n.style;Object.keys(u).forEach(function (e) {
11936
+ (0, s.styleUtil)(r, e, u[e]);
11937
+ });
11938
+ }"top" === n.mode || "bottom" === n.mode ? i.mode = n.mode : i.mode = "scroll", i.el = r, n.like && n.like.el && i.setLikeDom(n.like.el, n.like.style), i.status = "waiting";var c = void 0;if ((0, s.isNumber)(e.config.bulletOffset) && e.config.bulletOffset >= 0) c = e.config.bulletOffset;else {
11939
+ var f = e.containerPos;c = f.width / 10 > 100 ? 100 : f.width / 10;
11940
+ }var h = n.realTime ? 0 : Math.floor(Math.random() * c);return i.updateOffset(h), i;
11941
+ }return function (e, t) {
11942
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11943
+ }(t, e), o(t, [{ key: "updateOffset", value: function value(e) {
11944
+ this.random = e, (0, s.styleUtil)(this.el, "left", this.danmu.containerPos.width + e + "px");
11945
+ } }, { key: "attach", value: function value() {
11946
+ var e = this.el;this.container.appendChild(e), this.elPos = e.getBoundingClientRect(), "b2t" === this.direction ? (this.width = this.elPos.height, this.height = this.elPos.width) : (this.width = this.elPos.width, this.height = this.elPos.height), this.moveV && (this.duration = (this.danmu.containerPos.width + this.random + this.width) / this.moveV * 1e3), this.danmu.config && (this.danmu.config.mouseControl && (this.mouseoverFunWrapper = this.mouseoverFun.bind(this), e.addEventListener("mouseover", this.mouseoverFunWrapper, !1)), this.danmu.config.mouseEnterControl && (this.mouseEnterFunWrapper = this.mouseoverFun.bind(this), e.addEventListener("mouseenter", this.mouseEnterFunWrapper, !1))), e.addEventListener("transitionend", this._onTransitionEnd, !1);
11947
+ } }, { key: "detach", value: function value() {
11948
+ var e = this.el;if (e) {
11949
+ var t = this.danmu.config;t && (t.mouseControl && e.removeEventListener("mouseover", this.mouseoverFunWrapper, !1), t.mouseEnterControl && e.removeEventListener("mouseenter", this.mouseEnterFunWrapper, !1)), e.removeEventListener("transitionend", this._onTransitionEnd, !1), e.parentNode && e.parentNode.removeChild(e), this.reuseDOM && this.domObj.unused(e), this.el = null;
11950
+ }this.elPos = void 0, this.danmu.off("changeDirection", this.onChangeDirection);
11951
+ } }, { key: "willChange", value: function value() {
11952
+ var e = this.danmu.main.willChanges.concat(this.willChanges).join();(0, s.styleUtil)(this.el, "willChange", e);
11953
+ } }, { key: "mouseoverFun", value: function value(e) {
11954
+ this.danmu && this.danmu.mouseControl && this.danmu.config.mouseControlPause || "waiting" === this.status || "end" === this.status || this.danmu && this.danmu.emit("bullet_hover", { bullet: this, event: e });
11955
+ } }, { key: "_onTransitionEnd", value: function value() {
11956
+ this.status = "end", this.remove();
11957
+ } }, { key: "topInit", value: function value() {
11958
+ this.logger && this.logger.info("topInit #" + (this.options.txt || "[DOM Element]") + "#"), "b2t" === this.direction ? ((0, s.styleUtil)(this.el, "transformOrigin", "left top"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + this.danmu.containerPos.height + "px) translateZ(0px) rotate(90deg)"), (0, s.styleUtil)(this.el, "transition", "transform 0s linear 0s")) : (0, s.styleUtil)(this.el, "top", this.top + "px");
11959
+ } }, { key: "pauseMove", value: function value() {
11960
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],
11961
+ t = this;if ("paused" !== t.status && ("forcedPause" !== t.status && (this.status = "paused"), t._moveV = void 0, this.el)) if (this.willChange(), "scroll" === this.mode) {
11962
+ var n = t.danmu.containerPos;if (e) {
11963
+ var i = (new Date().getTime() - t.moveTime) / 1e3,
11964
+ o = i * this.moveV,
11965
+ r = 0;r = t.moveMoreS - o >= 0 ? "b2t" === this.direction ? (t.moveMoreS - o) / t.moveContainerHeight * n.height : (t.moveMoreS - o) / t.moveContainerWidth * n.width : t.moveMoreS - o, "b2t" === this.direction ? (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + r + "px) translateZ(0px) rotate(90deg)") : (0, s.styleUtil)(this.el, "left", r + "px");
11966
+ } else "b2t" === this.direction ? (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + (this.el.getBoundingClientRect().top - n.top) + "px) translateZ(0px) rotate(90deg)") : (0, s.styleUtil)(this.el, "left", this.el.getBoundingClientRect().left - n.left + "px");"b2t" === this.direction || (0, s.styleUtil)(this.el, "transform", "translateX(0px) translateY(0px) translateZ(0px)"), (0, s.styleUtil)(this.el, "transition", "transform 0s linear 0s");
11967
+ } else this.pastDuration && this.startTime ? this.pastDuration = this.pastDuration + new Date().getTime() - this.startTime : this.pastDuration = 1;
11968
+ } }, { key: "startMove", value: function value(e) {
11969
+ if (this.hasMove || (this.danmu.emit("bullet_start", this), this.hasMove = !0), ("forcedPause" !== this.status || e) && this.el && "start" !== this.status) if (this.status = "start", this.willChanges = ["transform", "transition"], this.willChange(), (0, s.styleUtil)(this.el, "backface-visibility", "hidden"), (0, s.styleUtil)(this.el, "perspective", "500em"), "scroll" === this.mode) {
11970
+ var t = this.danmu.containerPos;if ("b2t" === this.direction) {
11971
+ var n = (this.el.getBoundingClientRect().bottom - t.top) / this.moveV;(0, s.styleUtil)(this.el, "transition", "transform " + n + "s linear 0s"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + this.top + "px) translateY(-" + this.height + "px) translateZ(0px) rotate(90deg)"), this.moveTime = new Date().getTime(), this.moveMoreS = this.el.getBoundingClientRect().top - t.top, this.moveContainerHeight = t.height;
11972
+ } else {
11973
+ if (!this.el) return;var i = this.el.getBoundingClientRect(),
11974
+ o = i.right - t.left,
11975
+ r = o / this.moveV;i.right > t.left ? ((0, s.styleUtil)(this.el, "transition", "transform " + r + "s linear 0s"), (0, s.styleUtil)(this.el, "transform", "translateX(-" + o + "px) translateY(0px) translateZ(0px)"), this.moveTime = new Date().getTime(), this.moveMoreS = i.left - t.left, this.moveContainerWidth = t.width) : (this.status = "end", this.remove());
11976
+ }
11977
+ } else (0, s.styleUtil)(this.el, "left", "50%"), (0, s.styleUtil)(this.el, "margin", "0 0 0 -" + this.width / 2 + "px"), this.pastDuration || (this.pastDuration = 1), this.startTime = new Date().getTime();
11978
+ } }, { key: "remove", value: function value() {
11979
+ this.logger && this.logger.info("remove #" + (this.options.txt || "[DOM Element]") + "#");this.pauseMove(), this.el && this.el.parentNode && (this.willChanges = [], this.willChange(), this.detach(), this.options.el && 1 === this.options.el.nodeType && this.danmu.config.disableCopyDOM && (0, s.styleUtil)(this.options.el, "transform", "none"), this.danmu.emit("bullet_remove", { bullet: this }));
11980
+ } }, { key: "setFontSize", value: function value(e) {
11981
+ this.el && (this.el.style.fontSize = e);
11982
+ } }, { key: "setLikeDom", value: function value(e, t) {
11983
+ if (e) {
11984
+ Object.keys(t).forEach(function (n) {
11985
+ e.style[n] = t[n];
11986
+ });if (e.className = "danmu-like", this.el) {
11987
+ var n = this.el.querySelector(".danmu-like");n && this.el.removeChild(n), this.el.innerHTML = "" + this.el.innerHTML + e.outerHTML;
11988
+ }
11989
+ }return e;
11990
+ } }, { key: "moveV", get: function get() {
11991
+ var e = this._moveV;if (!e) {
11992
+ if (this.options.moveV) e = this.options.moveV;else if (this.elPos) {
11993
+ var t = this.danmu.containerPos;e = ("b2t" === this.direction ? t.height + this.height : t.width + this.width) / this.duration * 1e3;
11994
+ }e && (e *= this.danmu.main.playRate, this._moveV = e);
11995
+ }return e;
11996
+ } }]), t;
11997
+ }(a.default);t.default = u;
11998
+ }, function (e, t, n) {
11999
+ "use strict";
12000
+ Object.defineProperty(t, "__esModule", { value: !0 });var i,
12001
+ o = function () {
12002
+ function e(e, t) {
12003
+ for (var n = 0; n < t.length; n++) {
12004
+ var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
12005
+ }
12006
+ }return function (t, n, i) {
12007
+ return n && e(t.prototype, n), i && e(t, i), t;
12008
+ };
12009
+ }(),
12010
+ r = n(1),
12011
+ a = (i = r) && i.__esModule ? i : { default: i },
12012
+ s = n(0),
12013
+ l = n(31);var u = function (e) {
11843
12014
  function t(e) {
11844
12015
  !function (e, t) {
11845
12016
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
11846
12017
  }(this, t);var n = function (e, t) {
11847
12018
  if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
11848
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));n.setLogger("channel"), n.danmu = e, n.reset(!0);var i = n;return r.default.on(n.danmu, "bullet_remove", function (e) {
12019
+ }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this)),
12020
+ i = n;return i.setLogger("channel"), i.danmu = e, i.reset(!0), i.direction = e.direction, i.channels = [], i.updatePos(), (0, s.attachEventListener)(n.danmu, "bullet_remove", function (e) {
11849
12021
  i.removeBullet(e.bullet);
11850
- }, "destroy"), n.direction = e.direction, r.default.on(n.danmu, "changeDirection", function (e) {
12022
+ }, "destroy"), (0, s.attachEventListener)(n.danmu, "changeDirection", function (e) {
11851
12023
  i.direction = e;
11852
- }, "destroy"), n.containerPos = n.danmu.container.getBoundingClientRect(), n.containerWidth = n.containerPos.width, n.containerHeight = n.containerPos.height, n.containerLeft = n.containerPos.left, n.containerRight = n.containerPos.right, r.default.on(n.danmu, "channel_resize", function () {
11853
- i.containerPos = i.danmu.container.getBoundingClientRect(), i.resizing || (i.containerWidth = i.containerPos.width, i.containerHeight = i.containerPos.height, i.containerLeft = i.containerPos.left, i.containerRight = i.containerPos.right, i.resize(!0));
12024
+ }, "destroy"), (0, s.attachEventListener)(n.danmu, "channel_resize", function () {
12025
+ i.resize();
11854
12026
  }, "destroy"), n;
11855
12027
  }return function (e, t) {
11856
12028
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
11857
- }(t, e), i(t, [{ key: "destroy", value: function value() {
11858
- for (var e in this.logger && this.logger.info("destroy"), clearTimeout(this.resizeTimer), this.channels = [], this) {
11859
- delete this[e];
12029
+ }(t, e), o(t, [{ key: "updatePos", value: function value() {
12030
+ var e = this.container.getBoundingClientRect();this.containerPos = e, this.containerWidth = e.width, this.containerHeight = e.height, this.containerTop = e.top, this.containerBottom = e.bottom, this.containerLeft = e.left, this.containerRight = e.right;
12031
+ } }, { key: "destroy", value: function value() {
12032
+ for (var e in this.logger && this.logger.info("destroy"), this.channels.splice(0, this.channels.length), this._cancelResizeTimer(), this) {
12033
+ s.hasOwnProperty.call(this, e) && delete this[e];
11860
12034
  }
11861
- } }, { key: "resize", value: function value() {
11862
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("resize");var t = this.danmu.container,
11863
- n = this;n.resizing || (n.resizing = !0, this.resizeTimer = setTimeout(function () {
11864
- n.danmu.bulletBtn.main.data && n.danmu.bulletBtn.main.data.forEach(function (e) {
11865
- e.bookChannelId && (delete e.bookChannelId, n.logger && n.logger.info("resize导致" + e.id + "号优先弹幕预定取消"));
11866
- }), n.logger && n.logger.info("resize导致所有轨道恢复正常使用");var i = t.getBoundingClientRect();n.width = i.width, n.height = i.height, n.danmu.config.area && n.danmu.config.area.start >= 0 && n.danmu.config.area.end >= n.danmu.config.area.start && ("b2t" === n.direction ? n.width = n.width * (n.danmu.config.area.end - n.danmu.config.area.start) : n.height = n.height * (n.danmu.config.area.end - n.danmu.config.area.start)), n.container = t;var o = n.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
11867
- r = void 0;r = "b2t" === n.direction ? Math.floor(n.width / o) : Math.floor(n.height / o);for (var a = [], s = 0; s < r; s++) {
11868
- a[s] = { id: s, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
11869
- }if (n.channels && n.channels.length <= a.length) {
11870
- for (var l = function l(t) {
11871
- a[t] = { id: t, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (i) {
11872
- n.channels[t].queue[i].forEach(function (o) {
11873
- o.el && (a[t].queue[i].push(o), o.resized || (o.pauseMove(n.containerPos, e), "paused" !== o.danmu.bulletBtn.main.status && o.startMove(n.containerPos), o.resized = !0));
11874
- });
11875
- }), n.channels[t].queue.bottom.forEach(function (i) {
11876
- if (i.el) {
11877
- if (a[t + a.length - n.channels.length].queue.bottom.push(i), i.channel_id[0] + i.channel_id[1] - 1 === t) {
11878
- var r = [].concat(i.channel_id);i.channel_id = [r[0] - n.channels.length + a.length, r[1]], i.top = i.channel_id[0] * o, n.danmu.config.area && n.danmu.config.area.start && (i.top += n.containerHeight * n.danmu.config.area.start), i.topInit();
11879
- }i.resized || (i.pauseMove(n.containerPos, e), "paused" !== i.danmu.bulletBtn.main.status && i.startMove(n.containerPos), i.resized = !0);
11880
- }
11881
- });
11882
- }, u = 0; u < n.channels.length; u++) {
11883
- l(u);
11884
- }for (var c = function c(e) {
11885
- ["scroll", "top", "bottom"].forEach(function (t) {
11886
- a[e].queue[t].forEach(function (e) {
11887
- e.resized = !1;
11888
- });
11889
- });
11890
- }, f = 0; f < a.length; f++) {
11891
- c(f);
11892
- }n.channels = a, "b2t" === n.direction ? n.channelWidth = o : n.channelHeight = o;
11893
- } else if (n.channels && n.channels.length > a.length) {
11894
- for (var h = function h(t) {
11895
- a[t] = { id: t, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (i) {
11896
- if ("top" === i && t > Math.floor(a.length / 2)) ;else if ("bottom" === i && t <= Math.floor(a.length / 2)) ;else {
11897
- var r = "bottom" === i ? t - a.length + n.channels.length : t;n.channels[r].queue[i].forEach(function (s, l) {
11898
- if (s.el) {
11899
- if (a[t].queue[i].push(s), "bottom" === i && s.channel_id[0] + s.channel_id[1] - 1 === r) {
11900
- var u = [].concat(s.channel_id);s.channel_id = [u[0] - n.channels.length + a.length, u[1]], s.top = s.channel_id[0] * o, n.danmu.config.area && n.danmu.config.area.start && (s.top += n.containerHeight * n.danmu.config.area.start), s.topInit();
11901
- }s.pauseMove(n.containerPos, e), "paused" !== s.danmu.bulletBtn.main.status && s.startMove(n.containerPos), s.resized || (s.resized = !0);
11902
- }n.channels[r].queue[i].splice(l, 1);
11903
- });
11904
- }
11905
- });
11906
- }, d = 0; d < a.length; d++) {
11907
- h(d);
11908
- }for (var g = function g(e) {
11909
- ["scroll", "top", "bottom"].forEach(function (t) {
11910
- a[e].queue[t].forEach(function (e) {
11911
- e.resized = !1;
11912
- });
11913
- });
11914
- }, p = 0; p < a.length; p++) {
11915
- g(p);
11916
- }n.channels = a, "b2t" === n.direction ? n.channelWidth = o : n.channelHeight = o;
11917
- }n.resizing = !1;
11918
- }, 10));
11919
12035
  } }, { key: "addBullet", value: function value(e) {
11920
12036
  var t = this,
11921
12037
  n = this.danmu,
@@ -11925,36 +12041,38 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11925
12041
  a = void 0;if ("b2t" === t.direction ? (r = this.channelWidth, a = Math.ceil(e.width / r)) : (o = this.channelHeight, a = Math.ceil(e.height / o)), a > i.length) return { result: !1, message: "exceed channels.length, occupy=" + a + ",channelsSize=" + i.length };for (var s = !0, l = void 0, u = -1, c = 0, f = i.length; c < f; c++) {
11926
12042
  if (i[c].queue[e.mode].some(function (t) {
11927
12043
  return t.id === e.id;
11928
- })) return { result: !1, message: "exsited, channelOrder=" + c + ",danmu_id=" + e.id };
12044
+ })) return { result: !1, message: "exited, channelOrder=" + c + ",danmu_id=" + e.id };
11929
12045
  }if ("scroll" === e.mode) for (var h = 0, d = i.length - a; h <= d; h++) {
11930
- s = !0;for (var g = h; g < h + a; g++) {
11931
- if ((l = i[g]).operating.scroll) {
12046
+ s = !0;for (var p = h; p < h + a; p++) {
12047
+ if ((l = i[p]).operating.scroll) {
11932
12048
  s = !1;break;
11933
12049
  }if (l.bookId.scroll && l.bookId.scroll !== e.id) {
11934
12050
  s = !1;break;
11935
- }l.operating.scroll = !0;var p = l.queue.scroll[0];if (p) {
11936
- var m = p.el.getBoundingClientRect();if ("b2t" === t.direction) {
11937
- if (m.bottom > t.containerPos.bottom) {
12051
+ }l.operating.scroll = !0;var g = l.queue.scroll[0];if (g) {
12052
+ var m = g.el.getBoundingClientRect();if ("b2t" === t.direction) {
12053
+ if (m.bottom >= t.containerPos.bottom) {
11938
12054
  s = !1, l.operating.scroll = !1;break;
11939
12055
  }
11940
- } else if (m.right > t.containerPos.right) {
12056
+ } else if (m.right >= t.containerPos.right) {
11941
12057
  s = !1, l.operating.scroll = !1;break;
11942
- }var v,
12058
+ }var v = void 0,
12059
+ y = g.moveV,
11943
12060
  b = void 0,
11944
- y = void 0,
11945
- w = void 0,
11946
- _ = void 0;if ("b2t" === t.direction ? (y = (m.top - t.containerPos.top + m.height) / (b = (t.containerPos.height + m.height) / p.duration), w = t.containerPos.height, _ = (t.containerPos.height + e.height) / e.duration) : (y = (m.left - t.containerPos.left + m.width) / (b = (t.containerPos.width + m.width) / p.duration), w = t.containerPos.width, _ = (t.containerPos.width + e.width) / e.duration), v = w / _, n.config.bOffset || (n.config.bOffset = 0), b < _ && y + n.config.bOffset > v) {
11947
- s = !1, l.operating.scroll = !1;break;
12061
+ _ = e.moveV,
12062
+ w = void 0;if ("b2t" === t.direction ? (b = (v = m.bottom - t.containerTop) / y, w = t.containerHeight + e.random - v) : (b = (v = m.right - t.containerLeft) / y, w = t.containerWidth + e.random - v), _ > y) {
12063
+ var O = w / (_ - y);if (n.config.bOffset || (n.config.bOffset = 0), b + n.config.bOffset >= O) {
12064
+ var k = b * _ - t.containerPos.width;k > 0 && e.updateOffset(k + (1 + Math.ceil(5 * Math.random())));
12065
+ }
11948
12066
  }
11949
12067
  }l.operating.scroll = !1;
11950
12068
  }if (s) {
11951
12069
  u = h;break;
11952
12070
  }
11953
- } else if ("top" === e.mode) for (var O = 0, k = i.length - a; O <= k; O++) {
11954
- s = !0;for (var x = O; x < O + a; x++) {
11955
- if (x > Math.floor(i.length / 2)) {
12071
+ } else if ("top" === e.mode) for (var x = 0, C = i.length - a; x <= C; x++) {
12072
+ s = !0;for (var j = x; j < x + a; j++) {
12073
+ if (j > Math.floor(i.length / 2)) {
11956
12074
  s = !1;break;
11957
- }if ((l = i[x]).operating[e.mode]) {
12075
+ }if ((l = i[j]).operating[e.mode]) {
11958
12076
  s = !1;break;
11959
12077
  }if ((l.bookId[e.mode] || e.prior) && l.bookId[e.mode] !== e.id) {
11960
12078
  s = !1;break;
@@ -11962,13 +12080,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11962
12080
  s = !1, l.operating[e.mode] = !1;break;
11963
12081
  }l.operating[e.mode] = !1;
11964
12082
  }if (s) {
11965
- u = O;break;
12083
+ u = x;break;
11966
12084
  }
11967
- } else if ("bottom" === e.mode) for (var M = i.length - a; M >= 0; M--) {
11968
- s = !0;for (var C = M; C < M + a; C++) {
11969
- if (C <= Math.floor(i.length / 2)) {
12085
+ } else if ("bottom" === e.mode) for (var E = i.length - a; E >= 0; E--) {
12086
+ s = !0;for (var M = E; M < E + a; M++) {
12087
+ if (M <= Math.floor(i.length / 2)) {
11970
12088
  s = !1;break;
11971
- }if ((l = i[C]).operating[e.mode]) {
12089
+ }if ((l = i[M]).operating[e.mode]) {
11972
12090
  s = !1;break;
11973
12091
  }if ((l.bookId[e.mode] || e.prior) && l.bookId[e.mode] !== e.id) {
11974
12092
  s = !1;break;
@@ -11976,40 +12094,40 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
11976
12094
  s = !1, l.operating[e.mode] = !1;break;
11977
12095
  }l.operating[e.mode] = !1;
11978
12096
  }if (s) {
11979
- u = M;break;
12097
+ u = E;break;
11980
12098
  }
11981
12099
  }if (-1 !== u) {
11982
- for (var E = u, j = u + a; E < j; E++) {
11983
- (l = i[E]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && (delete l.bookId[e.mode], t.logger && t.logger.info(E + "号轨道恢复正常使用")), l.operating[e.mode] = !1;
12100
+ for (var L = u, T = u + a; L < T; L++) {
12101
+ (l = i[L]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && (delete l.bookId[e.mode], t.logger && t.logger.info(L + "号轨道恢复正常使用")), l.operating[e.mode] = !1;
11984
12102
  }if (e.prior) if (t.logger && t.logger.info(e.id + "号优先弹幕运行完毕"), delete e.bookChannelId, n.player) n.bulletBtn.main.data.some(function (t) {
11985
12103
  return t.id === e.id && (delete t.bookChannelId, !0);
11986
12104
  });return e.channel_id = [u, a], "b2t" === t.direction ? (e.top = u * r, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerWidth * t.danmu.config.area.start)) : (e.top = u * o, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start)), { result: e, message: "success" };
11987
12105
  }if (e.options.realTime) {
11988
- var B = 0,
11989
- T = -1,
11990
- P = null;if (t.danmu.bulletBtn.main.queue.forEach(function (e, n) {
11991
- !e.prior && !e.options.realTime && e.el && e.el.getBoundingClientRect().left > t.containerPos.right && e.start >= B && (B = e.start, T = n, P = e);
11992
- }), P) {
11993
- P.remove(), t.removeBullet(P), t.danmu.bulletBtn.main.queue.splice(T, 1), e.channel_id = P.channel_id;for (var z = P.channel_id[0], S = P.channel_id[0] + P.channel_id[1]; z < S; z++) {
11994
- (l = i[z]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && delete l.bookId[e.mode], l.operating[e.mode] = !1;
11995
- }return e.top = P.top, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start), { result: e, message: "success" };
12106
+ var P = 0,
12107
+ z = -1,
12108
+ S = null;if (t.danmu.bulletBtn.main.queue.forEach(function (e, n) {
12109
+ !e.prior && !e.options.realTime && e.el && e.el.getBoundingClientRect().left > t.containerPos.right && e.start >= P && (P = e.start, z = n, S = e);
12110
+ }), S) {
12111
+ S.remove(), t.removeBullet(S), t.danmu.bulletBtn.main.queue.splice(z, 1), e.channel_id = S.channel_id;for (var D = S.channel_id[0], I = S.channel_id[0] + S.channel_id[1]; D < I; D++) {
12112
+ (l = i[D]).operating[e.mode] = !0, l.queue[e.mode].unshift(e), e.prior && delete l.bookId[e.mode], l.operating[e.mode] = !1;
12113
+ }return e.top = S.top, t.danmu.config.area && t.danmu.config.area.start && (e.top += t.containerHeight * t.danmu.config.area.start), { result: e, message: "success" };
11996
12114
  }
11997
12115
  }if (e.prior) if (e.bookChannelId || t.danmu.live) {
11998
12116
  if (n.player) n.bulletBtn.main.data.some(function (n) {
11999
12117
  return n.id === e.id && (t.logger && t.logger.info(e.id + "号优先弹幕将于2秒后再次请求注册"), n.start += 2e3, !0);
12000
12118
  });
12001
12119
  } else {
12002
- u = -1;for (var L = 0, D = i.length - a; L <= D; L++) {
12003
- s = !0;for (var q = L; q < L + a; q++) {
12004
- if (i[q].bookId[e.mode]) {
12120
+ u = -1;for (var q = 0, R = i.length - a; q <= R; q++) {
12121
+ s = !0;for (var A = q; A < q + a; A++) {
12122
+ if (i[A].bookId[e.mode]) {
12005
12123
  s = !1;break;
12006
12124
  }
12007
12125
  }if (s) {
12008
- u = L;break;
12126
+ u = q;break;
12009
12127
  }
12010
12128
  }if (-1 !== u) {
12011
- for (var R = u; R < u + a; R++) {
12012
- i[R].bookId[e.mode] = e.id, t.logger && t.logger.info(R + "号轨道被" + e.id + "号优先弹幕预定");
12129
+ for (var U = u; U < u + a; U++) {
12130
+ i[U].bookId[e.mode] = e.id, t.logger && t.logger.info(U + "号轨道被" + e.id + "号优先弹幕预定");
12013
12131
  }if (n.player) n.bulletBtn.main.data.some(function (n) {
12014
12132
  return n.id === e.id && (t.logger && t.logger.info(e.id + "号优先弹幕将于2秒后再次请求注册"), n.start += 2e3, n.bookChannelId = [u, a], t.logger && t.logger.info(e.id + "号优先弹幕预定了" + u + "~" + (u + a - 1) + "号轨道"), !0);
12015
12133
  });
@@ -12023,187 +12141,107 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12023
12141
  }), a > -1 && i.queue[e.mode].splice(a, 1), i.operating[e.mode] = !1;
12024
12142
  }
12025
12143
  }e.options.loop && this.danmu.bulletBtn.main.playedData.push(e.options);
12026
- } }, { key: "resetArea", value: function value() {
12027
- this.logger && this.logger.info("resetArea");var e = this.danmu.container,
12028
- t = this,
12029
- n = e.getBoundingClientRect();t.width = n.width, t.height = n.height, t.danmu.config.area && t.danmu.config.area.start >= 0 && t.danmu.config.area.end >= t.danmu.config.area.start && ("b2t" === t.direction ? t.width = t.width * (t.danmu.config.area.end - t.danmu.config.area.start) : t.height = t.height * (t.danmu.config.area.end - t.danmu.config.area.start)), t.container = e;var i = t.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12030
- o = void 0;o = "b2t" === t.direction ? Math.floor(t.width / i) : Math.floor(t.height / i);for (var r = [], a = 0; a < o; a++) {
12031
- r[a] = { id: a, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12032
- }if (t.channels && t.channels.length <= r.length) {
12033
- for (var s = function s(e) {
12034
- r[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (n) {
12035
- t.channels[e].queue[n].forEach(function (i) {
12036
- i.el && (r[e].queue[n].push(i), i.resized || (i.pauseMove(t.containerPos, !1), i.startMove(t.containerPos), i.resized = !0));
12144
+ } }, { key: "resizeSync", value: function value() {
12145
+ this.resize(!0);
12146
+ } }, { key: "resize", value: function value() {
12147
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("resize");var t = this;function n() {
12148
+ var e = t.danmu,
12149
+ n = e.container,
12150
+ i = e.config,
12151
+ o = e.bulletBtn,
12152
+ r = void 0;if (t.updatePos(), t._cancelResizeTimer(), o.main.data && o.main.data.forEach(function (e) {
12153
+ e.bookChannelId && (delete e.bookChannelId, t.logger && t.logger.info("resize导致" + e.id + "号优先弹幕预定取消"));
12154
+ }), t.logger && t.logger.info("resize导致所有轨道恢复正常使用"), t.width = t.containerWidth, t.height = t.containerHeight, i.area) {
12155
+ var a = i.area,
12156
+ u = a.lines,
12157
+ c = a.start,
12158
+ f = a.end;(0, l.validAreaLineRule)(u) ? r = u : c >= 0 && f >= c && ("b2t" === t.direction ? t.width = t.width * (f - c) : t.height = t.height * (f - c));
12159
+ }t.container = n;var h = i.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12);(0, s.isNumber)(r) || (r = "b2t" === t.direction ? Math.floor(t.width / h) : Math.floor(t.height / h));for (var d = [], p = 0; p < r; p++) {
12160
+ d[p] = { id: p, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12161
+ }if (t.channels && t.channels.length <= d.length) {
12162
+ for (var g = function g(e) {
12163
+ d[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top"].forEach(function (n) {
12164
+ t.channels[e].queue[n].forEach(function (t) {
12165
+ t.el && d[e].queue[n].push(t);
12166
+ });
12167
+ }), t.channels[e].queue.bottom.forEach(function (n) {
12168
+ if (n.el && (d[e + d.length - t.channels.length].queue.bottom.push(n), n.channel_id[0] + n.channel_id[1] - 1 === e)) {
12169
+ var i = [].concat(n.channel_id);n.channel_id = [i[0] - t.channels.length + d.length, i[1]], n.top = n.channel_id[0] * h, t.danmu.config.area && t.danmu.config.area.start && (n.top += t.containerHeight * t.danmu.config.area.start), n.topInit();
12170
+ }
12037
12171
  });
12038
- }), t.channels[e].queue.bottom.forEach(function (n) {
12039
- if (n.el) {
12040
- if (r[e + r.length - t.channels.length].queue.bottom.push(n), n.channel_id[0] + n.channel_id[1] - 1 === e) {
12041
- var o = [].concat(n.channel_id);n.channel_id = [o[0] - t.channels.length + r.length, o[1]], n.top = n.channel_id[0] * i, t.danmu.config.area && t.danmu.config.area.start && (n.top += t.containerHeight * t.danmu.config.area.start), n.topInit();
12042
- }n.resized || (n.pauseMove(t.containerPos, !1), n.startMove(t.containerPos), n.resized = !0);
12043
- }
12044
- });
12045
- }, l = 0; l < t.channels.length; l++) {
12046
- s(l);
12047
- }for (var u = function u(e) {
12048
- ["scroll", "top", "bottom"].forEach(function (t) {
12049
- r[e].queue[t].forEach(function (e) {
12050
- e.resized = !1;
12172
+ }, m = 0; m < t.channels.length; m++) {
12173
+ g(m);
12174
+ }for (var v = function v(e) {
12175
+ ["scroll", "top", "bottom"].forEach(function (t) {
12176
+ d[e].queue[t].forEach(function (e) {
12177
+ e.resized = !1;
12178
+ });
12051
12179
  });
12052
- });
12053
- }, c = 0; c < r.length; c++) {
12054
- u(c);
12055
- }t.channels = r, "b2t" === t.direction ? t.channelWidth = i : t.channelHeight = i;
12056
- } else if (t.channels && t.channels.length > r.length) {
12057
- for (var f = function f(e) {
12058
- r[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (n) {
12059
- if ("top" === n && e > Math.floor(r.length / 2)) ;else if ("bottom" === n && e <= Math.floor(r.length / 2)) ;else {
12060
- var o = "bottom" === n ? e - r.length + t.channels.length : e;t.channels[o].queue[n].forEach(function (a, s) {
12061
- if (a.el) {
12062
- if (r[e].queue[n].push(a), "bottom" === n && a.channel_id[0] + a.channel_id[1] - 1 === o) {
12063
- var l = [].concat(a.channel_id);a.channel_id = [l[0] - t.channels.length + r.length, l[1]], a.top = a.channel_id[0] * i, t.danmu.config.area && t.danmu.config.area.start && (a.top += t.containerHeight * t.danmu.config.area.start), a.topInit();
12064
- }a.resized || (a.pauseMove(t.containerPos, !1), a.startMove(t.containerPos), a.resized = !0);
12065
- }t.channels[o].queue[n].splice(s, 1);
12180
+ }, y = 0; y < d.length; y++) {
12181
+ v(y);
12182
+ }t.channels = d, "b2t" === t.direction ? t.channelWidth = h : t.channelHeight = h;
12183
+ } else if (t.channels && t.channels.length > d.length) {
12184
+ for (var b = function b(e) {
12185
+ d[e] = { id: e, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} }, ["scroll", "top", "bottom"].forEach(function (n) {
12186
+ if ("top" === n && e > Math.floor(d.length / 2)) ;else if ("bottom" === n && e <= Math.floor(d.length / 2)) ;else {
12187
+ var i = "bottom" === n ? e - d.length + t.channels.length : e;t.channels[i].queue[n].forEach(function (o, r) {
12188
+ if (o.el && (d[e].queue[n].push(o), "bottom" === n && o.channel_id[0] + o.channel_id[1] - 1 === i)) {
12189
+ var a = [].concat(o.channel_id);o.channel_id = [a[0] - t.channels.length + d.length, a[1]], o.top = o.channel_id[0] * h, t.danmu.config.area && t.danmu.config.area.start && (o.top += t.containerHeight * t.danmu.config.area.start), o.topInit();
12190
+ }t.channels[i].queue[n].splice(r, 1);
12191
+ });
12192
+ }
12193
+ });
12194
+ }, _ = 0; _ < d.length; _++) {
12195
+ b(_);
12196
+ }for (var w = function w(e) {
12197
+ ["scroll", "top", "bottom"].forEach(function (t) {
12198
+ d[e].queue[t].forEach(function (e) {
12199
+ e.resized = !1;
12066
12200
  });
12067
- }
12068
- });
12069
- }, h = 0; h < r.length; h++) {
12070
- f(h);
12071
- }for (var d = function d(e) {
12072
- ["scroll", "top", "bottom"].forEach(function (t) {
12073
- r[e].queue[t].forEach(function (e) {
12074
- e.resized = !1;
12075
12201
  });
12076
- });
12077
- }, g = 0; g < r.length; g++) {
12078
- d(g);
12079
- }t.channels = r, "b2t" === t.direction ? t.channelWidth = i : t.channelHeight = i;
12080
- }
12202
+ }, O = 0; O < d.length; O++) {
12203
+ w(O);
12204
+ }t.channels = d, "b2t" === t.direction ? t.channelWidth = h : t.channelHeight = h;
12205
+ }t.resizing = !1;
12206
+ }t.resizing || (t.resizing = !0, e ? n() : (this._cancelResizeTimer(), this.resizeId = requestAnimationFrame(n)));
12207
+ } }, { key: "_cancelResizeTimer", value: function value() {
12208
+ this.resizeId && (cancelAnimationFrame(this.resizeId), this.resizeId = null);
12081
12209
  } }, { key: "reset", value: function value() {
12082
- var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("reset");var t = this.danmu.container,
12083
- n = this;function i() {
12084
- var e = t.getBoundingClientRect();n.width = e.width, n.height = e.height, n.danmu.config.area && n.danmu.config.area.start >= 0 && n.danmu.config.area.end >= n.danmu.config.area.start && ("b2t" === n.direction ? n.width = n.width * (n.danmu.config.area.end - n.danmu.config.area.start) : n.height = n.height * (n.danmu.config.area.end - n.danmu.config.area.start)), n.container = t;var i = n.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12085
- o = void 0;o = "b2t" === n.direction ? Math.floor(n.width / i) : Math.floor(n.height / i);for (var r = [], a = 0; a < o; a++) {
12086
- r[a] = { id: a, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12087
- }n.channels = r, "b2t" === n.direction ? n.channelWidth = i : n.channelHeight = i;
12088
- }n.danmu.bulletBtn && n.danmu.bulletBtn.main && n.danmu.bulletBtn.main.queue.forEach(function (e) {
12089
- e.pauseMove(n.containerPos), e.remove();
12090
- }), n.channels && n.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12091
- for (var t = 0; t < n.channels.length; t++) {
12092
- n.channels[t].queue[e].forEach(function (e) {
12093
- e.pauseMove(n.containerPos), e.remove();
12094
- });
12095
- }
12096
- }), n.danmu.bulletBtn && n.danmu.bulletBtn.main && n.danmu.bulletBtn.main.data && n.danmu.bulletBtn.main.data.forEach(function (e) {
12097
- e.hasAttached = !1;
12098
- }), e ? this.resetTimer = setTimeout(i, 200) : i();
12099
- } }, { key: "resetWithCb", value: function value(e, t) {
12100
- this.logger && this.logger.info("resetWithCb");var n = this.danmu.container,
12101
- i = this;i.channels && i.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12102
- for (var t = 0; t < i.channels.length; t++) {
12103
- i.channels[t].queue[e].forEach(function (e) {
12104
- e.pauseMove(i.containerPos), e.remove();
12210
+ var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0];this.logger && this.logger.info("reset");var t = this,
12211
+ n = t.danmu,
12212
+ i = n.container,
12213
+ o = n.bulletBtn,
12214
+ r = n.config;function a() {
12215
+ var e = void 0,
12216
+ n = i.getBoundingClientRect();if (t.width = n.width, t.height = n.height, t.resetId && (cancelAnimationFrame(t.resetId), t.resetId = null), r.area) {
12217
+ var o = r.area,
12218
+ a = o.lines,
12219
+ u = o.start,
12220
+ c = o.end;(0, l.validAreaLineRule)(a) ? e = a : u >= 0 && c >= u && ("b2t" === t.direction ? t.width = t.width * (c - u) : t.height = t.height * (c - u));
12221
+ }var f = r.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12);(0, s.isNumber)(e) || (e = "b2t" === t.direction ? Math.floor(t.width / f) : Math.floor(t.height / f));for (var h = [], d = 0; d < e; d++) {
12222
+ h[d] = { id: d, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12223
+ }t.channels = h, "b2t" === t.direction ? t.channelWidth = f : t.channelHeight = f;
12224
+ }t.container = i, o && o.main && o.main.queue.forEach(function (e) {
12225
+ e.remove();
12226
+ }), t.channels && t.channels.length > 0 && ["scroll", "top", "bottom"].forEach(function (e) {
12227
+ for (var n = 0; n < t.channels.length; n++) {
12228
+ t.channels[n].queue[e].forEach(function (e) {
12229
+ e.remove();
12105
12230
  });
12106
12231
  }
12107
- });var o = n.getBoundingClientRect();i.width = o.width, i.height = o.height, i.danmu.config.area && i.danmu.config.area.start >= 0 && i.danmu.config.area.end >= i.danmu.config.area.start && ("b2t" === i.direction ? i.width = i.width * (i.danmu.config.area.end - i.danmu.config.area.start) : i.height = i.height * (i.danmu.config.area.end - i.danmu.config.area.start)), i.container = n;var r = i.danmu.config.channelSize || (/mobile/gi.test(navigator.userAgent) ? 10 : 12),
12108
- a = void 0;a = "b2t" === i.direction ? Math.floor(i.width / r) : Math.floor(i.height / r);for (var s = [], l = 0; l < a; l++) {
12109
- s[l] = { id: l, queue: { scroll: [], top: [], bottom: [] }, operating: { scroll: !1, top: !1, bottom: !1 }, bookId: {} };
12110
- }i.channels = s, i.channelHeight = r, e && e(!0, t);
12232
+ }), o && o.main && o.main.data && o.main.data.forEach(function (e) {
12233
+ e.attached_ = !1;
12234
+ }), e ? this.resetId = requestAnimationFrame(a) : a();
12111
12235
  } }]), t;
12112
- }(o.default);t.default = s, e.exports = t.default;
12236
+ }(a.default);t.default = u, e.exports = t.default;
12113
12237
  }, function (e, t, n) {
12114
12238
  "use strict";
12115
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12116
- function e(e, t) {
12117
- for (var n = 0; n < t.length; n++) {
12118
- var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
12119
- }
12120
- }return function (t, n, i) {
12121
- return n && e(t.prototype, n), i && e(t, i), t;
12122
- };
12123
- }(),
12124
- o = a(n(1)),
12125
- r = a(n(0));function a(e) {
12126
- return e && e.__esModule ? e : { default: e };
12127
- }var s = function (e) {
12128
- function t(e, n) {
12129
- !function (e, t) {
12130
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12131
- }(this, t);var i = function (e, t) {
12132
- if (!e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !t || "object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) && "function" != typeof t ? e : t;
12133
- }(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this));i.setLogger("bullet"), i.danmu = e, i.options = n, i.duration = n.duration, i.moveV = n.moveV, i.id = n.id, i.container = e.container, i.start = n.start, i.prior = n.prior, i.color = n.color, i.bookChannelId = n.bookChannelId, i.direction = e.direction;var o = i;i.onChangeDirection = function (e) {
12134
- o.direction = e;
12135
- }, i.danmu.on("changeDirection", i.onChangeDirection);var a = void 0;if (i.domObj = e.domObj, n.el && 1 === n.el.nodeType) {
12136
- a = i.domObj.use();var s = r.default.copyDom(n.el);n.eventListeners && n.eventListeners.length > 0 && n.eventListeners.forEach(function (e) {
12137
- s.addEventListener(e.event, e.listener, e.useCapture || !1);
12138
- }), a.appendChild(s);
12139
- } else (a = i.domObj.use()).textContent = n.txt;if (n.style) {
12140
- var l = n.style;Object.keys(l).forEach(function (e) {
12141
- r.default.style(a, e, l[e]);
12142
- });
12143
- }"top" === n.mode || "bottom" === n.mode ? i.mode = n.mode : i.mode = "scroll", i.el = a, n.like && n.like.el && i.setLikeDom(n.like.el, n.like.style), i.status = "waiting";var u = i.container.getBoundingClientRect(),
12144
- c = Math.floor(Math.random() * (u.width / 10 > 100 ? 200 : u.width / 10));n.realTime && (c = 0);var f = u.width + c + "px";return r.default.style(i.el, "left", f), i.containerPos = u, i;
12145
- }return function (e, t) {
12146
- if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function, not " + (typeof t === "undefined" ? "undefined" : _typeof(t)));e.prototype = Object.create(t && t.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
12147
- }(t, e), i(t, [{ key: "attach", value: function value() {
12148
- if (this.container.appendChild(this.el), this.elPos = this.el.getBoundingClientRect(), "b2t" === this.direction ? (this.width = this.elPos.height, this.height = this.elPos.width) : (this.width = this.elPos.width, this.height = this.elPos.height), this.moveV) {
12149
- var e = this.containerPos;this.duration = (e.width + this.width) / this.moveV * 1e3;
12150
- }this.danmu.config && this.danmu.config.mouseControl && (this.mouseoverFunWrapper = this.mouseoverFun.bind(this), this.el.addEventListener("mouseover", this.mouseoverFunWrapper, !1)), this.danmu.config && this.danmu.config.mouseEnterControl && (this.mouseEnterFunWrapper = this.mouseoverFun.bind(this), this.el.addEventListener("mouseenter", this.mouseEnterFunWrapper, !1));
12151
- } }, { key: "mouseoverFun", value: function value(e) {
12152
- this.danmu && this.danmu.mouseControl && this.danmu.config.mouseControlPause || "waiting" === this.status || "end" === this.status || this.danmu && this.danmu.emit("bullet_hover", { bullet: this, event: e });
12153
- } }, { key: "detach", value: function value() {
12154
- this.el && (this.danmu.config && this.danmu.config.mouseControl && this.el.removeEventListener("mouseover", this.mouseoverFunWrapper, !1), this.danmu.config && this.danmu.config.mouseEnterControl && this.el.removeEventListener("mouseenter", this.mouseEnterFunWrapper, !1), this.el.parentNode && this.el.parentNode.removeChild(this.el), this.domObj.unuse(this.el), this.el = null), this.danmu.off("changeDirection", this.onChangeDirection);
12155
- } }, { key: "topInit", value: function value() {
12156
- if (this.logger && this.logger.info("topInit #" + (this.options.txt || "[DOM Element]") + "#"), "b2t" === this.direction) {
12157
- var e = this.containerPos;r.default.style(this.el, "transformOrigin", "left top"), r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + e.height + "px) translateZ(0px) rotate(90deg)"), r.default.style(this.el, "transition", "transform 0s linear 0s");
12158
- } else r.default.style(this.el, "top", this.top + "px");
12159
- } }, { key: "pauseMove", value: function value(e) {
12160
- var t = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];this.logger && this.logger.info("pauseMove #" + (this.options.txt || "[DOM Element]") + "#");var n = this;if ("paused" !== this.status && ("forcedPause" !== n.status && (this.status = "paused"), clearTimeout(n.removeTimer), this.el)) if (r.default.style(this.el, "willChange", "auto"), "scroll" === this.mode) {
12161
- if (t) {
12162
- var i = (new Date().getTime() - n.moveTime) / 1e3,
12163
- o = i * this.moveV,
12164
- a = 0;a = n.moveMoreS - o >= 0 ? "b2t" === this.direction ? (n.moveMoreS - o) / n.moveContainerHeight * e.height : (n.moveMoreS - o) / n.moveContainerWidth * e.width : n.moveMoreS - o, "b2t" === this.direction ? r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + a + "px) translateZ(0px) rotate(90deg)") : r.default.style(this.el, "left", a + "px");
12165
- } else "b2t" === this.direction ? r.default.style(this.el, "transform", "translateX(-" + this.top + "px) translateY(" + (this.el.getBoundingClientRect().top - e.top) + "px) translateZ(0px) rotate(90deg)") : r.default.style(this.el, "left", this.el.getBoundingClientRect().left - e.left + "px");"b2t" === this.direction || r.default.style(this.el, "transform", "translateX(0px) translateY(0px) translateZ(0px)"), r.default.style(this.el, "transition", "transform 0s linear 0s");
12166
- } else this.pastDuration && this.startTime ? this.pastDuration = this.pastDuration + new Date().getTime() - this.startTime : this.pastDuration = 1;
12167
- } }, { key: "startMove", value: function value(e, t) {
12168
- this.logger && this.logger.info("startMove #" + (this.options.txt || "[DOM Element]") + "#");var n = this;if (n.hasMove || (n.danmu.emit("bullet_start", n), n.hasMove = !0), ("forcedPause" !== n.status || t) && this.el && "start" !== this.status) if (this.status = "start", r.default.style(this.el, "willChange", "transform"), "scroll" === this.mode) {
12169
- if ("b2t" === this.direction) {
12170
- this.moveV = (e.height + this.height) / this.duration * 1e3;var i = (n.el.getBoundingClientRect().bottom - e.top) / this.moveV;r.default.style(this.el, "transition", "transform " + i + "s linear 0s"), this.startMoveTimer = setTimeout(function () {
12171
- n.el && (r.default.style(n.el, "transform", "translateX(-" + n.top + "px) translateY(-" + n.height + "px) translateZ(0px) rotate(90deg)"), n.moveTime = new Date().getTime(), n.moveMoreS = n.el.getBoundingClientRect().top - e.top, n.moveContainerHeight = e.height, n.removeTimer = setTimeout(l, 1e3 * i));
12172
- }, 20);
12173
- } else {
12174
- var o = this.el.getBoundingClientRect();this.moveV = (e.width + this.width) / this.duration * 1e3;var a = (o.right - e.left) / this.moveV;r.default.style(this.el, "transition", "transform " + a + "s linear 0s"), this.startMoveTimer = setTimeout(function () {
12175
- if (n.el) {
12176
- var t = n.el.getBoundingClientRect(),
12177
- i = (t.right - e.left) / a;t.right > e.left && i > n.moveV - 1 && i < n.moveV + 1 ? (r.default.style(n.el, "transform", "translateX(-" + (t.right - e.left) + "px) translateY(0px) translateZ(0px)"), n.moveTime = new Date().getTime(), n.moveMoreS = t.left - e.left, n.moveContainerWidth = e.width, n.removeTimer = setTimeout(l, 1e3 * a)) : (n.status = "end", n.remove());
12178
- }
12179
- }, 0);
12180
- }
12181
- } else {
12182
- r.default.style(this.el, "left", "50%"), r.default.style(this.el, "margin", "0 0 0 -" + this.width / 2 + "px"), this.pastDuration || (this.pastDuration = 1);var s = this.duration >= this.pastDuration ? this.duration - this.pastDuration : 0;this.removeTimer = setTimeout(l, s), this.startTime = new Date().getTime();
12183
- }function l() {
12184
- if (n.el) if ("scroll" === n.mode) {
12185
- var e = n.containerPos,
12186
- t = n.el.getBoundingClientRect();"b2t" === n.direction ? t && t.bottom <= e.top + 100 ? (n.status = "end", n.remove()) : (n.pauseMove(e), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(e)) : t && t.right <= e.left + 100 ? (n.status = "end", n.remove()) : (n.pauseMove(e), "paused" !== n.danmu.bulletBtn.main.status && n.startMove(e));
12187
- } else n.status = "end", n.remove();
12188
- }
12189
- } }, { key: "remove", value: function value() {
12190
- this.logger && this.logger.info("remove #" + (this.options.txt || "[DOM Element]") + "#");this.removeTimer && clearTimeout(this.removeTimer), this.startMoveTimer && clearTimeout(this.startMoveTimer), this.el && this.el.parentNode && (r.default.style(this.el, "willChange", "auto"), this.detach(), this.danmu.emit("bullet_remove", { bullet: this }));
12191
- } }, { key: "setFontSize", value: function value(e) {
12192
- this.el && (this.el.style.fontSize = e);
12193
- } }, { key: "setLikeDom", value: function value(e, t) {
12194
- if (e) {
12195
- Object.keys(t).forEach(function (n) {
12196
- e.style[n] = t[n];
12197
- });if (e.className = "danmu-like", this.el) {
12198
- var n = this.el.querySelector(".danmu-like");n && this.el.removeChild(n), this.el.innerHTML = "" + this.el.innerHTML + e.outerHTML;
12199
- }
12200
- }return e;
12201
- } }]), t;
12202
- }(o.default);t.default = s, e.exports = t.default;
12239
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.validAreaLineRule = function (e) {
12240
+ return "number" == typeof e && e >= 0 && Number.isInteger(e);
12241
+ };
12203
12242
  }, function (e, t, n) {
12204
12243
  "use strict";
12205
- Object.defineProperty(t, "__esModule", { value: !0 });var i,
12206
- o = function () {
12244
+ Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12207
12245
  function e(e, t) {
12208
12246
  for (var n = 0; n < t.length; n++) {
12209
12247
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -12212,19 +12250,18 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12212
12250
  return n && e(t.prototype, n), i && e(t, i), t;
12213
12251
  };
12214
12252
  }(),
12215
- r = n(0),
12216
- a = (i = r) && i.__esModule ? i : { default: i };var s = function () {
12253
+ o = n(0);var r = function () {
12217
12254
  function e(t) {
12218
12255
  !function (e, t) {
12219
12256
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12220
12257
  }(this, e), t = { initDOM: function initDOM() {
12221
12258
  return document.createElement("div");
12222
12259
  }, initSize: 10 }, this.init(t);
12223
- }return o(e, [{ key: "init", value: function value(e) {
12260
+ }return i(e, [{ key: "init", value: function value(e) {
12224
12261
  this.idleList = [], this.usingList = [], this._id = 0, this.options = e, this._expand(e.initSize);
12225
12262
  } }, { key: "use", value: function value() {
12226
12263
  this.idleList.length || this._expand(1);var e = this.idleList.shift();return this.usingList.push(e), e;
12227
- } }, { key: "unuse", value: function value(e) {
12264
+ } }, { key: "unused", value: function value(e) {
12228
12265
  var t = this.usingList.indexOf(e);t < 0 || (this.usingList.splice(t, 1), e.innerHTML = "", e.textcontent = "", this.clearElementStyle(e), this.idleList.push(e));
12229
12266
  } }, { key: "_expand", value: function value(e) {
12230
12267
  for (var t = 0; t < e; t++) {
@@ -12236,17 +12273,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12236
12273
  }for (var t = 0; t < this.usingList.length; t++) {
12237
12274
  this.usingList[t].innerHTML = "", this.usingList[t].textcontent = "", this.clearElementStyle(this.usingList[t]);
12238
12275
  }for (var n in this) {
12239
- delete this[n];
12276
+ o.hasOwnProperty.call(this, n) && delete this[n];
12240
12277
  }
12241
12278
  } }, { key: "clearElementStyle", value: function value(e) {
12242
- var t = "undefined" != typeof window ? window.navigator.userAgent : null;t && (t.indexOf("MSIE ") > -1 || t.indexOf("Trident/") > -1 ? a.default.style(e, "transform", "none") : e.setAttribute("style", ""));
12279
+ var t = "undefined" != typeof window ? window.navigator.userAgent : null;t && (t.indexOf("MSIE ") > -1 || t.indexOf("Trident/") > -1 ? (0, o.styleUtil)(e, "transform", "none") : e.setAttribute("style", ""));
12243
12280
  } }]), e;
12244
- }();t.default = s, e.exports = t.default;
12245
- }, function (e) {
12246
- e.exports = JSON.parse('{"version":"0.5.10"}');
12281
+ }();t.default = r, e.exports = t.default;
12247
12282
  }, function (e, t, n) {
12248
12283
  "use strict";
12249
- Object.defineProperty(t, "__esModule", { value: !0 });var i = function () {
12284
+ Object.defineProperty(t, "__esModule", { value: !0 }), t.destroyObserver = t.unObserver = t.addObserver = void 0;var i = function () {
12250
12285
  function e(e, t) {
12251
12286
  for (var n = 0; n < t.length; n++) {
12252
12287
  var i = t[n];i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
@@ -12254,14 +12289,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12254
12289
  }return function (t, n, i) {
12255
12290
  return n && e(t.prototype, n), i && e(t, i), t;
12256
12291
  };
12257
- }();var o = new (function () {
12292
+ }(),
12293
+ o = n(0);var r = new (function () {
12258
12294
  function e() {
12259
12295
  var t = this;if (function (e, t) {
12260
12296
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
12261
12297
  }(this, e), this.__handlers = [], window.ResizeObserver) try {
12262
- this.observer = new window.ResizeObserver(function (e) {
12263
- var n = new Date().getTime();n - t.timeStampe < 200 || (t.timeStampe = n, t.__trigger(e));
12264
- }), this.timeStampe = new Date().getTime();
12298
+ this.observer = new window.ResizeObserver((0, o.throttle)(function (e) {
12299
+ t.__trigger(e);
12300
+ }, 100));
12265
12301
  } catch (e) {}
12266
12302
  }return i(e, [{ key: "addObserver", value: function value(e, t) {
12267
12303
  if (this.observer) {
@@ -12293,16 +12329,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12293
12329
  });
12294
12330
  } }]), e;
12295
12331
  }())();t.addObserver = function (e, t) {
12296
- o.addObserver(e, t);
12332
+ r.addObserver(e, t);
12297
12333
  }, t.unObserver = function (e, t) {
12298
- o.unObserver(e, t);
12334
+ r.unObserver(e, t);
12299
12335
  }, t.destroyObserver = function (e, t) {
12300
- o.destroyObserver(e, t);
12336
+ r.destroyObserver(e, t);
12301
12337
  };
12302
12338
  }, function (e, t, n) {
12303
12339
  var i = n(35);"string" == typeof i && (i = [[e.i, i, ""]]);var o = { hmr: !0, transform: void 0, insertInto: void 0 };n(37)(i, o);i.locals && (e.exports = i.locals);
12304
12340
  }, function (e, t, n) {
12305
- (e.exports = n(36)(!1)).push([e.i, ".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#ffffff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}\n", ""]);
12341
+ (e.exports = n(36)(!1)).push([e.i, ".danmu{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;user-select:none;-ms-user-select:none}.danmu>*{position:absolute;white-space:nowrap}.danmu-switch{width:32px;height:20px;border-radius:100px;background-color:#ccc;-webkit-box-sizing:border-box;box-sizing:border-box;outline:none;cursor:pointer;position:relative;text-align:center;margin:10px auto}.danmu-switch.danmu-switch-active{padding-left:12px;background-color:#f85959}.danmu-switch span.txt{width:20px;height:20px;line-height:20px;text-align:center;display:block;border-radius:100px;background-color:#fff;-webkit-box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);box-shadow:-2px 0 0 0 rgba(0, 0, 0, .04);font-family:PingFangSC;font-size:10px;font-weight:500;color:#f44336}", ""]);
12306
12342
  }, function (e, t) {
12307
12343
  e.exports = function (e) {
12308
12344
  var t = [];return t.toString = function () {
@@ -12358,39 +12394,39 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12358
12394
  o.refs++;for (var a = 0; a < o.parts.length; a++) {
12359
12395
  o.parts[a](i.parts[a]);
12360
12396
  }for (; a < i.parts.length; a++) {
12361
- o.parts.push(y(i.parts[a], t));
12397
+ o.parts.push(b(i.parts[a], t));
12362
12398
  }
12363
12399
  } else {
12364
12400
  var s = [];for (a = 0; a < i.parts.length; a++) {
12365
- s.push(y(i.parts[a], t));
12401
+ s.push(b(i.parts[a], t));
12366
12402
  }r[i.id] = { id: i.id, refs: 1, parts: s };
12367
12403
  }
12368
12404
  }
12369
- }function g(e, t) {
12405
+ }function p(e, t) {
12370
12406
  for (var n = [], i = {}, o = 0; o < e.length; o++) {
12371
12407
  var r = e[o],
12372
12408
  a = t.base ? r[0] + t.base : r[0],
12373
12409
  s = { css: r[1], media: r[2], sourceMap: r[3] };i[a] ? i[a].parts.push(s) : n.push(i[a] = { id: a, parts: [s] });
12374
12410
  }return n;
12375
- }function p(e, t) {
12411
+ }function g(e, t) {
12376
12412
  var n = l(e.insertInto);if (!n) throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var i = f[f.length - 1];if ("top" === e.insertAt) i ? i.nextSibling ? n.insertBefore(t, i.nextSibling) : n.appendChild(t) : n.insertBefore(t, n.firstChild), f.push(t);else if ("bottom" === e.insertAt) n.appendChild(t);else {
12377
12413
  if ("object" != _typeof(e.insertAt) || !e.insertAt.before) throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o = l(e.insertInto + " " + e.insertAt.before);n.insertBefore(t, o);
12378
12414
  }
12379
12415
  }function m(e) {
12380
12416
  if (null === e.parentNode) return !1;e.parentNode.removeChild(e);var t = f.indexOf(e);t >= 0 && f.splice(t, 1);
12381
12417
  }function v(e) {
12382
- var t = document.createElement("style");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), b(t, e.attrs), p(e, t), t;
12383
- }function b(e, t) {
12418
+ var t = document.createElement("style");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), y(t, e.attrs), g(e, t), t;
12419
+ }function y(e, t) {
12384
12420
  Object.keys(t).forEach(function (n) {
12385
12421
  e.setAttribute(n, t[n]);
12386
12422
  });
12387
- }function y(e, t) {
12423
+ }function b(e, t) {
12388
12424
  var n, i, o, r;if (t.transform && e.css) {
12389
12425
  if (!(r = t.transform(e.css))) return function () {};e.css = r;
12390
12426
  }if (t.singleton) {
12391
12427
  var a = c++;n = u || (u = v(t)), i = O.bind(null, n, a, !1), o = O.bind(null, n, a, !0);
12392
12428
  } else e.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (n = function (e) {
12393
- var t = document.createElement("link");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), e.attrs.rel = "stylesheet", b(t, e.attrs), p(e, t), t;
12429
+ var t = document.createElement("link");return void 0 === e.attrs.type && (e.attrs.type = "text/css"), e.attrs.rel = "stylesheet", y(t, e.attrs), g(e, t), t;
12394
12430
  }(t), i = x.bind(null, n, t), o = function o() {
12395
12431
  m(n), n.href && URL.revokeObjectURL(n.href);
12396
12432
  }) : (n = v(t), i = k.bind(null, n), o = function o() {
@@ -12401,10 +12437,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12401
12437
  } else o();
12402
12438
  };
12403
12439
  }e.exports = function (e, t) {
12404
- if ("undefined" != typeof DEBUG && DEBUG && "object" != (typeof document === "undefined" ? "undefined" : _typeof(document))) throw new Error("The style-loader cannot be used in a non-browser environment");(t = t || {}).attrs = "object" == _typeof(t.attrs) ? t.attrs : {}, t.singleton || "boolean" == typeof t.singleton || (t.singleton = a()), t.insertInto || (t.insertInto = "head"), t.insertAt || (t.insertAt = "bottom");var n = g(e, t);return d(n, t), function (e) {
12440
+ if ("undefined" != typeof DEBUG && DEBUG && "object" != (typeof document === "undefined" ? "undefined" : _typeof(document))) throw new Error("The style-loader cannot be used in a non-browser environment");(t = t || {}).attrs = "object" == _typeof(t.attrs) ? t.attrs : {}, t.singleton || "boolean" == typeof t.singleton || (t.singleton = a()), t.insertInto || (t.insertInto = "head"), t.insertAt || (t.insertAt = "bottom");var n = p(e, t);return d(n, t), function (e) {
12405
12441
  for (var i = [], o = 0; o < n.length; o++) {
12406
12442
  var a = n[o];(s = r[a.id]).refs--, i.push(s);
12407
- }e && d(g(e, t), t);for (o = 0; o < i.length; o++) {
12443
+ }e && d(p(e, t), t);for (o = 0; o < i.length; o++) {
12408
12444
  var s;if (0 === (s = i[o]).refs) {
12409
12445
  for (var l = 0; l < s.parts.length; l++) {
12410
12446
  s.parts[l]();
@@ -12412,11 +12448,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
12412
12448
  }
12413
12449
  }
12414
12450
  };
12415
- };var w,
12416
- _ = (w = [], function (e, t) {
12417
- return w[e] = t, w.filter(Boolean).join("\n");
12451
+ };var _,
12452
+ w = (_ = [], function (e, t) {
12453
+ return _[e] = t, _.filter(Boolean).join("\n");
12418
12454
  });function O(e, t, n, i) {
12419
- var o = n ? "" : i.css;if (e.styleSheet) e.styleSheet.cssText = _(t, o);else {
12455
+ var o = n ? "" : i.css;if (e.styleSheet) e.styleSheet.cssText = w(t, o);else {
12420
12456
  var r = document.createTextNode(o),
12421
12457
  a = e.childNodes;a[t] && e.removeChild(a[t]), a.length ? e.insertBefore(r, a[t]) : e.appendChild(r);
12422
12458
  }