Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

danmu.js

Package Overview
Dependencies
Maintainers
5
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danmu.js - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8-0

4

browser/index.js

@@ -1,3 +0,3 @@

/*! Built @Mon, 13 Feb 2023 08:23:50 GMT */
window.DanmuJs=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},t.hasClass=i,t.addClass=r,t.removeClass=o,t.toggleClass=function(e,t){t.split(/\s+/g).forEach((function(t){i(e,t)?o(e,t):r(e,t)}))},t.findDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],n=void 0;try{n=e.querySelector(t)}catch(i){t.startsWith("#")&&(n=e.getElementById(t.slice(1)))}return n},t.deepCopy=function e(t,n){if("Object"===a(n)&&"Object"===a(t))return Object.keys(n).forEach((function(i){"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]})),t},t.typeOf=a,t.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},t.attachEventListener=function(e,t,n,i){if(i)e.on(t,n),function(e,t,n,i){e.once(i,(function r(){e.off(t,n),e.off(i,r)}))}(e,t,n,i);else{e.on(t,(function i(r){n(r),e.off(t,i)}))}},t.styleUtil=function(e,t,n){var i=e.style;try{i[t]=n}catch(e){i.setProperty(t,n)}},t.styleCSSText=function(e,t){var n=e.style;try{n.cssText=t}catch(e){}},t.isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},t.throttle=function(e,t){var n=this,i=0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){return e.apply(n,o)}),t)}};t.hasOwnProperty=Object.prototype.hasOwnProperty;function i(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function r(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):i(e,t)||(e.className+=" "+t)}function o(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):i(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))}function a(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(26),a=(i=o)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"setLogger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.logger=new a.default(e+".js")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var i=n(18)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(5),o=(i=r)&&i.__esModule?i:{default:i};n(34),t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DanmuJs=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=h(n(6)),o=n(25),a=h(n(1)),s=h(n(27)),l=h(n(32)),u=n(33),c=n(0);function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=t.DanmuJs=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;i.setLogger("danmu"),i.logger&&i.logger.info("danmu.js version: "+o.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,highScorePriority:!0};if((0,c.deepCopy)(a,e),(0,r.default)(i),i.hideArr=[],i.domObj=new l.default,i.freezeId=null,a.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),i.container=a.container&&1===a.container.nodeType?a.container:null,!i.container)return i.emit("error","container id can't be empty"),!1,f(n,!1);if(a.containerStyle){var u=a.containerStyle;Object.keys(u).forEach((function(e){i.container.style[e]=u[e]}))}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}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&(0,u.addObserver)(this.container,(function(){e.logger&&e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main.clear()}},{key:"destroy",value:function(){for(var e in(0,u.unObserver)(this.container),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn.destroy(),this.domObj.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){this.logger&&this.logger.info("sendComment: "+(e.txt||"[DOM Element]"));var t=this.main;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?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.keepPoolWatermark())}},{key:"setCommentID",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentID: oldID "+e+" newID "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.id=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentDuration: id "+e+" duration "+t),e&&t&&(t=t||5e3,this.main.data.some((function(n){return n.id===e&&(n.duration=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id "+e+" like "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.like=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.pauseMove(),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.main.status&&n.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id "+e),e){var t=this.main;if(this._releaseCtrl(e),"closed"===t.status)return;t.queue.some((function(n){return n.id===e&&("paused"!==t.status?n.startMove(!0):n.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){if(this.logger&&this.logger.info("freezeComment: id "+e),e){this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&(0,c.styleUtil)(t.el,"zIndex",10),!0)}))}}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id "+e),e){this._releaseCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.remove(),!0)})),this.main.data=this.main.data.filter((function(t){return t.id!==e}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.logger&&this.logger.info("updateComments: "+e.length+", isClear "+t);var n=this.main;"boolean"==typeof t&&t&&(n.data=[]),n.data=n.data.concat(e),n.sortData(),n.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this,n=arguments[1],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){e===t.mode&&(t.duration=n)})),this.main.queue.forEach((function(i){e===i.mode&&(i.duration=n,i.pauseMove(),"paused"!==t.main.status&&i.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",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){t===n.mode&&(n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity "+e),this.container.style.opacity=e}},{key:"setFontSize",value:function(e,t){var n=this,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){e.style&&(e.style.fontSize=n.fontSize)})),this.main.queue.forEach((function(e){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())}))),t&&(this.config.channelSize=t,i.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area "+e),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){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){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction "+e),this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}},{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";var i,r,o,a,s,l,u,c=n(7),h=n(24),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n,r;return h(t),r=this,i.call(this,e,n=function(){o.call(r,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return h(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},once:r,off:o=function(e,t){var n,i,r,o;if(h(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(i=n[e]))for(o=0;r=i[o];++o)r!==t&&r.__eeOnceListener__!==t||(2===i.length?n[e]=i[o?0:1]:i.splice(o,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,i,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(r=r.slice(),t=0;i=r[t];++t)f.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];f.call(r,this,o)}}},l={on:c(i),once:c(r),off:c(o),emit:c(a)},u=m({},l),e.exports=t=function(e){return null==e?p(u):m(Object(e),l)},t.methods=s},function(e,t,n){"use strict";var i=n(3),r=n(8),o=n(12),a=n(20),s=n(21);(e.exports=function(e,t){var n,r,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"),r=s.call(e,"e"),l=s.call(e,"w")):(n=l=!0,r=!1),c={value:t,configurable:n,enumerable:r,writable:l},u?o(a(u),c):c}).gs=function(e,t,n){var l,u,c,h;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],i(t)?r(t)?i(n)?r(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),h={get:t,set:n,configurable:l,enumerable:u},c?o(a(c),h):h}},function(e,t,n){"use strict";var i=n(9),r=/^\s*class[\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!r.test(o.call(e))}},function(e,t,n){"use strict";var i=n(10);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){"use strict";var i=n(11);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(3),r={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(r,typeof e)}},function(e,t,n){"use strict";e.exports=n(13)()?Object.assign:n(14)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(15),r=n(19),o=Math.max;e.exports=function(e,t){var n,a,s,l=o(arguments.length,2);for(e=Object(r(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},a=1;a<l;++a)i(t=arguments[a]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(16)()?Object.keys:n(17)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(2),r=Object.keys;e.exports=function(e){return r(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(2),r=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){i(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(22)()?String.prototype.contains:n(23)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e){e.exports=JSON.parse('{"version":"1.1.7"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return i(e,[{key:"info",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(i))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(1)),o=s(n(28)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.setLogger("control"),n.danmu=e,n.main=new o.default(e),e.config.defaultOff||n.main.start(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"createSwitch",value:function(){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}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)a.hasOwnProperty.call(this,e)&&delete this[e]}}]),t}(r.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n(1)),o=l(n(29)),a=l(n(30)),s=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(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._status="idle",(0,s.attachEventListener)(e,"bullet_remove",n.updateQueue.bind(n),"destroy"),(0,s.attachEventListener)(e,"changeDirection",(function(e){n.danmu.direction=e}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"_cancelDataHandleTimer",value:function(){this.handleId&&(clearTimeout(this.handleId),this.handleId=null),this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._cancelDataHandleTimer(),this.channel.destroy(),this.data=[],this)delete this[e]}},{key:"updateQueue",value:function(e){this.logger&&this.logger.info("updateQueue");var t=this;t.queue.some((function(n,i){return n.id===e.bullet.id&&(t.queue.splice(i,1),!0)})),t.data.some((function(t){return t.id===e.bullet.id&&(t.attached_=!1,!0)}))}},{key:"init",value:function(){var e=this;e.retryStatus="normal",e.sortData(),function t(){"closed"!==e._status||"stop"!==e.retryStatus?("playing"===e._status&&(e.readData(),e.dataHandle()),"stop"===e.retryStatus&&"paused"!==e._status||(e.handleTimer=setTimeout((function(){e.handleId=requestAnimationFrame((function(){t()}))}),250))):e._cancelDataHandleTimer()}()}},{key:"start",value:function(){this.logger&&this.logger.info("start");"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this.init())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop");"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container.innerHTML="",this.channel.reset())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel.reset(),this.data=[],this.queue=[],this.container.innerHTML=""}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))}))}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused";var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,n=this.channel,i=e.player,r=void 0,a=void 0;if(e.isReady){if(i){var l=i.currentTime?Math.floor(1e3*i.currentTime):0;a=this.data.filter((function(n){return!n.start&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&(n.start=l),!n.attached_&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&n.start-t<=l&&l<=n.start+t})),e.config.highScorePriority&&a.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.data=[])}else 0===(a=this.data.splice(0,1)).length&&(a=this.playedData.splice(0,1));if(a.length>0){n.updatePos();var u=2;e:for(var c,h=0;h<a.length;h++)if(c=a[h],this.forceDuration&&this.forceDuration!==c.duration&&(c.duration=this.forceDuration),(r=new o.default(e,c))&&!r.bulletCreateFail)if(r.attach(),c.attached_=!0,n.addBullet(r).result)this.queue.push(r),r.topInit(),u=2;else{for(var f in r.detach(),r)s.hasOwnProperty.call(r,f)&&delete r[f];if(r=null,c.attached_=!1,c.noDiscard&&(c.prior?this.data.unshift(c):this.data.push(c)),0===u)break e;u--}else{if(0===u)break e;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,n=e.player,i=this.data,r=[],o=0;if("number"==typeof t.maxCommentsLength&&i.length>t.maxCommentsLength){o=i.length-t.maxCommentsLength;for(var a,s=0;s<o;s++)(a=i[s]).prior&&!a.attached_&&r.push(i[s])}else if(t.dropStaleComments&&n&&n.currentTime){var l=Math.floor(1e3*n.currentTime)-t.interval;if(l>0)for(var u,c=0;c<i.length;c++)if((u=i[c]).prior&&!u.attached_&&r.push(i[c]),u.start>l){o=c;break}}o>0&&(i.splice(0,o),this.data=r.concat(i))}},{key:"status",get:function(){return this._status}}]),t}(r.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bullet=void 0;var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0);function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=t.Bullet=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i,o=void 0,a="",u=n.style||{};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.domObj=e.domObj,n.el&&1===n.el.nodeType){if(n.el.parentNode)return l(i,{bulletCreateFail:!0});if(e.config.disableCopyDOM||n.disableCopyDOM)i.reuseDOM=!1,o=n.el;else{var c=(0,s.copyDom)(n.el);n.eventListeners&&n.eventListeners.length>0&&n.eventListeners.forEach((function(e){c.addEventListener(e.event,e.listener,e.useCapture||!1)})),(o=i.domObj.use()).childNodes.length>0&&(o.innerHTML=""),o.textContent&&(o.textContent=""),o.appendChild(c)}}else(o=i.domObj.use()).textContent=n.txt;i.onChangeDirection=function(e){r.direction=e},i.danmu.on("changeDirection",i.onChangeDirection);var h=void 0;if((0,s.isNumber)(e.config.bulletOffset)&&e.config.bulletOffset>=0)h=e.config.bulletOffset;else{var f=e.containerPos;h=f.width/10>100?100:f.width/10}var d=n.realTime?0:Math.floor(Math.random()*h),p=i.updateOffset(d,!0);return u.left=p,Object.keys(u).forEach((function(e){a+=e+":"+u[e]+";"})),(0,s.styleCSSText)(o,a),"top"===n.mode||"bottom"===n.mode?i.mode=n.mode:i.mode="scroll",i.el=o,n.like&&n.like.el&&i.setLikeDom(n.like.el,n.like.style),i.status="waiting",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var n=this.danmu.containerPos.width+e+"px";return t||(0,s.styleUtil)(this.el,"left",this.danmu.containerPos.width+e+"px"),n}},{key:"attach",value:function(){var e=this.el;this.container.contains(e)||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))),this._onTransitionEnd=this._onTransitionEnd.bind(this),e.addEventListener("transitionend",this._onTransitionEnd,!1)}},{key:"detach",value:function(){var e=this.el;if(e){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),this.reuseDOM?this.domObj.unused(e):e.parentNode&&e.parentNode.removeChild(e),this.el=null}this.elPos=void 0,this.danmu.off("changeDirection",this.onChangeDirection)}},{key:"mouseoverFun",value:function(e){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})}},{key:"_onTransitionEnd",value:function(){this.status="end",this.remove(!1)}},{key:"topInit",value:function(){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")}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if("paused"!==t.status&&("forcedPause"!==t.status&&(this.status="paused"),t._moveV=void 0,this.el))if("scroll"===this.mode){var n=t.danmu.containerPos;if(e){var i=((new Date).getTime()-t.moveTime)/1e3,r=i*this.moveV,o=0;o=t.moveMoreS-r>=0?"b2t"===this.direction?(t.moveMoreS-r)/t.moveContainerHeight*n.height:(t.moveMoreS-r)/t.moveContainerWidth*n.width:t.moveMoreS-r,"b2t"===this.direction?(0,s.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+o+"px) translateZ(0px) rotate(90deg)"):(0,s.styleUtil)(this.el,"left",o+"px")}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")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){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",(0,s.styleUtil)(this.el,"backface-visibility","hidden"),(0,s.styleUtil)(this.el,"perspective","500em"),"scroll"===this.mode){var t=this.danmu.containerPos;if("b2t"===this.direction){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}else{if(!this.el)return;var i=this.el.getBoundingClientRect(),r=i.right-t.left,o=r/this.moveV;i.right>t.left?((0,s.styleUtil)(this.el,"transition","transform "+o+"s linear 0s"),(0,s.styleUtil)(this.el,"transform","translateX(-"+r+"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())}}else{var a=(new Date).getTime(),l=(this.startTime&&a-this.startTime>this.duration?a-this.startTime:this.duration)/1e3;(0,s.styleUtil)(this.el,"left","50%"),(0,s.styleUtil)(this.el,"margin","0 0 0 -"+this.width/2+"px"),(0,s.styleUtil)(this.el,"visibility","hidden"),(0,s.styleUtil)(this.el,"transition","visibility "+l+"s 0s"),this.pastDuration||(this.pastDuration=1),this.startTime=a}}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.logger&&this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#");var t=this;e&&t.pauseMove(),t.el&&t.el.parentNode&&(t.detach(),this.options.el&&1===this.options.el.nodeType&&this.danmu.config.disableCopyDOM&&(0,s.styleUtil)(this.options.el,"transform","none"),t.danmu.emit("bullet_remove",{bullet:t}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(n){e.style[n]=t[n]}));if(e.className="danmu-like",this.el){var n=this.el.querySelector(".danmu-like");n&&this.el.removeChild(n),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}}return e}},{key:"moveV",get:function(){var e=this._moveV;if(!e){if(this.options.moveV)e=this.options.moveV;else if(this.elPos){var t=this.danmu.containerPos;e=("b2t"===this.direction?t.height+this.height:t.width+this.width)/this.duration*1e3}e&&(e*=this.danmu.main.playRate,this._moveV=e)}return e}}]),t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0),l=n(31);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;return i.setLogger("channel"),i.danmu=e,i.width=0,i.height=0,i.reset(!0),i.direction=e.direction,i.channels=[],i.updatePos(),(0,s.attachEventListener)(n.danmu,"bullet_remove",(function(e){i.removeBullet(e.bullet)}),"destroy"),(0,s.attachEventListener)(n.danmu,"changeDirection",(function(e){i.direction=e}),"destroy"),(0,s.attachEventListener)(n.danmu,"channel_resize",(function(){i.resize()}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)s.hasOwnProperty.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,n=t.danmu,i=n.container,r=n.bulletBtn;function o(){var e=i.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var n=t._initChannels(),r=n.channelSize,o=n.channelCount,a=n.channels;t.channelCount=o,t.channels=a,"b2t"===t.direction?t.channelWidth=r:t.channelHeight=r}t.container=i,r&&r.main&&r.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var n=0;n<t.channels.length;n++)t.channels[n].queue[e].forEach((function(e){e.remove()}))})),r&&r.main&&r.main.data&&r.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(o):o()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){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}},{key:"addBullet",value:function(e){var t=this,n=this.danmu,i=this.channels,r=void 0,o=void 0,a=void 0;if("b2t"===t.direction?(o=this.channelWidth,a=Math.ceil(e.width/o)):(r=this.channelHeight,a=Math.ceil(e.height/r)),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,h=i.length;c<h;c++)if(i[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var f=0,d=i.length-a;f<=d;f++){s=!0;for(var p=f;p<f+a;p++){if((l=i[p]).operating.scroll){s=!1;break}if(l.bookId.scroll&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var m=g.el.getBoundingClientRect();if("b2t"===t.direction){if(m.bottom>=t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(m.right>=t.containerPos.right){s=!1,l.operating.scroll=!1;break}var v=void 0,y=g.moveV,b=void 0,_=e.moveV,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){var O=w/(_-y);if(n.config.bOffset||(n.config.bOffset=0),b+n.config.bOffset>=O){var k=b*_-t.containerPos.width;k>0&&e.updateOffset(k+(1+Math.ceil(5*Math.random())))}}}l.operating.scroll=!1}if(s){u=f;break}}else if("top"===e.mode)for(var x=0,C=i.length-a;x<=C;x++){s=!0;for(var E=x;E<x+a;E++){if(E>Math.floor(i.length/2)){s=!1;break}if((l=i[E]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=x;break}}else if("bottom"===e.mode)for(var j=i.length-a;j>=0;j--){s=!0;for(var M=j;M<j+a;M++){if(M<=Math.floor(i.length/2)){s=!1;break}if((l=i[M]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=j;break}}if(-1!==u){for(var T=u,L=u+a;T<L;T++)(l=i[T]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger&&t.logger.info(T+"号轨道恢复正常使用")),l.operating[e.mode]=!1;if(e.prior)if(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,n.player)n.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}));return e.channel_id=[u,a],e.el.setAttribute("data-line-index",u+1),"b2t"===t.direction?(e.top=u*o,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*r,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var P=0,S=-1,z=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,n){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=P&&(P=e.start,S=n,z=e)})),z){z.remove(),t.removeBullet(z),t.danmu.bulletBtn.main.queue.splice(S,1),e.channel_id=z.channel_id;for(var D=z.channel_id[0],I=z.channel_id[0]+z.channel_id[1];D<I;D++)(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;return e.top=z.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live){if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,!0)}))}else{u=-1;for(var R=0,q=i.length-a;R<=q;R++){s=!0;for(var A=R;A<R+a;A++)if(i[A].bookId[e.mode]){s=!1;break}if(s){u=R;break}}if(-1!==u){for(var U=u;U<u+a;U++)i[U].bookId[e.mode]=e.id,t.logger&&t.logger.info(U+"号轨道被"+e.id+"号优先弹幕预定");if(n.player)n.bulletBtn.main.data.some((function(n){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)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,n=e.channel_id,i=void 0,r=n[0],o=n[0]+n[1];r<o;r++)if(i=t[r]){i.operating[e.mode]=!0;var a=-1;i.queue[e.mode].some((function(t,n){return t.id===e.id&&(a=n,!0)})),a>-1&&i.queue[e.mode].splice(a,1),i.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12),n=void 0;if(e.area){var i=e.area,r=i.lines,o=i.start,a=i.end;if((0,l.validAreaLineRule)(r))n=r,"b2t"===this.direction?this.width=n*t:this.height=n*t;else if(o>=0&&a>=o){var u=a-o;"b2t"===this.direction?this.width=Math.floor(this.width*u):this.height=Math.floor(this.height*u)}}(0,s.isNumber)(n)||(n="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var c=[],h=0;h<n;h++)c[h]={id:h,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:n,channels:c}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function n(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function i(e,i){function r(n){["scroll","top"].forEach((function(i){t.channels[n].queue[i].forEach((function(t){t.el&&e[n].queue[i].push(t)}))}))}function o(n){t.channels[n].queue.bottom.forEach((function(r){if(r.el&&(e[n+e.length-t.channels.length].queue.bottom.push(r),r.channel_id[0]+r.channel_id[1]-1===n)){var o=[].concat(r.channel_id);r.channel_id=[o[0]-t.channels.length+e.length,o[1]],r.top=r.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}}))}for(var a=0;a<t.channels.length;a++)n(e,a),r(a),o(a);for(var s=function(t){["scroll","top","bottom"].forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))},l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function r(e,i){for(var r=["scroll","top","bottom"],o=function(o){n(e,o),r.forEach((function(n){if("top"===n&&o>Math.floor(e.length/2));else if("bottom"===n&&o<=Math.floor(e.length/2));else{var r="bottom"===n?o-e.length+t.channels.length:o;t.channels[r].queue[n].forEach((function(a,s){if(a.el){if(e[o].queue[n].push(a),"bottom"===n&&a.channel_id[0]+a.channel_id[1]-1===r){var l=[].concat(a.channel_id);a.channel_id=[l[0]-t.channels.length+e.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()}t.channels[r].queue[n].splice(s,1)}}))}}))},a=0;a<e.length;a++)o(a);var s=function(t){r.forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))};for(a=0;a<e.length;a++)s(a);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function o(){var e=t.danmu,n=e.container,o=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),o.main.data&&o.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var a=t._initChannels(),s=a.channelSize,l=a.channels;t.channels&&(t.channels.length<=l.length?i(l,s):r(l,s)),t.resizing=!1}t.resizing||(t.resizing=!0,e?o():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(o)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}}]),t}(a.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validAreaLineRule=function(e){return"number"==typeof e&&e>=0&&Number.isInteger(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return i(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var n in this)r.hasOwnProperty.call(this,n)&&delete this[n]}},{key:"clearElementStyle",value:function(e){var t="undefined"!=typeof window?window.navigator.userAgent:null;t&&(t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1?(0,r.styleUtil)(e,"transform","none"):e.setAttribute("style",""))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.destroyObserver=t.unObserver=t.addObserver=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=new(function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,r.throttle)((function(e){t.__trigger(e)}),100))}catch(e){}}return i(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){t[n].handler&&t[n].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());t.addObserver=function(e,t){o.addObserver(e,t)},t.unObserver=function(e,t){o.unObserver(e,t)},t.destroyObserver=function(e,t){o.destroyObserver(e,t)}},function(e,t,n){var i=n(35);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(37)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){(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}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var i,r,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=s.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,c=0,h=[],f=n(38);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=o[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(b(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(b(i.parts[a],t));o[i.id]={id:i.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function g(e,t){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=h[h.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{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 r=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,r)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,i,r,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var a=c++;n=u||(u=v(t)),i=O.bind(null,n,a,!1),r=O.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){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}(t),i=x.bind(null,n,t),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),i=k.bind(null,n),r=function(){m(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=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){for(var i=[],r=0;r<n.length;r++){var a=n[r];(s=o[a.id]).refs--,i.push(s)}e&&d(p(e,t),t);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function O(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function k(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var i=n.css,r=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||o)&&(i=f(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}}]);
/*! Built @Thu, 23 Feb 2023 11:41:38 GMT */
window.DanmuJs=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},t.hasClass=i,t.addClass=r,t.removeClass=o,t.toggleClass=function(e,t){t.split(/\s+/g).forEach((function(t){i(e,t)?o(e,t):r(e,t)}))},t.findDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],n=void 0;try{n=e.querySelector(t)}catch(i){t.startsWith("#")&&(n=e.getElementById(t.slice(1)))}return n},t.deepCopy=function e(t,n){if("Object"===a(n)&&"Object"===a(t))return Object.keys(n).forEach((function(i){"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]})),t},t.typeOf=a,t.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},t.attachEventListener=function(e,t,n,i){if(i)e.on(t,n),function(e,t,n,i){e.once(i,(function r(){e.off(t,n),e.off(i,r)}))}(e,t,n,i);else{e.on(t,(function i(r){n(r),e.off(t,i)}))}},t.styleUtil=function(e,t,n){var i=e.style;try{i[t]=n}catch(e){i.setProperty(t,n)}},t.styleCSSText=function(e,t){var n=e.style;try{n.cssText=t}catch(e){}},t.isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},t.throttle=function(e,t){var n=this,i=0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){return e.apply(n,o)}),t)}};t.hasOwnProperty=Object.prototype.hasOwnProperty;function i(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function r(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):i(e,t)||(e.className+=" "+t)}function o(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):i(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))}function a(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(26),a=(i=o)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"setLogger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.logger=new a.default(e+".js")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var i=n(18)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(5),o=(i=r)&&i.__esModule?i:{default:i};n(34),t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DanmuJs=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=h(n(6)),o=n(25),a=h(n(1)),s=h(n(27)),l=h(n(32)),u=n(33),c=n(0);function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=t.DanmuJs=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;i.setLogger("danmu"),i.logger&&i.logger.info("danmu.js version: "+o.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,highScorePriority:!0};if((0,c.deepCopy)(a,e),(0,r.default)(i),i.hideArr=[],i.domObj=new l.default,i.freezeId=null,a.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),i.container=a.container&&1===a.container.nodeType?a.container:null,!i.container)return i.emit("error","container id can't be empty"),!1,f(n,!1);if(a.containerStyle){var u=a.containerStyle;Object.keys(u).forEach((function(e){i.container.style[e]=u[e]}))}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}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&(0,u.addObserver)(this.container,(function(){e.logger&&e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main.clear()}},{key:"destroy",value:function(){for(var e in(0,u.unObserver)(this.container),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn.destroy(),this.domObj.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){this.logger&&this.logger.info("sendComment: "+(e.txt||"[DOM Element]"));var t=this.main;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?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.keepPoolWatermark())}},{key:"setCommentID",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentID: oldID "+e+" newID "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.id=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentDuration: id "+e+" duration "+t),e&&t&&(t=t||5e3,this.main.data.some((function(n){return n.id===e&&(n.duration=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id "+e+" like "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.like=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.pauseMove(),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.main.status&&n.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id "+e),e){var t=this.main;if(this._releaseCtrl(e),"closed"===t.status)return;t.queue.some((function(n){return n.id===e&&("paused"!==t.status?n.startMove(!0):n.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){if(this.logger&&this.logger.info("freezeComment: id "+e),e){this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&(0,c.styleUtil)(t.el,"zIndex",10),!0)}))}}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id "+e),e){var t=this;t._releaseCtrl(e),t.main.queue.some((function(t){return t.id===e&&(t.remove(),!0)})),t.main.data=t.main.data.filter((function(n){var i=n.id!==e;return i||t.main.dataElHandle([n]),i}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.logger&&this.logger.info("updateComments: "+e.length+", isClear "+t);var n=this.main;"boolean"==typeof t&&t&&(n.dataElHandle(n.data),n.data=[]),n.data=n.data.concat(e),n.sortData(),n.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this,n=arguments[1],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){e===t.mode&&(t.duration=n)})),this.main.queue.forEach((function(i){e===i.mode&&(i.duration=n,i.pauseMove(),"paused"!==t.main.status&&i.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",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){t===n.mode&&(n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity "+e),this.container.style.opacity=e}},{key:"setFontSize",value:function(e,t){var n=this,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){e.style&&(e.style.fontSize=n.fontSize)})),this.main.queue.forEach((function(e){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())}))),t&&(this.config.channelSize=t,i.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area "+e),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){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){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction "+e),this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}},{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";var i,r,o,a,s,l,u,c=n(7),h=n(24),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n,r;return h(t),r=this,i.call(this,e,n=function(){o.call(r,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return h(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},once:r,off:o=function(e,t){var n,i,r,o;if(h(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(i=n[e]))for(o=0;r=i[o];++o)r!==t&&r.__eeOnceListener__!==t||(2===i.length?n[e]=i[o?0:1]:i.splice(o,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,i,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(r=r.slice(),t=0;i=r[t];++t)f.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];f.call(r,this,o)}}},l={on:c(i),once:c(r),off:c(o),emit:c(a)},u=m({},l),e.exports=t=function(e){return null==e?p(u):m(Object(e),l)},t.methods=s},function(e,t,n){"use strict";var i=n(3),r=n(8),o=n(12),a=n(20),s=n(21);(e.exports=function(e,t){var n,r,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"),r=s.call(e,"e"),l=s.call(e,"w")):(n=l=!0,r=!1),c={value:t,configurable:n,enumerable:r,writable:l},u?o(a(u),c):c}).gs=function(e,t,n){var l,u,c,h;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],i(t)?r(t)?i(n)?r(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),h={get:t,set:n,configurable:l,enumerable:u},c?o(a(c),h):h}},function(e,t,n){"use strict";var i=n(9),r=/^\s*class[\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!r.test(o.call(e))}},function(e,t,n){"use strict";var i=n(10);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){"use strict";var i=n(11);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(3),r={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(r,typeof e)}},function(e,t,n){"use strict";e.exports=n(13)()?Object.assign:n(14)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(15),r=n(19),o=Math.max;e.exports=function(e,t){var n,a,s,l=o(arguments.length,2);for(e=Object(r(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},a=1;a<l;++a)i(t=arguments[a]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(16)()?Object.keys:n(17)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(2),r=Object.keys;e.exports=function(e){return r(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(2),r=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){i(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(22)()?String.prototype.contains:n(23)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e){e.exports=JSON.parse('{"version":"1.1.8-0"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return i(e,[{key:"info",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(i))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(1)),o=s(n(28)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.setLogger("control"),n.danmu=e,n.main=new o.default(e),e.config.defaultOff||n.main.start(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"createSwitch",value:function(){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}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)a.hasOwnProperty.call(this,e)&&delete this[e]}}]),t}(r.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n(1)),o=l(n(29)),a=l(n(30)),s=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(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._status="idle",(0,s.attachEventListener)(e,"bullet_remove",n.updateQueue.bind(n),"destroy"),(0,s.attachEventListener)(e,"changeDirection",(function(e){n.danmu.direction=e}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"_cancelDataHandleTimer",value:function(){this.handleId&&(clearTimeout(this.handleId),this.handleId=null),this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._cancelDataHandleTimer(),this.channel.destroy(),this.dataElHandle(this.data),this.data=[],this)delete this[e]}},{key:"updateQueue",value:function(e){this.logger&&this.logger.info("updateQueue");var t=this;t.queue.some((function(n,i){return n.id===e.bullet.id&&(t.queue.splice(i,1),!0)})),t.data.some((function(t){return t.id===e.bullet.id&&(t.attached_=!1,!0)}))}},{key:"init",value:function(){var e=this;e.retryStatus="normal",e.sortData(),function t(){"closed"!==e._status||"stop"!==e.retryStatus?("playing"===e._status&&(e.readData(),e.dataHandle()),"stop"===e.retryStatus&&"paused"!==e._status||(e.handleTimer=setTimeout((function(){e.handleId=requestAnimationFrame((function(){t()}))}),250))):e._cancelDataHandleTimer()}()}},{key:"start",value:function(){this.logger&&this.logger.info("start");"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this.init())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop");"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container.innerHTML="",this.channel.reset())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel.reset(),this.dataElHandle(this.data),this.data=[],this.queue=[],this.container.innerHTML=""}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))}))}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused";var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,n=this.channel,i=e.player,r=void 0,a=void 0;if(e.isReady){if(i){var l=i.currentTime?Math.floor(1e3*i.currentTime):0;a=this.data.filter((function(n){return!n.start&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&(n.start=l),!n.attached_&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&n.start-t<=l&&l<=n.start+t})),e.config.highScorePriority&&a.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.dataElHandle(this.data),this.data=[])}else 0===(a=this.data.splice(0,1)).length&&(a=this.playedData.splice(0,1));if(a.length>0){n.updatePos();var u=2;e:for(var c,h=0;h<a.length;h++)if(c=a[h],this.forceDuration&&this.forceDuration!==c.duration&&(c.duration=this.forceDuration),(r=new o.default(e,c))&&!r.bulletCreateFail)if(r.attach(),c.attached_=!0,n.addBullet(r).result)this.queue.push(r),r.topInit(),u=2;else{for(var f in r.detach(),r)s.hasOwnProperty.call(r,f)&&delete r[f];if(r=null,c.attached_=!1,c.noDiscard&&(c.prior?this.data.unshift(c):this.data.push(c)),0===u)break e;u--}else{if(0===u)break e;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,n=e.player,i=this.data,r=[],o=0;if("number"==typeof t.maxCommentsLength&&i.length>t.maxCommentsLength){o=i.length-t.maxCommentsLength;for(var a,s=0;s<o;s++)(a=i[s]).prior&&!a.attached_&&r.push(i[s])}else if(t.dropStaleComments&&n&&n.currentTime){var l=Math.floor(1e3*n.currentTime)-t.interval;if(l>0)for(var u,c=0;c<i.length;c++)if((u=i[c]).prior&&!u.attached_&&r.push(i[c]),u.start>l){o=c;break}}o>0&&(this.dataElHandle(i,0,o),i.splice(0,o),this.data=r.concat(i))}},{key:"dataElHandle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];if(Number.isNaN(n))n=e.length;else if(n>e.length)throw"dataElHandle invalid range: "+t+"-"+n;for(var i=t;i<n;i++){var r=e[i];if(r&&"function"==typeof r.onElDestroy)try{r.onElDestroy(r),r.onElDestroy=null}catch(e){console.error("danmu onElDestroy fail:",e)}}}},{key:"status",get:function(){return this._status}}]),t}(r.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bullet=void 0;var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0);function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=t.Bullet=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i,o=void 0,a="",u=n.style||{};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.domObj=e.domObj,n.el&&1===n.el.nodeType){if(n.el.parentNode)return l(i,{bulletCreateFail:!0});if(e.config.disableCopyDOM||n.disableCopyDOM)i.reuseDOM=!1,o=n.el;else{var c=(0,s.copyDom)(n.el);n.eventListeners&&n.eventListeners.length>0&&n.eventListeners.forEach((function(e){c.addEventListener(e.event,e.listener,e.useCapture||!1)})),(o=i.domObj.use()).childNodes.length>0&&(o.innerHTML=""),o.textContent&&(o.textContent=""),o.appendChild(c)}}else(o=i.domObj.use()).textContent=n.txt;i.onChangeDirection=function(e){r.direction=e},i.danmu.on("changeDirection",i.onChangeDirection);var h=void 0;if((0,s.isNumber)(e.config.bulletOffset)&&e.config.bulletOffset>=0)h=e.config.bulletOffset;else{var f=e.containerPos;h=f.width/10>100?100:f.width/10}var d=n.realTime?0:Math.floor(Math.random()*h),p=i.updateOffset(d,!0);return u.left=p,Object.keys(u).forEach((function(e){var t=e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));a+=t+":"+u[e]+";"})),(0,s.styleCSSText)(o,a),"top"===n.mode||"bottom"===n.mode?i.mode=n.mode:i.mode="scroll",i.el=o,n.like&&n.like.el&&i.setLikeDom(n.like.el,n.like.style),i.status="waiting",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var n=this.danmu.containerPos.width+e+"px";return t||(0,s.styleUtil)(this.el,"left",this.danmu.containerPos.width+e+"px"),n}},{key:"attach",value:function(){var e=this.el;this.container.contains(e)||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))),this._onTransitionEnd=this._onTransitionEnd.bind(this),e.addEventListener("transitionend",this._onTransitionEnd,!1)}},{key:"detach",value:function(){var e=this.el;if(e){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),this.reuseDOM?this.domObj.unused(e):e.parentNode&&e.parentNode.removeChild(e),this.el=null}this.elPos=void 0,this.danmu.off("changeDirection",this.onChangeDirection)}},{key:"mouseoverFun",value:function(e){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})}},{key:"_onTransitionEnd",value:function(){this.status="end",this.remove(!1)}},{key:"topInit",value:function(){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")}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if("paused"!==t.status&&("forcedPause"!==t.status&&(this.status="paused"),t._moveV=void 0,this.el))if("scroll"===this.mode){var n=t.danmu.containerPos;if(e){var i=((new Date).getTime()-t.moveTime)/1e3,r=i*this.moveV,o=0;o=t.moveMoreS-r>=0?"b2t"===this.direction?(t.moveMoreS-r)/t.moveContainerHeight*n.height:(t.moveMoreS-r)/t.moveContainerWidth*n.width:t.moveMoreS-r,"b2t"===this.direction?(0,s.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+o+"px) translateZ(0px) rotate(90deg)"):(0,s.styleUtil)(this.el,"left",o+"px")}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")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){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",(0,s.styleUtil)(this.el,"backface-visibility","hidden"),(0,s.styleUtil)(this.el,"perspective","500em"),"scroll"===this.mode){var t=this.danmu.containerPos;if("b2t"===this.direction){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}else{if(!this.el)return;var i=this.el.getBoundingClientRect(),r=i.right-t.left,o=r/this.moveV;i.right>t.left?((0,s.styleUtil)(this.el,"transition","transform "+o+"s linear 0s"),(0,s.styleUtil)(this.el,"transform","translateX(-"+r+"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())}}else{var a=(new Date).getTime(),l=(this.startTime&&a-this.startTime>this.duration?a-this.startTime:this.duration)/1e3;(0,s.styleUtil)(this.el,"left","50%"),(0,s.styleUtil)(this.el,"margin","0 0 0 -"+this.width/2+"px"),(0,s.styleUtil)(this.el,"visibility","hidden"),(0,s.styleUtil)(this.el,"transition","visibility "+l+"s 0s"),this.pastDuration||(this.pastDuration=1),this.startTime=a}}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.logger&&this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#");var t=this;e&&t.pauseMove(),t.el&&t.el.parentNode&&(t.detach(),this.options.el&&1===this.options.el.nodeType&&this.danmu.config.disableCopyDOM&&(0,s.styleUtil)(this.options.el,"transform","none"),t.danmu.emit("bullet_remove",{bullet:t}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(n){e.style[n]=t[n]}));if(e.className="danmu-like",this.el){var n=this.el.querySelector(".danmu-like");n&&this.el.removeChild(n),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}}return e}},{key:"moveV",get:function(){var e=this._moveV;if(!e){if(this.options.moveV)e=this.options.moveV;else if(this.elPos){var t=this.danmu.containerPos;e=("b2t"===this.direction?t.height+this.height:t.width+this.width)/this.duration*1e3}e&&(e*=this.danmu.main.playRate,this._moveV=e)}return e}}]),t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0),l=n(31);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;return i.setLogger("channel"),i.danmu=e,i.width=0,i.height=0,i.reset(!0),i.direction=e.direction,i.channels=[],i.updatePos(),(0,s.attachEventListener)(n.danmu,"bullet_remove",(function(e){i.removeBullet(e.bullet)}),"destroy"),(0,s.attachEventListener)(n.danmu,"changeDirection",(function(e){i.direction=e}),"destroy"),(0,s.attachEventListener)(n.danmu,"channel_resize",(function(){i.resize()}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)s.hasOwnProperty.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,n=t.danmu,i=n.container,r=n.bulletBtn;function o(){var e=i.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var n=t._initChannels(),r=n.channelSize,o=n.channelCount,a=n.channels;t.channelCount=o,t.channels=a,"b2t"===t.direction?t.channelWidth=r:t.channelHeight=r}t.container=i,r&&r.main&&r.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var n=0;n<t.channels.length;n++)t.channels[n].queue[e].forEach((function(e){e.remove()}))})),r&&r.main&&r.main.data&&r.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(o):o()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){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}},{key:"addBullet",value:function(e){var t=this,n=this.danmu,i=this.channels,r=void 0,o=void 0,a=void 0;if("b2t"===t.direction?(o=this.channelWidth,a=Math.ceil(e.width/o)):(r=this.channelHeight,a=Math.ceil(e.height/r)),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,h=i.length;c<h;c++)if(i[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var f=0,d=i.length-a;f<=d;f++){s=!0;for(var p=f;p<f+a;p++){if((l=i[p]).operating.scroll){s=!1;break}if(l.bookId.scroll&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var m=g.el.getBoundingClientRect();if("b2t"===t.direction){if(m.bottom>=t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(m.right>=t.containerPos.right){s=!1,l.operating.scroll=!1;break}var v=void 0,y=g.moveV,b=void 0,_=e.moveV,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){var O=w/(_-y);if(n.config.bOffset||(n.config.bOffset=0),b+n.config.bOffset>=O){var k=b*_-t.containerPos.width;k>0&&e.updateOffset(k+(1+Math.ceil(5*Math.random())))}}}l.operating.scroll=!1}if(s){u=f;break}}else if("top"===e.mode)for(var x=0,E=i.length-a;x<=E;x++){s=!0;for(var C=x;C<x+a;C++){if(C>Math.floor(i.length/2)){s=!1;break}if((l=i[C]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=x;break}}else if("bottom"===e.mode)for(var j=i.length-a;j>=0;j--){s=!0;for(var M=j;M<j+a;M++){if(M<=Math.floor(i.length/2)){s=!1;break}if((l=i[M]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=j;break}}if(-1!==u){for(var T=u,L=u+a;T<L;T++)(l=i[T]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger&&t.logger.info(T+"号轨道恢复正常使用")),l.operating[e.mode]=!1;if(e.prior)if(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,n.player)n.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}));return e.channel_id=[u,a],e.el.setAttribute("data-line-index",u+1),"b2t"===t.direction?(e.top=u*o,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*r,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var P=0,S=-1,z=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,n){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=P&&(P=e.start,S=n,z=e)})),z){z.remove(),t.removeBullet(z),t.danmu.bulletBtn.main.queue.splice(S,1),e.channel_id=z.channel_id;for(var D=z.channel_id[0],I=z.channel_id[0]+z.channel_id[1];D<I;D++)(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;return e.top=z.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live){if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,!0)}))}else{u=-1;for(var R=0,q=i.length-a;R<=q;R++){s=!0;for(var A=R;A<R+a;A++)if(i[A].bookId[e.mode]){s=!1;break}if(s){u=R;break}}if(-1!==u){for(var U=u;U<u+a;U++)i[U].bookId[e.mode]=e.id,t.logger&&t.logger.info(U+"号轨道被"+e.id+"号优先弹幕预定");if(n.player)n.bulletBtn.main.data.some((function(n){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)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,n=e.channel_id,i=void 0,r=n[0],o=n[0]+n[1];r<o;r++)if(i=t[r]){i.operating[e.mode]=!0;var a=-1;i.queue[e.mode].some((function(t,n){return t.id===e.id&&(a=n,!0)})),a>-1&&i.queue[e.mode].splice(a,1),i.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12),n=void 0;if(e.area){var i=e.area,r=i.lines,o=i.start,a=i.end;if((0,l.validAreaLineRule)(r))n=r,"b2t"===this.direction?this.width=n*t:this.height=n*t;else if(o>=0&&a>=o){var u=a-o;"b2t"===this.direction?this.width=Math.floor(this.width*u):this.height=Math.floor(this.height*u)}}(0,s.isNumber)(n)||(n="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var c=[],h=0;h<n;h++)c[h]={id:h,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:n,channels:c}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function n(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function i(e,i){function r(n){["scroll","top"].forEach((function(i){t.channels[n].queue[i].forEach((function(t){t.el&&e[n].queue[i].push(t)}))}))}function o(n){t.channels[n].queue.bottom.forEach((function(r){if(r.el&&(e[n+e.length-t.channels.length].queue.bottom.push(r),r.channel_id[0]+r.channel_id[1]-1===n)){var o=[].concat(r.channel_id);r.channel_id=[o[0]-t.channels.length+e.length,o[1]],r.top=r.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}}))}for(var a=0;a<t.channels.length;a++)n(e,a),r(a),o(a);for(var s=function(t){["scroll","top","bottom"].forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))},l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function r(e,i){for(var r=["scroll","top","bottom"],o=function(o){n(e,o),r.forEach((function(n){if("top"===n&&o>Math.floor(e.length/2));else if("bottom"===n&&o<=Math.floor(e.length/2));else{var r="bottom"===n?o-e.length+t.channels.length:o;t.channels[r].queue[n].forEach((function(a,s){if(a.el){if(e[o].queue[n].push(a),"bottom"===n&&a.channel_id[0]+a.channel_id[1]-1===r){var l=[].concat(a.channel_id);a.channel_id=[l[0]-t.channels.length+e.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()}t.channels[r].queue[n].splice(s,1)}}))}}))},a=0;a<e.length;a++)o(a);var s=function(t){r.forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))};for(a=0;a<e.length;a++)s(a);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function o(){var e=t.danmu,n=e.container,o=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),o.main.data&&o.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var a=t._initChannels(),s=a.channelSize,l=a.channels;t.channels&&(t.channels.length<=l.length?i(l,s):r(l,s)),t.resizing=!1}t.resizing||(t.resizing=!0,e?o():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(o)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}}]),t}(a.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validAreaLineRule=function(e){return"number"==typeof e&&e>=0&&Number.isInteger(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return i(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var n in this)r.hasOwnProperty.call(this,n)&&delete this[n]}},{key:"clearElementStyle",value:function(e){var t="undefined"!=typeof window?window.navigator.userAgent:null;t&&(t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1?(0,r.styleUtil)(e,"transform","none"):e.setAttribute("style",""))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.destroyObserver=t.unObserver=t.addObserver=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=new(function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,r.throttle)((function(e){t.__trigger(e)}),100))}catch(e){}}return i(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){t[n].handler&&t[n].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());t.addObserver=function(e,t){o.addObserver(e,t)},t.unObserver=function(e,t){o.unObserver(e,t)},t.destroyObserver=function(e,t){o.destroyObserver(e,t)}},function(e,t,n){var i=n(35);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(37)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){(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}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var i,r,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=s.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,c=0,h=[],f=n(38);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=o[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(b(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(b(i.parts[a],t));o[i.id]={id:i.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function g(e,t){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=h[h.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{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 r=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,r)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,i,r,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var a=c++;n=u||(u=v(t)),i=O.bind(null,n,a,!1),r=O.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){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}(t),i=x.bind(null,n,t),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),i=k.bind(null,n),r=function(){m(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=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){for(var i=[],r=0;r<n.length;r++){var a=n[r];(s=o[a.id]).refs--,i.push(s)}e&&d(p(e,t),t);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function O(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function k(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var i=n.css,r=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||o)&&(i=f(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}}]);
//# sourceMappingURL=index.js.map

