UNPKG

react-easy-audio

Version:

A simple audio player implementation

1 lines 22.4 kB
module.exports=function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Player=t.VolumeSlider=t.ProgressSlider=t.Slider=void 0;var o=r(1),i=n(o),a=r(3),s=n(a),l=r(4),u=n(l),d=r(5),c=n(d);r(10),t.Slider=i.default,t.ProgressSlider=s.default,t.VolumeSlider=u.default,t.Player=c.default;(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}function s(e){return e?e.offsetLeft+s(e.offsetParent):0}function l(){return!(document.documentMode<11)}function u(e){return Object.keys(e).reduce(function(t,r){var n=r;return(r.startsWith("webkit")||r.startsWith("moz")||r.startsWith("ms"))&&(n=n.charAt(0).toUpperCase()+n.substring(1)),t[n]=e[r],t},{})}Object.defineProperty(t,"__esModule",{value:!0});var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),f=r(2),p=n(f),h=r(8),v=n(h),y=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={isHovered:!1,isSliding:!1,value:0,media:null},r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return a(t,e),c(t,[{key:"componentWillMount",value:function(){var e=this.props,t=e.media,r=e.disableHint;this.applyStyle(),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.onMouseUp),t&&!this.state.media&&this.setMedia(t),!r&&l()||this.setState({disableHint:!0})}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,r=t.style,n=t.media;e.style&&e.style!==r&&this.applyStyle(),e.media&&e.media!==n&&this.setMedia(e.media)}},{key:"componentWillUnmount",value:function(){this.reset(),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp)}},{key:"onMouseEnter",value:function(e){var t=this.state.media;!e.buttons&&t&&this.setState({isHovered:!0})}},{key:"onMouseLeave",value:function(){this.setState({isHovered:!1})}},{key:"onMouseDown",value:function(e){var t=this.state.media;t&&(e.preventDefault(),1===e.buttons&&(this.setState({isSliding:!0}),this.onMouseMove(e,!0)))}},{key:"onMouseMove",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.state,n=r.isHovered,o=r.isSliding;if(n||o||t){var i=this.refs.sliderBody,a=Math.max(e.clientX-s(i),0);a=Math.min(a,i.offsetWidth);var l=a/i.offsetWidth;this.setState({cursorValue:l}),(o||t)&&this.setValue(l)}}},{key:"onMouseUp",value:function(){var e=this.state.isSliding;e&&(this.state.isSliding=!1)}},{key:"reset",value:function(){this.setState({isHovered:!1,isSliding:!1,value:0,media:null})}},{key:"setMedia",value:function(e){this.reset(),this.setState({media:e})}},{key:"setValue",value:function(e){this.setState({value:e})}},{key:"formatValue",value:function(e){return Math.round(100*e)/100}},{key:"applyStyle",value:function(){var e=this.props.style,t=void 0===e?{}:e,r=v.default,n=Object.keys(r).reduce(function(e,n){return e[n]=u(d({},r[n],t[n])),e},{});n.body.background=n.colors.background,n.bufferedFragment.background=n.colors.buffered,n.progress.background=n.colors.progress;var o=n.colors.controls;n.handleHovered.background=n.handleHovered.background||o,n.hintHovered.background=n.hintHovered.background||o,n.hintArrow.borderTopColor=n.hintArrow.borderTopColor||o,this.state.style=n}},{key:"renderHint",value:function(){var e=this.state,t=e.isHovered,r=e.isSliding,n=e.style,o=e.cursorValue,i=e.disableHint,a=this.formatValue(o);if(i||!a)return null;var s=t||r,l=d({},s?n.hintHovered:n.hint,{left:Math.floor(100*o)+"%"});return p.default.createElement("div",{style:l},a,p.default.createElement("div",{style:n.hintArrow}))}},{key:"renderInternal",value:function(){return null}},{key:"render",value:function(){var e=this.state,t=e.isHovered,r=e.isSliding,n=e.value,o=e.style,i=t||r,a=d({},o.progress,{width:Math.floor(100*n)+"%"});return p.default.createElement("div",{style:o.container,onMouseDown:this.onMouseDown.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this)},this.renderHint(),p.default.createElement("div",{style:o.body,ref:"sliderBody"},this.renderInternal(),p.default.createElement("div",{style:a},p.default.createElement("a",{style:i?o.handleHovered:o.handle}))))}}]),t}(f.Component);y.propTypes={style:f.PropTypes.object,media:f.PropTypes.object,disableHint:f.PropTypes.bool};var m=y;t.default=m;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(y,"Slider","/Users/james/Desktop/dev/react-material-audio/src/slider.jsx"),__REACT_HOT_LOADER__.register(s,"offsetLeft","/Users/james/Desktop/dev/react-material-audio/src/slider.jsx"),__REACT_HOT_LOADER__.register(l,"isPointerEventsSupported","/Users/james/Desktop/dev/react-material-audio/src/slider.jsx"),__REACT_HOT_LOADER__.register(u,"capitalizeVendorPrefix","/Users/james/Desktop/dev/react-material-audio/src/slider.jsx"),__REACT_HOT_LOADER__.register(m,"default","/Users/james/Desktop/dev/react-material-audio/src/slider.jsx"))})()},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},d=r(2),c=n(d),f=r(1),p=n(f),h=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state.progress=[],r.onTimeUpdate=r.onTimeUpdate.bind(r),r.onEnded=r.onEnded.bind(r),r.onProgress=r.onProgress.bind(r),r.onLoadStart=r.onLoadStart.bind(r),r}return a(t,e),l(t,[{key:"onMouseUp",value:function(){this.state.isSliding&&(u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"onMouseUp",this).call(this),this.setValue(this.state.value,!0))}},{key:"onTimeUpdate",value:function(e){if(!this.state.isSliding){var t=e.currentTarget;this.setValue(t.currentTime/t.duration,!1)}}},{key:"onEnded",value:function(){this.setValue(0)}},{key:"onProgress",value:function(e){var t=e.currentTarget,r=[],n=t.duration;if(t.buffered){for(var o=0;o<t.buffered.length;o++){var i=t.buffered.start(o)/n,a=t.buffered.end(o)/n;r.push({left:100*i+"%",width:100*(a-i)+"%"})}this.setState({progress:r})}}},{key:"onLoadStart",value:function(){this.setValue(0),this.setState({progress:[]})}},{key:"reset",value:function(){var e=this.state.media;u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reset",this).call(this),this.state.progress=[],e&&(e.removeEventListener("ended",this.onEnded,!1),e.removeEventListener("progress",this.onProgress,!1),e.removeEventListener("timeupdate",this.onTimeUpdate,!1),e.removeEventListener("loadstart",this.onLoadStart,!1))}},{key:"setMedia",value:function(e){this.setValue(0,!1),u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setMedia",this).call(this,e),e.addEventListener("ended",this.onEnded,!1),e.addEventListener("progress",this.onProgress,!1),e.addEventListener("timeupdate",this.onTimeUpdate,!1),e.addEventListener("loadstart",this.onLoadStart,!1)}},{key:"setValue",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.state.media;n&&(u(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e),r&&(n.currentTime=n.duration*e))}},{key:"formatValue",value:function(e){var t=this.state.media;if(!t)return"";var r=Math.floor(e*t.duration);return r>-1?new Date(1e3*r).toISOString().substr(10,9).replace("T00:","").replace("T0","").replace("T",""):""}},{key:"renderInternal",value:function(){var e=this.state,t=e.progress,r=e.style;return c.default.createElement("div",{style:r.bufferedContainer},t.map(function(e,t){return c.default.createElement("span",{key:t,style:s({},r.bufferedFragment,{marginLeft:e.left,width:e.width})})}))}}]),t}(p.default),v=h;t.default=v;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(h,"ProgressSlider","/Users/james/Desktop/dev/react-material-audio/src/progress-slider.jsx"),__REACT_HOT_LOADER__.register(v,"default","/Users/james/Desktop/dev/react-material-audio/src/progress-slider.jsx"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=function e(t,r,n){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,r);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,r,n)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(n)},u=r(1),d=n(u),c=function(e){function t(){o(this,t);var e=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.onVolumeChange=e.onVolumeChange.bind(e),e}return a(t,e),s(t,[{key:"setValue",value:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);var n=this.state.media;n&&r&&(n.volume=e)}},{key:"formatValue",value:function(e){return void 0===e?"":Math.floor(100*e)+"%"}},{key:"setMedia",value:function(e){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setMedia",this).call(this,e),this.setValue(e.volume,!1),e.addEventListener("volumechange",this.onVolumeChange,!1)}},{key:"reset",value:function(){l(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"reset",this).call(this);var e=this.state.media;e&&e.removeEventListener("volumechange",this.onVolumeChange,!1)}},{key:"onVolumeChange",value:function(e){this.setValue(e.currentTarget.volume,!1)}}]),t}(d.default),f=c;t.default=f;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(c,"VolumeSlider","/Users/james/Desktop/dev/react-material-audio/src/volume-slider.jsx"),__REACT_HOT_LOADER__.register(f,"default","/Users/james/Desktop/dev/react-material-audio/src/volume-slider.jsx"))})()},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(2),u=n(l),d=r(3),c=n(d),f=r(4),p=n(f),h=function(e){function t(e){o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.state={paused:!0},r.onEnded=r.onEnded.bind(r),r}return a(t,e),s(t,[{key:"componentDidMount",value:function(){var e={audio:this.audio,progressSlider:this.progressSlider,volumeSlider:this.volumeSlider},t=e.audio,r=e.progressSlider,n=e.volumeSlider;r.setMedia(t),n.setMedia(t),t.addEventListener("ended",this.onEnded,!1)}},{key:"componentWillUnmount",value:function(){var e={audio:this.audio},t=e.audio;t.removeEventListener("ended",this.onEnded,!1)}},{key:"onEnded",value:function(){this.setState({paused:!0})}},{key:"onPlayClick",value:function(){var e={audio:this.audio},t=e.audio;t.paused?t.play():t.pause();var r=t.paused;this.setState({paused:r})}},{key:"render",value:function(){var e=this,t=this.props,r=t.src,n=t.author,o=t.title,i=t.cover,a=t.style,s=t.onPlay,l=t.preload,d=t.autoPlay,f=this.state.paused;return u.default.createElement("div",{className:"player",style:a||{}},u.default.createElement("audio",{id:"audio",ref:function(t){return e.audio=t},autoPlay:d,onPlay:s,preload:l},u.default.createElement("source",{src:r})),u.default.createElement("img",{src:i,width:"60",height:"60",alt:"Cover"}),u.default.createElement("div",{className:"body"},u.default.createElement("div",{className:"info"},u.default.createElement("a",{className:"btn-play "+(f?"":"playing"),onClick:this.onPlayClick.bind(this)}),u.default.createElement("span",{className:"author-name"},n)," - ",u.default.createElement("span",{className:"song-name"},o)),u.default.createElement("div",{className:"controls"},u.default.createElement(c.default,{ref:function(t){return e.progressSlider=t}}),u.default.createElement("div",{className:"lbl-volume"},"🔊"),u.default.createElement(p.default,{ref:function(t){return e.volumeSlider=t}}))))}}]),t}(l.Component);h.propTypes={src:l.PropTypes.string.isRequired,title:l.PropTypes.string.isRequired,author:l.PropTypes.string.isRequired,cover:l.PropTypes.string.isRequired};var v=h;t.default=v;(function(){"undefined"!=typeof __REACT_HOT_LOADER__&&(__REACT_HOT_LOADER__.register(h,"Player","/Users/james/Desktop/dev/react-material-audio/src/player.jsx"),__REACT_HOT_LOADER__.register(v,"default","/Users/james/Desktop/dev/react-material-audio/src/player.jsx"))})()},function(e,t,r){t=e.exports=r(7)(),t.push([e.id,'.player{display:inline-block;margin:1em;padding:1em 1em .8em;box-shadow:0 0 8px rgba(0,0,0,.6);background-color:#673ab7}.player img{box-shadow:0 0 3px rgba(0,0,0,.3)}.player .body{display:inline-block;width:20em;padding:.5em 0 0 1em;vertical-align:top}.player .info{margin-bottom:8px;font-size:120%;color:#fff}.player .info .btn-play{display:inline-block;position:relative;box-sizing:border-box;width:25px;height:25px;margin-right:.5em;line-height:25px;text-align:center;vertical-align:middle;background:#ff1ae1;color:#fff;border-radius:100%;font-family:Segoe UI Symbol,Arial,sans-serif;font-size:11px;cursor:pointer}.player .info .btn-play:before{content:"\\25B6"}.player .info .btn-play.playing:before,.player .info .btn-play:before{position:absolute;margin:auto;left:0;right:-2px;top:50%;transform:translateY(-50%)}.player .info .btn-play.playing:before{content:"\\275A\\275A"}.player .controls>div{display:inline-block;vertical-align:middle}.player .controls .lbl-volume{width:2.3em;margin:-15px .4em 0 0;color:#aaa;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:right}.player .controls>div:first-child{width:calc(70% - 3em)}.player .controls>div:last-child{width:30%}.player .author-name,.player .song-name{font-size:15px}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var r=this[t];r[2]?e.push("@media "+r[2]+"{"+r[1]+"}"):e.push(r[1])}return e.join("")},e.i=function(t,r){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(n[i]=!0)}for(o=0;o<t.length;o++){var a=t[o];"number"==typeof a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),e.push(a))}},e}},function(e,t){e.exports={colors:{background:"rgba(0, 0, 0, .05)",progress:"rgba(255, 90, 225, 0.498039)",controls:"#5796ce",buffered:"rgba(255, 172, 225, 0.198039)"},container:{position:"relative",height:"10px",padding:"4px 0 10px",cursor:"pointer",webkitTouchCallout:"none",webkitUserSelect:"none",mozUserSelect:"none",msUserSelect:"none",userSelect:"none",webkitTapHighlightColor:"transparent"},body:{height:"3px",position:"relative"},bufferedContainer:{position:"absolute",top:"0",left:"0",bottom:"0",right:"0"},bufferedFragment:{display:"block",position:"absolute",height:"100%"},progress:{position:"relative",height:"100%"},handle:{opacity:"0"},handleHovered:{display:"block",float:"right",width:"10px",height:"10px",margin:"-3px -7px 0 0",borderRadius:"100%",opacity:"1",transition:"opacity .3s"},hint:{position:"absolute",opacity:"0",top:"-200px",display:"none"},hintHovered:{position:"absolute",left:"0",top:"-28px",marginLeft:"2px",padding:".2em .3em",transform:"translateX(-50%)",color:"#fff",borderRadius:"2px",border:"1px solid #5796ce",fontSize:"70%",pointerEvents:"none",opacity:"1",transition:"opacity .3s"},hintArrow:{position:"absolute",left:"50%",bottom:"-11px",width:"0",height:"0",marginLeft:"-6px",border:"6px solid transparent"}}},function(e,t,r){function n(e,t){for(var r=0;r<e.length;r++){var n=e[r],o=p[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(u(n.parts[i],t))}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(u(n.parts[i],t));p[n.id]={id:n.id,refs:1,parts:a}}}}function o(e){for(var t=[],r={},n=0;n<e.length;n++){var o=e[n],i=o[0],a=o[1],s=o[2],l=o[3],u={css:a,media:s,sourceMap:l};r[i]?r[i].parts.push(u):t.push(r[i]={id:i,parts:[u]})}return t}function i(e,t){var r=y(),n=g[g.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(t)}}function a(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function l(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function u(e,t){var r,n,o;if(t.singleton){var i=b++;r=m||(m=s(t)),n=d.bind(null,r,i,!1),o=d.bind(null,r,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(t),n=f.bind(null,r),o=function(){a(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(t),n=c.bind(null,r),o=function(){a(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}function d(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=_(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function c(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function f(e,t){var r=t.css,n=t.sourceMap;n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var o=new Blob([r],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var p={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},v=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),y=h(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,b=0,g=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=v()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var r=o(e);return n(r,t),function(e){for(var i=[],a=0;a<r.length;a++){var s=r[a],l=p[s.id];l.refs--,i.push(l)}if(e){var u=o(e);n(u,t)}for(var a=0;a<i.length;a++){var l=i[a];if(0===l.refs){for(var d=0;d<l.parts.length;d++)l.parts[d]();delete p[l.id]}}}};var _=function(){var e=[];return function(t,r){return e[t]=r,e.filter(Boolean).join("\n")}}()},function(e,t,r){var n=r(6);"string"==typeof n&&(n=[[e.id,n,""]]);r(9)(n,{});n.locals&&(e.exports=n.locals)}]);