{"version":3,"file":"throttle.js","sources":["requirejs/utility/throttle.js"],"sourcesContent":["define([\"require\", \"exports\"], function (require, exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n /**\n *\n * @param func\n * The function to throttle\n * @param wait\n * The frequency with which the function may be executed (in milliseconds)... i.e. \"It's okay to execute this function at most once every milliseconds\"\n * @param options\n * Aint gonna lie, I have no clue what these options do...\n */\n function throttle(func, wait, options) {\n var context, laterArgs, result;\n var timeout = null;\n var previous = 0;\n if (!options)\n options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, laterArgs);\n if (!timeout)\n context = laterArgs = null;\n };\n return function (...args) {\n laterArgs = args;\n var now = Date.now();\n if (!previous && options.leading === false)\n previous = now;\n var remaining = wait - (now - previous);\n context = this;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, laterArgs);\n if (!timeout)\n context = laterArgs = null;\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n }\n exports.default = throttle;\n ;\n});\n//# sourceMappingURL=throttle.js.map"],"names":["define","require","exports","Object","defineProperty","value","default","func","wait","options","later","previous","leading","Date","now","timeout","result","apply","context","laterArgs","args","remaining","this","clearTimeout","trailing","setTimeout"],"mappings":"AAAAA,OAAO,CAAC,UAAW,WAAY,SAAUC,EAASC,gBAE9CC,OAAOC,eAAeF,EAAS,aAAc,CAAEG,OAAO,IA8CtDH,EAAQI,QApCR,SAAkBC,EAAMC,EAAMC,GAMd,SAARC,IACAC,GAA+B,IAApBF,EAAQG,QAAoB,EAAIC,KAAKC,MAChDC,EAAU,KACVC,EAAST,EAAKU,MAAMC,EAASC,GACxBJ,IACDG,EAAUC,EAAY,MAV9B,IAAID,EAASC,EAAWH,EACpBD,EAAU,KACVJ,EAAW,EAUf,OARIF,EADCA,GACS,GAQP,YAAaW,GAChBD,EAAYC,EACZ,IAAIN,EAAMD,KAAKC,MAGXO,GAFCV,IAAgC,IAApBF,EAAQG,UACrBD,EAAWG,GACCN,GAAQM,EAAMH,IAe9B,OAdAO,EAAUI,KACND,GAAa,GAAiBb,EAAZa,GACdN,IACAQ,aAAaR,GACbA,EAAU,MAEdJ,EAAWG,EACXE,EAAST,EAAKU,MAAMC,EAASC,GACxBJ,IACDG,EAAUC,EAAY,OAEpBJ,IAAgC,IAArBN,EAAQe,WACzBT,EAAUU,WAAWf,EAAOW,IAEzBL"}