"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/objectWithoutProperties"),t=require("./constants.js"),n=require("./fetchTile.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),u=i(r),c=["queue"];function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}exports.processQueue=function e(r){for(var i=r.queue,f=u.default(r,c),p=function(){var t=i.pending.shift();if(!t)return"break";i.inProgress.add(t),n.fetchTile(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){o.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({tileKey:t},f)).finally((function(){i.inProgress.delete(t),e(r)}))};i.pending.length>0&&i.inProgress.size<t.MAX_CONCURRENT_FETCHES;){if("break"===p())break}};
//# sourceMappingURL=processQueue.js.map