@@ -1,3 +0,3 @@

/*! Built @Mon, 13 Feb 2023 08:23:50 GMT */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["danmu.js"]=t():e["danmu.js"]=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=document.createElement(e);return o.className=i,o.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,r=n[t];"video"===e||"audio"===e?r&&o.setAttribute(i,r):o.setAttribute(i,r)})),o},t.hasClass=i,t.addClass=o,t.removeClass=r,t.toggleClass=function(e,t){t.split(/\s+/g).forEach((function(t){i(e,t)?r(e,t):o(e,t)}))},t.findDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],n=void 0;try{n=e.querySelector(t)}catch(i){t.startsWith("#")&&(n=e.getElementById(t.slice(1)))}return n},t.deepCopy=function e(t,n){if("Object"===a(n)&&"Object"===a(t))return Object.keys(n).forEach((function(i){"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]})),t},t.typeOf=a,t.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},t.attachEventListener=function(e,t,n,i){if(i)e.on(t,n),function(e,t,n,i){e.once(i,(function o(){e.off(t,n),e.off(i,o)}))}(e,t,n,i);else{e.on(t,(function i(o){n(o),e.off(t,i)}))}},t.styleUtil=function(e,t,n){var i=e.style;try{i[t]=n}catch(e){i.setProperty(t,n)}},t.styleCSSText=function(e,t){var n=e.style;try{n.cssText=t}catch(e){}},t.isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},t.throttle=function(e,t){var n=this,i=0;return function(){for(var o=arguments.length,r=Array(o),a=0;a<o;a++)r[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){return e.apply(n,r)}),t)}};t.hasOwnProperty=Object.prototype.hasOwnProperty;function i(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function o(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):i(e,t)||(e.className+=" "+t)}function r(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):i(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))}function a(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(26),a=(i=r)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return o(e,[{key:"setLogger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.logger=new a.default(e+".js")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var i=n(18)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,o=n(5),r=(i=o)&&i.__esModule?i:{default:i};n(34),t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DanmuJs=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=h(n(6)),r=n(25),a=h(n(1)),s=h(n(27)),l=h(n(32)),u=n(33),c=n(0);function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=t.DanmuJs=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),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,highScorePriority:!0};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){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),i.container=a.container&&1===a.container.nodeType?a.container:null,!i.container)return i.emit("error","container id can't be empty"),!1,f(n,!1);if(a.containerStyle){var u=a.containerStyle;Object.keys(u).forEach((function(e){i.container.style[e]=u[e]}))}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}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&(0,u.addObserver)(this.container,(function(){e.logger&&e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main.clear()}},{key:"destroy",value:function(){for(var e in(0,u.unObserver)(this.container),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn.destroy(),this.domObj.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){this.logger&&this.logger.info("sendComment: "+(e.txt||"[DOM Element]"));var t=this.main;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?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.keepPoolWatermark())}},{key:"setCommentID",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentID: oldID "+e+" newID "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.id=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentDuration: id "+e+" duration "+t),e&&t&&(t=t||5e3,this.main.data.some((function(n){return n.id===e&&(n.duration=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id "+e+" like "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.like=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.pauseMove(),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.main.status&&n.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id "+e),e){var t=this.main;if(this._releaseCtrl(e),"closed"===t.status)return;t.queue.some((function(n){return n.id===e&&("paused"!==t.status?n.startMove(!0):n.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){if(this.logger&&this.logger.info("freezeComment: id "+e),e){this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&(0,c.styleUtil)(t.el,"zIndex",10),!0)}))}}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id "+e),e){this._releaseCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.remove(),!0)})),this.main.data=this.main.data.filter((function(t){return t.id!==e}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.logger&&this.logger.info("updateComments: "+e.length+", isClear "+t);var n=this.main;"boolean"==typeof t&&t&&(n.data=[]),n.data=n.data.concat(e),n.sortData(),n.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this,n=arguments[1],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){e===t.mode&&(t.duration=n)})),this.main.queue.forEach((function(i){e===i.mode&&(i.duration=n,i.pauseMove(),"paused"!==t.main.status&&i.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",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){t===n.mode&&(n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity "+e),this.container.style.opacity=e}},{key:"setFontSize",value:function(e,t){var n=this,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){e.style&&(e.style.fontSize=n.fontSize)})),this.main.queue.forEach((function(e){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())}))),t&&(this.config.channelSize=t,i.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area "+e),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){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){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction "+e),this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}},{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";var i,o,r,a,s,l,u,c=n(7),h=n(24),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};o=function(e,t){var n,o;return h(t),o=this,i.call(this,e,n=function(){r.call(o,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return h(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},once:o,off:r=function(e,t){var n,i,o,r;if(h(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)o!==t&&o.__eeOnceListener__!==t||(2===i.length?n[e]=i[r?0:1]:i.splice(r,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,i,o,r;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,r=new Array(n-1),t=1;t<n;++t)r[t-1]=arguments[t];for(o=o.slice(),t=0;i=o[t];++t)f.call(i,this,r)}else switch(arguments.length){case 1:d.call(o,this);break;case 2:d.call(o,this,arguments[1]);break;case 3:d.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,r=new Array(n-1),t=1;t<n;++t)r[t-1]=arguments[t];f.call(o,this,r)}}},l={on:c(i),once:c(o),off:c(r),emit:c(a)},u=m({},l),e.exports=t=function(e){return null==e?p(u):m(Object(e),l)},t.methods=s},function(e,t,n){"use strict";var i=n(3),o=n(8),r=n(12),a=n(20),s=n(21);(e.exports=function(e,t){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}).gs=function(e,t,n){var l,u,c,h;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),h={get:t,set:n,configurable:l,enumerable:u},c?r(a(c),h):h}},function(e,t,n){"use strict";var i=n(9),o=/^\s*class[\s{/}]/,r=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!o.test(r.call(e))}},function(e,t,n){"use strict";var i=n(10);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){"use strict";var i=n(11);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(3),o={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(o,typeof e)}},function(e,t,n){"use strict";e.exports=n(13)()?Object.assign:n(14)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(15),o=n(19),r=Math.max;e.exports=function(e,t){var n,a,s,l=r(arguments.length,2);for(e=Object(o(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},a=1;a<l;++a)i(t=arguments[a]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(16)()?Object.keys:n(17)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(2),o=Object.keys;e.exports=function(e){return o(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(2),o=Array.prototype.forEach,r=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=r(null);return o.call(arguments,(function(e){i(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(22)()?String.prototype.contains:n(23)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e){e.exports=JSON.parse('{"version":"1.1.7"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var o="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return i(e,[{key:"info",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];o&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(i))}}]),e}();t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=s(n(1)),r=s(n(28)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(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}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"createSwitch",value:function(){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}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)a.hasOwnProperty.call(this,e)&&delete this[e]}}]),t}(o.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=l(n(1)),r=l(n(29)),a=l(n(30)),s=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(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._status="idle",(0,s.attachEventListener)(e,"bullet_remove",n.updateQueue.bind(n),"destroy"),(0,s.attachEventListener)(e,"changeDirection",(function(e){n.danmu.direction=e}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"_cancelDataHandleTimer",value:function(){this.handleId&&(clearTimeout(this.handleId),this.handleId=null),this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._cancelDataHandleTimer(),this.channel.destroy(),this.data=[],this)delete this[e]}},{key:"updateQueue",value:function(e){this.logger&&this.logger.info("updateQueue");var t=this;t.queue.some((function(n,i){return n.id===e.bullet.id&&(t.queue.splice(i,1),!0)})),t.data.some((function(t){return t.id===e.bullet.id&&(t.attached_=!1,!0)}))}},{key:"init",value:function(){var e=this;e.retryStatus="normal",e.sortData(),function t(){"closed"!==e._status||"stop"!==e.retryStatus?("playing"===e._status&&(e.readData(),e.dataHandle()),"stop"===e.retryStatus&&"paused"!==e._status||(e.handleTimer=setTimeout((function(){e.handleId=requestAnimationFrame((function(){t()}))}),250))):e._cancelDataHandleTimer()}()}},{key:"start",value:function(){this.logger&&this.logger.info("start");"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this.init())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop");"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container.innerHTML="",this.channel.reset())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel.reset(),this.data=[],this.queue=[],this.container.innerHTML=""}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))}))}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused";var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,n=this.channel,i=e.player,o=void 0,a=void 0;if(e.isReady){if(i){var l=i.currentTime?Math.floor(1e3*i.currentTime):0;a=this.data.filter((function(n){return!n.start&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&(n.start=l),!n.attached_&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&n.start-t<=l&&l<=n.start+t})),e.config.highScorePriority&&a.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.data=[])}else 0===(a=this.data.splice(0,1)).length&&(a=this.playedData.splice(0,1));if(a.length>0){n.updatePos();var u=2;e:for(var c,h=0;h<a.length;h++)if(c=a[h],this.forceDuration&&this.forceDuration!==c.duration&&(c.duration=this.forceDuration),(o=new r.default(e,c))&&!o.bulletCreateFail)if(o.attach(),c.attached_=!0,n.addBullet(o).result)this.queue.push(o),o.topInit(),u=2;else{for(var f in o.detach(),o)s.hasOwnProperty.call(o,f)&&delete o[f];if(o=null,c.attached_=!1,c.noDiscard&&(c.prior?this.data.unshift(c):this.data.push(c)),0===u)break e;u--}else{if(0===u)break e;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,n=e.player,i=this.data,o=[],r=0;if("number"==typeof t.maxCommentsLength&&i.length>t.maxCommentsLength){r=i.length-t.maxCommentsLength;for(var a,s=0;s<r;s++)(a=i[s]).prior&&!a.attached_&&o.push(i[s])}else if(t.dropStaleComments&&n&&n.currentTime){var l=Math.floor(1e3*n.currentTime)-t.interval;if(l>0)for(var u,c=0;c<i.length;c++)if((u=i[c]).prior&&!u.attached_&&o.push(i[c]),u.start>l){r=c;break}}r>0&&(i.splice(0,r),this.data=o.concat(i))}},{key:"status",get:function(){return this._status}}]),t}(o.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bullet=void 0;var i,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(1),a=(i=r)&&i.__esModule?i:{default:i},s=n(0);function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=t.Bullet=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),o=i,r=void 0,a="",u=n.style||{};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.domObj=e.domObj,n.el&&1===n.el.nodeType){if(n.el.parentNode)return l(i,{bulletCreateFail:!0});if(e.config.disableCopyDOM||n.disableCopyDOM)i.reuseDOM=!1,r=n.el;else{var c=(0,s.copyDom)(n.el);n.eventListeners&&n.eventListeners.length>0&&n.eventListeners.forEach((function(e){c.addEventListener(e.event,e.listener,e.useCapture||!1)})),(r=i.domObj.use()).childNodes.length>0&&(r.innerHTML=""),r.textContent&&(r.textContent=""),r.appendChild(c)}}else(r=i.domObj.use()).textContent=n.txt;i.onChangeDirection=function(e){o.direction=e},i.danmu.on("changeDirection",i.onChangeDirection);var h=void 0;if((0,s.isNumber)(e.config.bulletOffset)&&e.config.bulletOffset>=0)h=e.config.bulletOffset;else{var f=e.containerPos;h=f.width/10>100?100:f.width/10}var d=n.realTime?0:Math.floor(Math.random()*h),p=i.updateOffset(d,!0);return u.left=p,Object.keys(u).forEach((function(e){a+=e+":"+u[e]+";"})),(0,s.styleCSSText)(r,a),"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",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),o(t,[{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var n=this.danmu.containerPos.width+e+"px";return t||(0,s.styleUtil)(this.el,"left",this.danmu.containerPos.width+e+"px"),n}},{key:"attach",value:function(){var e=this.el;this.container.contains(e)||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))),this._onTransitionEnd=this._onTransitionEnd.bind(this),e.addEventListener("transitionend",this._onTransitionEnd,!1)}},{key:"detach",value:function(){var e=this.el;if(e){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),this.reuseDOM?this.domObj.unused(e):e.parentNode&&e.parentNode.removeChild(e),this.el=null}this.elPos=void 0,this.danmu.off("changeDirection",this.onChangeDirection)}},{key:"mouseoverFun",value:function(e){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})}},{key:"_onTransitionEnd",value:function(){this.status="end",this.remove(!1)}},{key:"topInit",value:function(){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")}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if("paused"!==t.status&&("forcedPause"!==t.status&&(this.status="paused"),t._moveV=void 0,this.el))if("scroll"===this.mode){var n=t.danmu.containerPos;if(e){var i=((new Date).getTime()-t.moveTime)/1e3,o=i*this.moveV,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")}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")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){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",(0,s.styleUtil)(this.el,"backface-visibility","hidden"),(0,s.styleUtil)(this.el,"perspective","500em"),"scroll"===this.mode){var t=this.danmu.containerPos;if("b2t"===this.direction){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}else{if(!this.el)return;var i=this.el.getBoundingClientRect(),o=i.right-t.left,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())}}else{var a=(new Date).getTime(),l=(this.startTime&&a-this.startTime>this.duration?a-this.startTime:this.duration)/1e3;(0,s.styleUtil)(this.el,"left","50%"),(0,s.styleUtil)(this.el,"margin","0 0 0 -"+this.width/2+"px"),(0,s.styleUtil)(this.el,"visibility","hidden"),(0,s.styleUtil)(this.el,"transition","visibility "+l+"s 0s"),this.pastDuration||(this.pastDuration=1),this.startTime=a}}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.logger&&this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#");var t=this;e&&t.pauseMove(),t.el&&t.el.parentNode&&(t.detach(),this.options.el&&1===this.options.el.nodeType&&this.danmu.config.disableCopyDOM&&(0,s.styleUtil)(this.options.el,"transform","none"),t.danmu.emit("bullet_remove",{bullet:t}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(n){e.style[n]=t[n]}));if(e.className="danmu-like",this.el){var n=this.el.querySelector(".danmu-like");n&&this.el.removeChild(n),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}}return e}},{key:"moveV",get:function(){var e=this._moveV;if(!e){if(this.options.moveV)e=this.options.moveV;else if(this.elPos){var t=this.danmu.containerPos;e=("b2t"===this.direction?t.height+this.height:t.width+this.width)/this.duration*1e3}e&&(e*=this.danmu.main.playRate,this._moveV=e)}return e}}]),t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(1),a=(i=r)&&i.__esModule?i:{default:i},s=n(0),l=n(31);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;return i.setLogger("channel"),i.danmu=e,i.width=0,i.height=0,i.reset(!0),i.direction=e.direction,i.channels=[],i.updatePos(),(0,s.attachEventListener)(n.danmu,"bullet_remove",(function(e){i.removeBullet(e.bullet)}),"destroy"),(0,s.attachEventListener)(n.danmu,"changeDirection",(function(e){i.direction=e}),"destroy"),(0,s.attachEventListener)(n.danmu,"channel_resize",(function(){i.resize()}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),o(t,[{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)s.hasOwnProperty.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,n=t.danmu,i=n.container,o=n.bulletBtn;function r(){var e=i.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var n=t._initChannels(),o=n.channelSize,r=n.channelCount,a=n.channels;t.channelCount=r,t.channels=a,"b2t"===t.direction?t.channelWidth=o:t.channelHeight=o}t.container=i,o&&o.main&&o.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var n=0;n<t.channels.length;n++)t.channels[n].queue[e].forEach((function(e){e.remove()}))})),o&&o.main&&o.main.data&&o.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(r):r()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){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}},{key:"addBullet",value:function(e){var t=this,n=this.danmu,i=this.channels,o=void 0,r=void 0,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,h=i.length;c<h;c++)if(i[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var f=0,d=i.length-a;f<=d;f++){s=!0;for(var p=f;p<f+a;p++){if((l=i[p]).operating.scroll){s=!1;break}if(l.bookId.scroll&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var m=g.el.getBoundingClientRect();if("b2t"===t.direction){if(m.bottom>=t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(m.right>=t.containerPos.right){s=!1,l.operating.scroll=!1;break}var v=void 0,y=g.moveV,b=void 0,_=e.moveV,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){var O=w/(_-y);if(n.config.bOffset||(n.config.bOffset=0),b+n.config.bOffset>=O){var k=b*_-t.containerPos.width;k>0&&e.updateOffset(k+(1+Math.ceil(5*Math.random())))}}}l.operating.scroll=!1}if(s){u=f;break}}else if("top"===e.mode)for(var x=0,C=i.length-a;x<=C;x++){s=!0;for(var j=x;j<x+a;j++){if(j>Math.floor(i.length/2)){s=!1;break}if((l=i[j]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=x;break}}else if("bottom"===e.mode)for(var E=i.length-a;E>=0;E--){s=!0;for(var M=E;M<E+a;M++){if(M<=Math.floor(i.length/2)){s=!1;break}if((l=i[M]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=E;break}}if(-1!==u){for(var T=u,L=u+a;T<L;T++)(l=i[T]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger&&t.logger.info(T+"号轨道恢复正常使用")),l.operating[e.mode]=!1;if(e.prior)if(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,n.player)n.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}));return e.channel_id=[u,a],e.el.setAttribute("data-line-index",u+1),"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"}}if(e.options.realTime){var P=0,S=-1,z=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,n){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=P&&(P=e.start,S=n,z=e)})),z){z.remove(),t.removeBullet(z),t.danmu.bulletBtn.main.queue.splice(S,1),e.channel_id=z.channel_id;for(var D=z.channel_id[0],I=z.channel_id[0]+z.channel_id[1];D<I;D++)(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;return e.top=z.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live){if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,!0)}))}else{u=-1;for(var R=0,q=i.length-a;R<=q;R++){s=!0;for(var A=R;A<R+a;A++)if(i[A].bookId[e.mode]){s=!1;break}if(s){u=R;break}}if(-1!==u){for(var U=u;U<u+a;U++)i[U].bookId[e.mode]=e.id,t.logger&&t.logger.info(U+"号轨道被"+e.id+"号优先弹幕预定");if(n.player)n.bulletBtn.main.data.some((function(n){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)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,n=e.channel_id,i=void 0,o=n[0],r=n[0]+n[1];o<r;o++)if(i=t[o]){i.operating[e.mode]=!0;var a=-1;i.queue[e.mode].some((function(t,n){return t.id===e.id&&(a=n,!0)})),a>-1&&i.queue[e.mode].splice(a,1),i.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12),n=void 0;if(e.area){var i=e.area,o=i.lines,r=i.start,a=i.end;if((0,l.validAreaLineRule)(o))n=o,"b2t"===this.direction?this.width=n*t:this.height=n*t;else if(r>=0&&a>=r){var u=a-r;"b2t"===this.direction?this.width=Math.floor(this.width*u):this.height=Math.floor(this.height*u)}}(0,s.isNumber)(n)||(n="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var c=[],h=0;h<n;h++)c[h]={id:h,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:n,channels:c}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function n(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function i(e,i){function o(n){["scroll","top"].forEach((function(i){t.channels[n].queue[i].forEach((function(t){t.el&&e[n].queue[i].push(t)}))}))}function r(n){t.channels[n].queue.bottom.forEach((function(o){if(o.el&&(e[n+e.length-t.channels.length].queue.bottom.push(o),o.channel_id[0]+o.channel_id[1]-1===n)){var r=[].concat(o.channel_id);o.channel_id=[r[0]-t.channels.length+e.length,r[1]],o.top=o.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(o.top+=t.containerHeight*t.danmu.config.area.start),o.topInit()}}))}for(var a=0;a<t.channels.length;a++)n(e,a),o(a),r(a);for(var s=function(t){["scroll","top","bottom"].forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))},l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function o(e,i){for(var o=["scroll","top","bottom"],r=function(r){n(e,r),o.forEach((function(n){if("top"===n&&r>Math.floor(e.length/2));else if("bottom"===n&&r<=Math.floor(e.length/2));else{var o="bottom"===n?r-e.length+t.channels.length:r;t.channels[o].queue[n].forEach((function(a,s){if(a.el){if(e[r].queue[n].push(a),"bottom"===n&&a.channel_id[0]+a.channel_id[1]-1===o){var l=[].concat(a.channel_id);a.channel_id=[l[0]-t.channels.length+e.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()}t.channels[o].queue[n].splice(s,1)}}))}}))},a=0;a<e.length;a++)r(a);var s=function(t){o.forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))};for(a=0;a<e.length;a++)s(a);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function r(){var e=t.danmu,n=e.container,r=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),r.main.data&&r.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var a=t._initChannels(),s=a.channelSize,l=a.channels;t.channels&&(t.channels.length<=l.length?i(l,s):o(l,s)),t.resizing=!1}t.resizing||(t.resizing=!0,e?r():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(r)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}}]),t}(a.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validAreaLineRule=function(e){return"number"==typeof e&&e>=0&&Number.isInteger(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0);var r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return i(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var n in this)o.hasOwnProperty.call(this,n)&&delete this[n]}},{key:"clearElementStyle",value:function(e){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",""))}}]),e}();t.default=r,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.destroyObserver=t.unObserver=t.addObserver=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(0);var r=new(function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,o.throttle)((function(e){t.__trigger(e)}),100))}catch(e){}}return i(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,o=0;o<n.length;o++)n[o]&&e===n[o].target&&(i=o);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){t[n].handler&&t[n].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());t.addObserver=function(e,t){r.addObserver(e,t)},t.unObserver=function(e,t){r.unObserver(e,t)},t.destroyObserver=function(e,t){r.destroyObserver(e,t)}},function(e,t,n){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)},function(e,t,n){(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}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),r=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(r).concat([o]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},o=0;o<this.length;o++){var r=this[o][0];"number"==typeof r&&(i[r]=!0)}for(o=0;o<e.length;o++){var a=e[o];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var i,o,r={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=i.apply(this,arguments)),o}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=s.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,c=0,h=[],f=n(38);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=r[i.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](i.parts[a]);for(;a<i.parts.length;a++)o.parts.push(b(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(b(i.parts[a],t));r[i.id]={id:i.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],i={},o=0;o<e.length;o++){var r=e[o],a=t.base?r[0]+t.base:r[0],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]})}return n}function g(e,t){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=h[h.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{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)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,i,o,r;if(t.transform&&e.css){if(!(r=t.transform(e.css)))return function(){};e.css=r}if(t.singleton){var a=c++;n=u||(u=v(t)),i=O.bind(null,n,a,!1),o=O.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){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}(t),i=x.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),i=k.bind(null,n),o=function(){m(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=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){for(var i=[],o=0;o<n.length;o++){var a=n[o];(s=r[a.id]).refs--,i.push(s)}e&&d(p(e,t),t);for(o=0;o<i.length;o++){var s;if(0===(s=i[o]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete r[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function O(e,t,n,i){var o=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=w(t,o);else{var r=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}function k(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var i=n.css,o=n.sourceMap,r=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||r)&&(i=f(i)),o&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var o,r=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?e:(o=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:i+r.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}}])}));
/*! Built @Thu, 23 Feb 2023 11:41:38 GMT */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["danmu.js"]=t():e["danmu.js"]=t()}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},t.hasClass=i,t.addClass=r,t.removeClass=o,t.toggleClass=function(e,t){t.split(/\s+/g).forEach((function(t){i(e,t)?o(e,t):r(e,t)}))},t.findDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments[1],n=void 0;try{n=e.querySelector(t)}catch(i){t.startsWith("#")&&(n=e.getElementById(t.slice(1)))}return n},t.deepCopy=function e(t,n){if("Object"===a(n)&&"Object"===a(t))return Object.keys(n).forEach((function(i){"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]})),t},t.typeOf=a,t.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},t.attachEventListener=function(e,t,n,i){if(i)e.on(t,n),function(e,t,n,i){e.once(i,(function r(){e.off(t,n),e.off(i,r)}))}(e,t,n,i);else{e.on(t,(function i(r){n(r),e.off(t,i)}))}},t.styleUtil=function(e,t,n){var i=e.style;try{i[t]=n}catch(e){i.setProperty(t,n)}},t.styleCSSText=function(e,t){var n=e.style;try{n.cssText=t}catch(e){}},t.isNumber=function(e){return"number"==typeof e&&!Number.isNaN(e)},t.throttle=function(e,t){var n=this,i=0;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];clearTimeout(i),i=setTimeout((function(){return e.apply(n,o)}),t)}};t.hasOwnProperty=Object.prototype.hasOwnProperty;function i(e,t){return e.classList?Array.prototype.some.call(e.classList,(function(e){return e===t})):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function r(e,t){e.classList?t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)})):i(e,t)||(e.className+=" "+t)}function o(e,t){e.classList?t.split(/\s+/g).forEach((function(t){e.classList.remove(t)})):i(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}))}function a(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(26),a=(i=o)&&i.__esModule?i:{default:i};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return r(e,[{key:"setLogger",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.logger=new a.default(e+".js")}}]),e}();t.default=s,e.exports=t.default},function(e,t,n){"use strict";var i=n(18)();e.exports=function(e){return e!==i&&null!==e}},function(e,t,n){"use strict";e.exports=function(e){return null!=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=n(5),o=(i=r)&&i.__esModule?i:{default:i};n(34),t.default=o.default,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DanmuJs=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=h(n(6)),o=n(25),a=h(n(1)),s=h(n(27)),l=h(n(32)),u=n(33),c=n(0);function h(e){return e&&e.__esModule?e:{default:e}}function f(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var d=t.DanmuJs=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;i.setLogger("danmu"),i.logger&&i.logger.info("danmu.js version: "+o.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,highScorePriority:!0};if((0,c.deepCopy)(a,e),(0,r.default)(i),i.hideArr=[],i.domObj=new l.default,i.freezeId=null,a.comments.forEach((function(e){e.duration=e.duration?e.duration:5e3,e.mode||(e.mode="scroll")})),i.container=a.container&&1===a.container.nodeType?a.container:null,!i.container)return i.emit("error","container id can't be empty"),!1,f(n,!1);if(a.containerStyle){var u=a.containerStyle;Object.keys(u).forEach((function(e){i.container.style[e]=u[e]}))}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}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"addResizeObserver",value:function(){var e=this;this.config.needResizeObserver&&(0,u.addObserver)(this.container,(function(){e.logger&&e.logger.info("needResizeObserver"),e.resize()}))}},{key:"start",value:function(){this.logger&&this.logger.info("start"),this.main.start()}},{key:"pause",value:function(){this.logger&&this.logger.info("pause"),this.main.pause()}},{key:"play",value:function(){this.logger&&this.logger.info("play"),this.main.play()}},{key:"stop",value:function(){this.logger&&this.logger.info("stop"),this.main.stop()}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.main.clear()}},{key:"destroy",value:function(){for(var e in(0,u.unObserver)(this.container),this.logger&&this.logger.info("destroy"),this.stop(),this.bulletBtn.destroy(),this.domObj.destroy(),this)delete this[e];this.emit("destroy")}},{key:"sendComment",value:function(e){this.logger&&this.logger.info("sendComment: "+(e.txt||"[DOM Element]"));var t=this.main;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?(t.data.unshift(e),e.realTime&&(t.readData(),t.dataHandle())):t.data.push(e),t.keepPoolWatermark())}},{key:"setCommentID",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentID: oldID "+e+" newID "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.id=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.id=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentDuration",value:function(e,t){var n=this;this.logger&&this.logger.info("setCommentDuration: id "+e+" duration "+t),e&&t&&(t=t||5e3,this.main.data.some((function(n){return n.id===e&&(n.duration=t,!0)})),this.main.queue.some((function(i){return i.id===e&&(i.duration=t,i.pauseMove(),"paused"!==n.main.status&&i.startMove(),!0)})))}},{key:"setCommentLike",value:function(e,t){this.logger&&this.logger.info("setCommentLike: id "+e+" like "+t),e&&t&&(this.main.data.some((function(n){return n.id===e&&(n.like=t,!0)})),this.main.queue.some((function(n){return n.id===e&&(n.pauseMove(),n.setLikeDom(t.el,t.style),"paused"!==n.danmu.main.status&&n.startMove(),!0)})))}},{key:"restartComment",value:function(e){if(this.logger&&this.logger.info("restartComment: id "+e),e){var t=this.main;if(this._releaseCtrl(e),"closed"===t.status)return;t.queue.some((function(n){return n.id===e&&("paused"!==t.status?n.startMove(!0):n.status="paused",!0)}))}}},{key:"_releaseCtrl",value:function(e){this.freezeId&&e===this.freezeId&&(this.mouseControl=!1,this.freezeId=null)}},{key:"_freezeCtrl",value:function(e){this.mouseControl=!0,this.freezeId=e}},{key:"freezeComment",value:function(e){if(this.logger&&this.logger.info("freezeComment: id "+e),e){this._freezeCtrl(e),this.main.queue.some((function(t){return t.id===e&&(t.status="forcedPause",t.pauseMove(),t.el&&t.el.style&&(0,c.styleUtil)(t.el,"zIndex",10),!0)}))}}},{key:"removeComment",value:function(e){if(this.logger&&this.logger.info("removeComment: id "+e),e){var t=this;t._releaseCtrl(e),t.main.queue.some((function(t){return t.id===e&&(t.remove(),!0)})),t.main.data=t.main.data.filter((function(n){var i=n.id!==e;return i||t.main.dataElHandle([n]),i}))}}},{key:"updateComments",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.logger&&this.logger.info("updateComments: "+e.length+", isClear "+t);var n=this.main;"boolean"==typeof t&&t&&(n.dataElHandle(n.data),n.data=[]),n.data=n.data.concat(e),n.sortData(),n.keepPoolWatermark()}},{key:"setAllDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",t=this,n=arguments[1],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){e===t.mode&&(t.duration=n)})),this.main.queue.forEach((function(i){e===i.mode&&(i.duration=n,i.pauseMove(),"paused"!==t.main.status&&i.startMove())})))}},{key:"setPlayRate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll",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){t===n.mode&&(n.pauseMove(),"paused"!==e.main.status&&n.startMove())})))}},{key:"setOpacity",value:function(e){this.logger&&this.logger.info("setOpacity: opacity "+e),this.container.style.opacity=e}},{key:"setFontSize",value:function(e,t){var n=this,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){e.style&&(e.style.fontSize=n.fontSize)})),this.main.queue.forEach((function(e){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())}))),t&&(this.config.channelSize=t,i.reflow&&this.main.channel.resizeSync())}},{key:"setArea",value:function(e){this.logger&&this.logger.info("setArea: area "+e),this.config.area=e,!1!==e.reflow&&this.main.channel.resizeSync()}},{key:"hide",value:function(){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){return e===t.mode||"color"===e&&t.color}));t.forEach((function(e){return e.remove()}))}},{key:"show",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scroll";this.logger&&this.logger.info("show: mode "+e);var t=this.hideArr.indexOf(e);t>-1&&this.hideArr.splice(t,1)}},{key:"setDirection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"r2l";this.logger&&this.logger.info("setDirection: direction "+e),this.emit("changeDirection",e)}},{key:"resize",value:function(){this.logger&&this.logger.info("resize"),this.emit("channel_resize")}},{key:"status",get:function(){return this.main.status}},{key:"state",get:function(){var e=this.main;return{status:e.status,comments:e.data,bullets:e.queue,displayArea:e.channel.getRealOccupyArea()}}},{key:"containerPos",get:function(){return this.main.channel.containerPos}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";var i,r,o,a,s,l,u,c=n(7),h=n(24),f=Function.prototype.apply,d=Function.prototype.call,p=Object.create,g=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};r=function(e,t){var n,r;return h(t),r=this,i.call(this,e,n=function(){o.call(r,e,n),f.call(t,this,arguments)}),n.__eeOnceListener__=t,this},s={on:i=function(e,t){var n;return h(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},once:r,off:o=function(e,t){var n,i,r,o;if(h(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(i=n[e]))for(o=0;r=i[o];++o)r!==t&&r.__eeOnceListener__!==t||(2===i.length?n[e]=i[o?0:1]:i.splice(o,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},emit:a=function(e){var t,n,i,r,o;if(v.call(this,"__ee__")&&(r=this.__ee__[e]))if("object"==typeof r){for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];for(r=r.slice(),t=0;i=r[t];++t)f.call(i,this,o)}else switch(arguments.length){case 1:d.call(r,this);break;case 2:d.call(r,this,arguments[1]);break;case 3:d.call(r,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),t=1;t<n;++t)o[t-1]=arguments[t];f.call(r,this,o)}}},l={on:c(i),once:c(r),off:c(o),emit:c(a)},u=m({},l),e.exports=t=function(e){return null==e?p(u):m(Object(e),l)},t.methods=s},function(e,t,n){"use strict";var i=n(3),r=n(8),o=n(12),a=n(20),s=n(21);(e.exports=function(e,t){var n,r,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"),r=s.call(e,"e"),l=s.call(e,"w")):(n=l=!0,r=!1),c={value:t,configurable:n,enumerable:r,writable:l},u?o(a(u),c):c}).gs=function(e,t,n){var l,u,c,h;return"string"!=typeof e?(c=n,n=t,t=e,e=null):c=arguments[3],i(t)?r(t)?i(n)?r(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),h={get:t,set:n,configurable:l,enumerable:u},c?o(a(c),h):h}},function(e,t,n){"use strict";var i=n(9),r=/^\s*class[\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!r.test(o.call(e))}},function(e,t,n){"use strict";var i=n(10);e.exports=function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){"use strict";var i=n(11);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(3),r={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(r,typeof e)}},function(e,t,n){"use strict";e.exports=n(13)()?Object.assign:n(14)},function(e,t,n){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},function(e,t,n){"use strict";var i=n(15),r=n(19),o=Math.max;e.exports=function(e,t){var n,a,s,l=o(arguments.length,2);for(e=Object(r(e)),s=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},a=1;a<l;++a)i(t=arguments[a]).forEach(s);if(void 0!==n)throw n;return e}},function(e,t,n){"use strict";e.exports=n(16)()?Object.keys:n(17)},function(e,t,n){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,n){"use strict";var i=n(2),r=Object.keys;e.exports=function(e){return r(i(e)?Object(e):e)}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){"use strict";var i=n(2);e.exports=function(e){if(!i(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){"use strict";var i=n(2),r=Array.prototype.forEach,o=Object.create,a=function(e,t){var n;for(n in e)t[n]=e[n]};e.exports=function(e){var t=o(null);return r.call(arguments,(function(e){i(e)&&a(Object(e),t)})),t}},function(e,t,n){"use strict";e.exports=n(22)()?String.prototype.contains:n(23)},function(e,t,n){"use strict";var i="razdwatrzy";e.exports=function(){return"function"==typeof i.contains&&(!0===i.contains("dwa")&&!1===i.contains("foo"))}},function(e,t,n){"use strict";var i=String.prototype.indexOf;e.exports=function(e){return i.call(this,e,arguments[1])>-1}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},function(e){e.exports=JSON.parse('{"version":"1.1.8-0"}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r="undefined"!=typeof window&&window.location.href.indexOf("danmu-debug")>-1,o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructorName=t||""}return i(e,[{key:"info",value:function(e){for(var t,n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r&&(t=console).log.apply(t,["[Danmu Log]["+this.constructorName+"]",e].concat(i))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=s(n(1)),o=s(n(28)),a=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.setLogger("control"),n.danmu=e,n.main=new o.default(e),e.config.defaultOff||n.main.start(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"createSwitch",value:function(){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}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.main.destroy(),this)a.hasOwnProperty.call(this,e)&&delete this[e]}}]),t}(r.default);t.default=l,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=l(n(1)),o=l(n(29)),a=l(n(30)),s=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(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._status="idle",(0,s.attachEventListener)(e,"bullet_remove",n.updateQueue.bind(n),"destroy"),(0,s.attachEventListener)(e,"changeDirection",(function(e){n.danmu.direction=e}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),i(t,[{key:"_cancelDataHandleTimer",value:function(){this.handleId&&(clearTimeout(this.handleId),this.handleId=null),this.handleTimer&&(clearTimeout(this.handleTimer),this.handleTimer=null)}},{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this._cancelDataHandleTimer(),this.channel.destroy(),this.dataElHandle(this.data),this.data=[],this)delete this[e]}},{key:"updateQueue",value:function(e){this.logger&&this.logger.info("updateQueue");var t=this;t.queue.some((function(n,i){return n.id===e.bullet.id&&(t.queue.splice(i,1),!0)})),t.data.some((function(t){return t.id===e.bullet.id&&(t.attached_=!1,!0)}))}},{key:"init",value:function(){var e=this;e.retryStatus="normal",e.sortData(),function t(){"closed"!==e._status||"stop"!==e.retryStatus?("playing"===e._status&&(e.readData(),e.dataHandle()),"stop"===e.retryStatus&&"paused"!==e._status||(e.handleTimer=setTimeout((function(){e.handleId=requestAnimationFrame((function(){t()}))}),250))):e._cancelDataHandleTimer()}()}},{key:"start",value:function(){this.logger&&this.logger.info("start");"playing"!==this._status&&(this._status="playing",this.queue=[],this.container.innerHTML="",this.channel.reset(),this.init())}},{key:"stop",value:function(){this.logger&&this.logger.info("stop");"closed"!==this._status&&(this._status="closed",this.retryStatus="stop",this.queue=[],this.container.innerHTML="",this.channel.reset())}},{key:"clear",value:function(){this.logger&&this.logger.info("clear"),this.channel.reset(),this.dataElHandle(this.data),this.data=[],this.queue=[],this.container.innerHTML=""}},{key:"play",value:function(){var e=this;if("closed"!==this._status){this.logger&&this.logger.info("play"),this._status="playing";var t=this.channel.channels;t&&t.length>0&&["scroll","top","bottom"].forEach((function(n){e.queue.forEach((function(e){e.startMove(),e.resized=!0}));for(var i=0;i<t.length;i++)t[i].queue[n].forEach((function(e){e.resized=!1}))}))}else this.logger&&this.logger.info("play ignored")}},{key:"pause",value:function(){if("closed"!==this._status){this.logger&&this.logger.info("pause"),this._status="paused";var e=this.channel.channels;e&&e.length>0&&this.queue.forEach((function(e){e.pauseMove()}))}else this.logger&&this.logger.info("pause ignored")}},{key:"dataHandle",value:function(){"paused"!==this._status&&"closed"!==this._status&&this.queue.length&&this.queue.forEach((function(e){"waiting"===e.status&&e.startMove()}))}},{key:"readData",value:function(){var e=this.danmu,t=this.interval,n=this.channel,i=e.player,r=void 0,a=void 0;if(e.isReady){if(i){var l=i.currentTime?Math.floor(1e3*i.currentTime):0;a=this.data.filter((function(n){return!n.start&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&(n.start=l),!n.attached_&&e.hideArr.indexOf(n.mode)<0&&(!n.color||e.hideArr.indexOf("color")<0)&&n.start-t<=l&&l<=n.start+t})),e.config.highScorePriority&&a.sort((function(e,t){return t.prior&&!e.prior||(t.score||-1)-(e.score||-1)})),e.live&&(this.dataElHandle(this.data),this.data=[])}else 0===(a=this.data.splice(0,1)).length&&(a=this.playedData.splice(0,1));if(a.length>0){n.updatePos();var u=2;e:for(var c,h=0;h<a.length;h++)if(c=a[h],this.forceDuration&&this.forceDuration!==c.duration&&(c.duration=this.forceDuration),(r=new o.default(e,c))&&!r.bulletCreateFail)if(r.attach(),c.attached_=!0,n.addBullet(r).result)this.queue.push(r),r.topInit(),u=2;else{for(var f in r.detach(),r)s.hasOwnProperty.call(r,f)&&delete r[f];if(r=null,c.attached_=!1,c.noDiscard&&(c.prior?this.data.unshift(c):this.data.push(c)),0===u)break e;u--}else{if(0===u)break e;u--}}}}},{key:"sortData",value:function(){this.data.sort((function(e,t){return(e.start||-1)-(t.start||-1)}))}},{key:"keepPoolWatermark",value:function(){var e=this.danmu,t=e.config,n=e.player,i=this.data,r=[],o=0;if("number"==typeof t.maxCommentsLength&&i.length>t.maxCommentsLength){o=i.length-t.maxCommentsLength;for(var a,s=0;s<o;s++)(a=i[s]).prior&&!a.attached_&&r.push(i[s])}else if(t.dropStaleComments&&n&&n.currentTime){var l=Math.floor(1e3*n.currentTime)-t.interval;if(l>0)for(var u,c=0;c<i.length;c++)if((u=i[c]).prior&&!u.attached_&&r.push(i[c]),u.start>l){o=c;break}}o>0&&(this.dataElHandle(i,0,o),i.splice(0,o),this.data=r.concat(i))}},{key:"dataElHandle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2];if(Number.isNaN(n))n=e.length;else if(n>e.length)throw"dataElHandle invalid range: "+t+"-"+n;for(var i=t;i<n;i++){var r=e[i];if(r&&"function"==typeof r.onElDestroy)try{r.onElDestroy(r),r.onElDestroy=null}catch(e){console.error("danmu onElDestroy fail:",e)}}}},{key:"status",get:function(){return this._status}}]),t}(r.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Bullet=void 0;var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0);function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var u=t.Bullet=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i,o=void 0,a="",u=n.style||{};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.domObj=e.domObj,n.el&&1===n.el.nodeType){if(n.el.parentNode)return l(i,{bulletCreateFail:!0});if(e.config.disableCopyDOM||n.disableCopyDOM)i.reuseDOM=!1,o=n.el;else{var c=(0,s.copyDom)(n.el);n.eventListeners&&n.eventListeners.length>0&&n.eventListeners.forEach((function(e){c.addEventListener(e.event,e.listener,e.useCapture||!1)})),(o=i.domObj.use()).childNodes.length>0&&(o.innerHTML=""),o.textContent&&(o.textContent=""),o.appendChild(c)}}else(o=i.domObj.use()).textContent=n.txt;i.onChangeDirection=function(e){r.direction=e},i.danmu.on("changeDirection",i.onChangeDirection);var h=void 0;if((0,s.isNumber)(e.config.bulletOffset)&&e.config.bulletOffset>=0)h=e.config.bulletOffset;else{var f=e.containerPos;h=f.width/10>100?100:f.width/10}var d=n.realTime?0:Math.floor(Math.random()*h),p=i.updateOffset(d,!0);return u.left=p,Object.keys(u).forEach((function(e){var t=e.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));a+=t+":"+u[e]+";"})),(0,s.styleCSSText)(o,a),"top"===n.mode||"bottom"===n.mode?i.mode=n.mode:i.mode="scroll",i.el=o,n.like&&n.like.el&&i.setLikeDom(n.like.el,n.like.style),i.status="waiting",i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"updateOffset",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.random=e;var n=this.danmu.containerPos.width+e+"px";return t||(0,s.styleUtil)(this.el,"left",this.danmu.containerPos.width+e+"px"),n}},{key:"attach",value:function(){var e=this.el;this.container.contains(e)||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))),this._onTransitionEnd=this._onTransitionEnd.bind(this),e.addEventListener("transitionend",this._onTransitionEnd,!1)}},{key:"detach",value:function(){var e=this.el;if(e){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),this.reuseDOM?this.domObj.unused(e):e.parentNode&&e.parentNode.removeChild(e),this.el=null}this.elPos=void 0,this.danmu.off("changeDirection",this.onChangeDirection)}},{key:"mouseoverFun",value:function(e){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})}},{key:"_onTransitionEnd",value:function(){this.status="end",this.remove(!1)}},{key:"topInit",value:function(){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")}},{key:"pauseMove",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if("paused"!==t.status&&("forcedPause"!==t.status&&(this.status="paused"),t._moveV=void 0,this.el))if("scroll"===this.mode){var n=t.danmu.containerPos;if(e){var i=((new Date).getTime()-t.moveTime)/1e3,r=i*this.moveV,o=0;o=t.moveMoreS-r>=0?"b2t"===this.direction?(t.moveMoreS-r)/t.moveContainerHeight*n.height:(t.moveMoreS-r)/t.moveContainerWidth*n.width:t.moveMoreS-r,"b2t"===this.direction?(0,s.styleUtil)(this.el,"transform","translateX(-"+this.top+"px) translateY("+o+"px) translateZ(0px) rotate(90deg)"):(0,s.styleUtil)(this.el,"left",o+"px")}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")}else this.pastDuration&&this.startTime?this.pastDuration=this.pastDuration+(new Date).getTime()-this.startTime:this.pastDuration=1}},{key:"startMove",value:function(e){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",(0,s.styleUtil)(this.el,"backface-visibility","hidden"),(0,s.styleUtil)(this.el,"perspective","500em"),"scroll"===this.mode){var t=this.danmu.containerPos;if("b2t"===this.direction){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}else{if(!this.el)return;var i=this.el.getBoundingClientRect(),r=i.right-t.left,o=r/this.moveV;i.right>t.left?((0,s.styleUtil)(this.el,"transition","transform "+o+"s linear 0s"),(0,s.styleUtil)(this.el,"transform","translateX(-"+r+"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())}}else{var a=(new Date).getTime(),l=(this.startTime&&a-this.startTime>this.duration?a-this.startTime:this.duration)/1e3;(0,s.styleUtil)(this.el,"left","50%"),(0,s.styleUtil)(this.el,"margin","0 0 0 -"+this.width/2+"px"),(0,s.styleUtil)(this.el,"visibility","hidden"),(0,s.styleUtil)(this.el,"transition","visibility "+l+"s 0s"),this.pastDuration||(this.pastDuration=1),this.startTime=a}}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.logger&&this.logger.info("remove #"+(this.options.txt||"[DOM Element]")+"#");var t=this;e&&t.pauseMove(),t.el&&t.el.parentNode&&(t.detach(),this.options.el&&1===this.options.el.nodeType&&this.danmu.config.disableCopyDOM&&(0,s.styleUtil)(this.options.el,"transform","none"),t.danmu.emit("bullet_remove",{bullet:t}))}},{key:"setFontSize",value:function(e){this.el&&(this.el.style.fontSize=e)}},{key:"setLikeDom",value:function(e,t){if(e){Object.keys(t).forEach((function(n){e.style[n]=t[n]}));if(e.className="danmu-like",this.el){var n=this.el.querySelector(".danmu-like");n&&this.el.removeChild(n),this.el.innerHTML=""+this.el.innerHTML+e.outerHTML}}return e}},{key:"moveV",get:function(){var e=this._moveV;if(!e){if(this.options.moveV)e=this.options.moveV;else if(this.elPos){var t=this.danmu.containerPos;e=("b2t"===this.direction?t.height+this.height:t.width+this.width)/this.duration*1e3}e&&(e*=this.danmu.main.playRate,this._moveV=e)}return e}}]),t}(a.default);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),o=n(1),a=(i=o)&&i.__esModule?i:{default:i},s=n(0),l=n(31);var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;return i.setLogger("channel"),i.danmu=e,i.width=0,i.height=0,i.reset(!0),i.direction=e.direction,i.channels=[],i.updatePos(),(0,s.attachEventListener)(n.danmu,"bullet_remove",(function(e){i.removeBullet(e.bullet)}),"destroy"),(0,s.attachEventListener)(n.danmu,"changeDirection",(function(e){i.direction=e}),"destroy"),(0,s.attachEventListener)(n.danmu,"channel_resize",(function(){i.resize()}),"destroy"),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+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)}(t,e),r(t,[{key:"destroy",value:function(){for(var e in this.logger&&this.logger.info("destroy"),this.channels.splice(0,this.channels.length),this._cancelResizeTimer(),this)s.hasOwnProperty.call(this,e)&&delete this[e]}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("reset");var t=this,n=t.danmu,i=n.container,r=n.bulletBtn;function o(){var e=i.getBoundingClientRect();t.width=e.width,t.height=e.height,t.resetId&&(cancelAnimationFrame(t.resetId),t.resetId=null);var n=t._initChannels(),r=n.channelSize,o=n.channelCount,a=n.channels;t.channelCount=o,t.channels=a,"b2t"===t.direction?t.channelWidth=r:t.channelHeight=r}t.container=i,r&&r.main&&r.main.queue.forEach((function(e){e.remove()})),t.channels&&t.channels.length>0&&["scroll","top","bottom"].forEach((function(e){for(var n=0;n<t.channels.length;n++)t.channels[n].queue[e].forEach((function(e){e.remove()}))})),r&&r.main&&r.main.data&&r.main.data.forEach((function(e){e.attached_=!1})),e?this.resetId=requestAnimationFrame(o):o()}},{key:"getRealOccupyArea",value:function(){return{width:this.width,height:this.height}}},{key:"updatePos",value:function(){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}},{key:"addBullet",value:function(e){var t=this,n=this.danmu,i=this.channels,r=void 0,o=void 0,a=void 0;if("b2t"===t.direction?(o=this.channelWidth,a=Math.ceil(e.width/o)):(r=this.channelHeight,a=Math.ceil(e.height/r)),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,h=i.length;c<h;c++)if(i[c].queue[e.mode].some((function(t){return t.id===e.id})))return{result:!1,message:"exited, channelOrder="+c+",danmu_id="+e.id};if("scroll"===e.mode)for(var f=0,d=i.length-a;f<=d;f++){s=!0;for(var p=f;p<f+a;p++){if((l=i[p]).operating.scroll){s=!1;break}if(l.bookId.scroll&&l.bookId.scroll!==e.id){s=!1;break}l.operating.scroll=!0;var g=l.queue.scroll[0];if(g){var m=g.el.getBoundingClientRect();if("b2t"===t.direction){if(m.bottom>=t.containerPos.bottom){s=!1,l.operating.scroll=!1;break}}else if(m.right>=t.containerPos.right){s=!1,l.operating.scroll=!1;break}var v=void 0,y=g.moveV,b=void 0,_=e.moveV,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){var O=w/(_-y);if(n.config.bOffset||(n.config.bOffset=0),b+n.config.bOffset>=O){var k=b*_-t.containerPos.width;k>0&&e.updateOffset(k+(1+Math.ceil(5*Math.random())))}}}l.operating.scroll=!1}if(s){u=f;break}}else if("top"===e.mode)for(var x=0,E=i.length-a;x<=E;x++){s=!0;for(var C=x;C<x+a;C++){if(C>Math.floor(i.length/2)){s=!1;break}if((l=i[C]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=x;break}}else if("bottom"===e.mode)for(var j=i.length-a;j>=0;j--){s=!0;for(var M=j;M<j+a;M++){if(M<=Math.floor(i.length/2)){s=!1;break}if((l=i[M]).operating[e.mode]){s=!1;break}if((l.bookId[e.mode]||e.prior)&&l.bookId[e.mode]!==e.id){s=!1;break}if(l.operating[e.mode]=!0,l.queue[e.mode].length>0){s=!1,l.operating[e.mode]=!1;break}l.operating[e.mode]=!1}if(s){u=j;break}}if(-1!==u){for(var T=u,L=u+a;T<L;T++)(l=i[T]).operating[e.mode]=!0,l.queue[e.mode].unshift(e),e.prior&&(delete l.bookId[e.mode],t.logger&&t.logger.info(T+"号轨道恢复正常使用")),l.operating[e.mode]=!1;if(e.prior)if(t.logger&&t.logger.info(e.id+"号优先弹幕运行完毕"),delete e.bookChannelId,n.player)n.bulletBtn.main.data.some((function(t){return t.id===e.id&&(delete t.bookChannelId,!0)}));return e.channel_id=[u,a],e.el.setAttribute("data-line-index",u+1),"b2t"===t.direction?(e.top=u*o,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerWidth*t.danmu.config.area.start)):(e.top=u*r,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start)),{result:e,message:"success"}}if(e.options.realTime){var P=0,S=-1,z=null;if(t.danmu.bulletBtn.main.queue.forEach((function(e,n){!e.prior&&!e.options.realTime&&e.el&&e.el.getBoundingClientRect().left>t.containerPos.right&&e.start>=P&&(P=e.start,S=n,z=e)})),z){z.remove(),t.removeBullet(z),t.danmu.bulletBtn.main.queue.splice(S,1),e.channel_id=z.channel_id;for(var D=z.channel_id[0],I=z.channel_id[0]+z.channel_id[1];D<I;D++)(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;return e.top=z.top,t.danmu.config.area&&t.danmu.config.area.start&&(e.top+=t.containerHeight*t.danmu.config.area.start),{result:e,message:"success"}}}if(e.prior)if(e.bookChannelId||t.danmu.live){if(n.player)n.bulletBtn.main.data.some((function(n){return n.id===e.id&&(t.logger&&t.logger.info(e.id+"号优先弹幕将于2秒后再次请求注册"),n.start+=2e3,!0)}))}else{u=-1;for(var R=0,q=i.length-a;R<=q;R++){s=!0;for(var A=R;A<R+a;A++)if(i[A].bookId[e.mode]){s=!1;break}if(s){u=R;break}}if(-1!==u){for(var U=u;U<u+a;U++)i[U].bookId[e.mode]=e.id,t.logger&&t.logger.info(U+"号轨道被"+e.id+"号优先弹幕预定");if(n.player)n.bulletBtn.main.data.some((function(n){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)}))}}return{result:!1,message:"no surplus will right"}}},{key:"removeBullet",value:function(e){this.logger&&this.logger.info("removeBullet "+(e.options.txt||"[DOM Element]"));for(var t=this.channels,n=e.channel_id,i=void 0,r=n[0],o=n[0]+n[1];r<o;r++)if(i=t[r]){i.operating[e.mode]=!0;var a=-1;i.queue[e.mode].some((function(t,n){return t.id===e.id&&(a=n,!0)})),a>-1&&i.queue[e.mode].splice(a,1),i.operating[e.mode]=!1}e.options.loop&&this.danmu.bulletBtn.main.playedData.push(e.options)}},{key:"resizeSync",value:function(){this.resize(!0)}},{key:"_initChannels",value:function(){var e=this.danmu.config,t=e.channelSize||(/mobile/gi.test(navigator.userAgent)?10:12),n=void 0;if(e.area){var i=e.area,r=i.lines,o=i.start,a=i.end;if((0,l.validAreaLineRule)(r))n=r,"b2t"===this.direction?this.width=n*t:this.height=n*t;else if(o>=0&&a>=o){var u=a-o;"b2t"===this.direction?this.width=Math.floor(this.width*u):this.height=Math.floor(this.height*u)}}(0,s.isNumber)(n)||(n="b2t"===this.direction?Math.floor(this.width/t):Math.floor(this.height/t));for(var c=[],h=0;h<n;h++)c[h]={id:h,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}};return{channelSize:t,channelCount:n,channels:c}}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.logger&&this.logger.info("resize");var t=this;function n(e,t){e[t]={id:t,queue:{scroll:[],top:[],bottom:[]},operating:{scroll:!1,top:!1,bottom:!1},bookId:{}}}function i(e,i){function r(n){["scroll","top"].forEach((function(i){t.channels[n].queue[i].forEach((function(t){t.el&&e[n].queue[i].push(t)}))}))}function o(n){t.channels[n].queue.bottom.forEach((function(r){if(r.el&&(e[n+e.length-t.channels.length].queue.bottom.push(r),r.channel_id[0]+r.channel_id[1]-1===n)){var o=[].concat(r.channel_id);r.channel_id=[o[0]-t.channels.length+e.length,o[1]],r.top=r.channel_id[0]*i,t.danmu.config.area&&t.danmu.config.area.start&&(r.top+=t.containerHeight*t.danmu.config.area.start),r.topInit()}}))}for(var a=0;a<t.channels.length;a++)n(e,a),r(a),o(a);for(var s=function(t){["scroll","top","bottom"].forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))},l=0;l<e.length;l++)s(l);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function r(e,i){for(var r=["scroll","top","bottom"],o=function(o){n(e,o),r.forEach((function(n){if("top"===n&&o>Math.floor(e.length/2));else if("bottom"===n&&o<=Math.floor(e.length/2));else{var r="bottom"===n?o-e.length+t.channels.length:o;t.channels[r].queue[n].forEach((function(a,s){if(a.el){if(e[o].queue[n].push(a),"bottom"===n&&a.channel_id[0]+a.channel_id[1]-1===r){var l=[].concat(a.channel_id);a.channel_id=[l[0]-t.channels.length+e.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()}t.channels[r].queue[n].splice(s,1)}}))}}))},a=0;a<e.length;a++)o(a);var s=function(t){r.forEach((function(n){e[t].queue[n].forEach((function(e){e.resized=!1}))}))};for(a=0;a<e.length;a++)s(a);t.channels=e,"b2t"===t.direction?t.channelWidth=i:t.channelHeight=i}function o(){var e=t.danmu,n=e.container,o=e.bulletBtn;t.container=n,t.updatePos(),t._cancelResizeTimer(),o.main.data&&o.main.data.forEach((function(e){e.bookChannelId&&(delete e.bookChannelId,t.logger&&t.logger.info("resize导致"+e.id+"号优先弹幕预定取消"))})),t.logger&&t.logger.info("resize导致所有轨道恢复正常使用"),t.width=t.containerWidth,t.height=t.containerHeight;var a=t._initChannels(),s=a.channelSize,l=a.channels;t.channels&&(t.channels.length<=l.length?i(l,s):r(l,s)),t.resizing=!1}t.resizing||(t.resizing=!0,e?o():(this._cancelResizeTimer(),this.resizeId=requestAnimationFrame(o)))}},{key:"_cancelResizeTimer",value:function(){this.resizeId&&(cancelAnimationFrame(this.resizeId),this.resizeId=null)}}]),t}(a.default);t.default=u,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validAreaLineRule=function(e){return"number"==typeof e&&e>=0&&Number.isInteger(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t={initDOM:function(){return document.createElement("div")},initSize:10},this.init(t)}return i(e,[{key:"init",value:function(e){this.idleList=[],this.usingList=[],this._id=0,this.options=e,this._expand(e.initSize)}},{key:"use",value:function(){this.idleList.length||this._expand(1);var e=this.idleList.shift();return this.usingList.push(e),e}},{key:"unused",value:function(e){var t=this.usingList.indexOf(e);t<0||(this.usingList.splice(t,1),e.style.opacity=0,this.idleList.push(e))}},{key:"_expand",value:function(e){for(var t=0;t<e;t++)this.idleList.push(this.options.initDOM(this._id++))}},{key:"destroy",value:function(){for(var e=0;e<this.idleList.length;e++)this.idleList[e].innerHTML="",this.idleList[e].textcontent="",this.clearElementStyle(this.idleList[e]);for(var t=0;t<this.usingList.length;t++)this.usingList[t].innerHTML="",this.usingList[t].textcontent="",this.clearElementStyle(this.usingList[t]);for(var n in this)r.hasOwnProperty.call(this,n)&&delete this[n]}},{key:"clearElementStyle",value:function(e){var t="undefined"!=typeof window?window.navigator.userAgent:null;t&&(t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1?(0,r.styleUtil)(e,"transform","none"):e.setAttribute("style",""))}}]),e}();t.default=o,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.destroyObserver=t.unObserver=t.addObserver=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),r=n(0);var o=new(function(){function e(){var t=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__handlers=[],window.ResizeObserver)try{this.observer=new window.ResizeObserver((0,r.throttle)((function(e){t.__trigger(e)}),100))}catch(e){}}return i(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=this.__handlers,i=-1,r=0;r<n.length;r++)n[r]&&e===n[r].target&&(i=r);i>-1?this.__handlers[i].handler.push(t):this.__handlers.push({target:e,handler:[t]})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)})),this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){t[n].handler&&t[n].handler.map((function(e){try{e()}catch(e){console.error(e)}}));break}}},{key:"__trigger",value:function(e){var t=this;e.map((function(e){t.__runHandler(e.target)}))}}]),e}());t.addObserver=function(e,t){o.addObserver(e,t)},t.unObserver=function(e,t){o.unObserver(e,t)},t.destroyObserver=function(e,t){o.destroyObserver(e,t)}},function(e,t,n){var i=n(35);"string"==typeof i&&(i=[[e.i,i,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(37)(i,r);i.locals&&(e.exports=i.locals)},function(e,t,n){(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}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=function(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var r=(a=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),o=i.sources.map((function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"}));return[n].concat(o).concat([r]).join("\n")}var a;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n})).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(i[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&i[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){var i,r,o={},a=(i=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===r&&(r=i.apply(this,arguments)),r}),s=function(e){return document.querySelector(e)},l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=s.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),u=null,c=0,h=[],f=n(38);function d(e,t){for(var n=0;n<e.length;n++){var i=e[n],r=o[i.id];if(r){r.refs++;for(var a=0;a<r.parts.length;a++)r.parts[a](i.parts[a]);for(;a<i.parts.length;a++)r.parts.push(b(i.parts[a],t))}else{var s=[];for(a=0;a<i.parts.length;a++)s.push(b(i.parts[a],t));o[i.id]={id:i.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],a=t.base?o[0]+t.base:o[0],s={css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(s):n.push(i[a]={id:a,parts:[s]})}return n}function g(e,t){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=h[h.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),h.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{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 r=l(e.insertInto+" "+e.insertAt.before);n.insertBefore(t,r)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=h.indexOf(e);t>=0&&h.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),g(e,t),t}function y(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))}function b(e,t){var n,i,r,o;if(t.transform&&e.css){if(!(o=t.transform(e.css)))return function(){};e.css=o}if(t.singleton){var a=c++;n=u||(u=v(t)),i=O.bind(null,n,a,!1),r=O.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){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}(t),i=x.bind(null,n,t),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),i=k.bind(null,n),r=function(){m(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else r()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=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){for(var i=[],r=0;r<n.length;r++){var a=n[r];(s=o[a.id]).refs--,i.push(s)}e&&d(p(e,t),t);for(r=0;r<i.length;r++){var s;if(0===(s=i[r]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete o[s.id]}}}};var _,w=(_=[],function(e,t){return _[e]=t,_.filter(Boolean).join("\n")});function O(e,t,n,i){var r=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var o=document.createTextNode(r),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function k(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function x(e,t,n){var i=n.css,r=n.sourceMap,o=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||o)&&(i=f(i)),r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,i=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var r,o=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(o)?e:(r=0===o.indexOf("//")?o:0===o.indexOf("/")?n+o:i+o.replace(/^\.\//,""),"url("+JSON.stringify(r)+")")}))}}])}));
//# sourceMappingURL=index.js.map
{
"name": "danmu.js",
"version": "1.1.7",
"version": "1.1.8-0",
"description": "HTML5 danmu (danmaku) plugin for any DOM element",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc