(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[274],{8274:function(e,r,t){"use strict";t.r(r),t.d(r,{PlayButton:function(){return f}});var n,a=t(5893),l=t(7294),u=t(3950),c=t(3234),o=t(2175),i={iconName:"Play"},s={iconName:"Pause"},v={root:{borderRadius:"50%",border:"1px solid ".concat(c.r.palette.themePrimary)}},d={interval:{label:"interval (ms)",hint:"interval (ms)",value:null!==(n=JSON.parse(localStorage.getItem("interval")))&&void 0!==n?n:300,min:10,max:5e3}},f=(0,l.memo)((function(e){var r=e.disabled,t=e.onUpdateFrame,n=e.store1,c=e.store2,f=e.currentStore,m=(0,l.useState)(!1),b=m[0],p=m[1],h=(0,l.useRef)(),k=(0,o.M4)(d,{store:n}).interval,w=(0,o.M4)(d,{store:c}).interval,I=f===n?k:w;(0,l.useEffect)((function(){h.current&&(clearInterval(h.current),h.current=void 0,p(!1))}),[r]),(0,l.useEffect)((function(){h.current&&(clearInterval(h.current),h.current=window.setInterval(t,I))}),[I]);var N=(0,l.useCallback)((function(){h.current?(clearInterval(h.current),h.current=void 0,p(!1)):(h.current=window.setInterval(t,I),p(!0))}),[I,t]);return(0,a.jsx)(u.h,{disabled:r,iconProps:b?s:i,onClick:N,styles:v})}));r.default=f}}]);