/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/scrollto-with-animation@3.0.4/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rAF=void 0;var _animationFrame=require("animation-frame"),_animationFrame2=_interopRequireDefault(_animationFrame),_easings=require("./easings"),_easings2=_interopRequireDefault(_easings);function _interopRequireDefault(n){return n&&n.__esModule?n:{default:n}}var packageInfo={name:"scrollto-with-animation",url:"https://github.com/davesnx/scrollto-with-animation"},rAF=new _animationFrame2.default,DEBUG=process.env.NODE_ENV||!0,DEFAULT_ANIMATION="easeInQuad",LIB_NAME=""+packageInfo.name,TRANSITION_NOT_FOUND=LIB_NAME+": Transition not found - "+packageInfo.url,ANIMATION_NOT_VALID=LIB_NAME+": callback transition don't look like a valid equation - "+packageInfo.url,TRANSITION_NOT_VALID=LIB_NAME+": Transition isn't string or Function - "+packageInfo.url,ANIMATION_CANCEL="animation-cancel",ANIMATION_END="animation-end",_document="undefined"!=typeof document?document:{},_window="undefined"!=typeof window?window:{},findAnimation=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:DEFAULT_ANIMATION,e=_easings2.default[n];if(void 0===e&&DEBUG)throw new Error(TRANSITION_NOT_FOUND);return e},defineAnimation=function(n){if(4!==n.length&&DEBUG)throw new Error(ANIMATION_NOT_VALID);return n},scrollToWithAnimation=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"scrollTop",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,t=arguments.length>4&&void 0!==arguments[4]?arguments[4]:DEFAULT_ANIMATION,a=arguments[5],r=void 0,l="scrollTop"===e?n.scrollTop:n.scrollLeft,A=o-l,u=+new Date,N=!0,_=void 0,s=void 0;if(n||(n=_document.documentElement),"string"==typeof t||null===t)s=findAnimation(t);else{if("function"!=typeof t)throw new Error(TRANSITION_NOT_VALID);s=defineAnimation(t)}r=rAF.request((function t(){var d=+new Date,I=Math.floor(s(d-u,l,A,i));_&&o===n[e]?(N=!1,a&&(a(ANIMATION_CANCEL),rAF.cancel(r))):(_=I,n[e]=I),d>u+i&&(n[e]=o,N=!1,a&&(a(ANIMATION_END),rAF.cancel(r))),N&&(r=rAF.request(t))}))};_window!=={}&&(_window.scrollToWithAnimation=scrollToWithAnimation),exports.default=scrollToWithAnimation,exports.rAF=rAF;
//# sourceMappingURL=/sm/e81714e66027ba76d120fecce07d09ae82b294f2331add7b364efed882f1861b.map