define(["exports","./../common/pluginmanager.js","./../common/methodtimer.js"],function(_exports,_pluginmanager,_methodtimer){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=function(){var interval,self=this;function animate(){var min,max,animations=[bounceInLeft,bounceInRight,swing,tada,wobble,rotateIn,rotateOut],elem=document.querySelector(".logoScreenSaverImage");elem&&elem.animate&&(min=0,max=animations.length-1,animations[Math.floor(Math.random()*(max-min+1))+min](elem,1))}function bounceInLeft(elem,iterations){return elem.animate([{transform:"translate3d(-3000px, 0, 0)",opacity:"0",offset:0},{transform:"translate3d(25px, 0, 0)",opacity:"1",offset:.6},{transform:"translate3d(-100px, 0, 0)",offset:.75},{transform:"translate3d(5px, 0, 0)",offset:.9},{transform:"none",opacity:"1",offset:1}],{duration:900,iterations:iterations,easing:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"})}function bounceInRight(elem,iterations){return elem.animate([{transform:"translate3d(3000px, 0, 0)",opacity:"0",offset:0},{transform:"translate3d(-25px, 0, 0)",opacity:"1",offset:.6},{transform:"translate3d(100px, 0, 0)",offset:.75},{transform:"translate3d(-5px, 0, 0)",offset:.9},{transform:"none",opacity:"1",offset:1}],{duration:900,iterations:iterations,easing:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"})}function swing(elem,iterations){return elem.animate([{transform:"translate(0%)",offset:0},{transform:"rotate3d(0, 0, 1, 15deg)",offset:.2},{transform:"rotate3d(0, 0, 1, -10deg)",offset:.4},{transform:"rotate3d(0, 0, 1, 5deg)",offset:.6},{transform:"rotate3d(0, 0, 1, -5deg)",offset:.8},{transform:"rotate3d(0, 0, 1, 0deg)",offset:1}],{duration:900,iterations:iterations})}function tada(elem,iterations){return elem.animate([{transform:"scale3d(1, 1, 1)",offset:0},{transform:"scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)",offset:.1},{transform:"scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg)",offset:.2},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.3},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.4},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.5},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.6},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.7},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg)",offset:.8},{transform:"scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg)",offset:.9},{transform:"scale3d(1, 1, 1)",offset:1}],{duration:900,iterations:iterations})}function wobble(elem,iterations){return elem.animate([{transform:"translate(0%)",offset:0},{transform:"translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg)",offset:.15},{transform:"translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg)",offset:.45},{transform:"translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg)",offset:.6},{transform:"translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg)",offset:.75},{transform:"translateX(0%)",offset:1}],{duration:900,iterations:iterations})}function rotateIn(elem,iterations){return elem.animate([{transform:"rotate3d(0, 0, 1, -200deg)",opacity:"0",transformOrigin:"center",offset:0},{transform:"none",opacity:"1",transformOrigin:"center",offset:1}],{duration:900,iterations:iterations})}function rotateOut(elem,iterations){return elem.animate([{transform:"none",opacity:"1",transformOrigin:"center",offset:0},{transform:"rotate3d(0, 0, 1, 200deg)",opacity:"0",transformOrigin:"center",offset:1}],{duration:900,iterations:iterations})}function stopInterval(){interval&&(interval.destroy(),interval=null)}self.name="Logo Screen Saver",self.type="screensaver",self.id="logoscreensaver",self.supportsAnonymous=!0,self.show=function(){require(["css!modules/logoscreensaver/style.css"],function(){var elem=document.querySelector(".logoScreenSaver");elem||((elem=document.createElement("div")).classList.add("logoScreenSaver"),document.body.appendChild(elem),elem.innerHTML='<img class="logoScreenSaverImage" src="'+_pluginmanager.default.mapPath(self,"logowhite.png")+'" />'),stopInterval(),interval=new _methodtimer.default({onInterval:animate,type:"interval",timeoutMs:3e3})})},self.hide=function(){stopInterval();var onAnimationFinish,elem=document.querySelector(".logoScreenSaver");elem&&(onAnimationFinish=function(){var parentNode=elem.parentNode;parentNode&&parentNode.removeChild(elem)},elem.animate?function(elem,iterations){return elem.animate([{opacity:"1",offset:0},{opacity:"0",offset:1}],{duration:400,iterations:iterations})}(elem,1).onfinish=onAnimationFinish:onAnimationFinish())}}});