/*! For license information please see dll.TimedButton.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[112],{1055:function(t,e,n){"use strict";n.r(e);var i=n(13),a=n.n(i),o=n(12),s=n.n(o),r=n(6),l=n.n(r),c=n(14),u=n.n(c),d=n(15),p=n.n(d),h=n(8),f=n.n(h),m=n(5),g=n.n(m),v=n(0),b=n.n(v),w=n(1),y=n.n(w),k=n(25),L=n.n(k),N=n(24),S=n(215),x=n.n(S);n(2854);function C(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=f()(t);if(e){var a=f()(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return p()(this,n)}}var R=L()("isle:timed-button"),_=function(t){u()(n,t);var e=C(n);function n(t){var i;return a()(this,n),i=e.call(this,t),g()(l()(i),"refDimensions",(function(t){if(t){R("Show dimensions...");var e=t.getBoundingClientRect().width;i.setState({width:e})}})),g()(l()(i),"trigger",(function(){i.props.autoActivate?(i.props.onClick(),i.setState({waiting:!0}),i.start()):i.props.onClick((function(t){!1!==t&&(i.setState({waiting:!0}),i.start())}))})),i.state={timeLeft:t.duration,waiting:!t.disabled,width:100},i}return s()(n,[{key:"componentDidMount",value:function(){!1===this.state.waiting&&this.start()}},{key:"componentWillUnmount",value:function(){clearInterval(this.countdown)}},{key:"start",value:function(){var t=this;this.setState({waiting:!1}),this.countdown=setInterval((function(){t.setState({timeLeft:x()(0,t.state.timeLeft-1)}),0===t.state.timeLeft&&(clearInterval(t.countdown),t.setState({waiting:!0,timeLeft:t.props.duration}))}),1e3)}},{key:"render",value:function(){var t=this.props.disabled||!this.state.waiting,e={marginLeft:3,width:this.state.width},n={marginLeft:(1-this.state.timeLeft/this.props.duration)*this.state.width};return b.a.createElement("div",{className:"timed-button-container"},this.props.disabled?null:b.a.createElement("div",{style:e,className:"timed-button-remaining"},b.a.createElement("div",{className:"timed-button-bar"},b.a.createElement("div",{style:n,className:"timed-button-bar-overlay"}))),b.a.createElement(N.default,{className:this.props.className,href:this.props.href,size:this.props.size,block:this.props.block,type:this.props.type,ref:this.refDimensions,disabled:t,onClick:this.trigger,variant:this.props.variant,style:this.props.style},this.props.children))}}]),n}(v.Component);_.propTypes={block:y.a.bool,duration:y.a.number,className:y.a.string,disabled:y.a.bool,href:y.a.string,onClick:y.a.func,size:y.a.string,type:y.a.string,variant:y.a.string,autoActivate:y.a.bool,style:y.a.object},_.defaultProps={block:!1,className:"",disabled:!1,duration:3,href:null,onClick:function(){},size:null,type:null,variant:null,autoActivate:!0,style:{}},e.default=_},2854:function(t,e,n){var i=n(30),a=n(2855);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[t.i,a,""]]);var o={insert:"head",singleton:!1};i(a,o);t.exports=a.locals||{}},2855:function(t,e,n){(e=n(31)(!1)).push([t.i,".timed-button-remaining {\n\tposition: absolute;\n\ttop: -5px;\n\twidth: 100px;\n\theight: 2px;\n}\n\n.timed-button-bar {\n\twidth: auto;\n\theight: 2px;\n\tbackground: linear-gradient(45deg, tomato, gold, lightgreen);\n\toverflow: hidden;\n}\n\n.timed-button-bar-overlay {\n\twidth: 100%;\n\theight: 100%;\n\tbackground: ivory;\n\tmargin-left: 50%;\n}\n\n.timed-button-container {\n\twidth: auto;\n\theight: auto;\n\tposition: relative;\n\tdisplay: inline-block;\n}\n",""]),t.exports=e}}]);