!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.DWDanmu=n():t.DWDanmu=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=7)}([function(t,n,e){"use strict";t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var e=function(t,n){var e=t[1]||"",r=t[3];if(!r)return e;if(n&&"function"==typeof btoa){var o=(s=r,a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),"/*# ".concat(c," */")),i=r.sources.map(function(t){return"/*# sourceURL=".concat(r.sourceRoot).concat(t," */")});return[e].concat(i).concat([o]).join("\n")}var s,a,c;return[e].join("\n")}(n,t);return n[2]?"@media ".concat(n[2],"{").concat(e,"}"):e}).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o=0&&u.splice(n,1)}function g(t){var n=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return e.nc}();r&&(t.attrs.nonce=r)}return v(n,t.attrs),h(t,n),n}function v(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function y(t,n){var e,r,o,i;if(n.transform&&t.css){if(!(i="function"==typeof n.transform?n.transform(t.css):n.transform.default(t.css)))return function(){};t.css=i}if(n.singleton){var s=f++;e=c||(c=g(n)),r=x.bind(null,e,s,!1),o=x.bind(null,e,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=function(t){var n=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",v(n,t.attrs),h(t,n),n}(n),r=function(t,n,e){var r=e.css,o=e.sourceMap,i=void 0===n.convertToAbsoluteUrls&&o;(n.convertToAbsoluteUrls||i)&&(r=l(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var s=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}.bind(null,e,n),o=function(){m(e),e.href&&URL.revokeObjectURL(e.href)}):(e=g(n),r=function(t,n){var e=n.css,r=n.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}.bind(null,e),o=function(){m(e)});return r(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;r(t=n)}else o()}}t.exports=function(t,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(n=n||{}).attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||"boolean"==typeof n.singleton||(n.singleton=s()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var e=d(t,n);return p(e,n),function(t){for(var r=[],o=0;o=10)return;n.push(e);var s,a,c=(s={message:e,color:t.config.colorList[r(0,t.config.colorList.length-1)],maxHeight:t.height},(a=document.createElement("span")).style.color=s.color,a.style.fontSize=r(14,20)+"px",a.style.top=r(0,s.maxHeight-20)+"px",a.innerText=s.message,a);t.$wrapper.appendChild(c),c.classList.add(i.animate),c.style.transitionDuration=t.config.transitionDuration+"ms",c.style.transform="translateX(-"+(t.width+c.offsetWidth)+"px)",setTimeout(function(){c.remove(),n.shift()},t.config.transitionDuration)},this.config.timeInterval),this.config.grabComment&&this._getDanmuTextFromComments()},t.prototype._processConfig=function(){this.config.colorList=this.config.colorList?this.config.colorList:o.colorList,this.config.danmuList=this.config.danmuList?this.config.danmuList:o.danmuList,this.config.timeInterval=this.config.timeInterval?this.config.timeInterval:o.timeInterval,this.config.transitionDuration=this.config.transitionDuration?this.config.transitionDuration:o.transitionDuration,this.config.grabComment=this.config.grabComment?this.config.grabComment:o.grabComment},t.prototype._initWrapper=function(){this.config.top&&(this.$wrapper.style.top=this.config.top+"px"),this.config.left&&(this.$wrapper.style.left=this.config.left+"px"),this.$wrapper.style.width=this.width+"px",this.$wrapper.style.height=this.height+"px"},t.prototype._getDanmuTextFromComments=function(){var t=this,n=setInterval(function(){document.querySelectorAll(".dw-comment-comment_list .comment_text")&&setTimeout(function(){Array.from(document.querySelectorAll(".dw-comment-comment_list .comment_text")).forEach(function(n){t.config.danmuList.push(n.innerText)}),clearInterval(n)},1e3)},300)},t}();n.default=s}])});