"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getRequestAnimationFrame,exports.cancelRequestAnimationFrame=cancelRequestAnimationFrame;var availablePrefixs=["moz","ms","webkit"];function requestAnimationFramePolyfill(){var a=0;return function(e){var n=(new Date).getTime(),i=Math.max(0,16-(n-a)),t=window.setTimeout(function(){e(n+i)},i);return a=n+i,t}}function getRequestAnimationFrame(){if("undefined"==typeof window)return function(){};if(window.requestAnimationFrame)return window.requestAnimationFrame.bind(window);var e=availablePrefixs.filter(function(e){return e+"RequestAnimationFrame"in window})[0];return e?window[e+"RequestAnimationFrame"]:requestAnimationFramePolyfill()}function cancelRequestAnimationFrame(e){if("undefined"==typeof window)return null;if(window.cancelAnimationFrame)return window.cancelAnimationFrame(e);var n=availablePrefixs.filter(function(e){return e+"CancelAnimationFrame"in window||e+"CancelRequestAnimationFrame"in window})[0];return n?(window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"]).call(this,e):clearTimeout(e)}