2BKHJI2SJ3VXTFBK2BWNN3I3BDNMUU5YTJGKTQCOXV66VVRHCGKAC /**functions* create a schedule for a targetinputs* targets* current time* previous schedulesvariables* time that a schedule is started* time that a new schedule should be made and ran* time that a schedule finishesprocess* a new schedule needs to be created and ran when the duration of paddings of the previous schedule has elapsed.* to ensure that there is no downtime and overlap between the last task of the current schedule and the first task of the next scheudle, the minimum length a schedule should be long enough is such that the amount of paddings in the schedule is greater than or equal to the duration of the longest action (weaken).* e.g., if longest task takes 10 seconds before it starts, the amount of paddings have to be at least 10 seconds before starting the tasks in the next schedule.* prioritise adding another schedule to the better targets rather than adding a new schedule for worse targets.*/
// weaken_manager.js - 3.4GB - continuously runs enough threads of cyclic_weaken.js to meet float_ram_fraction_for_weaken_cyclic.import {array_make_schedule_script,void_schedule_script_runner} from "lib_ram_script.js";// mainexport const main = async function (ns) {for (;;)void_schedule_script_runner(ns,array_make_schedule_script(ns, [{file: ns.args[1],threads_or_ram_botnet: ns.args[2],args: [ns.args[3]],},])),await ns.sleep(1e3 * ns.args[0]);};
export const main = async function(ns) {await ns.sleep(ns.args[2]);// const start = Date.now();// const s = new Date(start);await ns.weaken(ns.args[1]);// const finish = Date.now();// const f = new Date(finish);// ns.tprint("\t#" + ns.args[3] + "\t" + ns.args[0] + " weakening " + ns.args[1] + "\nWeaken started:\t\t" + s.toISOString() + "\nWeaken finished:\t" + f.toISOString());};
// tor.js - 3.8GB - tries to continually buy TOR Routerexport const main = async function(ns) {const float_period_check = ns.args[0] * 1000;while (true) {if (ns.scan("home").includes("darkweb")) {break;}try {ns.purchaseTor();} catch (error) {ns.print(JSON.stringify(error));}await ns.sleep(float_period_check);}};
// servers.js - 8.55GB - continually buys the best server with cash available, unless there are 25 servers already, in which case deletes the worst server, unless all 25 have ram == PurchasedServerMaxRamexport const main = async function(ns) {const float_period_check = ns.args[0] * 1000;const string_servers_bought_name = ns.args[0];const object_get_constants = function(ns) {const object_constants = {// cost of server per 1 GB of RAMBaseCostFor1GBOfRamServer: 55000,// maximum amount of purchased servers allowedPurchasedServerLimit: 25,// minimum ram of purchased servers possibleinteger_server_ram_min: 2,// maximum ram of purchased servers possible. 2^20PurchasedServerMaxRam: 1048576,};return object_constants;};// returns the total ram of a serverconst integer_get_server_ram_total = function(ns, string_server) {return (ns.getServerRam(string_server))[0];};// true if all bought servers have ram == PurchasedServerMaxRamconst boolean_servers_bought_all_max = function(ns) {const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let boolean_tripwire = true;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {if (integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]) < object_get_constants(ns).PurchasedServerMaxRam) {boolean_tripwire = false;}}return boolean_tripwire;}};// returns bought server with smallest RAMconst string_get_server_bought_smallest = function(ns) {const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let string_server_smallest;let integer_size_smallest = object_get_constants(ns).PurchasedServerMaxRam;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {let integer_server_ram_total = integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]);if (integer_server_ram_total < integer_size_smallest) {string_server_smallest = array_servers_bought[integer_indices_0];integer_size_smallest = integer_server_ram_total;}}return string_server_smallest;}};// returns bought server with biggest RAMconst string_get_server_bought_biggest = function(ns) {const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let string_server_biggest;let integer_size_biggest = object_get_constants(ns).integer_server_ram_min;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {let integer_server_ram_total = integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]);if (integer_server_ram_total > integer_size_biggest) {string_server_biggest = array_servers_bought[integer_indices_0];integer_size_biggest = integer_server_ram_total;}}return string_server_biggest;}};// return the RAM of the server with the biggest RAM that you can affordconst integer_get_server_ram_biggest_afforded = function(ns) {const object_constants = object_get_constants(ns);let integer_server_ram_biggest_afforded = Math.pow(2, Math.trunc(Math.log2(ns.getServerMoneyAvailable("home") / object_constants.BaseCostFor1GBOfRamServer) / Math.log2(2)));if (integer_server_ram_biggest_afforded > object_constants.PurchasedServerMaxRam) {integer_server_ram_biggest_afforded = object_constants.PurchasedServerMaxRam;}return integer_server_ram_biggest_afforded;};const boolean_conditions_server_purchase_1 = function(ns) {const integer_server_ram_biggest_afforded = integer_get_server_ram_biggest_afforded(ns);const object_constants = object_get_constants(ns);if (// you have no bought servers yet(ns.getPurchasedServers().length === 0) &&// ram is at least equal to the minimum ram possible for purchased servers(integer_server_ram_biggest_afforded >= object_constants.integer_server_ram_min) &&// ram is at least equal to the ram of "home" (probably a bad idea to hardcode this since the string_name of "home" might change in the future) or max ram.(integer_server_ram_biggest_afforded >= integer_get_server_ram_total(ns, "home") ||integer_server_ram_biggest_afforded >= object_constants.PurchasedServerMaxRam)) {return true;}};const boolean_conditions_server_purchase_2 = function(ns) {const integer_servers_bought_amount = ns.getPurchasedServers().length;const object_constants = object_get_constants(ns);if (// you have one or more servers already(integer_servers_bought_amount > 0) &&// you currently own less than the maximum amount of purchased servers allowed(integer_servers_bought_amount < object_constants.PurchasedServerLimit)) {const float_ram_server_bought_biggest = integer_get_server_ram_total(ns, string_get_server_bought_biggest(ns));if (// you dont own a server with max ram yet, buy a server with ram greater than the ram of your biggest bought server(float_ram_server_bought_biggest != object_constants.PurchasedServerMaxRam) &&(float_ram_server_bought_biggest < integer_get_server_ram_biggest_afforded(ns))) {return true;}}};const boolean_conditions_server_purchase_3 = function(ns) {const integer_servers_bought_amount = ns.getPurchasedServers().length;const object_constants = object_get_constants(ns);const float_ram_server_bought_maximum = object_constants.PurchasedServerMaxRam;if (// you have one or more servers already(integer_servers_bought_amount > 0) &&// you currently own less than the maximum amount of purchased servers allowed(integer_servers_bought_amount < object_constants.PurchasedServerLimit)) {if (// you already bought a server with max ram, buy another server the max possible ram(integer_get_server_ram_total(ns, string_get_server_bought_biggest(ns)) == float_ram_server_bought_maximum) &&(integer_get_server_ram_biggest_afforded(ns) >= float_ram_server_bought_maximum)) {return true;}}};const boolean_conditions_server_delete_purchase = function(ns) {const object_constants = object_get_constants(ns);if (// you currently own the maximum amount of purchased servers allowed(ns.getPurchasedServers().length == object_constants.PurchasedServerLimit) &&// your servers do not all have the maximum ram possible for purchased servers!(boolean_servers_bought_all_max(ns, object_constants.PurchasedServerMaxRam)) &&// is cash at least equal to the price of the cheapest server bought + the next highest server after that, which is twice the price of the former, thus 3. this check is so that a server with the same ram as before isn't bought.(ns.getServerMoneyAvailable("home") >= 3 * object_constants.BaseCostFor1GBOfRamServer * integer_get_server_ram_total(ns, string_get_server_bought_smallest(ns)))) {return true;}else {return false;}};while (!boolean_servers_bought_all_max(ns)) {while (boolean_conditions_server_delete_purchase(ns)) {ns.deleteServer(string_get_server_bought_smallest(ns));ns.purchaseServer(string_servers_bought_name, integer_get_server_ram_biggest_afforded(ns));}while (boolean_conditions_server_purchase_3(ns) ||boolean_conditions_server_purchase_2(ns) ||boolean_conditions_server_purchase_1(ns)) {ns.purchaseServer(string_servers_bought_name, integer_get_server_ram_biggest_afforded(ns));}await ns.sleep(float_period_check);}};
// ram.js - 6.2GB - tries to continually buy ram as long as you have sufficient cashexport const main = async function(ns) {const float_period_check = ns.args[0] * 1000;while(true) {try {while (ns.getServerMoneyAvailable("home") >= ns.getUpgradeHomeRamCost()) {ns.upgradeHomeRam();}}catch (error) {ns.print(JSON.stringify(error));}await ns.sleep(float_period_check);}};
// programs.js - 3.7GB - tries to continually buy programsexport const main = async function(ns) {const float_period_check = ns.args[0] * 1000;const array_programs = ns.args[1];let boolean_has_all_programs = false;while (true) {if (boolean_has_all_programs) {break;}let boolean_program_missing = false;for (let integer_indices_0 = 0; integer_indices_0 < array_programs.length; ++integer_indices_0) {const string_program = array_programs[integer_indices_0];if (!ns.fileExists(string_program, "home")) {boolean_program_missing = true;}try {ns.purchaseProgram(string_program);} catch (error) {ns.print(JSON.stringify(error));}}if (!boolean_program_missing) {boolean_has_all_programs = true;}await ns.sleep(float_period_check);}};
export const main = async function (ns) {for (;;) await ns.sleep(999999);};
// hacknet.js - 5.6 GB - purchases nodes and upgrades them until the node requirements for joining Netburners are met.const object_get_nodes_stats = function (ns) {const object_output = {level: 0,ram: 0,cores: 0,};const integer_nodes = ns.hacknet.numNodes();for (let integer_index_nodes = 0;integer_index_nodes < integer_nodes;++integer_index_nodes) {const object_node_stats = ns.hacknet.getNodeStats(integer_index_nodes);object_output.level += object_node_stats.level;object_output.ram += object_node_stats.ram;object_output.cores += object_node_stats.cores;}return object_output;};export const main = async function (ns) {constfloat_period_check = 1e3 * ns.args[0],integer_level = 100,integer_ram = 8,integer_cores = 4;for (; ns.hacknet.numNodes() <= 0;) {try {ns.hacknet.purchaseNode();} catch (error) {await ns.sleep(float_period_check);}await ns.sleep(float_period_check);}let object_nodes_stats = object_get_nodes_stats(ns);for (;!(integer_level <= object_nodes_stats.level &&integer_ram <= object_nodes_stats.ram &&integer_cores <= object_nodes_stats.cores);) {object_nodes_stats = object_get_nodes_stats(ns);const integer_nodes = ns.hacknet.numNodes();letinteger_cost = ns.hacknet.getPurchaseNodeCost(),function_job = function () {ns.hacknet.purchaseNode();};for (let integer_index_nodes = 0;integer_index_nodes < integer_nodes;++integer_index_nodes) {constinteger_cost_level = ns.hacknet.getLevelUpgradeCost(integer_index_nodes, 1),integer_cost_ram = ns.hacknet.getRamUpgradeCost(integer_index_nodes, 1),integer_cost_core = ns.hacknet.getCoreUpgradeCost(integer_index_nodes, 1);if (object_nodes_stats.level < integer_level &&integer_cost_level < integer_cost) {integer_cost = integer_cost_level;function_job = function () {ns.hacknet.upgradeLevel(integer_index_nodes, 1);};}if (object_nodes_stats.ram < integer_ram &&integer_cost_ram < integer_cost) {integer_cost = integer_cost_ram;function_job = function () {ns.hacknet.upgradeRam(integer_index_nodes, 1);};}if (object_nodes_stats.cores < integer_cores &&integer_cost_core < integer_cost) {integer_cost = integer_cost_core;function_job = function () {ns.hacknet.upgradeCore(integer_index_nodes, 1);};}}try {function_job();} catch (error) {await ns.sleep(float_period_check);}await ns.sleep(float_period_check);}};
/* hacker.js - 8.05GB - TODO:* Maybe add functionality that allows on-the-fly hot loading of settings from a file.* add a job cap thing that prevents running more jobs if the first worker in a cycle finishes. add a thing to worker script that writes to a file (or to `window`) its identifier, when it started and when it finishes. add a padding optimiser that detects when tail collision occurs and increases padding each cycle if it does occur, and decreases it by half of how much it increases everytime no tail collision occurs* do we need to Add delay between each script execution?*/import {array_get_servers_rooted}from "lib_root.js";import {float_get_server_ram_free,array_get_servers_rooted_sorted_by_ram}from "lib_ram.js";// mainexport const main = async function(ns) {const array_arguments = ns.args;// main looplet integer_time_finishes = Date.now();while (true) {if (integer_time_finishes <= Date.now()) {integer_time_finishes = await void_runner(ns, ...array_arguments.slice(1)) + Date.now();}// arbitrarily check every float_period_check_seconds to see if the current time is greater than the time that the runner is supposed to finish.await ns.sleep(array_arguments[0] * 1000);}};// functionsconst object_get_constants = function(ns) {// from BitNode/BitNodeMultipliersconst object_get_bitnode_multipliers = function(ns) {// try {// return ns.getBitNodeMultipliers();// }// catch (error) {// ns.tprint(JSON.stringify(error));// return {// HackingLevelMultiplier: 1,// StrengthLevelMultiplier: 1,// DefenseLevelMultiplier: 1,// DexterityLevelMultiplier: 1,// AgilityLevelMultiplier: 1,// CharismaLevelMultiplier: 1,// ServerGrowthRate: 1,// ServerMaxMoney: 1,// ServerStartingMoney: 1,// ServerStartingSecurity: 1,// ServerWeakenRate: 1,// HomeComputerRamCost: 1,// PurchasedServerCost: 1,// PurchasedServerLimit: 1,// PurchasedServerMaxRam: 1,// CompanyWorkMoney: 1,// CrimeMoney: 1,// HacknetNodeMoney: 1,// ManualHackMoney: 1,// ScriptHackMoney: 1,// CodingContractMoney: 1,// ClassGymExpGain: 1,// CompanyWorkExpGain: 1,// CrimeExpGain: 1,// FactionWorkExpGain: 1,// HackExpGain: 1,// FactionPassiveRepGain: 1,// FactionWorkRepGain: 1,// RepToDonateToFaction: 1,// AugmentationMoneyCost: 1,// AugmentationRepCost: 1,// InfiltrationMoney: 1,// InfiltrationRep: 1,// FourSigmaMarketDataCost: 1,// FourSigmaMarketDataApiCost: 1,// CorporationValuation: 1,// BladeburnerRank: 1,// BladeburnerSkillCost: 1,// DaedalusAugsRequirement: 1,// };// }return {HackingLevelMultiplier: 1,StrengthLevelMultiplier: 1,DefenseLevelMultiplier: 1,DexterityLevelMultiplier: 1,AgilityLevelMultiplier: 1,CharismaLevelMultiplier: 1,ServerGrowthRate: 1,ServerMaxMoney: 1,ServerStartingMoney: 1,ServerStartingSecurity: 1,ServerWeakenRate: 1,HomeComputerRamCost: 1,PurchasedServerCost: 1,PurchasedServerLimit: 1,PurchasedServerMaxRam: 1,CompanyWorkMoney: 1,CrimeMoney: 1,HacknetNodeMoney: 1,ManualHackMoney: 1,ScriptHackMoney: 1,CodingContractMoney: 1,ClassGymExpGain: 1,CompanyWorkExpGain: 1,CrimeExpGain: 1,FactionWorkExpGain: 1,HackExpGain: 1,FactionPassiveRepGain: 1,FactionWorkRepGain: 1,RepToDonateToFaction: 1,AugmentationMoneyCost: 1,AugmentationRepCost: 1,InfiltrationMoney: 1,InfiltrationRep: 1,FourSigmaMarketDataCost: 1,FourSigmaMarketDataApiCost: 1,CorporationValuation: 1,BladeburnerRank: 1,BladeburnerSkillCost: 1,DaedalusAugsRequirement: 1,};};const object_get_stats = function(ns) {// try {// return ns.getStats();// }// catch (error) {// ns.tprint(JSON.stringify(error));// return {// hacking: ns.getHackingLevel(),// strength: 1,// defense: 1,// dexterity: 1,// agility: 1,// charisma: 1,// intelligence: 1// };// }return {hacking: ns.getHackingLevel(),strength: 1,defense: 1,dexterity: 1,agility: 1,charisma: 1,intelligence: 1};};// object_constants are from https://github.com/danielyxie/bitburner/blob/master/src/Constants.jsconst object_constants = {// factor used in determining the amount security increases by from a grow or hackServerFortifyAmount: 0.002,// amount security decreases by from a weakenServerWeakenAmount: 0.05,// base percentage cash increases by from a growServerBaseGrowthRate: 1.03,// max percentage cash increases by from a grow (accounts for server security)ServerMaxGrowthRate: 1.0035,// hacking multipliersobject_hacking_multipliers: ns.getHackingMultipliers(),// bitnode multipliersobject_bitnode_multipliers: object_get_bitnode_multipliers(ns),// player statsobject_stats: object_get_stats(ns),// filenames and ram cost of helper object_scriptsarray_workers: ["weaken.js", "grow.js", "hack.js"]};return object_constants;};// targetting// returns the score of a server which is calculated by taking into account its max cash, growth, and required hacking level. adapted from `calculatePercentMoneyHacked` in Hacking.jsconst float_get_server_score = function(ns, string_server_target) {const float_player_hacking_level = ns.getHackingLevel();return ns.getServerMaxMoney(string_server_target) * ns.getServerGrowth(string_server_target) * ((float_player_hacking_level - (ns.getServerRequiredHackingLevel(string_server_target) - 1)) * Math.pow(float_player_hacking_level, -1));};// sort an array of servers by their score, from lowest to highestconst void_sort_by_server_scores = function(ns, array_servers) {return array_servers.sort((string_element_0, string_element_1) => float_get_server_score(ns, string_element_0) - float_get_server_score(ns, string_element_1));};// weaken, grow, hack// returns integer_threads_required if it's less than or equal to integer_threads_available, otherwise returns integer_threads_availableconst integer_get_corrected_threads = function(ns, integer_threads_required, integer_threads_available) {if (integer_threads_required > integer_threads_available) {return integer_threads_available;}else {return integer_threads_required;}};// weaken stuff// the threads required for weaken to cause string_server_target's security to decrease by float_weaken_amount. adapted from `weaken` in NetscriptFunctions.js and `weaken` in Server.tsconst integer_get_threads_required_for_weaken = function(ns, float_weaken_amount) {const object_constants = object_get_constants(ns);return float_weaken_amount * Math.pow(object_constants.ServerWeakenAmount, -1) * Math.pow(object_constants.object_bitnode_multipliers.ServerWeakenRate, -1);};// returns the threads required for weaken to cause string_server_target's security to reach minimumconst integer_get_threads_required_for_weaken_minimum_security = function(ns, string_server_target, float_server_target_security) {return Math.ceil(integer_get_threads_required_for_weaken(ns, float_server_target_security - ns.getServerMinSecurityLevel(string_server_target)));};// returns the threads required for weaken to cause string_server_target's security to reach minimum if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_weaken = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security) {const string_weaken = object_get_constants(ns).array_workers[0];const integer_threads_available = Math.trunc(float_server_used_ram_free / ns.getScriptRam(string_weaken));const integer_threads_required = integer_get_threads_required_for_weaken_minimum_security(ns, string_server_target, float_server_target_security);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// returns the security decrease from the weaken threads used. Adapted from `weaken` in NetscriptFunctions.js and `weaken` in Server.tsconst float_get_security_decrease_from_weaken = function(ns, integer_threads_weaken) {return integer_threads_weaken * object_get_constants(ns).ServerWeakenAmount;};// grow stuff// returns the number of threads of `grow` needed to grow `string_server_target` by the percentage `float_growth` when it has security of `float_server_security`. float_growth = How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50). adapted from `numCycleForGrowth` in https://github.com/danielyxie/bitburner/blob/master/src/Server/ServerHelpers.tsconst integer_get_threads_for_growth = function(ns, string_server_target, float_server_target_security, float_growth) {const object_constants = object_get_constants(ns);let ajdGrowthRate = 1 + (object_constants.ServerBaseGrowthRate - 1) / float_server_target_security;if (ajdGrowthRate > object_constants.ServerMaxGrowthRate) {ajdGrowthRate = object_constants.ServerMaxGrowthRate;}const serverGrowthPercentage = ns.getServerGrowth(string_server_target) / 100;const cycles = Math.log(float_growth)/(Math.log(ajdGrowthRate) * object_constants.object_hacking_multipliers.growth * serverGrowthPercentage * object_constants.object_bitnode_multipliers.ServerGrowthRate);return Math.ceil(cycles);};// Inverse function of integer_get_threads_for_growth. Returns the percentage growth in decimal form (e.g., 2 = 100% growth).const float_get_growth_from_threads = function(ns, string_server_target, float_server_target_security, integer_threads) {const object_constants = object_get_constants(ns);let ajdGrowthRate = 1 + (object_constants.ServerBaseGrowthRate - 1) / float_server_target_security;if (ajdGrowthRate > object_constants.ServerMaxGrowthRate) {ajdGrowthRate = object_constants.ServerMaxGrowthRate;}const serverGrowthPercentage = ns.getServerGrowth(string_server_target) / 100;const float_growth = Math.pow(ajdGrowthRate, integer_threads * object_constants.object_hacking_multipliers.growth * serverGrowthPercentage * object_constants.object_bitnode_multipliers.ServerGrowthRate);return float_growth;};// returns the threads required by grow to grow string_server_target's cash to its maximum when security is at float_server_target_security and current cash is at float_server_target_cashconst integer_get_threads_required_for_grow_maximum_cash = function(ns, string_server_target, float_server_target_security, float_server_target_cash) {return integer_get_threads_for_growth(ns, string_server_target, float_server_target_security, ns.getServerMaxMoney(string_server_target) / float_server_target_cash);};// returns the threads required by grow to grow string_server_target's cash to its maximum if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_grow = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_server_target_cash) {const string_grow = object_get_constants(ns).array_workers[1];const integer_threads_available = Math.trunc(float_server_used_ram_free / ns.getScriptRam(string_grow));const integer_threads_required = integer_get_threads_required_for_grow_maximum_cash(ns, string_server_target, float_server_target_security, float_server_target_cash);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// returns the security increase from the growth threads used. Adapted from `processSingleServerGrowth` in ServerHelpers.ts and `fortify` in Server.tsconst float_get_security_increase_from_grow = function(ns, integer_threads_grow) {return 2 * object_get_constants(ns).ServerFortifyAmount * integer_threads_grow;};// hack stuff// returns the percentage of the available cash in string_server_target that is stolen when it is hacked when it has float_server_target_security. adapted from calculatePercentMoneyHacked() in https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js . See also `hackDifficulty` in https://github.com/danielyxie/bitburner/blob/master/src/Server.jsconst float_get_percentage_of_cash_from_available_per_hack = function(ns, string_server_target, float_server_target_security) {const object_constants = object_get_constants(ns);const balanceFactor = 240;const difficultyMult = (100 - float_server_target_security) / 100;const skillMult = (ns.getHackingLevel() - (ns.getServerRequiredHackingLevel(string_server_target) - 1)) / ns.getHackingLevel();const percentMoneyHacked = difficultyMult * skillMult * object_constants.object_hacking_multipliers.money / balanceFactor;if (percentMoneyHacked < 0) { return 0; }if (percentMoneyHacked > 1) { return 1; }return percentMoneyHacked * object_constants.object_bitnode_multipliers.ScriptHackMoney;};// returns the threads required to steal "float_percentage_to_steal" of available money in string_server_targetconst integer_get_threads_required_to_hack_percentage = function(ns, string_server_target, float_server_target_security, float_percentage_to_steal) {return Math.ceil(float_percentage_to_steal / float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security));};// returns the threads required to steal "float_percentage_to_steal" of available money in string_server_target if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_hack = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_percentage_to_steal) {const string_hack = object_get_constants(ns).array_workers[2];const integer_threads_available = Math.trunc(float_server_used_ram_free / ns.getScriptRam(string_hack));const integer_threads_required = integer_get_threads_required_to_hack_percentage(ns, string_server_target, float_server_target_security, float_percentage_to_steal);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// returns the security increase from the hack threads. adapted from `hack` in NetscriptFunctions.js and `fortify` in Server.tsconst float_get_security_increase_from_hack = function(ns, string_server_target, float_server_target_security, float_server_target_cash, integer_threads_hack) {let maxThreadNeeded = Math.ceil(1/float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security)*(float_server_target_cash/ns.getServerMaxMoney(string_server_target)));if (isNaN(maxThreadNeeded)) {// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large valuemaxThreadNeeded = 1e6;}return object_get_constants(ns).ServerFortifyAmount * Math.min(integer_threads_hack, maxThreadNeeded);};// percentage to steal stuff// returns the threads required by grow to grow a string_server_target's money back to its original value after stealing float_percentage_to_steal of it, and assuming security is at float_server_target_securityconst integer_get_threads_required_for_cash_grow_after_percentage_stolen = function(ns, string_server_target, float_server_target_security, float_percentage_to_steal) {return integer_get_threads_for_growth(ns, string_server_target, float_server_target_security, Math.pow(1 - float_percentage_to_steal, -1));};// should return true if there is enough ram to provide the threads required by weaken to weaken to minimum security, then by grow to grow string_server_target's cash back to maximum after stealing float_percentage_to_steal of the cash, then by weaken to weaken to minimum security again if possible, otherwise, returns false. assumes security is at float_server_target_securityconst boolean_is_ram_enough_after_hack_percentage = function(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal) {const string_weaken = object_get_constants(ns).array_workers[0];const string_grow = object_get_constants(ns).array_workers[1];const float_server_target_security_after_hack = float_server_target_security + float_get_security_increase_from_hack(ns, string_server_target, float_server_target_security, float_server_target_cash, integer_get_threads_hack(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_percentage_to_steal));const integer_threads_required_for_weaken_minimum_security_after_hack = integer_get_threads_required_for_weaken_minimum_security(ns, string_server_target, float_server_target_security_after_hack);const float_server_target_security_after_weaken = float_server_target_security_after_hack - float_get_security_decrease_from_weaken(ns, integer_threads_required_for_weaken_minimum_security_after_hack);const integer_threads_required_for_cash_grow_after_percentage_stolen = integer_get_threads_required_for_cash_grow_after_percentage_stolen(ns, string_server_target, float_server_target_security_after_weaken, float_percentage_to_steal);const float_server_target_security_after_grow = float_server_target_security_after_weaken + float_get_security_increase_from_grow(ns,integer_threads_required_for_cash_grow_after_percentage_stolen);const integer_threads_required_for_weaken_minimum_security_after_grow = integer_get_threads_required_for_weaken_minimum_security(ns, string_server_target, float_server_target_security_after_grow);const float_ram_required = (integer_threads_required_for_weaken_minimum_security_after_hack * ns.getScriptRam(string_weaken)) + (integer_threads_required_for_cash_grow_after_percentage_stolen * ns.getScriptRam(string_grow)) + (integer_threads_required_for_weaken_minimum_security_after_grow * ns.getScriptRam(string_weaken));if (float_ram_required < float_server_used_ram_free) {return true;}else {return false;}};// returns the number of cycles of bisection to be done to reach a certain precision, rounded up to the nearest integerconst integer_get_cycles_for_bisection_precision = function(ns, float_precision) {return Math.ceil(Math.log(Math.pow(float_precision, -1)) * Math.pow(Math.log(2), -1));};// this should return optimum percentage to steal such that cash stolen at most is as high as float_steal_cap and string_server_target's security is able to be weakened to minimum with one weaken after the hack, its cash grown to 100% after one grow after the weaken, then its security weakened again to minimum with one weaken, all with the ram it has remaining after the hack by using a binary search algorithmconst float_get_percentage_to_steal = function(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_precision, float_steal_cap) {const integer_cycles_for_bisection_precision = integer_get_cycles_for_bisection_precision(ns, float_precision);let float_ceiling = 1;let float_floor = 0;let float_percentage_to_steal = (float_ceiling + float_floor) * 0.5;for (let integer_indices_0 = 0; integer_indices_0 < integer_cycles_for_bisection_precision; ++integer_indices_0) {if (boolean_is_ram_enough_after_hack_percentage(ns, float_server_used_ram_free, string_server_target, float_server_target_cash, float_server_target_security, float_percentage_to_steal)) {float_floor = float_percentage_to_steal;}else {float_ceiling = float_percentage_to_steal;}float_percentage_to_steal = (float_ceiling + float_floor) * 0.5;if (float_percentage_to_steal > float_steal_cap) {break;}}// cap which can be used so not all money is stolen, which can be bad because it's harder to grow from 0 in most casesif (float_percentage_to_steal > float_steal_cap) {return float_steal_cap;}else {return float_percentage_to_steal;}};// schedulingconst array_get_servers_rooted_sorted_by_score = function(ns) {let array_servers_rooted = array_get_servers_rooted(ns);void_sort_by_server_scores(ns, array_servers_rooted);return array_servers_rooted;};const string_get_server_rooted_hackable_with_score_biggest = function(ns) {const array_servers_rooted_sorted_by_score = array_get_servers_rooted_sorted_by_score(ns);// iterate through array in reversefor (let integer_indices_0 = array_servers_rooted_sorted_by_score.length - 1; integer_indices_0 >= 0; --integer_indices_0) {const string_server_target = array_servers_rooted_sorted_by_score[integer_indices_0];if (ns.getHackingLevel() >= ns.getServerRequiredHackingLevel(string_server_target)) {return string_server_target;}}};const string_job_decider_prepare = function(ns, string_server_target, float_server_target_security, float_server_target_cash) {if (float_server_target_security > ns.getServerMinSecurityLevel(string_server_target)) {return "weaken";}if (float_server_target_cash < ns.getServerMaxMoney(string_server_target)) {return "grow";}return "";};const string_job_decider = function(ns, string_server_target, float_server_target_security, float_server_target_cash) {if (float_server_target_security > ns.getServerMinSecurityLevel(string_server_target)) {return "weaken";}else {if (float_server_target_cash < ns.getServerMaxMoney(string_server_target)) {return "grow";}else {return "hack";}}};const boolean_can_server_run_script_threads = function(ns, float_server_used_ram_free, float_script_ram, integer_threads) {if (float_script_ram * integer_threads > float_server_used_ram_free) {return false;}else {return true;}};// Returns time it takes to complete a hack on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsconst float_get_time_hack = function(ns, string_server_target, float_server_target_security) {const object_constants = object_get_constants(ns);const difficultyMult = ns.getServerRequiredHackingLevel(string_server_target) * float_server_target_security;const baseDiff = 500;const baseSkill = 50;const diffFactor = 2.5;const intFactor = 0.1;const hack_stat = object_constants.object_stats.hacking;const int = object_constants.object_stats.intelligence;var skillFactor = (diffFactor * difficultyMult + baseDiff);// tslint:disable-next-lineskillFactor /= (hack_stat + baseSkill + (intFactor * int));const hackTimeMultiplier = 5;const hackingTime = hackTimeMultiplier * skillFactor / object_constants.object_hacking_multipliers.speed;return hackingTime;};// Returns time it takes to complete a grow operation on a server, in seconds. Adapted from `calculateGrowTime` in Hacking.jsconst float_get_time_grow = function(ns, string_server_target, float_server_target_security) {const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2return growTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security);};// Returns time it takes to complete a weaken operation on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsconst float_get_time_weaken = function(ns, string_server_target, float_server_target_security) {const weakenTimeMultiplier = 4; // Relative to hacking timereturn weakenTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security);};// makes a scheduleconst array_make_schedule = function(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target, string_decider) {const array_workers = object_get_constants(ns).array_workers;const string_weaken = array_workers[0];const string_grow = array_workers[1];const string_hack = array_workers[2];const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram(ns);const float_server_target_security_minimum = ns.getServerMinSecurityLevel(string_server_target);const float_server_target_cash_maximum = ns.getServerMaxMoney(string_server_target);const float_time_weaken = float_get_time_weaken(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));const float_time_grow = float_get_time_grow(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));const float_time_hack = float_get_time_hack(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));// tripwireslet boolean_end_loop_array_servers = false;let boolean_end_loop_server = false;let float_server_target_security_current = ns.getServerSecurityLevel(string_server_target);let float_server_target_cash_current = ns.getServerMoneyAvailable(string_server_target);let array_schedule = [];let integer_array_schedule_length = 0;let integer_time_job_finishes_seconds = Math.max(float_time_weaken, float_time_grow, float_time_hack);// iterate through servers in reverse to use servers with the biggest rams firstfor (let integer_indices_0 = array_servers_rooted_sorted_by_ram.length - 1; integer_indices_0 >= 0; --integer_indices_0) {if (integer_array_schedule_length >= integer_job_cap ||boolean_end_loop_array_servers) {break;}const string_server_used = array_servers_rooted_sorted_by_ram[integer_indices_0];let float_server_used_ram_free_current = float_get_server_ram_free(ns, string_server_used);while (float_server_used_ram_free_current > 0 &&integer_array_schedule_length < integer_job_cap &&!boolean_end_loop_array_servers &&!boolean_end_loop_server) {const string_job = string_decider(ns, string_server_target, float_server_target_security_current, float_server_target_cash_current);const schedule_item = {string_job: string_job,string_server_used: string_server_used,string_server_target: string_server_target,float_server_target_security_before: float_server_target_security_current,float_server_target_cash_before: float_server_target_cash_current};switch (string_job) {case "": {boolean_end_loop_array_servers = true;break;}case "weaken": {if (!boolean_can_server_run_script_threads(ns, float_server_used_ram_free_current, ns.getScriptRam(string_weaken), 1)) {// start using a server with more ramboolean_end_loop_server = true;break;}const integer_threads_weaken = integer_get_threads_weaken(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current);float_server_used_ram_free_current -= integer_threads_weaken * ns.getScriptRam(string_weaken);const float_server_target_security_uncorrected = float_server_target_security_current - float_get_security_decrease_from_weaken(ns, integer_threads_weaken);if (float_server_target_security_uncorrected < float_server_target_security_minimum) {float_server_target_security_current = float_server_target_security_minimum;}else {float_server_target_security_current = float_server_target_security_uncorrected;}schedule_item.float_server_target_security_current = float_server_target_security_current;schedule_item.float_delay_seconds = integer_time_job_finishes_seconds - float_time_weaken + float_padding_seconds;integer_time_job_finishes_seconds += float_padding_seconds;schedule_item.integer_time_job_finishes_seconds = integer_time_job_finishes_seconds;schedule_item.integer_threads = integer_threads_weaken;array_schedule.push(schedule_item);++integer_array_schedule_length;break;}case "grow": {if (!boolean_can_server_run_script_threads(ns, float_server_used_ram_free_current, ns.getScriptRam(string_grow), 1)) {// start using a server with more ramboolean_end_loop_server = true;break;}if (float_server_target_cash_current === 0) {float_server_target_cash_current = 1; // counts 0 cash as 1 so it can still grow. taken from `grow` in NetscriptFunctions.js}const integer_threads_grow = integer_get_threads_grow(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_server_target_cash_current);float_server_used_ram_free_current -= integer_threads_grow * ns.getScriptRam(string_grow);const float_server_target_cash_current_uncorrected = float_server_target_cash_current * float_get_growth_from_threads(ns, string_server_target, float_server_target_security_current, integer_threads_grow);if (float_server_target_cash_current_uncorrected > float_server_target_cash_maximum) {float_server_target_cash_current = float_server_target_cash_maximum;}else {float_server_target_cash_current = float_server_target_cash_current_uncorrected;}// the following is adapted from `processSingleServerGrowth` in ServerHelpers.ts and `fortify` in Server.tsfloat_server_target_security_current += float_get_security_increase_from_grow(ns, integer_threads_grow);schedule_item.float_server_target_security_current = float_server_target_security_current;schedule_item.float_delay_seconds = integer_time_job_finishes_seconds - float_time_grow + float_padding_seconds;integer_time_job_finishes_seconds += float_padding_seconds;schedule_item.integer_time_job_finishes_seconds = integer_time_job_finishes_seconds;schedule_item.integer_threads = integer_threads_grow;array_schedule.push(schedule_item);++integer_array_schedule_length;break;}case "hack": {if (!boolean_can_server_run_script_threads(ns, float_server_used_ram_free_current, ns.getScriptRam(string_hack), 1)) {// start using a server with more ramboolean_end_loop_server = true;break;}const integer_threads_hack = integer_get_threads_hack(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_get_percentage_to_steal(ns, float_server_used_ram_free_current, string_server_target, float_server_target_cash_current, float_server_target_security_current, float_precision, float_steal_cap));float_server_used_ram_free_current -= integer_threads_hack * ns.getScriptRam(string_hack);// the following is adapted from `hack` in NetscriptFunctions.js and `fortify` in Server.tsconst float_server_target_cash_before = float_server_target_cash_current;const float_server_target_cash_current_uncorrected = float_server_target_cash_current - Math.floor(float_server_target_cash_current * float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security_current)) * integer_threads_hack;if (float_server_target_cash_current_uncorrected < 0) {float_server_target_cash_current = 0;}else {float_server_target_cash_current = float_server_target_cash_current_uncorrected;}float_server_target_security_current += float_get_security_increase_from_hack(ns, string_server_target, float_server_target_security_current, float_server_target_cash_before, integer_threads_hack);schedule_item.float_server_target_security_current = float_server_target_security_current;schedule_item.float_delay_seconds = integer_time_job_finishes_seconds - float_time_hack + float_padding_seconds;integer_time_job_finishes_seconds += float_padding_seconds;schedule_item.integer_time_job_finishes_seconds = integer_time_job_finishes_seconds;schedule_item.integer_threads = integer_threads_hack;array_schedule.push(schedule_item);++integer_array_schedule_length;break;}}}}// remove jobs near the end that cause security to not equal minimum. in other words, the target should have minimum security when the schedule finishes. this is to make the jobs in the next schedule run as quick as possible. TODO: make it so that we don't have to do this deleting step, instead, the array making steps above should already take into this into account and don't make more items than is needed.let array_schedule_edited = array_schedule;let boolean_have_not_seen_item_with_security_minimum = true;while (boolean_have_not_seen_item_with_security_minimum) {for (let integer_indices_1 = array_schedule_edited.length - 1; integer_indices_1 >= 0; --integer_indices_1) {if (!boolean_have_not_seen_item_with_security_minimum) {break;}const object_job = array_schedule_edited[integer_indices_1];if (object_job.float_server_target_security_current === float_server_target_security_minimum) {boolean_have_not_seen_item_with_security_minimum = false;break;}else {array_schedule_edited.splice(integer_indices_1, 1);}}}if (boolean_have_not_seen_item_with_security_minimum) {return array_schedule;}else {return array_schedule_edited;}};const void_schedule_runner = async function(ns, array_schedule) {const array_workers = object_get_constants(ns).array_workers;for (let integer_indices_0 = 0; integer_indices_0 < array_schedule.length; ++integer_indices_0) {const string_job = array_schedule[integer_indices_0].string_job;const string_server_used = array_schedule[integer_indices_0].string_server_used;const string_server_target = array_schedule[integer_indices_0].string_server_target;const integer_threads = array_schedule[integer_indices_0].integer_threads;const float_delay = array_schedule[integer_indices_0].float_delay_seconds * 1000;const identifier = integer_indices_0;let string_script = "";switch (string_job) {case "weaken": {string_script = array_workers[0];break;}case "grow": {string_script = array_workers[1];break;}case "hack": {string_script = array_workers[2];break;}}await ns.exec(string_script, string_server_used, integer_threads, string_server_used, string_server_target, float_delay, identifier);}};// returns the the time it'll take to finish in milliseconds.const void_runner = async function(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target_argument) {let integer_time_start = Date.now();let string_server_target = string_server_target_argument;if (string_server_target_argument === "") {string_server_target = string_get_server_rooted_hackable_with_score_biggest(ns);}// prepare the target if necessarywhile (true) {if (ns.getServerSecurityLevel(string_server_target) === ns.getServerMinSecurityLevel(string_server_target) &&ns.getServerMoneyAvailable(string_server_target) === ns.getServerMaxMoney(string_server_target)) {break;}const array_schedule_prepare = array_make_schedule(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target, string_job_decider_prepare);if (array_schedule_prepare.length > 0) {await void_schedule_runner(ns, array_schedule_prepare);await ns.sleep((array_schedule_prepare[array_schedule_prepare.length - 1].integer_time_job_finishes_seconds * 1000) - integer_time_start + Date.now());}}// make and run actual hacking scheduleconst array_schedule = array_make_schedule(ns, integer_job_cap, float_precision, float_steal_cap, float_padding_seconds, string_server_target, string_job_decider);await void_schedule_runner(ns, array_schedule);return (array_schedule[array_schedule.length - 1].integer_time_job_finishes_seconds * 1000) - integer_time_start + Date.now();};
export const main = async function(ns) {await ns.sleep(ns.args[2]);// const start = Date.now();// const s = new Date(start);await ns.hack(ns.args[1]);// const finish = Date.now();// const f = new Date(finish);// ns.tprint("\t#" + ns.args[3] + "\t" + ns.args[0] + " hacking " + ns.args[1] + "\nHack started:\t\t" + s.toISOString() + "\nHack finished:\t\t" + f.toISOString());};
export const main = async function(ns) {await ns.sleep(ns.args[2]);// const start = Date.now();// const s = new Date(start);await ns.grow(ns.args[1]);// const finish = Date.now();// const f = new Date(finish);// ns.tprint("\t#" + ns.args[3] + "\t" + ns.args[0] + " growing " + ns.args[1] + "\nGrow started:\t\t" + s.toISOString() + "\nGrow finished:\t\t" + f.toISOString());};
export const main = async function (ns) {for (;;) await ns.weaken(ns.args[0]), await ns.sleep(1);};
// botnet.js - 2.15GB - opens ports and nukes any unrooted servers if the player's hacking level is high enough to do so and the appropriate number of object_exploits are presentexport const main = async function(ns) {const float_period_check = ns.args[0] * 1000;const object_get_constants = function(ns) {// object_constants are from https://github.com/danielyxie/bitburner/blob/master/src/Constants.jsconst object_constants = {// filenames and related functions of exploitsarray_exploits: [ns.brutessh, ns.ftpcrack, ns.relaysmtp, ns.httpworm, ns.sqlinject],// name of current host (usually "home")string_host: "home" // or ns.getHostname()};return object_constants;};// returns an array of all servers in the gameconst array_get_servers = function(ns) {const string_host = object_get_constants(ns).string_host;const array_servers = [string_host];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const array_scan_results = ns.scan(array_servers[integer_indices_0]);for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {array_servers.push(array_scan_results[integer_indices_1]);}}}return array_servers;};// returns an array of all servers that are yet to be rootedconst array_get_servers_unrooted = function(ns) {const array_servers = array_get_servers(ns);const array_servers_unrooted = [];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {if (!ns.hasRootAccess(array_servers[integer_indices_0])) {array_servers_unrooted.push(array_servers[integer_indices_0]);}}return array_servers_unrooted;};// tries to open ports of serverconst void_open_ports_try = function(ns, string_server_target) {const array_exploits = object_get_constants(ns).array_exploits;for (let integer_indices_0 = 0; integer_indices_0 < array_exploits.length; ++integer_indices_0) {const string_exploit_function = array_exploits[integer_indices_0];try {string_exploit_function(string_server_target);}catch (error) {ns.print(JSON.stringify(error));}}};while(true) {const array_servers_unrooted = array_get_servers_unrooted(ns);if (array_servers_unrooted.length === 0) {break;}for (let integer_indices_0 = 0; integer_indices_0 < array_servers_unrooted.length; ++integer_indices_0) {const string_server_unrooted = array_servers_unrooted[integer_indices_0];void_open_ports_try(ns, string_server_unrooted);try {ns.nuke(string_server_unrooted);} catch (error) {ns.print(JSON.stringify(error));}}await ns.sleep(float_period_check);}};
{"name": "bitburner_scripts","version": "0.1.0","description": "Scripts for the game \"Bitburner\".","main": "index.js","dependencies": {"http-server": "^0.12.3"},"devDependencies": {},"scripts": {"start": "http-server -p 8080 -a 127.0.0.1 --cors -c-1","test": "echo \"Error: no test specified\" && exit 1"},"keywords": ["bitburner","netscript"],"author": "Jesse Ira Abadilla","license": "BlueOak-1.0.0"}
{"name": "a","version": "0.1.0","lockfileVersion": 2,"requires": true,"packages": {"": {"name": "a","dependencies": {"http-server": "^0.12.3"},"devDependencies": {}},"node_modules/async": {"version": "2.6.3","resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz","integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","dependencies": {"lodash": "^4.17.14"}},"node_modules/basic-auth": {"version": "1.1.0","resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz","integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=","engines": {"node": ">= 0.6"}},"node_modules/colors": {"version": "1.4.0","resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz","integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==","engines": {"node": ">=0.1.90"}},"node_modules/corser": {"version": "2.0.1","resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz","integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=","engines": {"node": ">= 0.4.0"}},"node_modules/debug": {"version": "3.2.7","resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz","integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==","dependencies": {"ms": "^2.1.1"}},"node_modules/ecstatic": {"version": "3.3.2","resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz","integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==","dependencies": {"he": "^1.1.1","mime": "^1.6.0","minimist": "^1.1.0","url-join": "^2.0.5"},"bin": {"ecstatic": "lib/ecstatic.js"}},"node_modules/eventemitter3": {"version": "4.0.7","resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz","integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="},"node_modules/follow-redirects": {"version": "1.13.1","resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz","integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==","engines": {"node": ">=4.0"}},"node_modules/he": {"version": "1.2.0","resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz","integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==","bin": {"he": "bin/he"}},"node_modules/http-proxy": {"version": "1.18.1","resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz","integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==","dependencies": {"eventemitter3": "^4.0.0","follow-redirects": "^1.0.0","requires-port": "^1.0.0"},"engines": {"node": ">=8.0.0"}},"node_modules/http-server": {"version": "0.12.3","resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz","integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==","dependencies": {"basic-auth": "^1.0.3","colors": "^1.4.0","corser": "^2.0.1","ecstatic": "^3.3.2","http-proxy": "^1.18.0","minimist": "^1.2.5","opener": "^1.5.1","portfinder": "^1.0.25","secure-compare": "3.0.1","union": "~0.5.0"},"bin": {"hs": "bin/http-server","http-server": "bin/http-server"},"engines": {"node": ">=6"}},"node_modules/lodash": {"version": "4.17.20","resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="},"node_modules/mime": {"version": "1.6.0","resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz","integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==","bin": {"mime": "cli.js"},"engines": {"node": ">=4"}},"node_modules/minimist": {"version": "1.2.5","resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="},"node_modules/mkdirp": {"version": "0.5.5","resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","dependencies": {"minimist": "^1.2.5"},"bin": {"mkdirp": "bin/cmd.js"}},"node_modules/ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz","integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="},"node_modules/opener": {"version": "1.5.2","resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz","integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==","bin": {"opener": "bin/opener-bin.js"}},"node_modules/portfinder": {"version": "1.0.28","resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz","integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==","dependencies": {"async": "^2.6.2","debug": "^3.1.1","mkdirp": "^0.5.5"},"engines": {"node": ">= 0.12.0"}},"node_modules/qs": {"version": "6.9.4","resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==","engines": {"node": ">=0.6"}},"node_modules/requires-port": {"version": "1.0.0","resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="},"node_modules/secure-compare": {"version": "3.0.1","resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz","integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="},"node_modules/union": {"version": "0.5.0","resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz","integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==","dependencies": {"qs": "^6.4.0"},"engines": {"node": ">= 0.8.0"}},"node_modules/url-join": {"version": "2.0.5","resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz","integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="}},"dependencies": {"async": {"version": "2.6.3","resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz","integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","requires": {"lodash": "^4.17.14"}},"basic-auth": {"version": "1.1.0","resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz","integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ="},"colors": {"version": "1.4.0","resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz","integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="},"corser": {"version": "2.0.1","resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz","integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c="},"debug": {"version": "3.2.7","resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz","integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==","requires": {"ms": "^2.1.1"}},"ecstatic": {"version": "3.3.2","resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz","integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==","requires": {"he": "^1.1.1","mime": "^1.6.0","minimist": "^1.1.0","url-join": "^2.0.5"}},"eventemitter3": {"version": "4.0.7","resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz","integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="},"follow-redirects": {"version": "1.13.1","resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz","integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg=="},"he": {"version": "1.2.0","resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz","integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="},"http-proxy": {"version": "1.18.1","resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz","integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==","requires": {"eventemitter3": "^4.0.0","follow-redirects": "^1.0.0","requires-port": "^1.0.0"}},"http-server": {"version": "0.12.3","resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz","integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==","requires": {"basic-auth": "^1.0.3","colors": "^1.4.0","corser": "^2.0.1","ecstatic": "^3.3.2","http-proxy": "^1.18.0","minimist": "^1.2.5","opener": "^1.5.1","portfinder": "^1.0.25","secure-compare": "3.0.1","union": "~0.5.0"}},"lodash": {"version": "4.17.20","resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="},"mime": {"version": "1.6.0","resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz","integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="},"minimist": {"version": "1.2.5","resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="},"mkdirp": {"version": "0.5.5","resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","requires": {"minimist": "^1.2.5"}},"ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz","integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="},"opener": {"version": "1.5.2","resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz","integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A=="},"portfinder": {"version": "1.0.28","resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz","integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==","requires": {"async": "^2.6.2","debug": "^3.1.1","mkdirp": "^0.5.5"}},"qs": {"version": "6.9.4","resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="},"requires-port": {"version": "1.0.0","resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="},"secure-compare": {"version": "3.0.1","resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz","integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="},"union": {"version": "0.5.0","resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz","integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==","requires": {"qs": "^6.4.0"}},"url-join": {"version": "2.0.5","resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz","integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="}}}
var urljoin = require('../lib/url-join');describe('url join', function () {it('should work for simple case', function () {urljoin('http://www.google.com/', 'foo/bar', '?test=123').should.eql('http://www.google.com/foo/bar?test=123');});it('should work for simple case with new syntax', function () {urljoin(['http://www.google.com/', 'foo/bar', '?test=123']).should.eql('http://www.google.com/foo/bar?test=123');});it('should work for hashbang urls', function () {urljoin(['http://www.google.com', '#!', 'foo/bar', '?test=123']).should.eql('http://www.google.com/#!/foo/bar?test=123');});it('should be able to join protocol', function () {urljoin('http:', 'www.google.com/', 'foo/bar', '?test=123').should.eql('http://www.google.com/foo/bar?test=123');});it('should be able to join protocol with slashes', function () {urljoin('http://', 'www.google.com/', 'foo/bar', '?test=123').should.eql('http://www.google.com/foo/bar?test=123');});it('should remove extra slashes', function () {urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123').should.eql('http://www.google.com/foo/bar?test=123');});it('should not remove extra slashes in an encoded URL', function () {urljoin('http:', 'www.google.com///', 'foo/bar', '?url=http%3A//Ftest.com').should.eql('http://www.google.com/foo/bar?url=http%3A//Ftest.com');urljoin('http://a.com/23d04b3/', '/b/c.html').should.eql('http://a.com/23d04b3/b/c.html').should.not.eql('http://a.com/23d04b3//b/c.html');});it('should support anchors in urls', function () {urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '#faaaaa').should.eql('http://www.google.com/foo/bar?test=123#faaaaa');});it('should support protocol-relative urls', function () {urljoin('//www.google.com', 'foo/bar', '?test=123').should.eql('//www.google.com/foo/bar?test=123')});it('should support file protocol urls', function () {urljoin('file:/', 'android_asset', 'foo/bar').should.eql('file://android_asset/foo/bar')urljoin('file:', '/android_asset', 'foo/bar').should.eql('file://android_asset/foo/bar')});it('should support absolute file protocol urls', function () {urljoin('file:', '///android_asset', 'foo/bar').should.eql('file:///android_asset/foo/bar')urljoin('file:///', 'android_asset', 'foo/bar').should.eql('file:///android_asset/foo/bar')urljoin('file:///', '//android_asset', 'foo/bar').should.eql('file:///android_asset/foo/bar')urljoin('file:///android_asset', 'foo/bar').should.eql('file:///android_asset/foo/bar')});it.skip('should merge multiple query params properly', function () {urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?key=456').should.eql('http://www.google.com/foo/bar?test=123&key=456');urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?boom=value', '&key=456').should.eql('http://www.google.com/foo/bar?test=123&boom=value&key=456');urljoin('http://example.org/x', '?a=1', '?b=2', '?c=3', '?d=4').should.eql('http://example.org/x?a=1&b=2&c=3&d=4');});//There is a problem with the capital A and the regex in the replace function// /([^:\s\%\3\A])\/+/g// I think the intention of the regex is to avoid replacing two slashes in the query string:// "?url=http%3A//"it.skip('should merge slashes in paths correctly', function () {urljoin('http://example.org', 'a//', 'b//', 'A//', 'B//').should.eql('http://example.org/a/b/A/B/');});it.skip('should merge colons in paths correctly', function () {urljoin('http://example.org/', ':foo:', 'bar').should.eql('http://example.org/:foo:/bar');});it.skip('should merge just a simple path without URL correctly', function() {urljoin('/', 'test').should.eql('/test');});it('should merge a simple path with a number correctly', function() {urljoin('http://blabla.com/', 1).should.eql('http://blabla.com/1');});it.skip('should merge slashes in protocol correctly', function () {urljoin('http://example.org', 'a').should.eql('http://example.org/a');urljoin('http:', '//example.org', 'a').should.eql('http://example.org/a');urljoin('http:///example.org', 'a').should.eql('http://example.org/a');urljoin('file:///example.org', 'a').should.eql('file:///example.org/a');//this one is brokenurljoin('file:example.org', 'a').should.eql('file://example.org/a');urljoin('file:/', 'example.org', 'a').should.eql('file://example.org/a');urljoin('file:', '/example.org', 'a').should.eql('file://example.org/a');urljoin('file:', '//example.org', 'a').should.eql('file://example.org/a');});});
{"_from": "url-join@^2.0.5","_id": "url-join@2.0.5","_inBundle": false,"_integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=","_location": "/url-join","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "url-join@^2.0.5","name": "url-join","escapedName": "url-join","rawSpec": "^2.0.5","saveSpec": null,"fetchSpec": "^2.0.5"},"_requiredBy": ["/ecstatic"],"_resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz","_shasum": "5af22f18c052a000a48d7b82c5e9c2e2feeda728","_spec": "url-join@^2.0.5","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/ecstatic","author": {"name": "José F. Romaniello","email": "jfromaniello@gmail.com","url": "http://joseoncode.com"},"bugs": {"url": "https://github.com/jfromaniello/url-join/issues"},"bundleDependencies": false,"deprecated": false,"description": "Join urls and normalize as in path.join.","devDependencies": {"mocha": "^3.2.0","should": "~1.2.1"},"homepage": "https://github.com/jfromaniello/url-join#readme","keywords": ["url","join"],"license": "MIT","main": "lib/url-join.js","name": "url-join","repository": {"type": "git","url": "git://github.com/jfromaniello/url-join.git"},"scripts": {"test": "mocha --require should"},"version": "2.0.5"}
(function (name, context, definition) {if (typeof module !== 'undefined' && module.exports) module.exports = definition();else if (typeof define === 'function' && define.amd) define(definition);else context[name] = definition();})('urljoin', this, function () {function startsWith(str, searchString) {return str.substr(0, searchString.length) === searchString;}function normalize (str, options) {if (startsWith(str, 'file://')) {// make sure file protocol has max three slashesstr = str.replace(/(\/{0,3})\/*/g, '$1');} else {// make sure protocol is followed by two slashesstr = str.replace(/:\//g, '://');// remove consecutive slashesstr = str.replace(/([^:\s\%\3\A])\/+/g, '$1/');}// remove trailing slash before parameters or hashstr = str.replace(/\/(\?|&|#[^!])/g, '$1');// replace ? in parameters with &str = str.replace(/(\?.+)\?/g, '$1&');return str;}return function () {var input = arguments;var options = {};if (typeof arguments[0] === 'object') {// new syntax with array and optionsinput = arguments[0];options = arguments[1] || {};}var joined = [].slice.call(input, 0).join('/');return normalize(joined, options);};});
{"name": "url-join","version": "2.0.5","homepage": "https://github.com/jfromaniello/url-join","authors": ["José F. Romaniello <jfromaniello@gmail.com>"],"description": "Join urls and normalize as in path.join.","main": "lib/url-join.js","moduleType": ["amd","globals","node"],"keywords": ["url","join"],"license": "MIT","ignore": ["**/.*","node_modules","bower_components","test","tests"]}
Join all arguments together and normalize the resulting url.## Install~~~npm install url-join~~~## Usage~~~javascriptvar urljoin = require('url-join');var fullUrl = urljoin('http://www.google.com', 'a', '/b/cd', '?foo=123');console.log(fullUrl);~~~Prints:~~~'http://www.google.com/a/b/cd?foo=123'~~~## Browser and AMDIt also works in the browser, you can either include ```lib/url-join.js``` in your page:~~~html<script src="url-join.js"></script><script type="text/javascript">urljoin('http://blabla.com', 'foo?a=1')</script>~~~Or using an AMD module system like requirejs:~~~javascriptdefine(['path/url-join.js'], function (urljoin) {urljoin('http://blabla.com', 'foo?a=1');});~~~## LicenseMIT
MIT LicenseCopyright (c) 2015 José F. RomanielloPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
language: node_jsnode_js:- "5"- "4"- "0.12"
node_modules/**.log
var assert = require('assert'),fs = require('fs'),path = require('path'),request = require('request'),vows = require('vows'),union = require('../');vows.describe('union/streaming').addBatch({'When using `union`': {'a simple union server': {topic: function () {var self = this;union.createServer({buffer: false,before: [function (req, res, next) {var chunks = '';req.on('data', function (chunk) {chunks += chunk;});req.on('end', function () {self.callback(null, chunks);});}]}).listen(9000, function () {request.post('http://localhost:9000').write('hello world');});},'should receive complete POST data': function (chunks) {assert.equal(chunks, 'hello world');}},"a simple pipe to a file": {topic: function () {var self = this;union.createServer({before: [function (req, res, next) {var filename = path.join(__dirname, 'fixtures', 'pipe-write-test.txt'),writeStream = fs.createWriteStream(filename);req.pipe(writeStream);writeStream.on('close', function () {res.writeHead(200);fs.createReadStream(filename).pipe(res);});}]}).listen(9044, function () {request({method: 'POST',uri: 'http://localhost:9044',body: 'hello world'}, self.callback);});},'should receive complete POST data': function (err, res, body) {assert.equal(body, 'hello world');}}}}).export(module);
var assert = require('assert'),request = require('request'),vows = require('vows'),union = require('../');vows.describe('union/status-code').addBatch({'When using `union`': {'with a server setting `res.statusCode`': {topic: function () {var server = union.createServer({before: [function (req, res) {res.statusCode = 404;res.end();}]});server.listen(9091, this.callback);},'and sending a request': {topic: function () {request('http://localhost:9091/', this.callback);},'it should have proper `statusCode` set': function (err, res, body) {assert.isTrue(!err);assert.equal(res.statusCode, 404);}}}}}).export(module);
/** simple-test.js: Simple tests for basic streaming and non-streaming HTTP requests with union.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var assert = require('assert'),fs = require('fs'),path = require('path'),spawn = require('child_process').spawn,request = require('request'),vows = require('vows'),macros = require('./helpers/macros');var examplesDir = path.join(__dirname, '..', 'examples', 'simple'),simpleScript = path.join(examplesDir, 'simple.js'),pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8')),fooURI = 'http://localhost:9090/foo',server;vows.describe('union/simple').addBatch({"When using union": {"a simple http server": {topic: function () {server = spawn(process.argv[0], [simpleScript]);server.stdout.on('data', this.callback.bind(this, null));},"a GET request to `/foo`": {topic: function () {request({ uri: fooURI }, this.callback);},"it should respond with `hello world`": function (err, res, body) {macros.assertValidResponse(err, res);assert.equal(body, 'hello world\n');},"it should respond with 'x-powered-by': 'union <version>'": function (err, res, body) {assert.isNull(err);assert.equal(res.headers['x-powered-by'], 'union ' + pkg.version);}},"a POST request to `/foo`": {topic: function () {request.post({ uri: fooURI }, this.callback);},"it should respond with `wrote to a stream!`": function (err, res, body) {macros.assertValidResponse(err, res);assert.equal(body, 'wrote to a stream!');}},"a GET request to `/redirect`": {topic: function () {request.get({url: 'http://localhost:9090/redirect',followRedirect: false}, this.callback);},"it should redirect to `http://www.google.com`": function (err, res, body) {assert.equal(res.statusCode, 302);assert.equal(res.headers.location, "http://www.google.com");}},"a GET request to `/custom_redirect`": {topic: function () {request.get({url: 'http://localhost:9090/custom_redirect',followRedirect: false}, this.callback);},"it should redirect to `/foo`": function (err, res, body) {assert.equal(res.statusCode, 301);assert.equal(res.headers.location, "http://localhost:9090/foo");}},"a GET request to `/async`": {topic: function () {request.get({url: 'http://localhost:9090/async',timeout: 500}, this.callback);},"it should not timeout": function (err, res, body) {assert.ifError(err);assert.equal(res.statusCode, 200);}}}}}).addBatch({"When the tests are over": {"the server should close": function () {server.kill();}}}).export(module);
var assert = require('assert'),request = require('request'),vows = require('vows'),union = require('../');vows.describe('union/properties').addBatch({'When using `union`': {'with a server that responds to requests': {topic: function () {var callback = this.callback;var server = union.createServer({before: [function (req, res) {callback(null, req, res);res.writeHead(200, { 'content-type': 'text' });res.end();}]});server.listen(9092, function () {request('http://localhost:9092/');});},'the `req` should have a proper `httpVersion` set': function (err, req) {assert.isNull(err);assert.equal(req.httpVersion, '1.1');},'the `req` should have a proper `httpVersionMajor` set': function (err, req) {assert.isNull(err);assert.equal(req.httpVersionMajor, 1);},'the `req` should have a proper `httpVersionMinor` set': function (err, req) {assert.isNull(err);assert.equal(req.httpVersionMinor, 1);},'the `req` should have proper `socket` reference set': function (err, req) {var net = require('net');assert.isNull(err);assert.isTrue(req.socket instanceof net.Socket);}}}}).export(module);
/** macros.js: Simple test macros** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var assert = require('assert');var macros = exports;macros.assertValidResponse = function (err, res) {assert.isTrue(!err);assert.equal(res.statusCode, 200);};
// var assert = require('assert'),// request = require('request'),// vows = require('vows'),// union = require('../');// vows.describe('union/header').addBatch({// 'When using `union`': {// 'with a server that responds with a header': {// topic: function () {// var callback = this.callback;// var server = union.createServer({// before: [// function (req, res) {// res.on('header', function () {// callback(null, res);// });// res.writeHead(200, { 'content-type': 'text' });// res.end();// }// ]// });// server.listen(9092, function () {// request('http://localhost:9092/');// });// },// 'it should have proper `headerSent` set': function (err, res) {// assert.isNull(err);// assert.isTrue(res.headerSent);// },// 'it should have proper `_emittedHeader` set': function (err, res) {// assert.isNull(err);// assert.isTrue(res._emittedHeader);// }// }// }// }).export(module);
hello world
/** simple-test.js: Simple tests for basic streaming and non-streaming HTTP requests with union.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var assert = require('assert'),ecstatic = require('ecstatic')(__dirname + '/fixtures/static'),request = require('request'),vows = require('vows'),union = require('../');vows.describe('union/ecstatic').addBatch({"When using union with ecstatic": {topic: function () {union.createServer({before: [ecstatic]}).listen(18082, this.callback);},"a request to /some-file.txt": {topic: function () {request({ uri: 'http://localhost:18082/some-file.txt' }, this.callback);},"should respond with `hello world`": function (err, res, body) {assert.isNull(err);assert.equal(body, 'hello world\n');}},"a request to /404.txt (which does not exist)": {topic: function () {request({ uri: 'http://localhost:18082/404.txt' }, this.callback);},"should respond with 404 status code": function (err, res, body) {assert.isNull(err);assert.equal(res.statusCode, 404);}}}}).export(module);
/** simple-test.js: Simple tests for basic streaming and non-streaming HTTP requests with union.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var assert = require('assert'),fs = require('fs'),path = require('path'),request = require('request'),vows = require('vows'),union = require('../lib/index'),macros = require('./helpers/macros');var doubleWrite = false,server;server = union.createServer({before: [function (req, res) {res.json(200, { 'hello': 'world' });res.emit('next');},function (req, res) {doubleWrite = true;res.json(200, { 'hello': 'world' });res.emit('next');}]});vows.describe('union/double-write').addBatch({"When using union": {"an http server which attempts to write to the response twice": {topic: function () {server.listen(9091, this.callback);},"a GET request to `/foo`": {topic: function () {request({ uri: 'http://localhost:9091/foo' }, this.callback);},"it should respond with `{ 'hello': 'world' }`": function (err, res, body) {macros.assertValidResponse(err, res);assert.deepEqual(JSON.parse(body), { 'hello': 'world' });},"it should not write to the response twice": function () {assert.isFalse(doubleWrite);}}}}}).addBatch({"When the tests are over": {"the server should close": function () {server.close();}}}).export(module);
/** simple-test.js: Simple tests for basic streaming and non-streaming HTTP requests with union.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var assert = require('assert'),connect = require('connect'),request = require('request'),vows = require('vows'),union = require('../');vows.describe('union/body-parser').addBatch({"When using union with connect body parsing via urlencoded() or json()": {topic: function () {union.createServer({buffer: false,before: [connect.urlencoded(),connect.json(),function (req, res) {res.end(JSON.stringify(req.body, true, 2));}]}).listen(8082, this.callback);},"a request to /": {topic: function () {request.post({uri: 'http://localhost:8082/',headers: {'content-type': 'application/json'},body: JSON.stringify({ a: "foo", b: "bar" })}, this.callback);},"should respond with a body-decoded object": function (err, res, body) {assert.isNull(err);assert.equal(res.statusCode, 200);assert.deepEqual(JSON.parse(body),{ a: 'foo', b: 'bar' });}}}}).export(module);
var assert = require('assert'),vows = require('vows'),request = require('request'),union = require('../');function stream_callback(cb) {return function () {var stream = new union.ResponseStream();stream.once("pipe", function (req) {return cb ? cb(null,req) : undefined;});return stream;};}vows.describe('union/after').addBatch({'When using `union`': {'a union server with after middleware': {topic: function () {var self = this;union.createServer({after: [ stream_callback(), stream_callback(self.callback) ]}).listen(9000, function () {request.get('http://localhost:9000');});},'should preserve the request until the last call': function (req) {assert.equal(req.req.httpVersion, '1.1');assert.equal(req.req.url, '/');assert.equal(req.req.method, 'GET');}}}}).export(module);
{"_from": "union@~0.5.0","_id": "union@0.5.0","_inBundle": false,"_integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==","_location": "/union","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "union@~0.5.0","name": "union","escapedName": "union","rawSpec": "~0.5.0","saveSpec": null,"fetchSpec": "~0.5.0"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz","_shasum": "b2c11be84f60538537b846edb9ba266ba0090075","_spec": "union@~0.5.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Charlie Robbins","email": "charlie.robbins@gmail.com"},"bugs": {"url": "https://github.com/flatiron/union/issues"},"bundleDependencies": false,"dependencies": {"qs": "^6.4.0"},"deprecated": false,"description": "A hybrid buffered / streaming middleware kernel backwards compatible with connect.","devDependencies": {"connect": "2.22.x","director": "1.x.x","ecstatic": "0.5.x","request": "2.29.x","vows": "0.8.0"},"engines": {"node": ">= 0.8.0"},"homepage": "https://github.com/flatiron/union#readme","main": "./lib","maintainers": [{"name": "dscape","email": "nuno@nodejitsu.com"}],"name": "union","repository": {"type": "git","url": "git+ssh://git@github.com/flatiron/union.git"},"scripts": {"test": "vows test/*-test.js --spec -i"},"version": "0.5.0"}
/** routing-stream.js: A Stream focused on connecting an arbitrary RequestStream and* ResponseStream through a given Router.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var util = require('util'),union = require('./index'),RequestStream = require('./request-stream'),ResponseStream = require('./response-stream');//// ### function RoutingStream (options)////var RoutingStream = module.exports = function (options) {options = options || {};RequestStream.call(this, options);this.before = options.before || [];this.after = options.after || [];this.response = options.response || options.res;this.headers = options.headers || {'x-powered-by': 'union ' + union.version};this.target = new ResponseStream({response: this.response,headers: this.headers});this.once('pipe', this.route);};util.inherits(RoutingStream, RequestStream);//// Called when this instance is piped to **by another stream**//RoutingStream.prototype.route = function (req) {//// When a `RoutingStream` is piped to://// 1. Setup the pipe-chain between the `after` middleware, the abstract response// and the concrete response.// 2. Attempt to dispatch to the `before` middleware, which represent things such as// favicon, static files, application routing.// 3. If no match is found then pipe to the 404Stream//var self = this,after,error,i;//// Don't allow `this.target` to be writable on HEAD requests//this.target.writable = req.method !== 'HEAD';//// 1. Setup the pipe-chain between the `after` middleware, the abstract response// and the concrete response.//after = [this.target].concat(this.after, this.response);for (i = 0; i < after.length - 1; i++) {//// attach req and res to all streams//after[i].req = req;after[i + 1].req = req;after[i].res = this.response;after[i + 1].res = this.response;after[i].pipe(after[i + 1]);//// prevent multiple responses and memory leaks//after[i].on('error', this.onError);}//// Helper function for dispatching to the 404 stream.//function notFound() {error = new Error('Not found');error.status = 404;self.onError(error);}//// 2. Attempt to dispatch to the `before` middleware, which represent things such as// favicon, static files, application routing.//(function dispatch(i) {if (self.target.modified) {return;}else if (++i === self.before.length) {//// 3. If no match is found then pipe to the 404Stream//return notFound();}self.target.once('next', dispatch.bind(null, i));if (self.before[i].length === 3) {self.before[i](self, self.target, function (err) {if (err) {self.onError(err);} else {self.target.emit('next');}});}else {self.before[i](self, self.target);}})(-1);};RoutingStream.prototype.onError = function (err) {this.emit('error', err);};
/** response-stream.js: A Stream focused on writing any relevant information to* a raw http.ServerResponse object.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var util = require('util'),HttpStream = require('./http-stream');var STATUS_CODES = require('http').STATUS_CODES;//// ### function ResponseStream (options)////var ResponseStream = module.exports = function (options) {var self = this,key;options = options || {};HttpStream.call(this, options);this.writeable = true;this.response = options.response;if (options.headers) {for (key in options.headers) {this.response.setHeader(key, options.headers[key]);}}//// Proxy `statusCode` changes to the actual `response.statusCode`.//Object.defineProperty(this, 'statusCode', {get: function () {return self.response.statusCode;},set: function (value) {self.response.statusCode = value;},enumerable: true,configurable: true});if (this.response) {this._headers = this.response._headers = this.response._headers || {};// Patch to node corethis.response._headerNames = this.response._headerNames || {};//// Proxy to emit "header" event//this._renderHeaders = this.response._renderHeaders;this.response._renderHeaders = function () {if (!self._emittedHeader) {self._emittedHeader = true;self.headerSent = true;self._header = true;self.emit('header');}return self._renderHeaders.call(self.response);};}};util.inherits(ResponseStream, HttpStream);ResponseStream.prototype.writeHead = function (statusCode, statusMessage, headers) {if (typeof statusMessage === 'string') {this.response.statusMessage = statusMessage;} else {this.response.statusMessage = this.response.statusMessage|| STATUS_CODES[statusCode] || 'unknown';headers = statusMessage;}this.response.statusCode = statusCode;if (headers) {var keys = Object.keys(headers);for (var i = 0; i < keys.length; i++) {var k = keys[i];if (k) this.response.setHeader(k, headers[k]);}}};//// Create pass-thru for the necessary// `http.ServerResponse` methods.//['setHeader', 'getHeader', 'removeHeader', '_implicitHeader', 'addTrailers'].forEach(function (method) {ResponseStream.prototype[method] = function () {return this.response[method].apply(this.response, arguments);};});ResponseStream.prototype.json = function (obj) {if (!this.response.writable) {return;}if (typeof obj === 'number') {this.response.statusCode = obj;obj = arguments[1];}this.modified = true;if (!this.response._header && this.response.getHeader('content-type') !== 'application/json') {this.response.setHeader('content-type', 'application/json');}this.end(obj ? JSON.stringify(obj) : '');};ResponseStream.prototype.html = function (str) {if (!this.response.writable) {return;}if (typeof str === 'number') {this.response.statusCode = str;str = arguments[1];}this.modified = true;if (!this.response._header && this.response.getHeader('content-type') !== 'text/html') {this.response.setHeader('content-type', 'text/html');}this.end(str ? str: '');};ResponseStream.prototype.text = function (str) {if (!this.response.writable) {return;}if (typeof str === 'number') {this.response.statusCode = str;str = arguments[1];}this.modified = true;if (!this.response._header && this.response.getHeader('content-type') !== 'text/plain') {this.response.setHeader('content-type', 'text/plain');}this.end(str ? str: '');};ResponseStream.prototype.end = function (data) {if (data && this.writable) {this.emit('data', data);}this.modified = true;this.emit('end');};ResponseStream.prototype.pipe = function () {var self = this,dest;self.dest = dest = HttpStream.prototype.pipe.apply(self, arguments);dest.on('drain', function() {self.emit('drain')})return dest;};ResponseStream.prototype.write = function (data) {this.modified = true;if (this.writable) {return this.dest.write(data);}};ResponseStream.prototype.redirect = function (path, status) {var url = '';if (~path.indexOf('://')) {url = path;} else {url += this.req.connection.encrypted ? 'https://' : 'http://';url += this.req.headers.host;url += (path[0] === '/') ? path : '/' + path;}this.res.writeHead(status || 302, { 'Location': url });this.end();};
/** http-stream.js: Idomatic buffered stream which pipes additional HTTP information.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var url = require('url'),util = require('util'),qs = require('qs'),HttpStream = require('./http-stream');var RequestStream = module.exports = function (options) {options = options || {};HttpStream.call(this, options);this.on('pipe', this.pipeRequest);this.request = options.request;};util.inherits(RequestStream, HttpStream);//// ### function pipeRequest (source)// #### @source {ServerRequest|HttpStream} Source stream piping to this instance// Pipes additional HTTP request metadata from the `source` HTTP stream (either concrete or// abstract) to this instance. e.g. url, headers, query, etc.//// Remark: Is there anything else we wish to pipe?//RequestStream.prototype.pipeRequest = function (source) {this.url = this.originalUrl = source.url;this.method = source.method;this.httpVersion = source.httpVersion;this.httpVersionMajor = source.httpVersionMajor;this.httpVersionMinor = source.httpVersionMinor;this.setEncoding = source.setEncoding;this.connection = source.connection;this.socket = source.socket;if (source.query) {this.query = source.query;}else {this.query = ~source.url.indexOf('?')? qs.parse(url.parse(source.url).query): {};}};// http.serverRequest methods['setEncoding'].forEach(function (method) {RequestStream.prototype[method] = function () {return this.request[method].apply(this.request, arguments);};});
/** index.js: Top-level plugin exposing HTTP features in flatiron** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var union = exports;//// Expose version information//exports.version = require('../package.json').version;//// Expose core union components//union.BufferedStream = require('./buffered-stream');union.HttpStream = require('./http-stream');union.ResponseStream = require('./response-stream');union.RoutingStream = require('./routing-stream');union.createServer = require('./core').createServer;union.errorHandler = require('./core').errorHandler;
/** http-stream.js: Idomatic buffered stream which pipes additional HTTP information.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var url = require('url'),util = require('util'),qs = require('qs'),BufferedStream = require('./buffered-stream');var HttpStream = module.exports = function (options) {options = options || {};BufferedStream.call(this, options.limit);if (options.buffer === false) {this.buffer = false;}this.on('pipe', this.pipeState);};util.inherits(HttpStream, BufferedStream);//// ### function pipeState (source)// #### @source {ServerRequest|HttpStream} Source stream piping to this instance// Pipes additional HTTP metadata from the `source` HTTP stream (either concrete or// abstract) to this instance. e.g. url, headers, query, etc.//// Remark: Is there anything else we wish to pipe?//HttpStream.prototype.pipeState = function (source) {this.headers = source.headers;this.trailers = source.trailers;this.method = source.method;if (source.url) {this.url = this.originalUrl = source.url;}if (source.query) {this.query = source.query;}else if (source.url) {this.query = ~source.url.indexOf('?')? qs.parse(url.parse(source.url).query): {};}};
/** core.js: Core functionality for the Flatiron HTTP (with SPDY support) plugin.** (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var http = require('http'),https = require('https'),fs = require('fs'),stream = require('stream'),HttpStream = require('./http-stream'),RoutingStream = require('./routing-stream');var core = exports;core.createServer = function (options) {var isArray = Array.isArray(options.after),credentials;if (!options) {throw new Error('options is required to create a server');}function requestHandler(req, res) {var routingStream = new RoutingStream({before: options.before,buffer: options.buffer,//// Remark: without new after is a huge memory leak that// pipes to every single open connection//after: isArray && options.after.map(function (After) {return new After;}),request: req,response: res,limit: options.limit,headers: options.headers});routingStream.on('error', function (err) {var fn = options.onError || core.errorHandler;fn(err, routingStream, routingStream.target, function () {routingStream.target.emit('next');});});req.pipe(routingStream);}//// both https and spdy requires same params//if (options.https || options.spdy) {if (options.https && options.spdy) {throw new Error('You shouldn\'t be using https and spdy simultaneously.');}var serverOptions,credentials,key = !options.spdy? 'https': 'spdy';serverOptions = options[key];if (!serverOptions.key || !serverOptions.cert) {throw new Error('Both options.' + key + '.`key` and options.' + key + '.`cert` are required.');}credentials = {key: fs.readFileSync(serverOptions.key),cert: fs.readFileSync(serverOptions.cert)};if (serverOptions.ca) {serverOptions.ca = !Array.isArray(serverOptions.ca)? [serverOptions.ca]: serverOptions.cacredentials.ca = serverOptions.ca.map(function (ca) {return fs.readFileSync(ca);});}if (options.spdy) {// spdy is optional so we require module here rather than on topvar spdy = require('spdy');return spdy.createServer(credentials, requestHandler);}return https.createServer(credentials, requestHandler);}return http.createServer(requestHandler);};core.errorHandler = function error(err, req, res) {if (err) {(this.res || res).writeHead(err.status || 500, err.headers || { "Content-Type": "text/plain" });(this.res || res).end(err.message + "\n");return;}(this.res || res).writeHead(404, {"Content-Type": "text/plain"});(this.res || res).end("Not Found\n");};
/** buffered-stream.js: A simple(r) Stream which is partially buffered into memory.** (C) 2010, Mikeal Rogers** Adapted for Flatiron* (C) 2011, Charlie Robbins & the Contributors* MIT LICENSE**/var events = require('events'),fs = require('fs'),stream = require('stream'),util = require('util');//// ### function BufferedStream (limit)// #### @limit {number} **Optional** Size of the buffer to limit// Constructor function for the BufferedStream object responsible for// maintaining a stream interface which can also persist to memory// temporarily.//var BufferedStream = module.exports = function (limit) {events.EventEmitter.call(this);if (typeof limit === 'undefined') {limit = Infinity;}this.limit = limit;this.size = 0;this.chunks = [];this.writable = true;this.readable = true;this._buffer = true;};util.inherits(BufferedStream, stream.Stream);Object.defineProperty(BufferedStream.prototype, 'buffer', {get: function () {return this._buffer;},set: function (value) {if (!value && this.chunks) {var self = this;this.chunks.forEach(function (c) { self.emit('data', c) });if (this.ended) this.emit('end');this.size = 0;delete this.chunks;}this._buffer = value;}});BufferedStream.prototype.pipe = function () {var self = this,dest;if (self.resume) {self.resume();}dest = stream.Stream.prototype.pipe.apply(self, arguments);//// just incase you are piping to two streams, do not emit data twice.// note: you can pipe twice, but you need to pipe both streams in the same tick.// (this is normal for streams)//if (this.piped) {return dest;}process.nextTick(function () {if (self.chunks) {self.chunks.forEach(function (c) { self.emit('data', c) });self.size = 0;delete self.chunks;}if (!self.readable) {if (self.ended) {self.emit('end');}else if (self.closed) {self.emit('close');}}});this.piped = true;return dest;};BufferedStream.prototype.write = function (chunk) {if (!this.chunks || this.piped) {this.emit('data', chunk);return;}this.chunks.push(chunk);this.size += chunk.length;if (this.limit < this.size) {this.pause();}};BufferedStream.prototype.end = function () {this.readable = false;this.ended = true;this.emit('end');};BufferedStream.prototype.destroy = function () {this.readable = false;this.writable = false;delete this.chunks;};BufferedStream.prototype.close = function () {this.readable = false;this.closed = true;};if (!stream.Stream.prototype.pause) {BufferedStream.prototype.pause = function () {this.emit('pause');};}if (!stream.Stream.prototype.resume) {BufferedStream.prototype.resume = function () {this.emit('resume');};}
var fs = require('fs'),union = require('union');var server = union.createServer({before: [function (req, res) {fs.readFile(__dirname + '/index.html',function (err, data) {if (err) {res.writeHead(500);return res.end('Error loading index.html');}res.writeHead(200);res.end(data);});}]});server.listen(9090);var io = require('socket.io').listen(server);io.sockets.on('connection', function (socket) {socket.emit('news', {hello: 'world'});socket.on('my other event', function (data) {console.log(data);});});
<script src="/socket.io/socket.io.js"></script><script>var socket = io.connect('http://localhost');socket.on('news', function (data) {console.log(data);socket.emit('my other event', { my: 'data' });});</script>
This folder contains an example of how to use Union with Socket.io.First, you'll want to install both Union and Socket.io. Run thiscommand in the folder you placed these two files:npm install union socket.ioYou can run the server like so:node server.jsNow open up your web browser to http://localhost and see the resultsin the console!
// In order to run this example you need to// generate local ssl certificatevar union = require('../../lib'),director = require('director');var router = new director.http.Router();var server = union.createServer({before: [function (req, res) {var found = router.dispatch(req, res);if (!found) {res.emit('next');}}],spdy :{key: './certs/privatekey.pem',cert: './certs/certificate.pem'}});router.get(/foo/, function () {this.res.writeHead(200, { 'Content-Type': 'text/plain' })this.res.end('hello world\n');});server.listen(9090, function () {console.log('union with director running on 9090 with SPDY');});
var fs = require('fs'),path = require('path'),union = require('../../lib'),director = require('director'),favicon = require('./middleware/favicon');var router = new director.http.Router();var server = union.createServer({before: [favicon(path.join(__dirname, 'favicon.png')),function (req, res) {var found = router.dispatch(req, res);if (!found) {res.emit('next');}}]});router.get('/foo', function () {this.res.writeHead(200, { 'Content-Type': 'text/plain' });this.res.end('hello world\n');});router.post('/foo', { stream: true }, function () {var req = this.req,res = this.res,writeStream;writeStream = fs.createWriteStream(__dirname + '/' + Date.now() + '-foo.txt');req.pipe(writeStream);writeStream.on('close', function () {res.writeHead(200, { 'Content-Type': 'text/plain' });res.end('wrote to a stream!');});});router.get('/redirect', function () {this.res.redirect('http://www.google.com');});router.get('/custom_redirect', function () {this.res.redirect('/foo', 301);});router.get('/async', function () {var self = this;process.nextTick(function () {self.req.on('end', function () {self.res.end();})self.req.buffer = false;});});server.listen(9090);console.log('union with director running on 9090');
var spawn = require('child_process').spawn,util = require('util'),ResponseStream = require('../../lib').ResponseStream;/*** Accepts a writable stream, i.e. fs.WriteStream, and returns a StreamStack* whose 'write()' calls are transparently sent to a 'gzip' process before* being written to the target stream.*/var GzipEncode = module.exports = function GzipEncode(options) {ResponseStream.call(this, options);if (compression) {process.assert(compression >= 1 && compression <= 9);this.compression = compression;}this.on('pipe', this.encode);}util.inherits(GzipEncode, ResponseStream);GzipEncode.prototype.encode = function (source) {this.source = source;};GzipEncode.prototype.pipe = function (dest) {if (!this.source) {throw new Error('GzipEncode is only pipeable once it has been piped to');}this.encoder = spawn('gzip', ['-'+this.compression]);this.encoder.stdout.pipe(dest);this.encoder.stdin.pipe(this.source);};inherits(GzipEncoderStack, StreamStack);exports.GzipEncoderStack = GzipEncoderStack;GzipEncoderStack.prototype.compression = 6;
var spawn = require('child_process').spawn,util = require('util'),RequestStream = require('../../lib').RequestStream;var GzipDecode = module.exports = function GzipDecoder(options) {RequestStream.call(this, options);this.on('pipe', this.decode);}util.inherits(GzipDecode, RequestStream);GzipDecode.prototype.decode = function (source) {this.decoder = spawn('gunzip');this.decoder.stdout.on('data', this._onGunzipData.bind(this));this.decoder.stdout.on('end', this._onGunzipEnd.bind(this));source.pipe(this.decoder);}GzipDecoderStack.prototype._onGunzipData = function (chunk) {this.emit('data', chunk);}GzipDecoderStack.prototype._onGunzipEnd = function () {this.emit('end');}
/*!* Connect - favicon* Copyright(c) 2010 Sencha Inc.* Copyright(c) 2011 TJ Holowaychuk* MIT Licensed*//*** Module dependencies.*/var crypto = require('crypto'), fs = require('fs');/*** Favicon cache.*/var icon;/*** Return md5 hash of the given string and optional encoding,* defaulting to hex.** utils.md5('wahoo');* // => "e493298061761236c96b02ea6aa8a2ad"** @param {String} str* @param {String} encoding* @return {String}* @api public*/exports.md5 = function (str, encoding) {return crypto.createHash('md5').update(str).digest(encoding || 'hex');};/*** By default serves the connect favicon, or the favicon* located by the given `path`.** Options:** - `maxAge` cache-control max-age directive, defaulting to 1 day** Examples:** connect.createServer(* connect.favicon()* );** connect.createServer(* connect.favicon(__dirname + '/public/favicon.ico')* );** @param {String} path* @param {Object} options* @return {Function}* @api public*/module.exports = function favicon(path, options) {var options = options || {}, path = path || __dirname + '/../public/favicon.ico', maxAge = options.maxAge || 86400000;return function favicon(req, res, next) {if ('/favicon.ico' == req.url) {if (icon) {res.writeHead(200, icon.headers);res.end(icon.body);} else {fs.readFile(path, function (err, buf) {if (err) return next(err);icon = {headers: {'Content-Type': 'image/x-icon', 'Content-Length': buf.length, 'ETag': '"' + exports.md5(buf) + '"', 'Cache-Control': 'public, max-age=' + (maxAge / 1000)},body: buf};res.writeHead(200, icon.headers);res.end(icon.body);});}} else {next();}};};
var fs = require('fs'),path = require('path'),union = require('../../lib');var server = union.createServer({before: [ function (req,res) {if (req.url === "/foo") {res.text(201, "foo");}} ],after: [function LoggerStream() {var stream = new union.ResponseStream();stream.once("pipe", function (req) {console.log({res: this.res.statusCode, method: this.req.method});});return stream;}]});server.listen(9080);console.log('union running on 9080');
<img src="https://github.com/flatiron/union/raw/master/union.png" /># SynopsisA hybrid streaming middleware kernel backwards compatible with connect.# MotivationThe advantage to streaming middlewares is that they do not require buffering the entire stream in order to execute their function.# Status[](http://travis-ci.org/flatiron/union)# InstallationThere are a few ways to use `union`. Install the library using npm. You can add it to your `package.json` file as a dependancy```bash$ [sudo] npm install union```## UsageUnion's request handling is [connect](https://github.com/senchalabs/connect)-compatible, meaning that all existing connect middlewares should work out-of-the-box with union.**(Union 0.3.x is compatible with connect >= 2.1.0)**In addition, the response object passed to middlewares listens for a "next" event, which is equivalent to calling `next()`. Flatiron middlewares are written in this manner, meaning they are not reverse-compatible with connect.### A simple case``` jsvar fs = require('fs'),union = require('../lib'),director = require('director');var router = new director.http.Router();var server = union.createServer({before: [function (req, res) {var found = router.dispatch(req, res);if (!found) {res.emit('next');}}]});router.get(/foo/, function () {this.res.writeHead(200, { 'Content-Type': 'text/plain' })this.res.end('hello world\n');});router.post(/foo/, { stream: true }, function () {var req = this.req,res = this.res,writeStream;writeStream = fs.createWriteStream(Date.now() + '-foo.txt');req.pipe(writeStream);writeStream.on('close', function () {res.writeHead(200, { 'Content-Type': 'text/plain' });res.end('wrote to a stream!');});});server.listen(9090);console.log('union with director running on 9090');```To demonstrate the code, we use [director](https://github.com/flatiron/director). A light-weight, Client AND Server side URL-Router for Node.js and Single Page Apps!### A case with connectCode based on connect```jsvar connect = require('connect'), http = require('http');var app = connect().use(connect.favicon()).use(connect.logger('dev')).use(connect.static('public')).use(connect.directory('public')).use(connect.cookieParser('my secret here')).use(connect.session()).use(function (req, res) {res.end('Hello from Connect!\n');});http.createServer(app).listen(3000);```Code based on union```jsvar connect = require('connect'), union = require('union');var server = union.createServer({buffer: false,before: [connect.favicon(),connect.logger('dev'),connect.static('public'),connect.directory('public'),connect.cookieParser('my secret here'),connect.session(),function (req, res) {res.end('Hello from Connect!\n');},]}).listen(3000);```### SPDY enabled server example# API## union Static Members### createServer(options)The `options` object is required. Options include:Specification```function createServer(options)@param options {Object}An object literal that represents the configuration for the server.@option before {Array}The `before` value is an array of middlewares, which are used to route and serve incomingrequests. For instance, in the example, `favicon` is a middleware which handles requestsfor `/favicon.ico`.@option after {Array}The `after` value is an array of functions that return stream filters,which are applied after the request handlers in `options.before`.Stream filters inherit from `union.ResponseStream`, which implements theNode.js core streams api with a bunch of other goodies.@option limit {Object}(optional) A value, passed to internal instantiations of `union.BufferedStream`.@option https {Object}(optional) A value that specifies the certificate and key necessary to create an instance of`https.Server`.@option spdy {Object}(optional) A value that specifies the certificate and key necessary to create an instance of`spdy.Server`.@option headers {Object}(optional) An object representing a set of headers to set in every outgoing response```Example```jsvar server = union.createServer({before: [favicon('./favicon.png'),function (req, res) {var found = router.dispatch(req, res);if (!found) {res.emit('next');}}]});```An example of the `https` or `spdy` option.``` js{cert: 'path/to/cert.pem',key: 'path/to/key.pem',ca: 'path/to/ca.pem'}```An example of the `headers` option.``` js{'x-powered-by': 'your-sweet-application v10.9.8'}```## Error HandlingError handler is similiar to middlware but takes an extra argument for error at the beginning.```jsvar handle = function (err, req, res) {res.statusCode = err.status;res.end(req.headers);};var server = union.createServer({onError: handle,before: [favicon('./favicon.png'),function (req, res) {var found = router.dispatch(req, res);if (!found) {res.emit('next');}}]});```## BufferedStream ConstructorThis constructor inherits from `Stream` and can buffer data up to `limit` bytes. It also implements `pause` and `resume` methods.Specification```function BufferedStream(limit)@param limit {Number}the limit for which the stream can be buffered```Example```jsvar bs = union.BufferedStream(n);```## HttpStream ConstructorThis constructor inherits from `union.BufferedStream` and returns a stream with these extra properties:Specification```function HttpStream()```Example```jsvar hs = union.HttpStream();```## HttpStream Instance Members### urlThe url from the request.Example```jshttpStream.url = '';```### headersThe HTTP headers associated with the stream.Example```jshttpStream.headers = '';```### methodThe HTTP method ("GET", "POST", etc).Example```jshttpStream.method = 'POST';```### queryThe querystring associated with the stream (if applicable).Example```jshttpStream.query = '';```## ResponseStream ConstructorThis constructor inherits from `union.HttpStream`, and is additionally writeable. Union supplies this constructor as a basic response stream middleware from which to inherit.Specification```function ResponseStream()```Example```jsvar rs = union.ResponseStream();```# TestsAll tests are written with [vows][0] and should be run with [npm][1]:``` bash$ npm test```# Licence(The MIT License)Copyright (c) 2010-2012 Charlie Robbins & the ContributorsPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.[0]: http://vowsjs.org[1]: http://npmjs.org
Copyright (c) 2010 Charlie Robbins & the Contributors.Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
0.3.4 / 2012-07-24==================* Added SPDY support* Added http redirect utility function
language: node_jsnode_js:- "0.10"- "0.12"- "4"- "6"notifications:email:- travis@nodejitsu.comirc: "irc.freenode.org#nodejitsu"
package-lock.json binary
/*** Dependencies*/var compare = require('./');require('chai').should();/*** Tests*/describe ('secure-compare', function () {it ('compare', function () {compare('abc', 'abc').should.equal(true);compare('abc', 'ab').should.equal(false);});});
{"_from": "secure-compare@3.0.1","_id": "secure-compare@3.0.1","_inBundle": false,"_integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=","_location": "/secure-compare","_phantomChildren": {},"_requested": {"type": "version","registry": true,"raw": "secure-compare@3.0.1","name": "secure-compare","escapedName": "secure-compare","rawSpec": "3.0.1","saveSpec": null,"fetchSpec": "3.0.1"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz","_shasum": "f1a0329b308b221fae37b9974f3d578d0ca999e3","_spec": "secure-compare@3.0.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Vadim Demedes","email": "vdemedes@gmail.com"},"bugs": {"url": "https://github.com/vdemedes/secure-compare/issues"},"bundleDependencies": false,"deprecated": false,"description": "Securely compare two strings, copied from cryptiles","devDependencies": {"chai": "^2.2.0","mocha": "^2.2.1"},"homepage": "https://github.com/vdemedes/secure-compare","keywords": ["secure","compare"],"license": "MIT","main": "index.js","name": "secure-compare","repository": {"type": "git","url": "git+https://github.com/vdemedes/secure-compare.git"},"scripts": {"test": "mocha test"},"version": "3.0.1"}
/*** Expose secure-compare*/module.exports = compare;/*** Secure compare*/function compare (a, b) {if (typeof a !== 'string' || typeof b !== 'string') return false;var mismatch = a.length === b.length ? 0 : 1;if (mismatch) {b = a;}for (var i = 0, il = a.length; i < il; ++i) {mismatch |= (a.charCodeAt(i) ^ b.charCodeAt(i));}return mismatch === 0;};
# secure-compareConstant-time comparison algorithm to prevent timing attacks for Node.js.Copied from [cryptiles](https://github.com/hapijs/cryptiles) by [C J Silverio](https://github.com/ceejbot).### Installation```$ npm install secure-compare --save```### Usage```javascriptvar compare = require('secure-compare');compare('hello world', 'hello world').should.equal(true);compare('你好世界', '你好世界').should.equal(true);compare('hello', 'not hello').should.equal(false);```### Tests```$ npm test```### Licensesecure-compare is released under the MIT license.
node_modules
describe('requires-port', function () {'use strict';var assume = require('assume'), required = require('./');it('is exported as a function', function () {assume(required).is.a('function');});it('does not require empty ports', function () {assume(required('', 'http')).false();assume(required('', 'wss')).false();assume(required('', 'ws')).false();assume(required('', 'cowsack')).false();});it('assumes true for unknown protocols',function () {assume(required('808', 'foo')).true();assume(required('80', 'bar')).true();});it('never requires port numbers for file', function () {assume(required(8080, 'file')).false();});it('does not require port 80 for http', function () {assume(required('80', 'http')).false();assume(required(80, 'http')).false();assume(required(80, 'http://')).false();assume(required(80, 'http://www.google.com')).false();assume(required('8080', 'http')).true();assume(required(8080, 'http')).true();assume(required(8080, 'http://')).true();assume(required(8080, 'http://www.google.com')).true();});it('does not require port 80 for ws', function () {assume(required('80', 'ws')).false();assume(required(80, 'ws')).false();assume(required(80, 'ws://')).false();assume(required(80, 'ws://www.google.com')).false();assume(required('8080', 'ws')).true();assume(required(8080, 'ws')).true();assume(required(8080, 'ws://')).true();assume(required(8080, 'ws://www.google.com')).true();});it('does not require port 443 for https', function () {assume(required('443', 'https')).false();assume(required(443, 'https')).false();assume(required(443, 'https://')).false();assume(required(443, 'https://www.google.com')).false();assume(required('8080', 'https')).true();assume(required(8080, 'https')).true();assume(required(8080, 'https://')).true();assume(required(8080, 'https://www.google.com')).true();});it('does not require port 443 for wss', function () {assume(required('443', 'wss')).false();assume(required(443, 'wss')).false();assume(required(443, 'wss://')).false();assume(required(443, 'wss://www.google.com')).false();assume(required('8080', 'wss')).true();assume(required(8080, 'wss')).true();assume(required(8080, 'wss://')).true();assume(required(8080, 'wss://www.google.com')).true();});it('does not require port 21 for ftp', function () {assume(required('21', 'ftp')).false();assume(required(21, 'ftp')).false();assume(required(21, 'ftp://')).false();assume(required(21, 'ftp://www.google.com')).false();assume(required('8080', 'ftp')).true();assume(required(8080, 'ftp')).true();assume(required(8080, 'ftp://')).true();assume(required(8080, 'ftp://www.google.com')).true();});it('does not require port 70 for gopher', function () {assume(required('70', 'gopher')).false();assume(required(70, 'gopher')).false();assume(required(70, 'gopher://')).false();assume(required(70, 'gopher://www.google.com')).false();assume(required('8080', 'gopher')).true();assume(required(8080, 'gopher')).true();assume(required(8080, 'gopher://')).true();assume(required(8080, 'gopher://www.google.com')).true();});});
{"_from": "requires-port@^1.0.0","_id": "requires-port@1.0.0","_inBundle": false,"_integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=","_location": "/requires-port","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "requires-port@^1.0.0","name": "requires-port","escapedName": "requires-port","rawSpec": "^1.0.0","saveSpec": null,"fetchSpec": "^1.0.0"},"_requiredBy": ["/http-proxy"],"_resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","_shasum": "925d2601d39ac485e091cf0da5c6e694dc3dcaff","_spec": "requires-port@^1.0.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-proxy","author": {"name": "Arnout Kazemier"},"bugs": {"url": "https://github.com/unshiftio/requires-port/issues"},"bundleDependencies": false,"deprecated": false,"description": "Check if a protocol requires a certain port number to be added to an URL.","devDependencies": {"assume": "1.3.x","istanbul": "0.4.x","mocha": "2.3.x","pre-commit": "1.1.x"},"homepage": "https://github.com/unshiftio/requires-port","keywords": ["port","require","http","https","ws","wss","gopher","file","ftp","requires","requried","portnumber","url","parsing","validation","cows"],"license": "MIT","main": "index.js","name": "requires-port","repository": {"type": "git","url": "git+https://github.com/unshiftio/requires-port.git"},"scripts": {"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100","coverage": "istanbul cover _mocha -- test.js","test": "mocha test.js","test-travis": "istanbul cover _mocha --report lcovonly -- test.js","watch": "mocha --watch test.js"},"version": "1.0.0"}
'use strict';/*** Check if we're required to add a port number.** @see https://url.spec.whatwg.org/#default-port* @param {Number|String} port Port number we need to check* @param {String} protocol Protocol we need to check against.* @returns {Boolean} Is it a default port for the given protocol* @api private*/module.exports = function required(port, protocol) {protocol = protocol.split(':')[0];port = +port;if (!port) return false;switch (protocol) {case 'http':case 'ws':return port !== 80;case 'https':case 'wss':return port !== 443;case 'ftp':return port !== 21;case 'gopher':return port !== 70;case 'file':return false;}return port !== 0;};
# requires-port[](http://unshift.io)[](http://browsenpm.org/package/requires-port)[](https://travis-ci.org/unshiftio/requires-port)[](https://david-dm.org/unshiftio/requires-port)[](https://coveralls.io/r/unshiftio/requires-port?branch=master)[](http://webchat.freenode.net/?channels=unshift)The module name says it all, check if a protocol requires a given port.## InstallationThis module is intended to be used with browserify or Node.js and is distributedin the public npm registry. To install it simply run the following command fromyour CLI:```jnpm install --save requires-port```## UsageThe module exports it self as function and requires 2 arguments:1. The port number, can be a string or number.2. Protocol, can be `http`, `http:` or even `https://yomoma.com`. We just splitit at `:` and use the first result. We currently accept the followingprotocols:- `http`- `https`- `ws`- `wss`- `ftp`- `gopher`- `file`It returns a boolean that indicates if protocol requires this port to be addedto your URL.```js'use strict';var required = require('requires-port');console.log(required('8080', 'http')) // trueconsole.log(required('80', 'http')) // false```# LicenseMIT
The MIT License (MIT)Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors.Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
sudo: falselanguage: node_jsnode_js:- "4"- "iojs"- "0.12"- "0.10"script:- "npm run test-travis"after_script:- "npm install coveralls@2 && cat coverage/lcov.info | coveralls"matrix:fast_finish: truenotifications:irc:channels:- "irc.freenode.org#unshift"on_success: changeon_failure: change
node_modulescoverage
'use strict';var test = require('tape');var inspect = require('object-inspect');var SaferBuffer = require('safer-buffer').Buffer;var forEach = require('for-each');var utils = require('../lib/utils');test('merge()', function (t) {t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array');t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });var noOptionsNonObjectSource = utils.merge({ foo: 'baz' }, 'bar');t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true });t.test('avoids invoking array setters unnecessarily',{ skip: typeof Object.defineProperty !== 'function' },function (st) {var setCount = 0;var getCount = 0;var observed = [];Object.defineProperty(observed, 0, {get: function () {getCount += 1;return { bar: 'baz' };},set: function () { setCount += 1; }});utils.merge(observed, [null]);st.equal(setCount, 0);st.equal(getCount, 1);observed[0] = observed[0]; // eslint-disable-line no-self-assignst.equal(setCount, 1);st.equal(getCount, 2);st.end();});t.end();});test('assign()', function (t) {var target = { a: 1, b: 2 };var source = { b: 3, c: 4 };var result = utils.assign(target, source);t.equal(result, target, 'returns the target');t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged');t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched');t.end();});test('combine()', function (t) {t.test('both arrays', function (st) {var a = [1];var b = [2];var combined = utils.combine(a, b);st.deepEqual(a, [1], 'a is not mutated');st.deepEqual(b, [2], 'b is not mutated');st.notEqual(a, combined, 'a !== combined');st.notEqual(b, combined, 'b !== combined');st.deepEqual(combined, [1, 2], 'combined is a + b');st.end();});t.test('one array, one non-array', function (st) {var aN = 1;var a = [aN];var bN = 2;var b = [bN];var combinedAnB = utils.combine(aN, b);st.deepEqual(b, [bN], 'b is not mutated');st.notEqual(aN, combinedAnB, 'aN + b !== aN');st.notEqual(a, combinedAnB, 'aN + b !== a');st.notEqual(bN, combinedAnB, 'aN + b !== bN');st.notEqual(b, combinedAnB, 'aN + b !== b');st.deepEqual([1, 2], combinedAnB, 'first argument is array-wrapped when not an array');var combinedABn = utils.combine(a, bN);st.deepEqual(a, [aN], 'a is not mutated');st.notEqual(aN, combinedABn, 'a + bN !== aN');st.notEqual(a, combinedABn, 'a + bN !== a');st.notEqual(bN, combinedABn, 'a + bN !== bN');st.notEqual(b, combinedABn, 'a + bN !== b');st.deepEqual([1, 2], combinedABn, 'second argument is array-wrapped when not an array');st.end();});t.test('neither is an array', function (st) {var combined = utils.combine(1, 2);st.notEqual(1, combined, '1 + 2 !== 1');st.notEqual(2, combined, '1 + 2 !== 2');st.deepEqual([1, 2], combined, 'both arguments are array-wrapped when not an array');st.end();});t.end();});test('isBuffer()', function (t) {forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], function () {}, /a/g], function (x) {t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer');});var fakeBuffer = { constructor: Buffer };t.equal(utils.isBuffer(fakeBuffer), false, 'fake buffer is not a buffer');var saferBuffer = SaferBuffer.from('abc');t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc');t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer');t.end();});
'use strict';var test = require('tape');var qs = require('../');var utils = require('../lib/utils');var iconv = require('iconv-lite');var SaferBuffer = require('safer-buffer').Buffer;var hasSymbols = require('has-symbols');var hasBigInt = typeof BigInt === 'function';test('stringify()', function (t) {t.test('stringifies a querystring object', function (st) {st.equal(qs.stringify({ a: 'b' }), 'a=b');st.equal(qs.stringify({ a: 1 }), 'a=1');st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');st.end();});t.test('stringifies falsy values', function (st) {st.equal(qs.stringify(undefined), '');st.equal(qs.stringify(null), '');st.equal(qs.stringify(null, { strictNullHandling: true }), '');st.equal(qs.stringify(false), '');st.equal(qs.stringify(0), '');st.end();});t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) {st.equal(qs.stringify(Symbol.iterator), '');st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29');st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29');st.equal(qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),'a[]=Symbol%28Symbol.iterator%29');st.end();});t.test('stringifies bigints', { skip: !hasBigInt }, function (st) {var three = BigInt(3);var encodeWithN = function (value, defaultEncoder, charset) {var result = defaultEncoder(value, defaultEncoder, charset);return typeof value === 'bigint' ? result + 'n' : result;};st.equal(qs.stringify(three), '');st.equal(qs.stringify([three]), '0=3');st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n');st.equal(qs.stringify({ a: three }), 'a=3');st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n');st.equal(qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),'a[]=3');st.equal(qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }),'a[]=3n');st.end();});t.test('adds query prefix', function (st) {st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');st.end();});t.test('with query prefix, outputs blank string given an empty object', function (st) {st.equal(qs.stringify({}, { addQueryPrefix: true }), '');st.end();});t.test('stringifies nested falsy values', function (st) {st.equal(qs.stringify({ a: { b: { c: null } } }), 'a%5Bb%5D%5Bc%5D=');st.equal(qs.stringify({ a: { b: { c: null } } }, { strictNullHandling: true }), 'a%5Bb%5D%5Bc%5D');st.equal(qs.stringify({ a: { b: { c: false } } }), 'a%5Bb%5D%5Bc%5D=false');st.end();});t.test('stringifies a nested object', function (st) {st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');st.end();});t.test('stringifies a nested object with dots notation', function (st) {st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');st.end();});t.test('stringifies an array value', function (st) {st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }),'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d','indices => indices');st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }),'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d','brackets => brackets');st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'comma' }),'a=b%2Cc%2Cd','comma => comma');st.equal(qs.stringify({ a: ['b', 'c', 'd'] }),'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d','default => indices');st.end();});t.test('omits nulls when asked', function (st) {st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b');st.end();});t.test('omits nested nulls when asked', function (st) {st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c');st.end();});t.test('omits array indices when asked', function (st) {st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');st.end();});t.test('stringifies a nested array value', function (st) {st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d');st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'comma' }), 'a%5Bb%5D=c%2Cd'); // a[b]=c,dst.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');st.end();});t.test('stringifies a nested array value with dots notation', function (st) {st.equal(qs.stringify({ a: { b: ['c', 'd'] } },{ allowDots: true, encode: false, arrayFormat: 'indices' }),'a.b[0]=c&a.b[1]=d','indices: stringifies with dots + indices');st.equal(qs.stringify({ a: { b: ['c', 'd'] } },{ allowDots: true, encode: false, arrayFormat: 'brackets' }),'a.b[]=c&a.b[]=d','brackets: stringifies with dots + brackets');st.equal(qs.stringify({ a: { b: ['c', 'd'] } },{ allowDots: true, encode: false, arrayFormat: 'comma' }),'a.b=c,d','comma: stringifies with dots + comma');st.equal(qs.stringify({ a: { b: ['c', 'd'] } },{ allowDots: true, encode: false }),'a.b[0]=c&a.b[1]=d','default: stringifies with dots + indices');st.end();});t.test('stringifies an object inside an array', function (st) {st.equal(qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }),'a%5B0%5D%5Bb%5D=c', // a[0][b]=c'indices => brackets');st.equal(qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }),'a%5B%5D%5Bb%5D=c', // a[][b]=c'brackets => brackets');st.equal(qs.stringify({ a: [{ b: 'c' }] }),'a%5B0%5D%5Bb%5D=c','default => indices');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }),'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1','indices => indices');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }),'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1','brackets => brackets');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }),'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1','default => indices');st.end();});t.test('stringifies an array with mixed objects and primitives', function (st) {st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }),'a[0][b]=1&a[1]=2&a[2]=3','indices => indices');st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }),'a[][b]=1&a[]=2&a[]=3','brackets => brackets');st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }),'a[0][b]=1&a[1]=2&a[2]=3','default => indices');st.end();});t.test('stringifies an object inside an array with dots notation', function (st) {st.equal(qs.stringify({ a: [{ b: 'c' }] },{ allowDots: true, encode: false, arrayFormat: 'indices' }),'a[0].b=c','indices => indices');st.equal(qs.stringify({ a: [{ b: 'c' }] },{ allowDots: true, encode: false, arrayFormat: 'brackets' }),'a[].b=c','brackets => brackets');st.equal(qs.stringify({ a: [{ b: 'c' }] },{ allowDots: true, encode: false }),'a[0].b=c','default => indices');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] },{ allowDots: true, encode: false, arrayFormat: 'indices' }),'a[0].b.c[0]=1','indices => indices');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] },{ allowDots: true, encode: false, arrayFormat: 'brackets' }),'a[].b.c[]=1','brackets => brackets');st.equal(qs.stringify({ a: [{ b: { c: [1] } }] },{ allowDots: true, encode: false }),'a[0].b.c[0]=1','default => indices');st.end();});t.test('does not omit object keys when indices = false', function (st) {st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');st.end();});t.test('uses indices notation for arrays when indices=true', function (st) {st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');st.end();});t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');st.end();});t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) {st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');st.end();});t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) {st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');st.end();});t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) {st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');st.end();});t.test('stringifies a complicated object', function (st) {st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');st.end();});t.test('stringifies an empty value', function (st) {st.equal(qs.stringify({ a: '' }), 'a=');st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');st.end();});t.test('stringifies a null object', { skip: !Object.create }, function (st) {var obj = Object.create(null);obj.a = 'b';st.equal(qs.stringify(obj), 'a=b');st.end();});t.test('returns an empty string for invalid input', function (st) {st.equal(qs.stringify(undefined), '');st.equal(qs.stringify(false), '');st.equal(qs.stringify(null), '');st.equal(qs.stringify(''), '');st.end();});t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) {var obj = { a: Object.create(null) };obj.a.b = 'c';st.equal(qs.stringify(obj), 'a%5Bb%5D=c');st.end();});t.test('drops keys with a value of undefined', function (st) {st.equal(qs.stringify({ a: undefined }), '');st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');st.end();});t.test('url encodes values', function (st) {st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');st.end();});t.test('stringifies a date', function (st) {var now = new Date();var str = 'a=' + encodeURIComponent(now.toISOString());st.equal(qs.stringify({ a: now }), str);st.end();});t.test('stringifies the weird object from qs', function (st) {st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');st.end();});t.test('skips properties that are part of the object prototype', function (st) {Object.prototype.crash = 'test';st.equal(qs.stringify({ a: 'b' }), 'a=b');st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');delete Object.prototype.crash;st.end();});t.test('stringifies boolean values', function (st) {st.equal(qs.stringify({ a: true }), 'a=true');st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');st.equal(qs.stringify({ b: false }), 'b=false');st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');st.end();});t.test('stringifies buffer values', function (st) {st.equal(qs.stringify({ a: SaferBuffer.from('test') }), 'a=test');st.equal(qs.stringify({ a: { b: SaferBuffer.from('test') } }), 'a%5Bb%5D=test');st.end();});t.test('stringifies an object using an alternative delimiter', function (st) {st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');st.end();});t.test('doesn\'t blow up when Buffer global is missing', function (st) {var tempBuffer = global.Buffer;delete global.Buffer;var result = qs.stringify({ a: 'b', c: 'd' });global.Buffer = tempBuffer;st.equal(result, 'a=b&c=d');st.end();});t.test('selects properties when filter=array', function (st) {st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },{ filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }),'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3','indices => indices');st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },{ filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }),'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3','brackets => brackets');st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },{ filter: ['a', 'b', 0, 2] }),'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3','default => indices');st.end();});t.test('supports custom representations when filter=function', function (st) {var calls = 0;var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };var filterFunc = function (prefix, value) {calls += 1;if (calls === 1) {st.equal(prefix, '', 'prefix is empty');st.equal(value, obj);} else if (prefix === 'c') {return void 0;} else if (value instanceof Date) {st.equal(prefix, 'e[f]');return value.getTime();}return value;};st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');st.equal(calls, 5);st.end();});t.test('can disable uri encoding', function (st) {st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');st.end();});t.test('can sort the keys', function (st) {var sort = function (a, b) {return a.localeCompare(b);};st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');st.end();});t.test('can sort the keys at depth 3 or more too', function (st) {var sort = function (a, b) {return a.localeCompare(b);};st.equal(qs.stringify({ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },{ sort: sort, encode: false }),'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb');st.equal(qs.stringify({ a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },{ sort: null, encode: false }),'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b');st.end();});t.test('can stringify with custom encoding', function (st) {st.equal(qs.stringify({ 県: '大阪府', '': '' }, {encoder: function (str) {if (str.length === 0) {return '';}var buf = iconv.encode(str, 'shiftjis');var result = [];for (var i = 0; i < buf.length; ++i) {result.push(buf.readUInt8(i).toString(16));}return '%' + result.join('%');}}), '%8c%a7=%91%e5%8d%e3%95%7b&=');st.end();});t.test('receives the default encoder as a second argument', function (st) {st.plan(2);qs.stringify({ a: 1 }, {encoder: function (str, defaultEncoder) {st.equal(defaultEncoder, utils.encode);}});st.end();});t.test('throws error with wrong encoder', function (st) {st['throws'](function () {qs.stringify({}, { encoder: 'string' });}, new TypeError('Encoder has to be a function.'));st.end();});t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) {st.equal(qs.stringify({ a: SaferBuffer.from([1]) }, {encoder: function (buffer) {if (typeof buffer === 'string') {return buffer;}return String.fromCharCode(buffer.readUInt8(0) + 97);}}), 'a=b');st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, {encoder: function (buffer) {return buffer;}}), 'a=a b');st.end();});t.test('serializeDate option', function (st) {var date = new Date();st.equal(qs.stringify({ a: date }),'a=' + date.toISOString().replace(/:/g, '%3A'),'default is toISOString');var mutatedDate = new Date();mutatedDate.toISOString = function () {throw new SyntaxError();};st['throws'](function () {mutatedDate.toISOString();}, SyntaxError);st.equal(qs.stringify({ a: mutatedDate }),'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'),'toISOString works even when method is not locally present');var specificDate = new Date(6);st.equal(qs.stringify({ a: specificDate },{ serializeDate: function (d) { return d.getTime() * 7; } }),'a=42','custom serializeDate function called');st.equal(qs.stringify({ a: [date] },{serializeDate: function (d) { return d.getTime(); },arrayFormat: 'comma'}),'a=' + date.getTime(),'works with arrayFormat comma');st.end();});t.test('RFC 1738 spaces serialization', function (st) {st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');st.end();});t.test('RFC 3986 spaces serialization', function (st) {st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b');st.end();});t.test('Backward compatibility to RFC 3986', function (st) {st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b');st.end();});t.test('Edge cases and unknown formats', function (st) {['UFO1234', false, 1234, null, {}, []].forEach(function (format) {st['throws'](function () {qs.stringify({ a: 'b c' }, { format: format });},new TypeError('Unknown format option provided.'));});st.end();});t.test('encodeValuesOnly', function (st) {st.equal(qs.stringify({ a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },{ encodeValuesOnly: true }),'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h');st.equal(qs.stringify({ a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }),'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h');st.end();});t.test('encodeValuesOnly - strictNullHandling', function (st) {st.equal(qs.stringify({ a: { b: null } },{ encodeValuesOnly: true, strictNullHandling: true }),'a[b]');st.end();});t.test('throws if an invalid charset is specified', function (st) {st['throws'](function () {qs.stringify({ a: 'b' }, { charset: 'foobar' });}, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));st.end();});t.test('respects a charset of iso-8859-1', function (st) {st.equal(qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' }), '%E6=%E6');st.end();});t.test('encodes unrepresentable chars as numeric entities in iso-8859-1 mode', function (st) {st.equal(qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' }), 'a=%26%239786%3B');st.end();});t.test('respects an explicit charset of utf-8 (the default)', function (st) {st.equal(qs.stringify({ a: 'æ' }, { charset: 'utf-8' }), 'a=%C3%A6');st.end();});t.test('adds the right sentinel when instructed to and the charset is utf-8', function (st) {st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'utf-8' }), 'utf8=%E2%9C%93&a=%C3%A6');st.end();});t.test('adds the right sentinel when instructed to and the charset is iso-8859-1', function (st) {st.equal(qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' }), 'utf8=%26%2310003%3B&a=%E6');st.end();});t.test('does not mutate the options argument', function (st) {var options = {};qs.stringify({}, options);st.deepEqual(options, {});st.end();});t.test('strictNullHandling works with custom filter', function (st) {var filter = function (prefix, value) {return value;};var options = { strictNullHandling: true, filter: filter };st.equal(qs.stringify({ key: null }, options), 'key');st.end();});t.test('strictNullHandling works with null serializeDate', function (st) {var serializeDate = function () {return null;};var options = { strictNullHandling: true, serializeDate: serializeDate };var date = new Date();st.equal(qs.stringify({ key: date }, options), 'key');st.end();});t.test('allows for encoding keys and values differently', function (st) {var encoder = function (str, defaultEncoder, charset, type) {if (type === 'key') {return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();}if (type === 'value') {return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();}throw 'this should never happen! type: ' + type;};st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');st.end();});t.end();});
'use strict';var test = require('tape');var qs = require('../');var utils = require('../lib/utils');var iconv = require('iconv-lite');var SaferBuffer = require('safer-buffer').Buffer;test('parse()', function (t) {t.test('parses a simple string', function (st) {st.deepEqual(qs.parse('0=foo'), { 0: 'foo' });st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' });st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });st.deepEqual(qs.parse('foo'), { foo: '' });st.deepEqual(qs.parse('foo='), { foo: '' });st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {cht: 'p3',chd: 't:60,40',chs: '250x100',chl: 'Hello|World'});st.end();});t.test('arrayFormat: brackets allows only explicit arrays', function (st) {st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'brackets' }), { a: 'b,c' });st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'brackets' }), { a: ['b', 'c'] });st.end();});t.test('arrayFormat: indices allows only indexed arrays', function (st) {st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'indices' }), { a: 'b,c' });st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'indices' }), { a: ['b', 'c'] });st.end();});t.test('arrayFormat: comma allows only comma-separated arrays', function (st) {st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'comma' }), { a: 'b,c' });st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'comma' }), { a: ['b', 'c'] });st.end();});t.test('arrayFormat: repeat allows only repeated values', function (st) {st.deepEqual(qs.parse('a[]=b&a[]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b,c', { arrayFormat: 'repeat' }), { a: 'b,c' });st.deepEqual(qs.parse('a=b&a=c', { arrayFormat: 'repeat' }), { a: ['b', 'c'] });st.end();});t.test('allows enabling dot notation', function (st) {st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });st.end();});t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');t.deepEqual(qs.parse('a[b][c][d][e][f][g][h]=i'),{ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },'defaults to a depth of 5');t.test('only parses one level when depth = 1', function (st) {st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });st.end();});t.test('uses original key when depth = 0', function (st) {st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' });st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });st.end();});t.test('uses original key when depth = false', function (st) {st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: false }), { 'a[0]': 'b', 'a[1]': 'c' });st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: false }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });st.end();});t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');t.test('parses an explicit array', function (st) {st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });st.end();});t.test('parses a mix of simple and explicit arrays', function (st) {st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] });st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });st.end();});t.test('parses a nested array', function (st) {st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });st.end();});t.test('allows to specify array indices', function (st) {st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] });st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } });st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });st.end();});t.test('limits specific array indices to arrayLimit', function (st) {st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] });st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } });st.end();});t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');t.test('supports encoded = signs', function (st) {st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });st.end();});t.test('is ok with url encoded strings', function (st) {st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });st.end();});t.test('allows brackets in the value', function (st) {st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });st.end();});t.test('allows empty values', function (st) {st.deepEqual(qs.parse(''), {});st.deepEqual(qs.parse(null), {});st.deepEqual(qs.parse(undefined), {});st.end();});t.test('transforms arrays to objects', function (st) {st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } });st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } });st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } });st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } });st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } });st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } });st.end();});t.test('transforms arrays to objects (dot notation)', function (st) {st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } });st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });st.end();});t.test('correctly prunes undefined values when converting an array to an object', function (st) {st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } });st.end();});t.test('supports malformed uri characters', function (st) {st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });st.end();});t.test('doesn\'t produce empty keys', function (st) {st.deepEqual(qs.parse('_r=1&'), { _r: '1' });st.end();});t.test('cannot access Object prototype', function (st) {qs.parse('constructor[prototype][bad]=bad');qs.parse('bad[constructor][prototype][bad]=bad');st.equal(typeof Object.prototype.bad, 'undefined');st.end();});t.test('parses arrays of objects', function (st) {st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });st.end();});t.test('allows for empty strings in arrays', function (st) {st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }),{ a: ['b', null, 'c', ''] },'with arrayLimit 20 + array indices: null then empty string works');st.deepEqual(qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }),{ a: ['b', null, 'c', ''] },'with arrayLimit 0 + array brackets: null then empty string works');st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }),{ a: ['b', '', 'c', null] },'with arrayLimit 20 + array indices: empty string then null works');st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }),{ a: ['b', '', 'c', null] },'with arrayLimit 0 + array brackets: empty string then null works');st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'),{ a: ['', 'b', 'c'] },'array brackets: empty strings work');st.end();});t.test('compacts sparse arrays', function (st) {st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] });st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] });st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] });st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] });st.end();});t.test('parses semi-parsed strings', function (st) {st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });st.end();});t.test('parses buffers correctly', function (st) {var b = SaferBuffer.from('test');st.deepEqual(qs.parse({ a: b }), { a: b });st.end();});t.test('parses jquery-param strings', function (st) {// readable = 'filter[0][]=int1&filter[0][]==&filter[0][]=77&filter[]=and&filter[2][]=int2&filter[2][]==&filter[2][]=8'var encoded = 'filter%5B0%5D%5B%5D=int1&filter%5B0%5D%5B%5D=%3D&filter%5B0%5D%5B%5D=77&filter%5B%5D=and&filter%5B2%5D%5B%5D=int2&filter%5B2%5D%5B%5D=%3D&filter%5B2%5D%5B%5D=8';var expected = { filter: [['int1', '=', '77'], 'and', ['int2', '=', '8']] };st.deepEqual(qs.parse(encoded), expected);st.end();});t.test('continues parsing when no parent is found', function (st) {st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' });st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' });st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });st.end();});t.test('does not error when parsing a very long array', function (st) {var str = 'a[]=a';while (Buffer.byteLength(str) < 128 * 1024) {str = str + '&' + str;}st.doesNotThrow(function () {qs.parse(str);});st.end();});t.test('should not throw when a native prototype has an enumerable property', function (st) {Object.prototype.crash = '';Array.prototype.crash = '';st.doesNotThrow(qs.parse.bind(null, 'a=b'));st.deepEqual(qs.parse('a=b'), { a: 'b' });st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });delete Object.prototype.crash;delete Array.prototype.crash;st.end();});t.test('parses a string with an alternative string delimiter', function (st) {st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });st.end();});t.test('parses a string with an alternative RegExp delimiter', function (st) {st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });st.end();});t.test('does not use non-splittable objects as delimiters', function (st) {st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });st.end();});t.test('allows overriding parameter limit', function (st) {st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });st.end();});t.test('allows setting the parameter limit to Infinity', function (st) {st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });st.end();});t.test('allows overriding array limit', function (st) {st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } });st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });st.end();});t.test('allows disabling array parsing', function (st) {var indices = qs.parse('a[0]=b&a[1]=c', { parseArrays: false });st.deepEqual(indices, { a: { 0: 'b', 1: 'c' } });st.equal(Array.isArray(indices.a), false, 'parseArrays:false, indices case is not an array');var emptyBrackets = qs.parse('a[]=b', { parseArrays: false });st.deepEqual(emptyBrackets, { a: { 0: 'b' } });st.equal(Array.isArray(emptyBrackets.a), false, 'parseArrays:false, empty brackets case is not an array');st.end();});t.test('allows for query string prefix', function (st) {st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });st.end();});t.test('parses an object', function (st) {var input = {'user[name]': { 'pop[bob]': 3 },'user[email]': null};var expected = {user: {name: { 'pop[bob]': 3 },email: null}};var result = qs.parse(input);st.deepEqual(result, expected);st.end();});t.test('parses string with comma as array divider', function (st) {st.deepEqual(qs.parse('foo=bar,tee', { comma: true }), { foo: ['bar', 'tee'] });st.deepEqual(qs.parse('foo[bar]=coffee,tee', { comma: true }), { foo: { bar: ['coffee', 'tee'] } });st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' });st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' });st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null });st.end();});t.test('parses values with comma as array divider', function (st) {st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: false }), { foo: 'bar,tee' });st.deepEqual(qs.parse({ foo: 'bar,tee' }, { comma: true }), { foo: ['bar', 'tee'] });st.end();});t.test('use number decoder, parses string that has one number with comma option enabled', function (st) {var decoder = function (str, defaultDecoder, charset, type) {if (!isNaN(Number(str))) {return parseFloat(str);}return defaultDecoder(str, defaultDecoder, charset, type);};st.deepEqual(qs.parse('foo=1', { comma: true, decoder: decoder }), { foo: 1 });st.deepEqual(qs.parse('foo=0', { comma: true, decoder: decoder }), { foo: 0 });st.end();});t.test('parses brackets holds array of arrays when having two parts of strings with comma as array divider', function (st) {st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=4,5,6', { comma: true }), { foo: [['1', '2', '3'], ['4', '5', '6']] });st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=', { comma: true }), { foo: [['1', '2', '3'], ''] });st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=,', { comma: true }), { foo: [['1', '2', '3'], ['', '']] });st.deepEqual(qs.parse('foo[]=1,2,3&foo[]=a', { comma: true }), { foo: [['1', '2', '3'], 'a'] });st.end();});t.test('parses comma delimited array while having percent-encoded comma treated as normal text', function (st) {st.deepEqual(qs.parse('foo=a%2Cb', { comma: true }), { foo: 'a,b' });st.deepEqual(qs.parse('foo=a%2C%20b,d', { comma: true }), { foo: ['a, b', 'd'] });st.deepEqual(qs.parse('foo=a%2C%20b,c%2C%20d', { comma: true }), { foo: ['a, b', 'c, d'] });st.end();});t.test('parses an object in dot notation', function (st) {var input = {'user.name': { 'pop[bob]': 3 },'user.email.': null};var expected = {user: {name: { 'pop[bob]': 3 },email: null}};var result = qs.parse(input, { allowDots: true });st.deepEqual(result, expected);st.end();});t.test('parses an object and not child values', function (st) {var input = {'user[name]': { 'pop[bob]': { test: 3 } },'user[email]': null};var expected = {user: {name: { 'pop[bob]': { test: 3 } },email: null}};var result = qs.parse(input);st.deepEqual(result, expected);st.end();});t.test('does not blow up when Buffer global is missing', function (st) {var tempBuffer = global.Buffer;delete global.Buffer;var result = qs.parse('a=b&c=d');global.Buffer = tempBuffer;st.deepEqual(result, { a: 'b', c: 'd' });st.end();});t.test('does not crash when parsing circular references', function (st) {var a = {};a.b = a;var parsed;st.doesNotThrow(function () {parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });});st.equal('foo' in parsed, true, 'parsed has "foo" property');st.equal('bar' in parsed.foo, true);st.equal('baz' in parsed.foo, true);st.equal(parsed.foo.bar, 'baz');st.deepEqual(parsed.foo.baz, a);st.end();});t.test('does not crash when parsing deep objects', function (st) {var parsed;var str = 'foo';for (var i = 0; i < 5000; i++) {str += '[p]';}str += '=bar';st.doesNotThrow(function () {parsed = qs.parse(str, { depth: 5000 });});st.equal('foo' in parsed, true, 'parsed has "foo" property');var depth = 0;var ref = parsed.foo;while ((ref = ref.p)) {depth += 1;}st.equal(depth, 5000, 'parsed is 5000 properties deep');st.end();});t.test('parses null objects correctly', { skip: !Object.create }, function (st) {var a = Object.create(null);a.b = 'c';st.deepEqual(qs.parse(a), { b: 'c' });var result = qs.parse({ a: a });st.equal('a' in result, true, 'result has "a" property');st.deepEqual(result.a, a);st.end();});t.test('parses dates correctly', function (st) {var now = new Date();st.deepEqual(qs.parse({ a: now }), { a: now });st.end();});t.test('parses regular expressions correctly', function (st) {var re = /^test$/;st.deepEqual(qs.parse({ a: re }), { a: re });st.end();});t.test('does not allow overwriting prototype properties', function (st) {st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {});st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {});st.deepEqual(qs.parse('toString', { allowPrototypes: false }),{},'bare "toString" results in {}');st.end();});t.test('can allow overwriting prototype properties', function (st) {st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } });st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' });st.deepEqual(qs.parse('toString', { allowPrototypes: true }),{ toString: '' },'bare "toString" results in { toString: "" }');st.end();});t.test('params starting with a closing bracket', function (st) {st.deepEqual(qs.parse(']=toString'), { ']': 'toString' });st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' });st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' });st.end();});t.test('params starting with a starting bracket', function (st) {st.deepEqual(qs.parse('[=toString'), { '[': 'toString' });st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' });st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' });st.end();});t.test('add keys to objects', function (st) {st.deepEqual(qs.parse('a[b]=c&a=d'),{ a: { b: 'c', d: true } },'can add keys to objects');st.deepEqual(qs.parse('a[b]=c&a=toString'),{ a: { b: 'c' } },'can not overwrite prototype');st.deepEqual(qs.parse('a[b]=c&a=toString', { allowPrototypes: true }),{ a: { b: 'c', toString: true } },'can overwrite prototype with allowPrototypes true');st.deepEqual(qs.parse('a[b]=c&a=toString', { plainObjects: true }),{ __proto__: null, a: { __proto__: null, b: 'c', toString: true } },'can overwrite prototype with plainObjects true');st.end();});t.test('can return null objects', { skip: !Object.create }, function (st) {var expected = Object.create(null);expected.a = Object.create(null);expected.a.b = 'c';expected.a.hasOwnProperty = 'd';st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null));var expectedArray = Object.create(null);expectedArray.a = Object.create(null);expectedArray.a[0] = 'b';expectedArray.a.c = 'd';st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);st.end();});t.test('can parse with custom encoding', function (st) {st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', {decoder: function (str) {var reg = /%([0-9A-F]{2})/ig;var result = [];var parts = reg.exec(str);while (parts) {result.push(parseInt(parts[1], 16));parts = reg.exec(str);}return String(iconv.decode(SaferBuffer.from(result), 'shift_jis'));}}), { 県: '大阪府' });st.end();});t.test('receives the default decoder as a second argument', function (st) {st.plan(1);qs.parse('a', {decoder: function (str, defaultDecoder) {st.equal(defaultDecoder, utils.decode);}});st.end();});t.test('throws error with wrong decoder', function (st) {st['throws'](function () {qs.parse({}, { decoder: 'string' });}, new TypeError('Decoder has to be a function.'));st.end();});t.test('does not mutate the options argument', function (st) {var options = {};qs.parse('a[b]=true', options);st.deepEqual(options, {});st.end();});t.test('throws if an invalid charset is specified', function (st) {st['throws'](function () {qs.parse('a=b', { charset: 'foobar' });}, new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'));st.end();});t.test('parses an iso-8859-1 string if asked to', function (st) {st.deepEqual(qs.parse('%A2=%BD', { charset: 'iso-8859-1' }), { '¢': '½' });st.end();});var urlEncodedCheckmarkInUtf8 = '%E2%9C%93';var urlEncodedOSlashInUtf8 = '%C3%B8';var urlEncodedNumCheckmark = '%26%2310003%3B';var urlEncodedNumSmiley = '%26%239786%3B';t.test('prefers an utf-8 charset specified by the utf8 sentinel to a default charset of iso-8859-1', function (st) {st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'iso-8859-1' }), { ø: 'ø' });st.end();});t.test('prefers an iso-8859-1 charset specified by the utf8 sentinel to a default charset of utf-8', function (st) {st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { 'ø': 'ø' });st.end();});t.test('does not require the utf8 sentinel to be defined before the parameters whose decoding it affects', function (st) {st.deepEqual(qs.parse('a=' + urlEncodedOSlashInUtf8 + '&utf8=' + urlEncodedNumCheckmark, { charsetSentinel: true, charset: 'utf-8' }), { a: 'ø' });st.end();});t.test('should ignore an utf8 sentinel with an unknown value', function (st) {st.deepEqual(qs.parse('utf8=foo&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true, charset: 'utf-8' }), { ø: 'ø' });st.end();});t.test('uses the utf8 sentinel to switch to utf-8 when no default charset is given', function (st) {st.deepEqual(qs.parse('utf8=' + urlEncodedCheckmarkInUtf8 + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { ø: 'ø' });st.end();});t.test('uses the utf8 sentinel to switch to iso-8859-1 when no default charset is given', function (st) {st.deepEqual(qs.parse('utf8=' + urlEncodedNumCheckmark + '&' + urlEncodedOSlashInUtf8 + '=' + urlEncodedOSlashInUtf8, { charsetSentinel: true }), { 'ø': 'ø' });st.end();});t.test('interprets numeric entities in iso-8859-1 when `interpretNumericEntities`', function (st) {st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1', interpretNumericEntities: true }), { foo: '☺' });st.end();});t.test('handles a custom decoder returning `null`, in the `iso-8859-1` charset, when `interpretNumericEntities`', function (st) {st.deepEqual(qs.parse('foo=&bar=' + urlEncodedNumSmiley, {charset: 'iso-8859-1',decoder: function (str, defaultDecoder, charset) {return str ? defaultDecoder(str, defaultDecoder, charset) : null;},interpretNumericEntities: true}), { foo: null, bar: '☺' });st.end();});t.test('does not interpret numeric entities in iso-8859-1 when `interpretNumericEntities` is absent', function (st) {st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'iso-8859-1' }), { foo: '☺' });st.end();});t.test('does not interpret numeric entities when the charset is utf-8, even when `interpretNumericEntities`', function (st) {st.deepEqual(qs.parse('foo=' + urlEncodedNumSmiley, { charset: 'utf-8', interpretNumericEntities: true }), { foo: '☺' });st.end();});t.test('does not interpret %uXXXX syntax in iso-8859-1 mode', function (st) {st.deepEqual(qs.parse('%u263A=%u263A', { charset: 'iso-8859-1' }), { '%u263A': '%u263A' });st.end();});t.test('allows for decoding keys and values differently', function (st) {var decoder = function (str, defaultDecoder, charset, type) {if (type === 'key') {return defaultDecoder(str, defaultDecoder, charset, type).toLowerCase();}if (type === 'value') {return defaultDecoder(str, defaultDecoder, charset, type).toUpperCase();}throw 'this should never happen! type: ' + type;};st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' });st.end();});t.end();});
'use strict';require('./parse');require('./stringify');require('./utils');
{"rules": {"array-bracket-newline": 0,"array-element-newline": 0,"consistent-return": 2,"function-paren-newline": 0,"max-lines": 0,"max-lines-per-function": 0,"max-nested-callbacks": [2, 3],"max-statements": 0,"no-buffer-constructor": 0,"no-extend-native": 0,"no-magic-numbers": 0,"no-throw-literal": 0,"object-curly-newline": 0,"sort-keys": 0,}}
{"_from": "qs@^6.4.0","_id": "qs@6.9.4","_inBundle": false,"_integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==","_location": "/qs","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "qs@^6.4.0","name": "qs","escapedName": "qs","rawSpec": "^6.4.0","saveSpec": null,"fetchSpec": "^6.4.0"},"_requiredBy": ["/union"],"_resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","_shasum": "9090b290d1f91728d3c22e54843ca44aea5ab687","_spec": "qs@^6.4.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/union","bugs": {"url": "https://github.com/ljharb/qs/issues"},"bundleDependencies": false,"contributors": [{"name": "Jordan Harband","email": "ljharb@gmail.com","url": "http://ljharb.codes"}],"dependencies": {},"deprecated": false,"description": "A querystring parser that supports nesting and arrays, with a depth limit","devDependencies": {"@ljharb/eslint-config": "^16.0.0","browserify": "^16.5.1","covert": "^1.1.1","eclint": "^2.8.1","eslint": "^6.8.0","evalmd": "^0.0.19","for-each": "^0.3.3","has-symbols": "^1.0.1","iconv-lite": "^0.5.1","mkdirp": "^0.5.4","object-inspect": "^1.7.0","qs-iconv": "^1.0.4","safe-publish-latest": "^1.1.4","safer-buffer": "^2.1.2","tape": "^5.0.0"},"engines": {"node": ">=0.6"},"funding": {"url": "https://github.com/sponsors/ljharb"},"greenkeeper": {"ignore": ["iconv-lite","mkdirp"]},"homepage": "https://github.com/ljharb/qs","keywords": ["querystring","qs","query","url","parse","stringify"],"license": "BSD-3-Clause","main": "lib/index.js","name": "qs","repository": {"type": "git","url": "git+https://github.com/ljharb/qs.git"},"scripts": {"coverage": "covert test","dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js","lint": "eslint lib/*.js test/*.js","postlint": "eclint check * lib/* test/*","posttest": "npx aud --production","prepublish": "safe-publish-latest && npm run dist","pretest": "npm run --silent readme && npm run --silent lint","readme": "evalmd README.md","test": "npm run --silent coverage","tests-only": "node test"},"version": "6.9.4"}
'use strict';var has = Object.prototype.hasOwnProperty;var isArray = Array.isArray;var hexTable = (function () {var array = [];for (var i = 0; i < 256; ++i) {array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());}return array;}());var compactQueue = function compactQueue(queue) {while (queue.length > 1) {var item = queue.pop();var obj = item.obj[item.prop];if (isArray(obj)) {var compacted = [];for (var j = 0; j < obj.length; ++j) {if (typeof obj[j] !== 'undefined') {compacted.push(obj[j]);}}item.obj[item.prop] = compacted;}}};var arrayToObject = function arrayToObject(source, options) {var obj = options && options.plainObjects ? Object.create(null) : {};for (var i = 0; i < source.length; ++i) {if (typeof source[i] !== 'undefined') {obj[i] = source[i];}}return obj;};var merge = function merge(target, source, options) {/* eslint no-param-reassign: 0 */if (!source) {return target;}if (typeof source !== 'object') {if (isArray(target)) {target.push(source);} else if (target && typeof target === 'object') {if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {target[source] = true;}} else {return [target, source];}return target;}if (!target || typeof target !== 'object') {return [target].concat(source);}var mergeTarget = target;if (isArray(target) && !isArray(source)) {mergeTarget = arrayToObject(target, options);}if (isArray(target) && isArray(source)) {source.forEach(function (item, i) {if (has.call(target, i)) {var targetItem = target[i];if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {target[i] = merge(targetItem, item, options);} else {target.push(item);}} else {target[i] = item;}});return target;}return Object.keys(source).reduce(function (acc, key) {var value = source[key];if (has.call(acc, key)) {acc[key] = merge(acc[key], value, options);} else {acc[key] = value;}return acc;}, mergeTarget);};var assign = function assignSingleSource(target, source) {return Object.keys(source).reduce(function (acc, key) {acc[key] = source[key];return acc;}, target);};var decode = function (str, decoder, charset) {var strWithoutPlus = str.replace(/\+/g, ' ');if (charset === 'iso-8859-1') {// unescape never throws, no try...catch needed:return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);}// utf-8try {return decodeURIComponent(strWithoutPlus);} catch (e) {return strWithoutPlus;}};var encode = function encode(str, defaultEncoder, charset) {// This code was originally written by Brian White (mscdex) for the io.js core querystring library.// It has been adapted here for stricter adherence to RFC 3986if (str.length === 0) {return str;}var string = str;if (typeof str === 'symbol') {string = Symbol.prototype.toString.call(str);} else if (typeof str !== 'string') {string = String(str);}if (charset === 'iso-8859-1') {return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {return '%26%23' + parseInt($0.slice(2), 16) + '%3B';});}var out = '';for (var i = 0; i < string.length; ++i) {var c = string.charCodeAt(i);if (c === 0x2D // -|| c === 0x2E // .|| c === 0x5F // _|| c === 0x7E // ~|| (c >= 0x30 && c <= 0x39) // 0-9|| (c >= 0x41 && c <= 0x5A) // a-z|| (c >= 0x61 && c <= 0x7A) // A-Z) {out += string.charAt(i);continue;}if (c < 0x80) {out = out + hexTable[c];continue;}if (c < 0x800) {out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);continue;}if (c < 0xD800 || c >= 0xE000) {out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);continue;}i += 1;c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));out += hexTable[0xF0 | (c >> 18)]+ hexTable[0x80 | ((c >> 12) & 0x3F)]+ hexTable[0x80 | ((c >> 6) & 0x3F)]+ hexTable[0x80 | (c & 0x3F)];}return out;};var compact = function compact(value) {var queue = [{ obj: { o: value }, prop: 'o' }];var refs = [];for (var i = 0; i < queue.length; ++i) {var item = queue[i];var obj = item.obj[item.prop];var keys = Object.keys(obj);for (var j = 0; j < keys.length; ++j) {var key = keys[j];var val = obj[key];if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {queue.push({ obj: obj, prop: key });refs.push(val);}}}compactQueue(queue);return value;};var isRegExp = function isRegExp(obj) {return Object.prototype.toString.call(obj) === '[object RegExp]';};var isBuffer = function isBuffer(obj) {if (!obj || typeof obj !== 'object') {return false;}return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));};var combine = function combine(a, b) {return [].concat(a, b);};var maybeMap = function maybeMap(val, fn) {if (isArray(val)) {var mapped = [];for (var i = 0; i < val.length; i += 1) {mapped.push(fn(val[i]));}return mapped;}return fn(val);};module.exports = {arrayToObject: arrayToObject,assign: assign,combine: combine,compact: compact,decode: decode,encode: encode,isBuffer: isBuffer,isRegExp: isRegExp,maybeMap: maybeMap,merge: merge};
'use strict';var utils = require('./utils');var formats = require('./formats');var has = Object.prototype.hasOwnProperty;var arrayPrefixGenerators = {brackets: function brackets(prefix) {return prefix + '[]';},comma: 'comma',indices: function indices(prefix, key) {return prefix + '[' + key + ']';},repeat: function repeat(prefix) {return prefix;}};var isArray = Array.isArray;var push = Array.prototype.push;var pushToArray = function (arr, valueOrArray) {push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);};var toISO = Date.prototype.toISOString;var defaultFormat = formats['default'];var defaults = {addQueryPrefix: false,allowDots: false,charset: 'utf-8',charsetSentinel: false,delimiter: '&',encode: true,encoder: utils.encode,encodeValuesOnly: false,format: defaultFormat,formatter: formats.formatters[defaultFormat],// deprecatedindices: false,serializeDate: function serializeDate(date) {return toISO.call(date);},skipNulls: false,strictNullHandling: false};var isNonNullishPrimitive = function isNonNullishPrimitive(v) {return typeof v === 'string'|| typeof v === 'number'|| typeof v === 'boolean'|| typeof v === 'symbol'|| typeof v === 'bigint';};var stringify = function stringify(object,prefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset) {var obj = object;if (typeof filter === 'function') {obj = filter(prefix, obj);} else if (obj instanceof Date) {obj = serializeDate(obj);} else if (generateArrayPrefix === 'comma' && isArray(obj)) {obj = utils.maybeMap(obj, function (value) {if (value instanceof Date) {return serializeDate(value);}return value;}).join(',');}if (obj === null) {if (strictNullHandling) {return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;}obj = '';}if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {if (encoder) {var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];}return [formatter(prefix) + '=' + formatter(String(obj))];}var values = [];if (typeof obj === 'undefined') {return values;}var objKeys;if (isArray(filter)) {objKeys = filter;} else {var keys = Object.keys(obj);objKeys = sort ? keys.sort(sort) : keys;}for (var i = 0; i < objKeys.length; ++i) {var key = objKeys[i];var value = obj[key];if (skipNulls && value === null) {continue;}var keyPrefix = isArray(obj)? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix: prefix + (allowDots ? '.' + key : '[' + key + ']');pushToArray(values, stringify(value,keyPrefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset));}return values;};var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {if (!opts) {return defaults;}if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {throw new TypeError('Encoder has to be a function.');}var charset = opts.charset || defaults.charset;if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var format = formats['default'];if (typeof opts.format !== 'undefined') {if (!has.call(formats.formatters, opts.format)) {throw new TypeError('Unknown format option provided.');}format = opts.format;}var formatter = formats.formatters[format];var filter = defaults.filter;if (typeof opts.filter === 'function' || isArray(opts.filter)) {filter = opts.filter;}return {addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,charset: charset,charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,filter: filter,formatter: formatter,serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,sort: typeof opts.sort === 'function' ? opts.sort : null,strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling};};module.exports = function (object, opts) {var obj = object;var options = normalizeStringifyOptions(opts);var objKeys;var filter;if (typeof options.filter === 'function') {filter = options.filter;obj = filter('', obj);} else if (isArray(options.filter)) {filter = options.filter;objKeys = filter;}var keys = [];if (typeof obj !== 'object' || obj === null) {return '';}var arrayFormat;if (opts && opts.arrayFormat in arrayPrefixGenerators) {arrayFormat = opts.arrayFormat;} else if (opts && 'indices' in opts) {arrayFormat = opts.indices ? 'indices' : 'repeat';} else {arrayFormat = 'indices';}var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];if (!objKeys) {objKeys = Object.keys(obj);}if (options.sort) {objKeys.sort(options.sort);}for (var i = 0; i < objKeys.length; ++i) {var key = objKeys[i];if (options.skipNulls && obj[key] === null) {continue;}pushToArray(keys, stringify(obj[key],key,generateArrayPrefix,options.strictNullHandling,options.skipNulls,options.encode ? options.encoder : null,options.filter,options.sort,options.allowDots,options.serializeDate,options.formatter,options.encodeValuesOnly,options.charset));}var joined = keys.join(options.delimiter);var prefix = options.addQueryPrefix === true ? '?' : '';if (options.charsetSentinel) {if (options.charset === 'iso-8859-1') {// encodeURIComponent('✓'), the "numeric entity" representation of a checkmarkprefix += 'utf8=%26%2310003%3B&';} else {// encodeURIComponent('✓')prefix += 'utf8=%E2%9C%93&';}}return joined.length > 0 ? prefix + joined : '';};
'use strict';var utils = require('./utils');var has = Object.prototype.hasOwnProperty;var isArray = Array.isArray;var defaults = {allowDots: false,allowPrototypes: false,arrayLimit: 20,charset: 'utf-8',charsetSentinel: false,comma: false,decoder: utils.decode,delimiter: '&',depth: 5,ignoreQueryPrefix: false,interpretNumericEntities: false,parameterLimit: 1000,parseArrays: true,plainObjects: false,strictNullHandling: false};var interpretNumericEntities = function (str) {return str.replace(/&#(\d+);/g, function ($0, numberStr) {return String.fromCharCode(parseInt(numberStr, 10));});};var parseArrayValue = function (val, options) {if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {return val.split(',');}return val;};// This is what browsers will submit when the ✓ character occurs in an// application/x-www-form-urlencoded body and the encoding of the page containing// the form is iso-8859-1, or when the submitted form has an accept-charset// attribute of iso-8859-1. Presumably also with other charsets that do not contain// the ✓ character, such as us-ascii.var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')var parseValues = function parseQueryStringValues(str, options) {var obj = {};var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;var parts = cleanStr.split(options.delimiter, limit);var skipIndex = -1; // Keep track of where the utf8 sentinel was foundvar i;var charset = options.charset;if (options.charsetSentinel) {for (i = 0; i < parts.length; ++i) {if (parts[i].indexOf('utf8=') === 0) {if (parts[i] === charsetSentinel) {charset = 'utf-8';} else if (parts[i] === isoSentinel) {charset = 'iso-8859-1';}skipIndex = i;i = parts.length; // The eslint settings do not allow break;}}}for (i = 0; i < parts.length; ++i) {if (i === skipIndex) {continue;}var part = parts[i];var bracketEqualsPos = part.indexOf(']=');var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;var key, val;if (pos === -1) {key = options.decoder(part, defaults.decoder, charset, 'key');val = options.strictNullHandling ? null : '';} else {key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options),function (encodedVal) {return options.decoder(encodedVal, defaults.decoder, charset, 'value');});}if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {val = interpretNumericEntities(val);}if (part.indexOf('[]=') > -1) {val = isArray(val) ? [val] : val;}if (has.call(obj, key)) {obj[key] = utils.combine(obj[key], val);} else {obj[key] = val;}}return obj;};var parseObject = function (chain, val, options, valuesParsed) {var leaf = valuesParsed ? val : parseArrayValue(val, options);for (var i = chain.length - 1; i >= 0; --i) {var obj;var root = chain[i];if (root === '[]' && options.parseArrays) {obj = [].concat(leaf);} else {obj = options.plainObjects ? Object.create(null) : {};var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;var index = parseInt(cleanRoot, 10);if (!options.parseArrays && cleanRoot === '') {obj = { 0: leaf };} else if (!isNaN(index)&& root !== cleanRoot&& String(index) === cleanRoot&& index >= 0&& (options.parseArrays && index <= options.arrayLimit)) {obj = [];obj[index] = leaf;} else {obj[cleanRoot] = leaf;}}leaf = obj; // eslint-disable-line no-param-reassign}return leaf;};var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {if (!givenKey) {return;}// Transform dot notation to bracket notationvar key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;// The regex chunksvar brackets = /(\[[^[\]]*])/;var child = /(\[[^[\]]*])/g;// Get the parentvar segment = options.depth > 0 && brackets.exec(key);var parent = segment ? key.slice(0, segment.index) : key;// Stash the parent if it existsvar keys = [];if (parent) {// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype propertiesif (!options.plainObjects && has.call(Object.prototype, parent)) {if (!options.allowPrototypes) {return;}}keys.push(parent);}// Loop through children appending to the array until we hit depthvar i = 0;while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {i += 1;if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {if (!options.allowPrototypes) {return;}}keys.push(segment[1]);}// If there's a remainder, just add whatever is leftif (segment) {keys.push('[' + key.slice(segment.index) + ']');}return parseObject(keys, val, options, valuesParsed);};var normalizeParseOptions = function normalizeParseOptions(opts) {if (!opts) {return defaults;}if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {throw new TypeError('Decoder has to be a function.');}if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;return {allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,charset: charset,charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,// eslint-disable-next-line no-implicit-coercion, no-extra-parensdepth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,ignoreQueryPrefix: opts.ignoreQueryPrefix === true,interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,parseArrays: opts.parseArrays !== false,plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling};};module.exports = function (str, opts) {var options = normalizeParseOptions(opts);if (str === '' || str === null || typeof str === 'undefined') {return options.plainObjects ? Object.create(null) : {};}var tempObj = typeof str === 'string' ? parseValues(str, options) : str;var obj = options.plainObjects ? Object.create(null) : {};// Iterate over the keys and setup the new objectvar keys = Object.keys(tempObj);for (var i = 0; i < keys.length; ++i) {var key = keys[i];var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');obj = utils.merge(obj, newObj, options);}return utils.compact(obj);};
'use strict';var stringify = require('./stringify');var parse = require('./parse');var formats = require('./formats');module.exports = {formats: formats,parse: parse,stringify: stringify};
'use strict';var replace = String.prototype.replace;var percentTwenties = /%20/g;var util = require('./utils');var Format = {RFC1738: 'RFC1738',RFC3986: 'RFC3986'};module.exports = util.assign({'default': Format.RFC3986,formatters: {RFC1738: function (value) {return replace.call(value, percentTwenties, '+');},RFC3986: function (value) {return String(value);}}},Format);
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){'use strict';var replace = String.prototype.replace;var percentTwenties = /%20/g;var util = require('./utils');var Format = {RFC1738: 'RFC1738',RFC3986: 'RFC3986'};module.exports = util.assign({'default': Format.RFC3986,formatters: {RFC1738: function (value) {return replace.call(value, percentTwenties, '+');},RFC3986: function (value) {return String(value);}}},Format);},{"./utils":5}],2:[function(require,module,exports){'use strict';var stringify = require('./stringify');var parse = require('./parse');var formats = require('./formats');module.exports = {formats: formats,parse: parse,stringify: stringify};},{"./formats":1,"./parse":3,"./stringify":4}],3:[function(require,module,exports){'use strict';var utils = require('./utils');var has = Object.prototype.hasOwnProperty;var isArray = Array.isArray;var defaults = {allowDots: false,allowPrototypes: false,arrayLimit: 20,charset: 'utf-8',charsetSentinel: false,comma: false,decoder: utils.decode,delimiter: '&',depth: 5,ignoreQueryPrefix: false,interpretNumericEntities: false,parameterLimit: 1000,parseArrays: true,plainObjects: false,strictNullHandling: false};var interpretNumericEntities = function (str) {return str.replace(/&#(\d+);/g, function ($0, numberStr) {return String.fromCharCode(parseInt(numberStr, 10));});};var parseArrayValue = function (val, options) {if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {return val.split(',');}return val;};// This is what browsers will submit when the ✓ character occurs in an// application/x-www-form-urlencoded body and the encoding of the page containing// the form is iso-8859-1, or when the submitted form has an accept-charset// attribute of iso-8859-1. Presumably also with other charsets that do not contain// the ✓ character, such as us-ascii.var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')var parseValues = function parseQueryStringValues(str, options) {var obj = {};var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;var parts = cleanStr.split(options.delimiter, limit);var skipIndex = -1; // Keep track of where the utf8 sentinel was foundvar i;var charset = options.charset;if (options.charsetSentinel) {for (i = 0; i < parts.length; ++i) {if (parts[i].indexOf('utf8=') === 0) {if (parts[i] === charsetSentinel) {charset = 'utf-8';} else if (parts[i] === isoSentinel) {charset = 'iso-8859-1';}skipIndex = i;i = parts.length; // The eslint settings do not allow break;}}}for (i = 0; i < parts.length; ++i) {if (i === skipIndex) {continue;}var part = parts[i];var bracketEqualsPos = part.indexOf(']=');var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;var key, val;if (pos === -1) {key = options.decoder(part, defaults.decoder, charset, 'key');val = options.strictNullHandling ? null : '';} else {key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options),function (encodedVal) {return options.decoder(encodedVal, defaults.decoder, charset, 'value');});}if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {val = interpretNumericEntities(val);}if (part.indexOf('[]=') > -1) {val = isArray(val) ? [val] : val;}if (has.call(obj, key)) {obj[key] = utils.combine(obj[key], val);} else {obj[key] = val;}}return obj;};var parseObject = function (chain, val, options, valuesParsed) {var leaf = valuesParsed ? val : parseArrayValue(val, options);for (var i = chain.length - 1; i >= 0; --i) {var obj;var root = chain[i];if (root === '[]' && options.parseArrays) {obj = [].concat(leaf);} else {obj = options.plainObjects ? Object.create(null) : {};var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;var index = parseInt(cleanRoot, 10);if (!options.parseArrays && cleanRoot === '') {obj = { 0: leaf };} else if (!isNaN(index)&& root !== cleanRoot&& String(index) === cleanRoot&& index >= 0&& (options.parseArrays && index <= options.arrayLimit)) {obj = [];obj[index] = leaf;} else {obj[cleanRoot] = leaf;}}leaf = obj; // eslint-disable-line no-param-reassign}return leaf;};var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {if (!givenKey) {return;}// Transform dot notation to bracket notationvar key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;// The regex chunksvar brackets = /(\[[^[\]]*])/;var child = /(\[[^[\]]*])/g;// Get the parentvar segment = options.depth > 0 && brackets.exec(key);var parent = segment ? key.slice(0, segment.index) : key;// Stash the parent if it existsvar keys = [];if (parent) {// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype propertiesif (!options.plainObjects && has.call(Object.prototype, parent)) {if (!options.allowPrototypes) {return;}}keys.push(parent);}// Loop through children appending to the array until we hit depthvar i = 0;while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {i += 1;if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {if (!options.allowPrototypes) {return;}}keys.push(segment[1]);}// If there's a remainder, just add whatever is leftif (segment) {keys.push('[' + key.slice(segment.index) + ']');}return parseObject(keys, val, options, valuesParsed);};var normalizeParseOptions = function normalizeParseOptions(opts) {if (!opts) {return defaults;}if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {throw new TypeError('Decoder has to be a function.');}if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;return {allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,charset: charset,charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,// eslint-disable-next-line no-implicit-coercion, no-extra-parensdepth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,ignoreQueryPrefix: opts.ignoreQueryPrefix === true,interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,parseArrays: opts.parseArrays !== false,plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling};};module.exports = function (str, opts) {var options = normalizeParseOptions(opts);if (str === '' || str === null || typeof str === 'undefined') {return options.plainObjects ? Object.create(null) : {};}var tempObj = typeof str === 'string' ? parseValues(str, options) : str;var obj = options.plainObjects ? Object.create(null) : {};// Iterate over the keys and setup the new objectvar keys = Object.keys(tempObj);for (var i = 0; i < keys.length; ++i) {var key = keys[i];var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');obj = utils.merge(obj, newObj, options);}return utils.compact(obj);};},{"./utils":5}],4:[function(require,module,exports){'use strict';var utils = require('./utils');var formats = require('./formats');var has = Object.prototype.hasOwnProperty;var arrayPrefixGenerators = {brackets: function brackets(prefix) {return prefix + '[]';},comma: 'comma',indices: function indices(prefix, key) {return prefix + '[' + key + ']';},repeat: function repeat(prefix) {return prefix;}};var isArray = Array.isArray;var push = Array.prototype.push;var pushToArray = function (arr, valueOrArray) {push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);};var toISO = Date.prototype.toISOString;var defaultFormat = formats['default'];var defaults = {addQueryPrefix: false,allowDots: false,charset: 'utf-8',charsetSentinel: false,delimiter: '&',encode: true,encoder: utils.encode,encodeValuesOnly: false,format: defaultFormat,formatter: formats.formatters[defaultFormat],// deprecatedindices: false,serializeDate: function serializeDate(date) {return toISO.call(date);},skipNulls: false,strictNullHandling: false};var isNonNullishPrimitive = function isNonNullishPrimitive(v) {return typeof v === 'string'|| typeof v === 'number'|| typeof v === 'boolean'|| typeof v === 'symbol'|| typeof v === 'bigint';};var stringify = function stringify(object,prefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset) {var obj = object;if (typeof filter === 'function') {obj = filter(prefix, obj);} else if (obj instanceof Date) {obj = serializeDate(obj);} else if (generateArrayPrefix === 'comma' && isArray(obj)) {obj = utils.maybeMap(obj, function (value) {if (value instanceof Date) {return serializeDate(value);}return value;}).join(',');}if (obj === null) {if (strictNullHandling) {return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;}obj = '';}if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {if (encoder) {var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];}return [formatter(prefix) + '=' + formatter(String(obj))];}var values = [];if (typeof obj === 'undefined') {return values;}var objKeys;if (isArray(filter)) {objKeys = filter;} else {var keys = Object.keys(obj);objKeys = sort ? keys.sort(sort) : keys;}for (var i = 0; i < objKeys.length; ++i) {var key = objKeys[i];var value = obj[key];if (skipNulls && value === null) {continue;}var keyPrefix = isArray(obj)? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix: prefix + (allowDots ? '.' + key : '[' + key + ']');pushToArray(values, stringify(value,keyPrefix,generateArrayPrefix,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,formatter,encodeValuesOnly,charset));}return values;};var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {if (!opts) {return defaults;}if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {throw new TypeError('Encoder has to be a function.');}var charset = opts.charset || defaults.charset;if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');}var format = formats['default'];if (typeof opts.format !== 'undefined') {if (!has.call(formats.formatters, opts.format)) {throw new TypeError('Unknown format option provided.');}format = opts.format;}var formatter = formats.formatters[format];var filter = defaults.filter;if (typeof opts.filter === 'function' || isArray(opts.filter)) {filter = opts.filter;}return {addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,charset: charset,charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,filter: filter,formatter: formatter,serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,sort: typeof opts.sort === 'function' ? opts.sort : null,strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling};};module.exports = function (object, opts) {var obj = object;var options = normalizeStringifyOptions(opts);var objKeys;var filter;if (typeof options.filter === 'function') {filter = options.filter;obj = filter('', obj);} else if (isArray(options.filter)) {filter = options.filter;objKeys = filter;}var keys = [];if (typeof obj !== 'object' || obj === null) {return '';}var arrayFormat;if (opts && opts.arrayFormat in arrayPrefixGenerators) {arrayFormat = opts.arrayFormat;} else if (opts && 'indices' in opts) {arrayFormat = opts.indices ? 'indices' : 'repeat';} else {arrayFormat = 'indices';}var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];if (!objKeys) {objKeys = Object.keys(obj);}if (options.sort) {objKeys.sort(options.sort);}for (var i = 0; i < objKeys.length; ++i) {var key = objKeys[i];if (options.skipNulls && obj[key] === null) {continue;}pushToArray(keys, stringify(obj[key],key,generateArrayPrefix,options.strictNullHandling,options.skipNulls,options.encode ? options.encoder : null,options.filter,options.sort,options.allowDots,options.serializeDate,options.formatter,options.encodeValuesOnly,options.charset));}var joined = keys.join(options.delimiter);var prefix = options.addQueryPrefix === true ? '?' : '';if (options.charsetSentinel) {if (options.charset === 'iso-8859-1') {// encodeURIComponent('✓'), the "numeric entity" representation of a checkmarkprefix += 'utf8=%26%2310003%3B&';} else {// encodeURIComponent('✓')prefix += 'utf8=%E2%9C%93&';}}return joined.length > 0 ? prefix + joined : '';};},{"./formats":1,"./utils":5}],5:[function(require,module,exports){'use strict';var has = Object.prototype.hasOwnProperty;var isArray = Array.isArray;var hexTable = (function () {var array = [];for (var i = 0; i < 256; ++i) {array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());}return array;}());var compactQueue = function compactQueue(queue) {while (queue.length > 1) {var item = queue.pop();var obj = item.obj[item.prop];if (isArray(obj)) {var compacted = [];for (var j = 0; j < obj.length; ++j) {if (typeof obj[j] !== 'undefined') {compacted.push(obj[j]);}}item.obj[item.prop] = compacted;}}};var arrayToObject = function arrayToObject(source, options) {var obj = options && options.plainObjects ? Object.create(null) : {};for (var i = 0; i < source.length; ++i) {if (typeof source[i] !== 'undefined') {obj[i] = source[i];}}return obj;};var merge = function merge(target, source, options) {/* eslint no-param-reassign: 0 */if (!source) {return target;}if (typeof source !== 'object') {if (isArray(target)) {target.push(source);} else if (target && typeof target === 'object') {if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {target[source] = true;}} else {return [target, source];}return target;}if (!target || typeof target !== 'object') {return [target].concat(source);}var mergeTarget = target;if (isArray(target) && !isArray(source)) {mergeTarget = arrayToObject(target, options);}if (isArray(target) && isArray(source)) {source.forEach(function (item, i) {if (has.call(target, i)) {var targetItem = target[i];if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {target[i] = merge(targetItem, item, options);} else {target.push(item);}} else {target[i] = item;}});return target;}return Object.keys(source).reduce(function (acc, key) {var value = source[key];if (has.call(acc, key)) {acc[key] = merge(acc[key], value, options);} else {acc[key] = value;}return acc;}, mergeTarget);};var assign = function assignSingleSource(target, source) {return Object.keys(source).reduce(function (acc, key) {acc[key] = source[key];return acc;}, target);};var decode = function (str, decoder, charset) {var strWithoutPlus = str.replace(/\+/g, ' ');if (charset === 'iso-8859-1') {// unescape never throws, no try...catch needed:return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);}// utf-8try {return decodeURIComponent(strWithoutPlus);} catch (e) {return strWithoutPlus;}};var encode = function encode(str, defaultEncoder, charset) {// This code was originally written by Brian White (mscdex) for the io.js core querystring library.// It has been adapted here for stricter adherence to RFC 3986if (str.length === 0) {return str;}var string = str;if (typeof str === 'symbol') {string = Symbol.prototype.toString.call(str);} else if (typeof str !== 'string') {string = String(str);}if (charset === 'iso-8859-1') {return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {return '%26%23' + parseInt($0.slice(2), 16) + '%3B';});}var out = '';for (var i = 0; i < string.length; ++i) {var c = string.charCodeAt(i);if (c === 0x2D // -|| c === 0x2E // .|| c === 0x5F // _|| c === 0x7E // ~|| (c >= 0x30 && c <= 0x39) // 0-9|| (c >= 0x41 && c <= 0x5A) // a-z|| (c >= 0x61 && c <= 0x7A) // A-Z) {out += string.charAt(i);continue;}if (c < 0x80) {out = out + hexTable[c];continue;}if (c < 0x800) {out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);continue;}if (c < 0xD800 || c >= 0xE000) {out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);continue;}i += 1;c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));out += hexTable[0xF0 | (c >> 18)]+ hexTable[0x80 | ((c >> 12) & 0x3F)]+ hexTable[0x80 | ((c >> 6) & 0x3F)]+ hexTable[0x80 | (c & 0x3F)];}return out;};var compact = function compact(value) {var queue = [{ obj: { o: value }, prop: 'o' }];var refs = [];for (var i = 0; i < queue.length; ++i) {var item = queue[i];var obj = item.obj[item.prop];var keys = Object.keys(obj);for (var j = 0; j < keys.length; ++j) {var key = keys[j];var val = obj[key];if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {queue.push({ obj: obj, prop: key });refs.push(val);}}}compactQueue(queue);return value;};var isRegExp = function isRegExp(obj) {return Object.prototype.toString.call(obj) === '[object RegExp]';};var isBuffer = function isBuffer(obj) {if (!obj || typeof obj !== 'object') {return false;}return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));};var combine = function combine(a, b) {return [].concat(a, b);};var maybeMap = function maybeMap(val, fn) {if (isArray(val)) {var mapped = [];for (var i = 0; i < val.length; i += 1) {mapped.push(fn(val[i]));}return mapped;}return fn(val);};module.exports = {arrayToObject: arrayToObject,assign: assign,combine: combine,compact: compact,decode: decode,encode: encode,isBuffer: isBuffer,isRegExp: isRegExp,maybeMap: maybeMap,merge: merge};},{}]},{},[2])(2)});
# qs <sup>[![Version Badge][2]][1]</sup>[![Build Status][3]][4][![dependency status][5]][6][![dev dependency status][7]][8][![License][license-image]][license-url][![Downloads][downloads-image]][downloads-url][![npm badge][11]][1]A querystring parsing and stringifying library with some added security.Lead Maintainer: [Jordan Harband](https://github.com/ljharb)The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).## Usage```javascriptvar qs = require('qs');var assert = require('assert');var obj = qs.parse('a=c');assert.deepEqual(obj, { a: 'c' });var str = qs.stringify(obj);assert.equal(str, 'a=c');```### Parsing Objects[](#preventEval)```javascriptqs.parse(string, [options]);```**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.For example, the string `'foo[bar]=baz'` converts to:```javascriptassert.deepEqual(qs.parse('foo[bar]=baz'), {foo: {bar: 'baz'}});```When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:```javascriptvar nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } });```By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.```javascriptvar protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });```URI encoded strings work too:```javascriptassert.deepEqual(qs.parse('a%5Bb%5D=c'), {a: { b: 'c' }});```You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:```javascriptassert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {foo: {bar: {baz: 'foobarbaz'}}});```By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:```javascriptvar expected = {a: {b: {c: {d: {e: {f: {'[g][h][i]': 'j'}}}}}}};var string = 'a[b][c][d][e][f][g][h][i]=j';assert.deepEqual(qs.parse(string), expected);```This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:```javascriptvar deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });```The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:```javascriptvar limited = qs.parse('a=b&c=d', { parameterLimit: 1 });assert.deepEqual(limited, { a: 'b' });```To bypass the leading question mark, use `ignoreQueryPrefix`:```javascriptvar prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true });assert.deepEqual(prefixed, { a: 'b', c: 'd' });```An optional delimiter can also be passed:```javascriptvar delimited = qs.parse('a=b;c=d', { delimiter: ';' });assert.deepEqual(delimited, { a: 'b', c: 'd' });```Delimiters can be a regular expression too:```javascriptvar regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });```Option `allowDots` can be used to enable dot notation:```javascriptvar withDots = qs.parse('a.b=c', { allowDots: true });assert.deepEqual(withDots, { a: { b: 'c' } });```If you have to deal with legacy browsers or services, there'salso support for decoding percent-encoded octets as iso-8859-1:```javascriptvar oldCharset = qs.parse('a=%A7', { charset: 'iso-8859-1' });assert.deepEqual(oldCharset, { a: '§' });```Some services add an initial `utf8=✓` value to forms so that oldInternet Explorer versions are more likely to submit the form asutf-8. Additionally, the server can check the value against wrongencodings of the checkmark character and detect that a query stringor `application/x-www-form-urlencoded` body was *not* sent asutf-8, eg. if the form had an `accept-charset` parameter or thecontaining page had a different character set.**qs** supports this mechanism via the `charsetSentinel` option.If specified, the `utf8` parameter will be omitted from thereturned object. It will be used to switch to `iso-8859-1`/`utf-8`mode depending on how the checkmark is encoded.**Important**: When you specify both the `charset` option and the`charsetSentinel` option, the `charset` will be overridden whenthe request contains a `utf8` parameter from which the actualcharset can be deduced. In that sense the `charset` will behaveas the default charset rather than the authoritative charset.```javascriptvar detectedAsUtf8 = qs.parse('utf8=%E2%9C%93&a=%C3%B8', {charset: 'iso-8859-1',charsetSentinel: true});assert.deepEqual(detectedAsUtf8, { a: 'ø' });// Browsers encode the checkmark as ✓ when submitting as iso-8859-1:var detectedAsIso8859_1 = qs.parse('utf8=%26%2310003%3B&a=%F8', {charset: 'utf-8',charsetSentinel: true});assert.deepEqual(detectedAsIso8859_1, { a: 'ø' });```If you want to decode the `&#...;` syntax to the actual character,you can specify the `interpretNumericEntities` option as well:```javascriptvar detectedAsIso8859_1 = qs.parse('a=%26%239786%3B', {charset: 'iso-8859-1',interpretNumericEntities: true});assert.deepEqual(detectedAsIso8859_1, { a: '☺' });```It also works when the charset has been detected in `charsetSentinel`mode.### Parsing Arrays**qs** can also parse arrays using a similar `[]` notation:```javascriptvar withArray = qs.parse('a[]=b&a[]=c');assert.deepEqual(withArray, { a: ['b', 'c'] });```You may specify an index as well:```javascriptvar withIndexes = qs.parse('a[1]=c&a[0]=b');assert.deepEqual(withIndexes, { a: ['b', 'c'] });```Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a numberto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preservingtheir order:```javascriptvar noSparse = qs.parse('a[1]=b&a[15]=c');assert.deepEqual(noSparse, { a: ['b', 'c'] });```Note that an empty string is also a value, and will be preserved:```javascriptvar withEmptyString = qs.parse('a[]=&a[]=b');assert.deepEqual(withEmptyString, { a: ['', 'b'] });var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });```**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` willinstead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array.```javascriptvar withMaxIndex = qs.parse('a[100]=b');assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });```This limit can be overridden by passing an `arrayLimit` option:```javascriptvar withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });```To disable array parsing entirely, set `parseArrays` to `false`.```javascriptvar noParsingArrays = qs.parse('a[]=b', { parseArrays: false });assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });```If you mix notations, **qs** will merge the two items into an object:```javascriptvar mixedNotation = qs.parse('a[0]=b&a[b]=c');assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });```You can also create arrays of objects:```javascriptvar arraysOfObjects = qs.parse('a[][b]=c');assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });```Some people use comma to join array, **qs** can parse it:```javascriptvar arraysOfObjects = qs.parse('a=b,c', { comma: true })assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] })```(_this cannot convert nested objects, such as `a={b:1},{c:d}`_)### Stringifying[](#preventEval)```javascriptqs.stringify(object, [options]);```When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:```javascriptassert.equal(qs.stringify({ a: 'b' }), 'a=b');assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');```This encoding can be disabled by setting the `encode` option to `false`:```javascriptvar unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });assert.equal(unencoded, 'a[b]=c');```Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`:```javascriptvar encodedValues = qs.stringify({ a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },{ encodeValuesOnly: true });assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h');```This encoding can also be replaced by a custom encoding method set as `encoder` option:```javascriptvar encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) {// Passed in values `a`, `b`, `c`return // Return encoded string}})```_(Note: the `encoder` option does not apply if `encode` is `false`)_Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values:```javascriptvar decoded = qs.parse('x=z', { decoder: function (str) {// Passed in values `x`, `z`return // Return decoded string}})```You can encode keys and values using different logic by using the type argument provided to the encoder:```javascriptvar encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultEncoder, charset, type) {if (type === 'key') {return // Encoded key} else if (type === 'value') {return // Encoded value}}})```The type argument is also provided to the decoder:```javascriptvar decoded = qs.parse('x=z', { decoder: function (str, defaultEncoder, charset, type) {if (type === 'key') {return // Decoded key} else if (type === 'value') {return // Decoded value}}})```Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.When arrays are stringified, by default they are given explicit indices:```javascriptqs.stringify({ a: ['b', 'c', 'd'] });// 'a[0]=b&a[1]=c&a[2]=d'```You may override this by setting the `indices` option to `false`:```javascriptqs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });// 'a=b&a=c&a=d'```You may use the `arrayFormat` option to specify the format of the output array:```javascriptqs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })// 'a[0]=b&a[1]=c'qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })// 'a[]=b&a[]=c'qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })// 'a=b&a=c'qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })// 'a=b,c'```When objects are stringified, by default they use bracket notation:```javascriptqs.stringify({ a: { b: { c: 'd', e: 'f' } } });// 'a[b][c]=d&a[b][e]=f'```You may override this to use dot notation by setting the `allowDots` option to `true`:```javascriptqs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });// 'a.b.c=d&a.b.e=f'```Empty strings and null values will omit the value, but the equals sign (=) remains in place:```javascriptassert.equal(qs.stringify({ a: '' }), 'a=');```Key with no values (such as an empty object or array) will return nothing:```javascriptassert.equal(qs.stringify({ a: [] }), '');assert.equal(qs.stringify({ a: {} }), '');assert.equal(qs.stringify({ a: [{}] }), '');assert.equal(qs.stringify({ a: { b: []} }), '');assert.equal(qs.stringify({ a: { b: {}} }), '');```Properties that are set to `undefined` will be omitted entirely:```javascriptassert.equal(qs.stringify({ a: null, b: undefined }), 'a=');```The query string may optionally be prepended with a question mark:```javascriptassert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');```The delimiter may be overridden with stringify as well:```javascriptassert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');```If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option:```javascriptvar date = new Date(7);assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A'));assert.equal(qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }),'a=7');```You may use the `sort` option to affect the order of parameter keys:```javascriptfunction alphabeticalSort(a, b) {return a.localeCompare(b);}assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y');```Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if youpass an array, it will be used to select properties and array indices for stringification:```javascriptfunction filterFunc(prefix, value) {if (prefix == 'b') {// Return an `undefined` value to omit a property.return;}if (prefix == 'e[f]') {return value.getTime();}if (prefix == 'e[g][0]') {return value * 2;}return value;}qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });// 'a=b&c=d&e[f]=123&e[g][0]=4'qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });// 'a=b&e=f'qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });// 'a[0]=b&a[2]=d'```### Handling of `null` valuesBy default, `null` values are treated like empty strings:```javascriptvar withNull = qs.stringify({ a: null, b: '' });assert.equal(withNull, 'a=&b=');```Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.```javascriptvar equalsInsensitive = qs.parse('a&b=');assert.deepEqual(equalsInsensitive, { a: '', b: '' });```To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`values have no `=` sign:```javascriptvar strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });assert.equal(strictNull, 'a&b=');```To parse values without `=` back to `null` use the `strictNullHandling` flag:```javascriptvar parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });assert.deepEqual(parsedStrictNull, { a: null, b: '' });```To completely skip rendering keys with `null` values, use the `skipNulls` flag:```javascriptvar nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });assert.equal(nullsSkipped, 'a=b');```If you're communicating with legacy systems, you can switch to `iso-8859-1`using the `charset` option:```javascriptvar iso = qs.stringify({ æ: 'æ' }, { charset: 'iso-8859-1' });assert.equal(iso, '%E6=%E6');```Characters that don't exist in `iso-8859-1` will be converted to numericentities, similar to what browsers do:```javascriptvar numeric = qs.stringify({ a: '☺' }, { charset: 'iso-8859-1' });assert.equal(numeric, 'a=%26%239786%3B');```You can use the `charsetSentinel` option to announce the character byincluding an `utf8=✓` parameter with the proper encoding if the checkmark,similar to what Ruby on Rails and others do when submitting forms.```javascriptvar sentinel = qs.stringify({ a: '☺' }, { charsetSentinel: true });assert.equal(sentinel, 'utf8=%E2%9C%93&a=%E2%98%BA');var isoSentinel = qs.stringify({ a: 'æ' }, { charsetSentinel: true, charset: 'iso-8859-1' });assert.equal(isoSentinel, 'utf8=%26%2310003%3B&a=%E6');```### Dealing with special character setsBy default the encoding and decoding of characters is done in `utf-8`,and `iso-8859-1` support is also built in via the `charset` parameter.If you wish to encode querystrings to a different character set (i.e.[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library:```javascriptvar encoder = require('qs-iconv/encoder')('shift_jis');var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder });assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');```This also works for decoding of query strings:```javascriptvar decoder = require('qs-iconv/decoder')('shift_jis');var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });assert.deepEqual(obj, { a: 'こんにちは!' });```### RFC 3986 and RFC 1738 space encodingRFC3986 used as default option and encodes ' ' to *%20* which is backward compatible.In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'.```assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c');assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c');```## SecurityPlease email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.## qs for enterpriseAvailable as part of the Tidelift SubscriptionThe maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)[1]: https://npmjs.org/package/qs[2]: http://versionbadg.es/ljharb/qs.svg[3]: https://api.travis-ci.org/ljharb/qs.svg[4]: https://travis-ci.org/ljharb/qs[5]: https://david-dm.org/ljharb/qs.svg[6]: https://david-dm.org/ljharb/qs[7]: https://david-dm.org/ljharb/qs/dev-status.svg[8]: https://david-dm.org/ljharb/qs?type=dev[9]: https://ci.testling.com/ljharb/qs.png[10]: https://ci.testling.com/ljharb/qs[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true[license-image]: http://img.shields.io/npm/l/qs.svg[license-url]: LICENSE[downloads-image]: http://img.shields.io/npm/dm/qs.svg[downloads-url]: http://npm-stat.com/charts.html?package=qs
BSD 3-Clause LicenseCopyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/ljharb/qs/graphs/contributors)All rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, thislist of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentationand/or other materials provided with the distribution.3. Neither the name of the copyright holder nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
## **6.9.4**- [Fix] `stringify`: when `arrayFormat` is `comma`, respect `serializeDate` (#364)- [Refactor] `stringify`: reduce branching (part of #350)- [Refactor] move `maybeMap` to `utils`- [Dev Deps] update `browserify`, `tape`## **6.9.3**- [Fix] proper comma parsing of URL-encoded commas (#361)- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)## **6.9.2**- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)- [meta] ignore eclint transitive audit warning- [meta] fix indentation in package.json- [meta] add tidelift marketing copy- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `has-symbols`, `tape`, `mkdirp`, `iconv-lite`- [actions] add automatic rebasing / merge commit blocking## **6.9.1**- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)- [Fix] `parse`: with comma true, do not split non-string values (#334)- [meta] add `funding` field- [Dev Deps] update `eslint`, `@ljharb/eslint-config`- [Tests] use shared travis-ci config## **6.9.0**- [New] `parse`/`stringify`: Pass extra key/value argument to `decoder` (#333)- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `evalmd`- [Tests] `parse`: add passing `arrayFormat` tests- [Tests] add `posttest` using `npx aud` to run `npm audit` without a lockfile- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray## **6.8.2**- [Fix] proper comma parsing of URL-encoded commas (#361)- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)## **6.8.1**- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)- [fix] `parse`: with comma true, do not split non-string values (#334)- [meta] add tidelift marketing copy- [meta] add `funding` field- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `has-symbols`, `iconv-lite`, `mkdirp`, `object-inspect`- [Tests] `parse`: add passing `arrayFormat` tests- [Tests] use shared travis-ci configs- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray- [actions] add automatic rebasing / merge commit blocking## **6.8.0**- [New] add `depth=false` to preserve the original key; [Fix] `depth=0` should preserve the original key (#326)- [New] [Fix] stringify symbols and bigints- [Fix] ensure node 0.12 can stringify Symbols- [Fix] fix for an impossible situation: when the formatter is called with a non-string value- [Refactor] `formats`: tiny bit of cleanup.- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `safe-publish-latest`, `iconv-lite`, `tape`- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended (#326)- [Tests] use `eclint` instead of `editorconfig-tools`- [docs] readme: add security note- [meta] add github sponsorship- [meta] add FUNDING.yml- [meta] Clean up license text so it’s properly detected as BSD-3-Clause## **6.7.2**- [Fix] proper comma parsing of URL-encoded commas (#361)- [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)## **6.7.1**- [Fix] `parse`: Fix parsing array from object with `comma` true (#359)- [Fix] `parse`: with comma true, handle field that holds an array of arrays (#335)- [fix] `parse`: with comma true, do not split non-string values (#334)- [Fix] `parse`: throw a TypeError instead of an Error for bad charset (#349)- [Fix] fix for an impossible situation: when the formatter is called with a non-string value- [Refactor] `formats`: tiny bit of cleanup.- readme: add security note- [meta] add tidelift marketing copy- [meta] add `funding` field- [meta] add FUNDING.yml- [meta] Clean up license text so it’s properly detected as BSD-3-Clause- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `safe-publish-latest`, `evalmd`, `iconv-lite`, `mkdirp`, `object-inspect`, `browserify`- [Tests] `parse`: add passing `arrayFormat` tests- [Tests] use shared travis-ci configs- [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray- [Tests] add tests for `depth=0` and `depth=false` behavior, both current and intuitive/intended- [Tests] use `eclint` instead of `editorconfig-tools`- [actions] add automatic rebasing / merge commit blocking## **6.7.0**- [New] `stringify`/`parse`: add `comma` as an `arrayFormat` option (#276, #219)- [Fix] correctly parse nested arrays (#212)- [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source, also with an array source- [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty`- [Refactor] `utils`: `isBuffer`: small tweak; add tests- [Refactor] use cached `Array.isArray`- [Refactor] `parse`/`stringify`: make a function to normalize the options- [Refactor] `utils`: reduce observable [[Get]]s- [Refactor] `stringify`/`utils`: cache `Array.isArray`- [Tests] always use `String(x)` over `x.toString()`- [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10- [Tests] temporarily allow coverage to fail## **6.6.0**- [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268)- [New] move two-value combine to a `utils` function (#189)- [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)- [Fix] when `parseArrays` is false, properly handle keys ending in `[]` (#260)- [Fix] `stringify`: do not crash in an obscure combo of `interpretNumericEntities`, a bad custom `decoder`, & `iso-8859-1`- [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided- [refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)- [Refactor] `parse`: only need to reassign the var once- [Refactor] `parse`/`stringify`: clean up `charset` options checking; fix defaults- [Refactor] add missing defaults- [Refactor] `parse`: one less `concat` call- [Refactor] `utils`: `compactQueue`: make it explicitly side-effecting- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape`- [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS## **6.5.2**- [Fix] use `safer-buffer` instead of `Buffer` constructor- [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230)- [Dev Deps] update `browserify`, `eslint`, `iconv-lite`, `safer-buffer`, `tape`, `browserify`## **6.5.1**- [Fix] Fix parsing & compacting very deep objects (#224)- [Refactor] name utils functions- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`- [Tests] up to `node` `v8.4`; use `nvm install-latest-npm` so newer npm doesn’t break older node- [Tests] Use precise dist for Node.js 0.6 runtime (#225)- [Tests] make 0.6 required, now that it’s passing- [Tests] on `node` `v8.2`; fix npm on node 0.6## **6.5.0**- [New] add `utils.assign`- [New] pass default encoder/decoder to custom encoder/decoder functions (#206)- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213)- [Fix] Handle stringifying empty objects with addQueryPrefix (#217)- [Fix] do not mutate `options` argument (#207)- [Refactor] `parse`: cache index to reuse in else statement (#182)- [Docs] add various badges to readme (#208)- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape`- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4- [Tests] add `editorconfig-tools`## **6.4.0**- [New] `qs.stringify`: add `encodeValuesOnly` option- [Fix] follow `allowPrototypes` option during merge (#201, #201)- [Fix] support keys starting with brackets (#202, #200)- [Fix] chmod a-x- [Dev Deps] update `eslint`- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds- [eslint] reduce warnings## **6.3.2**- [Fix] follow `allowPrototypes` option during merge (#201, #200)- [Dev Deps] update `eslint`- [Fix] chmod a-x- [Fix] support keys starting with brackets (#202, #200)- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds## **6.3.1**- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!)- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape`- [Tests] on all node minors; improve test matrix- [Docs] document stringify option `allowDots` (#195)- [Docs] add empty object and array values example (#195)- [Docs] Fix minor inconsistency/typo (#192)- [Docs] document stringify option `sort` (#191)- [Refactor] `stringify`: throw faster with an invalid encoder- [Refactor] remove unnecessary escapes (#184)- Remove contributing.md, since `qs` is no longer part of `hapi` (#183)## **6.3.0**- [New] Add support for RFC 1738 (#174, #173)- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159)- [Fix] ensure `utils.merge` handles merging two arrays- [Refactor] only constructors should be capitalized- [Refactor] capitalized var names are for constructors only- [Refactor] avoid using a sparse array- [Robustness] `formats`: cache `String#replace`- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest`- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix- [Tests] flesh out arrayLimit/arrayFormat tests (#107)- [Tests] skip Object.create tests when null objects are not available- [Tests] Turn on eslint for test files (#175)## **6.2.3**- [Fix] follow `allowPrototypes` option during merge (#201, #200)- [Fix] chmod a-x- [Fix] support keys starting with brackets (#202, #200)- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds## **6.2.2**- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties## **6.2.1**- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call`- [Tests] remove `parallelshell` since it does not reliably report failures- [Tests] up to `node` `v6.3`, `v5.12`- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv`## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed)- [New] pass Buffers to the encoder/decoder directly (#161)- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)- [Fix] fix compacting of nested sparse arrays (#150)## **6.1.2- [Fix] follow `allowPrototypes` option during merge (#201, #200)- [Fix] chmod a-x- [Fix] support keys starting with brackets (#202, #200)- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds## **6.1.1**- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed)- [New] allowDots option for `stringify` (#151)- [Fix] "sort" option should work at a depth of 3 or more (#151)- [Fix] Restore `dist` directory; will be removed in v7 (#148)## **6.0.4**- [Fix] follow `allowPrototypes` option during merge (#201, #200)- [Fix] chmod a-x- [Fix] support keys starting with brackets (#202, #200)- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds## **6.0.3**- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties- [Fix] Restore `dist` directory; will be removed in v7 (#148)## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)- Revert ES6 requirement and restore support for node down to v0.8.## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4## **5.2.1**- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed)- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed)- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed)- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed)- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed)- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed)- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects.- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed)- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed)- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed)- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed)- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed)- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed)- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed)- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer?- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed)- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed)- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed)- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver?## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed)- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed)- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters?## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed)- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed)- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit?- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed)- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed)- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed)- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed)- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed)- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index
name: Automatic Rebaseon: [pull_request]jobs:_:name: "Automatic Rebase"runs-on: ubuntu-lateststeps:- uses: actions/checkout@v1- uses: ljharb/rebase@masterenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# These are supported funding model platformsgithub: [ljharb]patreon: # Replace with a single Patreon usernameopen_collective: # Replace with a single Open Collective usernameko_fi: # Replace with a single Ko-fi usernametidelift: npm/qscommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundryliberapay: # Replace with a single Liberapay usernameissuehunt: # Replace with a single IssueHunt usernameotechie: # Replace with a single Otechie usernamecustom: # Replace with a single custom sponsorship URL
{"root": true,"extends": "@ljharb","rules": {"complexity": 0,"consistent-return": 1,"func-name-matching": 0,"id-length": [2, { "min": 1, "max": 25, "properties": "never" }],"indent": [2, 4],"max-lines-per-function": [2, { "max": 150 }],"max-params": [2, 14],"max-statements": [2, 52],"multiline-comment-style": 0,"no-continue": 1,"no-magic-numbers": 0,"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],"operator-linebreak": [2, "before"],}}
dist
root = true[*]indent_style = spaceindent_size = 4end_of_line = lfcharset = utf-8trim_trailing_whitespace = trueinsert_final_newline = truemax_line_length = 160[test/*]max_line_length = off[LICENSE.md]indent_size = off[*.md]max_line_length = off[*.json]max_line_length = off[Makefile]max_line_length = off[CHANGELOG.md]indent_style = spaceindent_size = 2[LICENSE]indent_size = 2max_line_length = off
{"_from": "portfinder@^1.0.25","_id": "portfinder@1.0.28","_inBundle": false,"_integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==","_location": "/portfinder","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "portfinder@^1.0.25","name": "portfinder","escapedName": "portfinder","rawSpec": "^1.0.25","saveSpec": null,"fetchSpec": "^1.0.25"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz","_shasum": "67c4622852bd5374dd1dd900f779f53462fac778","_spec": "portfinder@^1.0.25","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Charlie Robbins","email": "charlie.robbins@gmail.com"},"bugs": {"url": "https://github.com/http-party/node-portfinder/issues"},"bundleDependencies": false,"dependencies": {"async": "^2.6.2","debug": "^3.1.1","mkdirp": "^0.5.5"},"deprecated": false,"description": "A simple tool to find an open port on the current machine","devDependencies": {"glob": "^7.1.4","vows": "^0.8.2"},"engines": {"node": ">= 0.12.0"},"files": ["lib"],"homepage": "https://github.com/http-party/node-portfinder#readme","keywords": ["http","ports","utilities"],"license": "MIT","main": "./lib/portfinder","name": "portfinder","repository": {"type": "git","url": "git+ssh://git@github.com/http-party/node-portfinder.git"},"scripts": {"test": "vows test/*-test.js --spec"},"types": "./lib/portfinder.d.ts","version": "1.0.28"}
/** portfinder.js: A simple tool to find an open port on the current machine.** (C) 2011, Charlie Robbins**/"use strict";var fs = require('fs'),os = require('os'),net = require('net'),path = require('path'),_async = require('async'),debug = require('debug'),mkdirp = require('mkdirp').mkdirp;var debugTestPort = debug('portfinder:testPort'),debugGetPort = debug('portfinder:getPort'),debugDefaultHosts = debug('portfinder:defaultHosts');var internals = {};internals.testPort = function(options, callback) {if (!callback) {callback = options;options = {};}options.server = options.server || net.createServer(function () {//// Create an empty listener for the port testing server.//});debugTestPort("entered testPort(): trying", options.host, "port", options.port);function onListen () {debugTestPort("done w/ testPort(): OK", options.host, "port", options.port);options.server.removeListener('error', onError);options.server.close();callback(null, options.port);}function onError (err) {debugTestPort("done w/ testPort(): failed", options.host, "w/ port", options.port, "with error", err.code);options.server.removeListener('listening', onListen);if (!(err.code == 'EADDRINUSE' || err.code == 'EACCES')) {return callback(err);}var nextPort = exports.nextPort(options.port);if (nextPort > exports.highestPort) {return callback(new Error('No open ports available'));}internals.testPort({port: nextPort,host: options.host,server: options.server}, callback);}options.server.once('error', onError);options.server.once('listening', onListen);if (options.host) {options.server.listen(options.port, options.host);} else {/*Judgement of service without hostexample:express().listen(options.port)*/options.server.listen(options.port);}};//// ### @basePort {Number}// The lowest port to begin any port search from//exports.basePort = 8000;//// ### @highestPort {Number}// Largest port number is an unsigned short 2**16 -1=65335//exports.highestPort = 65535;//// ### @basePath {string}// Default path to begin any socket search from//exports.basePath = '/tmp/portfinder'//// ### function getPort (options, callback)// #### @options {Object} Settings to use when finding the necessary port// #### @callback {function} Continuation to respond to when complete.// Responds with a unbound port on the current machine.//exports.getPort = function (options, callback) {if (!callback) {callback = options;options = {};}options.port = Number(options.port) || Number(exports.basePort);options.host = options.host || null;options.stopPort = Number(options.stopPort) || Number(exports.highestPort);if(!options.startPort) {options.startPort = Number(options.port);if(options.startPort < 0) {throw Error('Provided options.startPort(' + options.startPort + ') is less than 0, which are cannot be bound.');}if(options.stopPort < options.startPort) {throw Error('Provided options.stopPort(' + options.stopPort + 'is less than options.startPort (' + options.startPort + ')');}}if (options.host) {var hasUserGivenHost;for (var i = 0; i < exports._defaultHosts.length; i++) {if (exports._defaultHosts[i] === options.host) {hasUserGivenHost = true;break;}}if (!hasUserGivenHost) {exports._defaultHosts.push(options.host);}}var openPorts = [], currentHost;return _async.eachSeries(exports._defaultHosts, function(host, next) {debugGetPort("in eachSeries() iteration callback: host is", host);return internals.testPort({ host: host, port: options.port }, function(err, port) {if (err) {debugGetPort("in eachSeries() iteration callback testPort() callback", "with an err:", err.code);currentHost = host;return next(err);} else {debugGetPort("in eachSeries() iteration callback testPort() callback","with a success for port", port);openPorts.push(port);return next();}});}, function(err) {if (err) {debugGetPort("in eachSeries() result callback: err is", err);// If we get EADDRNOTAVAIL it means the host is not bindable, so remove it// from exports._defaultHosts and start over. For ubuntu, we use EINVAL for the sameif (err.code === 'EADDRNOTAVAIL' || err.code === 'EINVAL') {if (options.host === currentHost) {// if bad address matches host given by user, tell them//// NOTE: We may need to one day handle `my-non-existent-host.local` if users// report frustration with passing in hostnames that DONT map to bindable// hosts, without showing them a good error.var msg = 'Provided host ' + options.host + ' could NOT be bound. Please provide a different host address or hostname';return callback(Error(msg));} else {var idx = exports._defaultHosts.indexOf(currentHost);exports._defaultHosts.splice(idx, 1);return exports.getPort(options, callback);}} else {// error is not accounted for, file ticket, handle special casereturn callback(err);}}// sort so we can compare first host to last hostopenPorts.sort(function(a, b) {return a - b;});debugGetPort("in eachSeries() result callback: openPorts is", openPorts);if (openPorts[0] === openPorts[openPorts.length-1]) {// if first === last, we found an open portif(openPorts[0] <= options.stopPort) {return callback(null, openPorts[0]);}else {var msg = 'No open ports found in between '+ options.startPort + ' and ' + options.stopPort;return callback(Error(msg));}} else {// otherwise, try again, using sorted port, aka, highest open for >= 1 hostreturn exports.getPort({ port: openPorts.pop(), host: options.host, startPort: options.startPort, stopPort: options.stopPort }, callback);}});};//// ### function getPortPromise (options)// #### @options {Object} Settings to use when finding the necessary port// Responds a promise to an unbound port on the current machine.//exports.getPortPromise = function (options) {if (typeof Promise !== 'function') {throw Error('Native promise support is not available in this version of node.' +'Please install a polyfill and assign Promise to global.Promise before calling this method');}if (!options) {options = {};}return new Promise(function(resolve, reject) {exports.getPort(options, function(err, port) {if (err) {return reject(err);}resolve(port);});});}//// ### function getPorts (count, options, callback)// #### @count {Number} The number of ports to find// #### @options {Object} Settings to use when finding the necessary port// #### @callback {function} Continuation to respond to when complete.// Responds with an array of unbound ports on the current machine.//exports.getPorts = function (count, options, callback) {if (!callback) {callback = options;options = {};}var lastPort = null;_async.timesSeries(count, function(index, asyncCallback) {if (lastPort) {options.port = exports.nextPort(lastPort);}exports.getPort(options, function (err, port) {if (err) {asyncCallback(err);} else {lastPort = port;asyncCallback(null, port);}});}, callback);};//// ### function getSocket (options, callback)// #### @options {Object} Settings to use when finding the necessary port// #### @callback {function} Continuation to respond to when complete.// Responds with a unbound socket using the specified directory and base// name on the current machine.//exports.getSocket = function (options, callback) {if (!callback) {callback = options;options = {};}options.mod = options.mod || parseInt(755, 8);options.path = options.path || exports.basePath + '.sock';//// Tests the specified socket//function testSocket () {fs.stat(options.path, function (err) {//// If file we're checking doesn't exist (thus, stating it emits ENOENT),// we should be OK with listening on this socket.//if (err) {if (err.code == 'ENOENT') {callback(null, options.path);}else {callback(err);}}else {//// This file exists, so it isn't possible to listen on it. Lets try// next socket.//options.path = exports.nextSocket(options.path);exports.getSocket(options, callback);}});}//// Create the target `dir` then test connection// against the socket.//function createAndTestSocket (dir) {mkdirp(dir, options.mod, function (err) {if (err) {return callback(err);}options.exists = true;testSocket();});}//// Check if the parent directory of the target// socket path exists. If it does, test connection// against the socket. Otherwise, create the directory// then test connection.//function checkAndTestSocket () {var dir = path.dirname(options.path);fs.stat(dir, function (err, stats) {if (err || !stats.isDirectory()) {return createAndTestSocket(dir);}options.exists = true;testSocket();});}//// If it has been explicitly stated that the// target `options.path` already exists, then// simply test the socket.//return options.exists? testSocket(): checkAndTestSocket();};//// ### function nextPort (port)// #### @port {Number} Port to increment from.// Gets the next port in sequence from the// specified `port`.//exports.nextPort = function (port) {return port + 1;};//// ### function nextSocket (socketPath)// #### @socketPath {string} Path to increment from// Gets the next socket path in sequence from the// specified `socketPath`.//exports.nextSocket = function (socketPath) {var dir = path.dirname(socketPath),name = path.basename(socketPath, '.sock'),match = name.match(/^([a-zA-z]+)(\d*)$/i),index = parseInt(match[2]),base = match[1];if (isNaN(index)) {index = 0;}index += 1;return path.join(dir, base + index + '.sock');};/*** @desc List of internal hostnames provided by your machine. A user* provided hostname may also be provided when calling portfinder.getPort,* which would then be added to the default hosts we lookup and return here.** @return {array}** Long Form Explantion:** - Input: (os.networkInterfaces() w/ MacOS 10.11.5+ and running a VM)** { lo0:* [ { address: '::1',* netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',* family: 'IPv6',* mac: '00:00:00:00:00:00',* scopeid: 0,* internal: true },* { address: '127.0.0.1',* netmask: '255.0.0.0',* family: 'IPv4',* mac: '00:00:00:00:00:00',* internal: true },* { address: 'fe80::1',* netmask: 'ffff:ffff:ffff:ffff::',* family: 'IPv6',* mac: '00:00:00:00:00:00',* scopeid: 1,* internal: true } ],* en0:* [ { address: 'fe80::a299:9bff:fe17:766d',* netmask: 'ffff:ffff:ffff:ffff::',* family: 'IPv6',* mac: 'a0:99:9b:17:76:6d',* scopeid: 4,* internal: false },* { address: '10.0.1.22',* netmask: '255.255.255.0',* family: 'IPv4',* mac: 'a0:99:9b:17:76:6d',* internal: false } ],* awdl0:* [ { address: 'fe80::48a8:37ff:fe34:aaef',* netmask: 'ffff:ffff:ffff:ffff::',* family: 'IPv6',* mac: '4a:a8:37:34:aa:ef',* scopeid: 8,* internal: false } ],* vnic0:* [ { address: '10.211.55.2',* netmask: '255.255.255.0',* family: 'IPv4',* mac: '00:1c:42:00:00:08',* internal: false } ],* vnic1:* [ { address: '10.37.129.2',* netmask: '255.255.255.0',* family: 'IPv4',* mac: '00:1c:42:00:00:09',* internal: false } ] }** - Output:** [* '0.0.0.0',* '::1',* '127.0.0.1',* 'fe80::1',* '10.0.1.22',* 'fe80::48a8:37ff:fe34:aaef',* '10.211.55.2',* '10.37.129.2'* ]** Note we export this so we can use it in our tests, otherwise this API is private*/exports._defaultHosts = (function() {var interfaces = {};try{interfaces = os.networkInterfaces();}catch(e) {// As of October 2016, Windows Subsystem for Linux (WSL) does not support// the os.networkInterfaces() call and throws instead. For this platform,// assume 0.0.0.0 as the only address//// - https://github.com/Microsoft/BashOnWindows/issues/468//// - Workaround is a mix of good work from the community:// - https://github.com/http-party/node-portfinder/commit/8d7e30a648ff5034186551fa8a6652669dec2f2f// - https://github.com/yarnpkg/yarn/pull/772/filesif (e.syscall === 'uv_interface_addresses') {// swallow error because we're just going to use defaults// documented @ https://github.com/nodejs/node/blob/4b65a65e75f48ff447cabd5500ce115fb5ad4c57/doc/api/net.md#L231} else {throw e;}}var interfaceNames = Object.keys(interfaces),hiddenButImportantHost = '0.0.0.0', // !important - dont remove, hence the naming :)results = [hiddenButImportantHost];for (var i = 0; i < interfaceNames.length; i++) {var _interface = interfaces[interfaceNames[i]];for (var j = 0; j < _interface.length; j++) {var curr = _interface[j];results.push(curr.address);}}// add null value, For createServer function, do not use host.results.push(null);debugDefaultHosts("exports._defaultHosts is: %o", results);return results;}());
/*** portfinder.js typescript definitions.** (C) 2011, Charlie Robbins*/type PortfinderCallback = (err: Error, port: number) => void;interface PortFinderOptions{/*** Host to find available port on.*/host?: string;/*** search start port (equals to port when not provided)* This exists because getPort and getPortPromise mutates port state in* recursive calls and doesn't have a way to retrieve begininng port while* searching.*/startPort?: number;/*** Minimum port (takes precedence over `basePort`).*/port?: number;/*** Maximum port*/stopPort?: number;}/*** The lowest port to begin any port search from.*/export let basePort: number;/*** Responds with a unbound port on the current machine.*/export function getPort(callback: PortfinderCallback): void;export function getPort(options: PortFinderOptions, callback: PortfinderCallback): void;export function getPorts(count: number, options: PortFinderOptions, callback: (err: Error, ports: Array<number>) => void): void;/*** Responds a promise of an unbound port on the current machine.*/export function getPortPromise(options?: PortFinderOptions): Promise<number>;
# node-portfinder [](https://travis-ci.org/http-party/node-portfinder)## Installation``` bash$ [sudo] npm install portfinder```## UsageThe `portfinder` module has a simple interface:``` jsvar portfinder = require('portfinder');portfinder.getPort(function (err, port) {//// `port` is guaranteed to be a free port// in this scope.//});```Or with promise (if Promise are supported) :``` jsconst portfinder = require('portfinder');portfinder.getPortPromise().then((port) => {//// `port` is guaranteed to be a free port// in this scope.//}).catch((err) => {//// Could not get a free port, `err` contains the reason.//});```If `portfinder.getPortPromise()` is called on a Node version without Promise (<4), it will throw an Error unless [Bluebird](http://bluebirdjs.com/docs/getting-started.html) or any Promise pollyfill is used.### Ports search scopeBy default `portfinder` will start searching from `8000` and scan until maximum port number (`65535`) is reached.You can change this globally by setting:```jsportfinder.basePort = 3000; // default: 8000portfinder.highestPort = 3333; // default: 65535```or by passing optional options object on each invocation:```jsportfinder.getPort({port: 3000, // minimum portstopPort: 3333 // maximum port}, callback);```## Run Tests``` bash$ npm test```#### Author: [Charlie Robbins][0]#### Maintainer: [Erik Trom][1]#### License: MIT/X11[0]: http://nodejitsu.com[1]: https://github.com/eriktrom
node-portfinderCopyright (c) 2012 Charlie RobbinsPermission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{"_from": "opener@^1.5.1","_id": "opener@1.5.2","_inBundle": false,"_integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==","_location": "/opener","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "opener@^1.5.1","name": "opener","escapedName": "opener","rawSpec": "^1.5.1","saveSpec": null,"fetchSpec": "^1.5.1"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz","_shasum": "5d37e1f35077b9dcac4301372271afdeb2a13598","_spec": "opener@^1.5.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Domenic Denicola","email": "d@domenic.me","url": "https://domenic.me/"},"bin": {"opener": "bin/opener-bin.js"},"bugs": {"url": "https://github.com/domenic/opener/issues"},"bundleDependencies": false,"deprecated": false,"description": "Opens stuff, like webpages and files and executables, cross-platform","devDependencies": {"eslint": "^7.7.0"},"files": ["lib/","bin/"],"homepage": "https://github.com/domenic/opener#readme","license": "(WTFPL OR MIT)","main": "lib/opener.js","name": "opener","repository": {"type": "git","url": "git+https://github.com/domenic/opener.git"},"scripts": {"lint": "eslint ."},"version": "1.5.2"}
"use strict";var childProcess = require("child_process");var os = require("os");module.exports = function opener(args, options, callback) {var platform = process.platform;// Attempt to detect Windows Subystem for Linux (WSL). WSL itself as Linux (which works in most cases), but in// this specific case we need to treat it as actually being Windows. The "Windows-way" of opening things through// cmd.exe works just fine here, whereas using xdg-open does not, since there is no X Windows in WSL.if (platform === "linux" && os.release().indexOf("Microsoft") !== -1) {platform = "win32";}// http://stackoverflow.com/q/1480971/3191, but see below for Windows.var command;switch (platform) {case "win32": {command = "cmd.exe";break;}case "darwin": {command = "open";break;}default: {command = "xdg-open";break;}}if (typeof args === "string") {args = [args];}if (typeof options === "function") {callback = options;options = {};}if (options && typeof options === "object" && options.command) {if (platform === "win32") {// *always* use cmd on windowsargs = [options.command].concat(args);} else {command = options.command;}}if (platform === "win32") {// On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and// escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the// responsibility to "cmd /c", which has that logic built in.//// Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title,// so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191//// Additionally, on Windows ampersand and caret need to be escaped when passed to "start"args = args.map(function (value) {return value.replace(/[&^]/g, "^$&");});args = ["/c", "start", "\"\""].concat(args);}return childProcess.execFile(command, args, options, callback);};
#!/usr/bin/env node"use strict";var opener = require("..");opener(process.argv.slice(2), function (error) {if (error) {throw error;}});
# It Opens StuffThat is, in your desktop environment. This will make *actual windows pop up*, with stuff in them:```bashnpm install opener -gopener http://google.comopener ./my-file.txtopener firefoxopener npm run lint```Also if you want to use it programmatically you can do that too:```jsvar opener = require("opener");opener("http://google.com");opener("./my-file.txt");opener("firefox");opener("npm run lint");```Plus, it returns the child process created, so you can do things like let your script exit while the window stays open:```jsvar editor = opener("documentation.odt");editor.unref();// These other unrefs may be necessary if your OS's opener process// exits before the process it started is complete.editor.stdin.unref();editor.stdout.unref();editor.stderr.unref();```## Use It for GoodLike opening the user's browser with a test harness in your package's test script:```json{"scripts": {"test": "opener ./test/runner.html"},"devDependencies": {"opener": "*"}}```## WhyBecause Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least [according to some person on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all three. Like Node.js. And Opener.
Dual licensed under WTFPL and MIT:---Copyright © 2012–2020 Domenic Denicola <d@domenic.me>This work is free. You can redistribute it and/or modify it under theterms of the Do What The Fuck You Want To Public License, Version 2,as published by Sam Hocevar. See below for more details.DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSEVersion 2, December 2004Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>Everyone is permitted to copy and distribute verbatim or modifiedcopies of this license document, and changing it is allowed as longas the name is changed.DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSETERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION0. You just DO WHAT THE FUCK YOU WANT TO.---The MIT License (MIT)Copyright © 2012–2020 Domenic Denicola <d@domenic.me>Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
# msUse this package to easily convert various time formats to milliseconds.## Examples```jsms('2 days') // 172800000ms('1d') // 86400000ms('10h') // 36000000ms('2.5 hrs') // 9000000ms('2h') // 7200000ms('1m') // 60000ms('5s') // 5000ms('1y') // 31557600000ms('100') // 100ms('-3 days') // -259200000ms('-1h') // -3600000ms('-200') // -200```### Convert from Milliseconds```jsms(60000) // "1m"ms(2 * 60000) // "2m"ms(-3 * 60000) // "-3m"ms(ms('10 hours')) // "10h"```### Time Format Written-Out```jsms(60000, { long: true }) // "1 minute"ms(2 * 60000, { long: true }) // "2 minutes"ms(-3 * 60000, { long: true }) // "-3 minutes"ms(ms('10 hours'), { long: true }) // "10 hours"```## Features- Works both in [Node.js](https://nodejs.org) and in the browser- If a number is supplied to `ms`, a string with a unit is returned- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned## Related Packages- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.## Caught a Bug?1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device2. Link the package to the global module directory: `npm link`3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!As always, you can run the tests using: `npm test`
{"_from": "ms@^2.1.1","_id": "ms@2.1.3","_inBundle": false,"_integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==","_location": "/ms","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "ms@^2.1.1","name": "ms","escapedName": "ms","rawSpec": "^2.1.1","saveSpec": null,"fetchSpec": "^2.1.1"},"_requiredBy": ["/debug"],"_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz","_shasum": "574c8138ce1d2b5861f0b44579dbadd60c6615b2","_spec": "ms@^2.1.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/debug","bugs": {"url": "https://github.com/vercel/ms/issues"},"bundleDependencies": false,"deprecated": false,"description": "Tiny millisecond conversion utility","devDependencies": {"eslint": "4.18.2","expect.js": "0.3.1","husky": "0.14.3","lint-staged": "5.0.0","mocha": "4.0.1","prettier": "2.0.5"},"eslintConfig": {"extends": "eslint:recommended","env": {"node": true,"es6": true}},"files": ["index.js"],"homepage": "https://github.com/vercel/ms#readme","license": "MIT","lint-staged": {"*.js": ["npm run lint","prettier --single-quote --write","git add"]},"main": "./index","name": "ms","repository": {"type": "git","url": "git+https://github.com/vercel/ms.git"},"scripts": {"lint": "eslint lib/* bin/*","precommit": "lint-staged","test": "mocha tests.js"},"version": "2.1.3"}
The MIT License (MIT)Copyright (c) 2020 Vercel, Inc.Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
/*** Helpers.*/var s = 1000;var m = s * 60;var h = m * 60;var d = h * 24;var w = d * 7;var y = d * 365.25;/*** Parse or format the given `val`.** Options:** - `long` verbose formatting [false]** @param {String|Number} val* @param {Object} [options]* @throws {Error} throw an error if val is not a non-empty string or a number* @return {String|Number}* @api public*/module.exports = function (val, options) {options = options || {};var type = typeof val;if (type === 'string' && val.length > 0) {return parse(val);} else if (type === 'number' && isFinite(val)) {return options.long ? fmtLong(val) : fmtShort(val);}throw new Error('val is not a non-empty string or a valid number. val=' +JSON.stringify(val));};/*** Parse the given `str` and return milliseconds.** @param {String} str* @return {Number}* @api private*/function parse(str) {str = String(str);if (str.length > 100) {return;}var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if (!match) {return;}var n = parseFloat(match[1]);var type = (match[2] || 'ms').toLowerCase();switch (type) {case 'years':case 'year':case 'yrs':case 'yr':case 'y':return n * y;case 'weeks':case 'week':case 'w':return n * w;case 'days':case 'day':case 'd':return n * d;case 'hours':case 'hour':case 'hrs':case 'hr':case 'h':return n * h;case 'minutes':case 'minute':case 'mins':case 'min':case 'm':return n * m;case 'seconds':case 'second':case 'secs':case 'sec':case 's':return n * s;case 'milliseconds':case 'millisecond':case 'msecs':case 'msec':case 'ms':return n;default:return undefined;}}/*** Short format for `ms`.** @param {Number} ms* @return {String}* @api private*/function fmtShort(ms) {var msAbs = Math.abs(ms);if (msAbs >= d) {return Math.round(ms / d) + 'd';}if (msAbs >= h) {return Math.round(ms / h) + 'h';}if (msAbs >= m) {return Math.round(ms / m) + 'm';}if (msAbs >= s) {return Math.round(ms / s) + 's';}return ms + 'ms';}/*** Long format for `ms`.** @param {Number} ms* @return {String}* @api private*/function fmtLong(ms) {var msAbs = Math.abs(ms);if (msAbs >= d) {return plural(ms, msAbs, d, 'day');}if (msAbs >= h) {return plural(ms, msAbs, h, 'hour');}if (msAbs >= m) {return plural(ms, msAbs, m, 'minute');}if (msAbs >= s) {return plural(ms, msAbs, s, 'second');}return ms + ' ms';}/*** Pluralization helper.*/function plural(ms, msAbs, n, name) {var isPlural = msAbs >= n * 1.5;return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');}
# mkdirpLike `mkdir -p`, but in node.js](http://travis-ci.org/substack/node-mkdirp)# example## pow.js```jsvar mkdirp = require('mkdirp');mkdirp('/tmp/foo/bar/baz', function (err) {if (err) console.error(err)else console.log('pow!')});```Output```pow!```And now /tmp/foo/bar/baz exists, huzzah!# methods```jsvar mkdirp = require('mkdirp');```## mkdirp(dir, opts, cb)Create a new directory and any necessary subdirectories at `dir` with octalpermission string `opts.mode`. If `opts` is a non-object, it will be treated asthe `opts.mode`.If `opts.mode` isn't specified, it defaults to `0777`.`cb(err, made)` fires with the error or the first directory `made`that had to be created, if any.You can optionally pass in an alternate `fs` implementation by passing in`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and`opts.fs.stat(path, cb)`.## mkdirp.sync(dir, opts)Synchronously create a new directory and any necessary subdirectories at `dir`with octal permission string `opts.mode`. If `opts` is a non-object, it will betreated as the `opts.mode`.If `opts.mode` isn't specified, it defaults to `0777`.Returns the first directory that had to be created, if any.You can optionally pass in an alternate `fs` implementation by passing in`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and`opts.fs.statSync(path)`.# usageThis package also ships with a `mkdirp` command.```usage: mkdirp [DIR1,DIR2..] {OPTIONS}Create each supplied directory including any necessary parent directories thatdon't yet exist.If the directory already exists, do nothing.OPTIONS are:-m, --mode If a directory needs to be created, set the mode as an octalpermission string.```# installWith [npm](http://npmjs.org) do:```npm install mkdirp```to get the library, or```npm install -g mkdirp```to get the command.# licenseMIT
{"_from": "mkdirp@^0.5.5","_id": "mkdirp@0.5.5","_inBundle": false,"_integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","_location": "/mkdirp","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "mkdirp@^0.5.5","name": "mkdirp","escapedName": "mkdirp","rawSpec": "^0.5.5","saveSpec": null,"fetchSpec": "^0.5.5"},"_requiredBy": ["/portfinder"],"_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","_shasum": "d91cefd62d1436ca0f41620e251288d420099def","_spec": "mkdirp@^0.5.5","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/portfinder","author": {"name": "James Halliday","email": "mail@substack.net","url": "http://substack.net"},"bin": {"mkdirp": "bin/cmd.js"},"bugs": {"url": "https://github.com/substack/node-mkdirp/issues"},"bundleDependencies": false,"dependencies": {"minimist": "^1.2.5"},"deprecated": false,"description": "Recursively mkdir, like `mkdir -p`","devDependencies": {"mock-fs": "^3.7.0","tap": "^5.4.2"},"files": ["bin","index.js"],"homepage": "https://github.com/substack/node-mkdirp#readme","keywords": ["mkdir","directory"],"license": "MIT","main": "index.js","name": "mkdirp","publishConfig": {"tag": "legacy"},"repository": {"type": "git","url": "git+https://github.com/substack/node-mkdirp.git"},"scripts": {"test": "tap test/*.js"},"version": "0.5.5"}
var path = require('path');var fs = require('fs');var _0777 = parseInt('0777', 8);module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;function mkdirP (p, opts, f, made) {if (typeof opts === 'function') {f = opts;opts = {};}else if (!opts || typeof opts !== 'object') {opts = { mode: opts };}var mode = opts.mode;var xfs = opts.fs || fs;if (mode === undefined) {mode = _0777}if (!made) made = null;var cb = f || function () {};p = path.resolve(p);xfs.mkdir(p, mode, function (er) {if (!er) {made = made || p;return cb(null, made);}switch (er.code) {case 'ENOENT':if (path.dirname(p) === p) return cb(er);mkdirP(path.dirname(p), opts, function (er, made) {if (er) cb(er, made);else mkdirP(p, opts, cb, made);});break;// In the case of any other error, just see if there's a dir// there already. If so, then hooray! If not, then something// is borked.default:xfs.stat(p, function (er2, stat) {// if the stat fails, then that's super weird.// let the original error be the failure reason.if (er2 || !stat.isDirectory()) cb(er, made)else cb(null, made);});break;}});}mkdirP.sync = function sync (p, opts, made) {if (!opts || typeof opts !== 'object') {opts = { mode: opts };}var mode = opts.mode;var xfs = opts.fs || fs;if (mode === undefined) {mode = _0777}if (!made) made = null;p = path.resolve(p);try {xfs.mkdirSync(p, mode);made = made || p;}catch (err0) {switch (err0.code) {case 'ENOENT' :made = sync(path.dirname(p), opts, made);sync(p, opts, made);break;// In the case of any other error, just see if there's a dir// there already. If so, then hooray! If not, then something// is borked.default:var stat;try {stat = xfs.statSync(p);}catch (err1) {throw err0;}if (!stat.isDirectory()) throw err0;break;}}return made;};
usage: mkdirp [DIR1,DIR2..] {OPTIONS}Create each supplied directory including any necessary parent directories thatdon't yet exist.If the directory already exists, do nothing.OPTIONS are:-m, --mode If a directory needs to be created, set the mode as an octalpermission string.
#!/usr/bin/env nodevar mkdirp = require('../');var minimist = require('minimist');var fs = require('fs');var argv = minimist(process.argv.slice(2), {alias: { m: 'mode', h: 'help' },string: [ 'mode' ]});if (argv.help) {fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);return;}var paths = argv._.slice();var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;(function next () {if (paths.length === 0) return;var p = paths.shift();if (mode === undefined) mkdirp(p, cb)else mkdirp(p, mode, cb)function cb (err) {if (err) {console.error(err.message);process.exit(1);}else next();}})();
Copyright 2010 James Halliday (mail@substack.net)This project is free software released under the MIT/X11 license:Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
var parse = require('../');var test = require('tape');test('whitespace should be whitespace' , function (t) {t.plan(1);var x = parse([ '-x', '\t' ]).x;t.equal(x, '\t');});
var parse = require('../');var test = require('tape');test('boolean and alias is not unknown', function (t) {var unknown = [];function unknownFn(arg) {unknown.push(arg);return false;}var aliased = [ '-h', 'true', '--derp', 'true' ];var regular = [ '--herp', 'true', '-d', 'true' ];var opts = {alias: { h: 'herp' },boolean: 'h',unknown: unknownFn};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);t.same(unknown, ['--derp', '-d']);t.end();});test('flag boolean true any double hyphen argument is not unknown', function (t) {var unknown = [];function unknownFn(arg) {unknown.push(arg);return false;}var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], {boolean: true,unknown: unknownFn});t.same(unknown, ['--tacos=good', 'cow', '-p']);t.same(argv, {honk: true,_: []});t.end();});test('string and alias is not unknown', function (t) {var unknown = [];function unknownFn(arg) {unknown.push(arg);return false;}var aliased = [ '-h', 'hello', '--derp', 'goodbye' ];var regular = [ '--herp', 'hello', '-d', 'moon' ];var opts = {alias: { h: 'herp' },string: 'h',unknown: unknownFn};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);t.same(unknown, ['--derp', '-d']);t.end();});test('default and alias is not unknown', function (t) {var unknown = [];function unknownFn(arg) {unknown.push(arg);return false;}var aliased = [ '-h', 'hello' ];var regular = [ '--herp', 'hello' ];var opts = {default: { 'h': 'bar' },alias: { 'h': 'herp' },unknown: unknownFn};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);t.same(unknown, []);t.end();unknownFn(); // exercise fn for 100% coverage});test('value following -- is not unknown', function (t) {var unknown = [];function unknownFn(arg) {unknown.push(arg);return false;}var aliased = [ '--bad', '--', 'good', 'arg' ];var opts = {'--': true,unknown: unknownFn};var argv = parse(aliased, opts);t.same(unknown, ['--bad']);t.same(argv, {'--': ['good', 'arg'],'_': []})t.end();});
var parse = require('../');var test = require('tape');test('stops parsing on the first non-option when stopEarly is set', function (t) {var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {stopEarly: true});t.deepEqual(argv, {aaa: 'bbb',_: ['ccc', '--ddd']});t.end();});
var parse = require('../');var test = require('tape');test('numeric short args', function (t) {t.plan(2);t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });t.deepEqual(parse([ '-123', '456' ]),{ 1: true, 2: true, 3: 456, _: [] });});test('short', function (t) {t.deepEqual(parse([ '-b' ]),{ b : true, _ : [] },'short boolean');t.deepEqual(parse([ 'foo', 'bar', 'baz' ]),{ _ : [ 'foo', 'bar', 'baz' ] },'bare');t.deepEqual(parse([ '-cats' ]),{ c : true, a : true, t : true, s : true, _ : [] },'group');t.deepEqual(parse([ '-cats', 'meow' ]),{ c : true, a : true, t : true, s : 'meow', _ : [] },'short group next');t.deepEqual(parse([ '-h', 'localhost' ]),{ h : 'localhost', _ : [] },'short capture');t.deepEqual(parse([ '-h', 'localhost', '-p', '555' ]),{ h : 'localhost', p : 555, _ : [] },'short captures');t.end();});test('mixed short bool and capture', function (t) {t.same(parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),{f : true, p : 555, h : 'localhost',_ : [ 'script.js' ]});t.end();});test('short and long', function (t) {t.deepEqual(parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),{f : true, p : 555, h : 'localhost',_ : [ 'script.js' ]});t.end();});
var parse = require('../');var test = require('tape');test('proto pollution', function (t) {var argv = parse(['--__proto__.x','123']);t.equal({}.x, undefined);t.equal(argv.__proto__.x, undefined);t.equal(argv.x, undefined);t.end();});test('proto pollution (array)', function (t) {var argv = parse(['--x','4','--x','5','--x.__proto__.z','789']);t.equal({}.z, undefined);t.deepEqual(argv.x, [4,5]);t.equal(argv.x.z, undefined);t.equal(argv.x.__proto__.z, undefined);t.end();});test('proto pollution (number)', function (t) {var argv = parse(['--x','5','--x.__proto__.z','100']);t.equal({}.z, undefined);t.equal((4).z, undefined);t.equal(argv.x, 5);t.equal(argv.x.z, undefined);t.end();});test('proto pollution (string)', function (t) {var argv = parse(['--x','abc','--x.__proto__.z','def']);t.equal({}.z, undefined);t.equal('...'.z, undefined);t.equal(argv.x, 'abc');t.equal(argv.x.z, undefined);t.end();});test('proto pollution (constructor)', function (t) {var argv = parse(['--constructor.prototype.y','123']);t.equal({}.y, undefined);t.equal(argv.y, undefined);t.end();});
var parse = require('../');var test = require('tape');test('parse with modifier functions' , function (t) {t.plan(1);var argv = parse([ '-b', '123' ], { boolean: 'b' });t.deepEqual(argv, { b: true, _: [123] });});
var parse = require('../');var test = require('tape');test('parse args', function (t) {t.deepEqual(parse([ '--no-moo' ]),{ moo : false, _ : [] },'no');t.deepEqual(parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),{ v : ['a','b','c'], _ : [] },'multi');t.end();});test('comprehensive', function (t) {t.deepEqual(parse(['--name=meowmers', 'bare', '-cats', 'woo','-h', 'awesome', '--multi=quux','--key', 'value','-b', '--bool', '--no-meep', '--multi=baz','--', '--not-a-flag', 'eek']),{c : true,a : true,t : true,s : 'woo',h : 'awesome',b : true,bool : true,key : 'value',multi : [ 'quux', 'baz' ],meep : false,name : 'meowmers',_ : [ 'bare', '--not-a-flag', 'eek' ]});t.end();});test('flag boolean', function (t) {var argv = parse([ '-t', 'moo' ], { boolean: 't' });t.deepEqual(argv, { t : true, _ : [ 'moo' ] });t.deepEqual(typeof argv.t, 'boolean');t.end();});test('flag boolean value', function (t) {var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {boolean: [ 't', 'verbose' ],default: { verbose: true }});t.deepEqual(argv, {verbose: false,t: true,_: ['moo']});t.deepEqual(typeof argv.verbose, 'boolean');t.deepEqual(typeof argv.t, 'boolean');t.end();});test('newlines in params' , function (t) {var args = parse([ '-s', "X\nX" ])t.deepEqual(args, { _ : [], s : "X\nX" });// reproduce in bash:// VALUE="new// line"// node program.js --s="$VALUE"args = parse([ "--s=X\nX" ])t.deepEqual(args, { _ : [], s : "X\nX" });t.end();});test('strings' , function (t) {var s = parse([ '-s', '0001234' ], { string: 's' }).s;t.equal(s, '0001234');t.equal(typeof s, 'string');var x = parse([ '-x', '56' ], { string: 'x' }).x;t.equal(x, '56');t.equal(typeof x, 'string');t.end();});test('stringArgs', function (t) {var s = parse([ ' ', ' ' ], { string: '_' })._;t.same(s.length, 2);t.same(typeof s[0], 'string');t.same(s[0], ' ');t.same(typeof s[1], 'string');t.same(s[1], ' ');t.end();});test('empty strings', function(t) {var s = parse([ '-s' ], { string: 's' }).s;t.equal(s, '');t.equal(typeof s, 'string');var str = parse([ '--str' ], { string: 'str' }).str;t.equal(str, '');t.equal(typeof str, 'string');var letters = parse([ '-art' ], {string: [ 'a', 't' ]});t.equal(letters.a, '');t.equal(letters.r, true);t.equal(letters.t, '');t.end();});test('string and alias', function(t) {var x = parse([ '--str', '000123' ], {string: 's',alias: { s: 'str' }});t.equal(x.str, '000123');t.equal(typeof x.str, 'string');t.equal(x.s, '000123');t.equal(typeof x.s, 'string');var y = parse([ '-s', '000123' ], {string: 'str',alias: { str: 's' }});t.equal(y.str, '000123');t.equal(typeof y.str, 'string');t.equal(y.s, '000123');t.equal(typeof y.s, 'string');t.end();});test('slashBreak', function (t) {t.same(parse([ '-I/foo/bar/baz' ]),{ I : '/foo/bar/baz', _ : [] });t.same(parse([ '-xyz/foo/bar/baz' ]),{ x : true, y : true, z : '/foo/bar/baz', _ : [] });t.end();});test('alias', function (t) {var argv = parse([ '-f', '11', '--zoom', '55' ], {alias: { z: 'zoom' }});t.equal(argv.zoom, 55);t.equal(argv.z, argv.zoom);t.equal(argv.f, 11);t.end();});test('multiAlias', function (t) {var argv = parse([ '-f', '11', '--zoom', '55' ], {alias: { z: [ 'zm', 'zoom' ] }});t.equal(argv.zoom, 55);t.equal(argv.z, argv.zoom);t.equal(argv.z, argv.zm);t.equal(argv.f, 11);t.end();});test('nested dotted objects', function (t) {var argv = parse(['--foo.bar', '3', '--foo.baz', '4','--foo.quux.quibble', '5', '--foo.quux.o_O','--beep.boop']);t.same(argv.foo, {bar : 3,baz : 4,quux : {quibble : 5,o_O : true}});t.same(argv.beep, { boop : true });t.end();});
var parse = require('../');var test = require('tape');test('nums', function (t) {var argv = parse(['-x', '1234','-y', '5.67','-z', '1e7','-w', '10f','--hex', '0xdeadbeef','789']);t.deepEqual(argv, {x : 1234,y : 5.67,z : 1e7,w : '10f',hex : 0xdeadbeef,_ : [ 789 ]});t.deepEqual(typeof argv.x, 'number');t.deepEqual(typeof argv.y, 'number');t.deepEqual(typeof argv.z, 'number');t.deepEqual(typeof argv.w, 'string');t.deepEqual(typeof argv.hex, 'number');t.deepEqual(typeof argv._[0], 'number');t.end();});test('already a number', function (t) {var argv = parse([ '-x', 1234, 789 ]);t.deepEqual(argv, { x : 1234, _ : [ 789 ] });t.deepEqual(typeof argv.x, 'number');t.deepEqual(typeof argv._[0], 'number');t.end();});
var test = require('tape');var parse = require('../');test('long opts', function (t) {t.deepEqual(parse([ '--bool' ]),{ bool : true, _ : [] },'long boolean');t.deepEqual(parse([ '--pow', 'xixxle' ]),{ pow : 'xixxle', _ : [] },'long capture sp');t.deepEqual(parse([ '--pow=xixxle' ]),{ pow : 'xixxle', _ : [] },'long capture eq');t.deepEqual(parse([ '--host', 'localhost', '--port', '555' ]),{ host : 'localhost', port : 555, _ : [] },'long captures sp');t.deepEqual(parse([ '--host=localhost', '--port=555' ]),{ host : 'localhost', port : 555, _ : [] },'long captures eq');t.end();});
var parse = require('../');var test = require('tape');test('short -k=v' , function (t) {t.plan(1);var argv = parse([ '-b=123' ]);t.deepEqual(argv, { b: 123, _: [] });});test('multi short -k=v' , function (t) {t.plan(1);var argv = parse([ '-a=whatever', '-b=robots' ]);t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] });});
var parse = require('../');var test = require('tape');test('dotted alias', function (t) {var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});t.equal(argv.a.b, 22);t.equal(argv.aa.bb, 22);t.end();});test('dotted default', function (t) {var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});t.equal(argv.a.b, 11);t.equal(argv.aa.bb, 11);t.end();});test('dotted default with no alias', function (t) {var argv = parse('', {default: {'a.b': 11}});t.equal(argv.a.b, 11);t.end();});
var test = require('tape');var parse = require('../');test('boolean default true', function (t) {var argv = parse([], {boolean: 'sometrue',default: { sometrue: true }});t.equal(argv.sometrue, true);t.end();});test('boolean default false', function (t) {var argv = parse([], {boolean: 'somefalse',default: { somefalse: false }});t.equal(argv.somefalse, false);t.end();});test('boolean default to null', function (t) {var argv = parse([], {boolean: 'maybe',default: { maybe: null }});t.equal(argv.maybe, null);var argv = parse(['--maybe'], {boolean: 'maybe',default: { maybe: null }});t.equal(argv.maybe, true);t.end();})
var parse = require('../');var test = require('tape');test('-', function (t) {t.plan(5);t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });t.deepEqual(parse([ '-' ]), { _: [ '-' ] });t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });t.deepEqual(parse([ '-b', '-' ], { boolean: 'b' }),{ b: true, _: [ '-' ] });t.deepEqual(parse([ '-s', '-' ], { string: 's' }),{ s: '-', _: [] });});test('-a -- b', function (t) {t.plan(3);t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });});test('move arguments after the -- into their own `--` array', function(t) {t.plan(1);t.deepEqual(parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }),{ name: 'John', _: [ 'before' ], '--': [ 'after' ] });});
var parse = require('../');var test = require('tape');test('flag boolean default false', function (t) {var argv = parse(['moo'], {boolean: ['t', 'verbose'],default: { verbose: false, t: false }});t.deepEqual(argv, {verbose: false,t: false,_: ['moo']});t.deepEqual(typeof argv.verbose, 'boolean');t.deepEqual(typeof argv.t, 'boolean');t.end();});test('boolean groups', function (t) {var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], {boolean: ['x','y','z']});t.deepEqual(argv, {x : true,y : false,z : true,_ : [ 'one', 'two', 'three' ]});t.deepEqual(typeof argv.x, 'boolean');t.deepEqual(typeof argv.y, 'boolean');t.deepEqual(typeof argv.z, 'boolean');t.end();});test('boolean and alias with chainable api', function (t) {var aliased = [ '-h', 'derp' ];var regular = [ '--herp', 'derp' ];var opts = {herp: { alias: 'h', boolean: true }};var aliasedArgv = parse(aliased, {boolean: 'herp',alias: { h: 'herp' }});var propertyArgv = parse(regular, {boolean: 'herp',alias: { h: 'herp' }});var expected = {herp: true,h: true,'_': [ 'derp' ]};t.same(aliasedArgv, expected);t.same(propertyArgv, expected);t.end();});test('boolean and alias with options hash', function (t) {var aliased = [ '-h', 'derp' ];var regular = [ '--herp', 'derp' ];var opts = {alias: { 'h': 'herp' },boolean: 'herp'};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);var expected = {herp: true,h: true,'_': [ 'derp' ]};t.same(aliasedArgv, expected);t.same(propertyArgv, expected);t.end();});test('boolean and alias array with options hash', function (t) {var aliased = [ '-h', 'derp' ];var regular = [ '--herp', 'derp' ];var alt = [ '--harp', 'derp' ];var opts = {alias: { 'h': ['herp', 'harp'] },boolean: 'h'};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);var altPropertyArgv = parse(alt, opts);var expected = {harp: true,herp: true,h: true,'_': [ 'derp' ]};t.same(aliasedArgv, expected);t.same(propertyArgv, expected);t.same(altPropertyArgv, expected);t.end();});test('boolean and alias using explicit true', function (t) {var aliased = [ '-h', 'true' ];var regular = [ '--herp', 'true' ];var opts = {alias: { h: 'herp' },boolean: 'h'};var aliasedArgv = parse(aliased, opts);var propertyArgv = parse(regular, opts);var expected = {herp: true,h: true,'_': [ ]};t.same(aliasedArgv, expected);t.same(propertyArgv, expected);t.end();});// regression, see https://github.com/substack/node-optimist/issues/71test('boolean and --x=true', function(t) {var parsed = parse(['--boool', '--other=true'], {boolean: 'boool'});t.same(parsed.boool, true);t.same(parsed.other, 'true');parsed = parse(['--boool', '--other=false'], {boolean: 'boool'});t.same(parsed.boool, true);t.same(parsed.other, 'false');t.end();});test('boolean --boool=true', function (t) {var parsed = parse(['--boool=true'], {default: {boool: false},boolean: ['boool']});t.same(parsed.boool, true);t.end();});test('boolean --boool=false', function (t) {var parsed = parse(['--boool=false'], {default: {boool: true},boolean: ['boool']});t.same(parsed.boool, false);t.end();});test('boolean using something similar to true', function (t) {var opts = { boolean: 'h' };var result = parse(['-h', 'true.txt'], opts);var expected = {h: true,'_': ['true.txt']};t.same(result, expected);t.end();});
var parse = require('../');var test = require('tape');test('flag boolean true (default all --args to boolean)', function (t) {var argv = parse(['moo', '--honk', 'cow'], {boolean: true});t.deepEqual(argv, {honk: true,_: ['moo', 'cow']});t.deepEqual(typeof argv.honk, 'boolean');t.end();});test('flag boolean true only affects double hyphen arguments without equals signs', function (t) {var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], {boolean: true});t.deepEqual(argv, {honk: true,tacos: 'good',p: 55,_: ['moo', 'cow']});t.deepEqual(typeof argv.honk, 'boolean');t.end();});
# minimistparse argument optionsThis module is the guts of optimist's argument parser without all thefanciful decoration.# example``` jsvar argv = require('minimist')(process.argv.slice(2));console.log(argv);``````$ node example/parse.js -a beep -b boop{ _: [], a: 'beep', b: 'boop' }``````$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz{ _: [ 'foo', 'bar', 'baz' ],x: 3,y: 4,n: 5,a: true,b: true,c: true,beep: 'boop' }```# securityPrevious versions had a prototype pollution bug that could cause privilegeescalation in some circumstances when handling untrusted user input.Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764# methods``` jsvar parseArgs = require('minimist')```## var argv = parseArgs(args, opts={})Return an argument object `argv` populated with the array arguments from `args`.`argv._` contains all the arguments that didn't have an option associated withthem.Numeric-looking arguments will be returned as numbers unless `opts.string` or`opts.boolean` is set for that argument name.Any arguments after `'--'` will not be parsed and will end up in `argv._`.options can be:* `opts.string` - a string or array of strings argument names to always treat asstrings* `opts.boolean` - a boolean, string or array of strings to always treat asbooleans. if `true` will treat all double hyphenated arguments without equal signsas boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)* `opts.alias` - an object mapping string names to strings or arrays of stringargument names to use as aliases* `opts.default` - an object mapping string argument names to default values* `opts.stopEarly` - when true, populate `argv._` with everything after thefirst non-option* `opts['--']` - when true, populate `argv._` with everything before the `--`and `argv['--']` with everything after the `--`. Here's an example:```> require('./')('one two three -- four five --six'.split(' '), { '--': true }){ _: [ 'one', 'two', 'three' ],'--': [ 'four', 'five', '--six' ] }```Note that with `opts['--']` set, parsing for arguments still stops after the`--`.* `opts.unknown` - a function which is invoked with a command line parameter notdefined in the `opts` configuration object. If the function returns `false`, theunknown option is not added to `argv`.# installWith [npm](https://npmjs.org) do:```npm install minimist```# licenseMIT
{"_from": "minimist@^1.2.5","_id": "minimist@1.2.5","_inBundle": false,"_integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==","_location": "/minimist","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "minimist@^1.2.5","name": "minimist","escapedName": "minimist","rawSpec": "^1.2.5","saveSpec": null,"fetchSpec": "^1.2.5"},"_requiredBy": ["/ecstatic","/http-server","/mkdirp"],"_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","_shasum": "67d66014b66a6a8aaa0c083c5fd58df4e4e97602","_spec": "minimist@^1.2.5","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "James Halliday","email": "mail@substack.net","url": "http://substack.net"},"bugs": {"url": "https://github.com/substack/minimist/issues"},"bundleDependencies": false,"deprecated": false,"description": "parse argument options","devDependencies": {"covert": "^1.0.0","tap": "~0.4.0","tape": "^3.5.0"},"homepage": "https://github.com/substack/minimist","keywords": ["argv","getopt","parser","optimist"],"license": "MIT","main": "index.js","name": "minimist","repository": {"type": "git","url": "git://github.com/substack/minimist.git"},"scripts": {"coverage": "covert test/*.js","test": "tap test/*.js"},"testling": {"files": "test/*.js","browsers": ["ie/6..latest","ff/5","firefox/latest","chrome/10","chrome/latest","safari/5.1","safari/latest","opera/12"]},"version": "1.2.5"}
module.exports = function (args, opts) {if (!opts) opts = {};var flags = { bools : {}, strings : {}, unknownFn: null };if (typeof opts['unknown'] === 'function') {flags.unknownFn = opts['unknown'];}if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {flags.allBools = true;} else {[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {flags.bools[key] = true;});}var aliases = {};Object.keys(opts.alias || {}).forEach(function (key) {aliases[key] = [].concat(opts.alias[key]);aliases[key].forEach(function (x) {aliases[x] = [key].concat(aliases[key].filter(function (y) {return x !== y;}));});});[].concat(opts.string).filter(Boolean).forEach(function (key) {flags.strings[key] = true;if (aliases[key]) {flags.strings[aliases[key]] = true;}});var defaults = opts['default'] || {};var argv = { _ : [] };Object.keys(flags.bools).forEach(function (key) {setArg(key, defaults[key] === undefined ? false : defaults[key]);});var notFlags = [];if (args.indexOf('--') !== -1) {notFlags = args.slice(args.indexOf('--')+1);args = args.slice(0, args.indexOf('--'));}function argDefined(key, arg) {return (flags.allBools && /^--[^=]+$/.test(arg)) ||flags.strings[key] || flags.bools[key] || aliases[key];}function setArg (key, val, arg) {if (arg && flags.unknownFn && !argDefined(key, arg)) {if (flags.unknownFn(arg) === false) return;}var value = !flags.strings[key] && isNumber(val)? Number(val) : val;setKey(argv, key.split('.'), value);(aliases[key] || []).forEach(function (x) {setKey(argv, x.split('.'), value);});}function setKey (obj, keys, value) {var o = obj;for (var i = 0; i < keys.length-1; i++) {var key = keys[i];if (key === '__proto__') return;if (o[key] === undefined) o[key] = {};if (o[key] === Object.prototype || o[key] === Number.prototype|| o[key] === String.prototype) o[key] = {};if (o[key] === Array.prototype) o[key] = [];o = o[key];}var key = keys[keys.length - 1];if (key === '__proto__') return;if (o === Object.prototype || o === Number.prototype|| o === String.prototype) o = {};if (o === Array.prototype) o = [];if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {o[key] = value;}else if (Array.isArray(o[key])) {o[key].push(value);}else {o[key] = [ o[key], value ];}}function aliasIsBoolean(key) {return aliases[key].some(function (x) {return flags.bools[x];});}for (var i = 0; i < args.length; i++) {var arg = args[i];if (/^--.+=/.test(arg)) {// Using [\s\S] instead of . because js doesn't support the// 'dotall' regex modifier. See:// http://stackoverflow.com/a/1068308/13216var m = arg.match(/^--([^=]+)=([\s\S]*)$/);var key = m[1];var value = m[2];if (flags.bools[key]) {value = value !== 'false';}setArg(key, value, arg);}else if (/^--no-.+/.test(arg)) {var key = arg.match(/^--no-(.+)/)[1];setArg(key, false, arg);}else if (/^--.+/.test(arg)) {var key = arg.match(/^--(.+)/)[1];var next = args[i + 1];if (next !== undefined && !/^-/.test(next)&& !flags.bools[key]&& !flags.allBools&& (aliases[key] ? !aliasIsBoolean(key) : true)) {setArg(key, next, arg);i++;}else if (/^(true|false)$/.test(next)) {setArg(key, next === 'true', arg);i++;}else {setArg(key, flags.strings[key] ? '' : true, arg);}}else if (/^-[^-]+/.test(arg)) {var letters = arg.slice(1,-1).split('');var broken = false;for (var j = 0; j < letters.length; j++) {var next = arg.slice(j+2);if (next === '-') {setArg(letters[j], next, arg)continue;}if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {setArg(letters[j], next.split('=')[1], arg);broken = true;break;}if (/[A-Za-z]/.test(letters[j])&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {setArg(letters[j], next, arg);broken = true;break;}if (letters[j+1] && letters[j+1].match(/\W/)) {setArg(letters[j], arg.slice(j+2), arg);broken = true;break;}else {setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);}}var key = arg.slice(-1)[0];if (!broken && key !== '-') {if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])&& !flags.bools[key]&& (aliases[key] ? !aliasIsBoolean(key) : true)) {setArg(key, args[i+1], arg);i++;}else if (args[i+1] && /^(true|false)$/.test(args[i+1])) {setArg(key, args[i+1] === 'true', arg);i++;}else {setArg(key, flags.strings[key] ? '' : true, arg);}}}else {if (!flags.unknownFn || flags.unknownFn(arg) !== false) {argv._.push(flags.strings['_'] || !isNumber(arg) ? arg : Number(arg));}if (opts.stopEarly) {argv._.push.apply(argv._, args.slice(i + 1));break;}}}Object.keys(defaults).forEach(function (key) {if (!hasKey(argv, key.split('.'))) {setKey(argv, key.split('.'), defaults[key]);(aliases[key] || []).forEach(function (x) {setKey(argv, x.split('.'), defaults[key]);});}});if (opts['--']) {argv['--'] = new Array();notFlags.forEach(function(key) {argv['--'].push(key);});}else {notFlags.forEach(function(key) {argv._.push(key);});}return argv;};function hasKey (obj, keys) {var o = obj;keys.slice(0,-1).forEach(function (key) {o = (o[key] || {});});var key = keys[keys.length - 1];return key in o;}function isNumber (x) {if (typeof x === 'number') return true;if (/^0x[0-9a-f]+$/i.test(x)) return true;return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);}
var argv = require('../')(process.argv.slice(2));console.log(argv);
This software is released under the MIT license:Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ORCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHERIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
language: node_jsnode_js:- "0.8"- "0.10"- "0.12"- "iojs"before_install:- npm install -g npm@~1.4.6
{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}
/*** Usage: node test.js*/var mime = require('../mime');var assert = require('assert');var path = require('path');//// Test mime lookups//assert.equal('text/plain', mime.lookup('text.txt')); // normal fileassert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercaseassert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + fileassert.equal('text/plain', mime.lookup('.text.txt')); // hidden fileassert.equal('text/plain', mime.lookup('.txt')); // namelessassert.equal('text/plain', mime.lookup('txt')); // extension-onlyassert.equal('text/plain', mime.lookup('/txt')); // extension-less ()assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-lessassert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognizedassert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default//// Test extensions//assert.equal('txt', mime.extension(mime.types.text));assert.equal('html', mime.extension(mime.types.htm));assert.equal('bin', mime.extension('application/octet-stream'));assert.equal('bin', mime.extension('application/octet-stream '));assert.equal('html', mime.extension(' text/html; charset=UTF-8'));assert.equal('html', mime.extension('text/html; charset=UTF-8 '));assert.equal('html', mime.extension('text/html; charset=UTF-8'));assert.equal('html', mime.extension('text/html ; charset=UTF-8'));assert.equal('html', mime.extension('text/html;charset=UTF-8'));assert.equal('html', mime.extension('text/Html;charset=UTF-8'));assert.equal(undefined, mime.extension('unrecognized'));//// Test node.types lookups//assert.equal('font/woff', mime.lookup('file.woff'));assert.equal('application/octet-stream', mime.lookup('file.buffer'));// TODO: Uncomment once #157 is resolved// assert.equal('audio/mp4', mime.lookup('file.m4a'));assert.equal('font/otf', mime.lookup('file.otf'));//// Test charsets//assert.equal('UTF-8', mime.charsets.lookup('text/plain'));assert.equal('UTF-8', mime.charsets.lookup(mime.types.js));assert.equal('UTF-8', mime.charsets.lookup(mime.types.json));assert.equal(undefined, mime.charsets.lookup(mime.types.bin));assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback'));console.log('\nAll tests passed');
#!/usr/bin/env node'use strict';const fs = require('fs');const path = require('path');const mimeScore = require('mime-score');let db = require('mime-db');let chalk = require('chalk');const STANDARD_FACET_SCORE = 900;const byExtension = {};// Clear out any conflict extensions in mime-dbfor (let type in db) {let entry = db[type];entry.type = type;if (!entry.extensions) continue;entry.extensions.forEach(ext => {if (ext in byExtension) {const e0 = entry;const e1 = byExtension[ext];e0.pri = mimeScore(e0.type, e0.source);e1.pri = mimeScore(e1.type, e1.source);let drop = e0.pri < e1.pri ? e0 : e1;let keep = e0.pri >= e1.pri ? e0 : e1;drop.extensions = drop.extensions.filter(e => e !== ext);console.log(`${ext}: Keeping ${chalk.green(keep.type)} (${keep.pri}), dropping ${chalk.red(drop.type)} (${drop.pri})`);}byExtension[ext] = entry;});}function writeTypesFile(types, path) {fs.writeFileSync(path, JSON.stringify(types));}// Segregate into standard and non-standard types based on facet per// https://tools.ietf.org/html/rfc6838#section-3.1const types = {};Object.keys(db).sort().forEach(k => {const entry = db[k];types[entry.type] = entry.extensions;});writeTypesFile(types, path.join(__dirname, '..', 'types.json'));
{"_from": "mime@^1.6.0","_id": "mime@1.6.0","_inBundle": false,"_integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==","_location": "/mime","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "mime@^1.6.0","name": "mime","escapedName": "mime","rawSpec": "^1.6.0","saveSpec": null,"fetchSpec": "^1.6.0"},"_requiredBy": ["/ecstatic"],"_resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz","_shasum": "32cd9e5c64553bd58d19a568af452acff04981b1","_spec": "mime@^1.6.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/ecstatic","author": {"name": "Robert Kieffer","email": "robert@broofa.com","url": "http://github.com/broofa"},"bin": {"mime": "cli.js"},"bugs": {"url": "https://github.com/broofa/node-mime/issues"},"bundleDependencies": false,"contributors": [{"name": "Benjamin Thomas","email": "benjamin@benjaminthomas.org","url": "http://github.com/bentomas"}],"dependencies": {},"deprecated": false,"description": "A comprehensive library for mime-type mapping","devDependencies": {"github-release-notes": "0.13.1","mime-db": "1.31.0","mime-score": "1.1.0"},"engines": {"node": ">=4"},"homepage": "https://github.com/broofa/node-mime#readme","keywords": ["util","mime"],"license": "MIT","main": "mime.js","name": "mime","repository": {"url": "git+https://github.com/broofa/node-mime.git","type": "git"},"scripts": {"changelog": "gren changelog --tags=all --generate --override","prepare": "node src/build.js","test": "node src/test.js"},"version": "1.6.0"}
var path = require('path');var fs = require('fs');function Mime() {// Map of extension -> mime typethis.types = Object.create(null);// Map of mime type -> extensionthis.extensions = Object.create(null);}/*** Define mimetype -> extension mappings. Each key is a mime-type that maps* to an array of extensions associated with the type. The first extension is* used as the default extension for the type.** e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});** @param map (Object) type definitions*/Mime.prototype.define = function (map) {for (var type in map) {var exts = map[type];for (var i = 0; i < exts.length; i++) {if (process.env.DEBUG_MIME && this.types[exts[i]]) {console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +this.types[exts[i]] + ' to ' + type);}this.types[exts[i]] = type;}// Default extension is the first one we encounterif (!this.extensions[type]) {this.extensions[type] = exts[0];}}};/*** Load an Apache2-style ".types" file** This may be called multiple times (it's expected). Where files declare* overlapping types/extensions, the last file wins.** @param file (String) path of file to load.*/Mime.prototype.load = function(file) {this._loading = file;// Read file and split into linesvar map = {},content = fs.readFileSync(file, 'ascii'),lines = content.split(/[\r\n]+/);lines.forEach(function(line) {// Clean up whitespace/comments, and split into fieldsvar fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);map[fields.shift()] = fields;});this.define(map);this._loading = null;};/*** Lookup a mime type based on extension*/Mime.prototype.lookup = function(path, fallback) {var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase();return this.types[ext] || fallback || this.default_type;};/*** Return file extension associated with a mime type*/Mime.prototype.extension = function(mimeType) {var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[type];};// Default instancevar mime = new Mime();// Define built-in typesmime.define(require('./types.json'));// Default typemime.default_type = mime.lookup('bin');//// Additional API specific to the default instance//mime.Mime = Mime;/*** Lookup a charset based on mime type.*/mime.charsets = {lookup: function(mimeType, fallback) {// Assume text types are utf8return (/^text\/|^application\/(javascript|json)/).test(mimeType) ? 'UTF-8' : fallback;}};module.exports = mime;
#!/usr/bin/env nodevar mime = require('./mime.js');var file = process.argv[2];var type = mime.lookup(file);process.stdout.write(type + '\n');
# mimeComprehensive MIME type mapping API based on mime-db module.## InstallInstall with [npm](http://github.com/isaacs/npm):npm install mime## Contributing / Testingnpm run test## Command Linemime [path_string]E.g.> mime scripts/jquery.jsapplication/javascript## API - Queries### mime.lookup(path)Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g.```jsvar mime = require('mime');mime.lookup('/path/to/file.txt'); // => 'text/plain'mime.lookup('file.txt'); // => 'text/plain'mime.lookup('.TXT'); // => 'text/plain'mime.lookup('htm'); // => 'text/html'```### mime.default_typeSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)### mime.extension(type)Get the default extension for `type````jsmime.extension('text/html'); // => 'html'mime.extension('application/octet-stream'); // => 'bin'```### mime.charsets.lookup()Map mime-type to charset```jsmime.charsets.lookup('text/plain'); // => 'UTF-8'```(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)## API - Defining Custom TypesCustom type mappings can be added on a per-project basis via the following APIs.### mime.define()Add custom mime/extension mappings```jsmime.define({'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],'application/x-my-type': ['x-mt', 'x-mtt'],// etc ...});mime.lookup('x-sft'); // => 'text/x-some-format'```The first entry in the extensions array is returned by `mime.extension()`. E.g.```jsmime.extension('text/x-some-format'); // => 'x-sf'```### mime.load(filepath)Load mappings from an Apache ".types" format file```jsmime.load('./my_project.types');```The .types file format is simple - See the `types` dir for examples.
The MIT License (MIT)Copyright (c) 2010 Benjamin Thomas, Robert KiefferPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
# Changelog## v1.6.0 (24/11/2017)*No changelog for this release.*---## v2.0.4 (24/11/2017)- [**closed**] Switch to mime-score module for resolving extension contention issues. [#182](https://github.com/broofa/node-mime/issues/182)- [**closed**] Update mime-db to 1.31.0 in v1.x branch [#181](https://github.com/broofa/node-mime/issues/181)---## v1.5.0 (22/11/2017)- [**closed**] need ES5 version ready in npm package [#179](https://github.com/broofa/node-mime/issues/179)- [**closed**] mime-db no trace of iWork - pages / numbers / etc. [#178](https://github.com/broofa/node-mime/issues/178)- [**closed**] How it works in brownser ? [#176](https://github.com/broofa/node-mime/issues/176)- [**closed**] Missing `./Mime` [#175](https://github.com/broofa/node-mime/issues/175)- [**closed**] Vulnerable Regular Expression [#167](https://github.com/broofa/node-mime/issues/167)---## v2.0.3 (25/09/2017)*No changelog for this release.*---## v1.4.1 (25/09/2017)- [**closed**] Issue when bundling with webpack [#172](https://github.com/broofa/node-mime/issues/172)---## v2.0.2 (15/09/2017)- [**V2**] fs.readFileSync is not a function [#165](https://github.com/broofa/node-mime/issues/165)- [**closed**] The extension for video/quicktime should map to .mov, not .qt [#164](https://github.com/broofa/node-mime/issues/164)- [**V2**] [v2 Feedback request] Mime class API [#163](https://github.com/broofa/node-mime/issues/163)- [**V2**] [v2 Feedback request] Resolving conflicts over extensions [#162](https://github.com/broofa/node-mime/issues/162)- [**V2**] Allow callers to load module with official, full, or no defined types. [#161](https://github.com/broofa/node-mime/issues/161)- [**V2**] Use "facets" to resolve extension conflicts [#160](https://github.com/broofa/node-mime/issues/160)- [**V2**] Remove fs and path dependencies [#152](https://github.com/broofa/node-mime/issues/152)- [**V2**] Default content-type should not be application/octet-stream [#139](https://github.com/broofa/node-mime/issues/139)- [**V2**] reset mime-types [#124](https://github.com/broofa/node-mime/issues/124)- [**V2**] Extensionless paths should return null or false [#113](https://github.com/broofa/node-mime/issues/113)---## v2.0.1 (14/09/2017)- [**closed**] Changelog for v2.0 does not mention breaking changes [#171](https://github.com/broofa/node-mime/issues/171)- [**closed**] MIME breaking with 'class' declaration as it is without 'use strict mode' [#170](https://github.com/broofa/node-mime/issues/170)---## v2.0.0 (12/09/2017)- [**closed**] woff and woff2 [#168](https://github.com/broofa/node-mime/issues/168)---## v1.4.0 (28/08/2017)- [**closed**] support for ac3 voc files [#159](https://github.com/broofa/node-mime/issues/159)- [**closed**] Help understanding change from application/xml to text/xml [#158](https://github.com/broofa/node-mime/issues/158)- [**closed**] no longer able to override mimetype [#157](https://github.com/broofa/node-mime/issues/157)- [**closed**] application/vnd.adobe.photoshop [#147](https://github.com/broofa/node-mime/issues/147)- [**closed**] Directories should appear as something other than application/octet-stream [#135](https://github.com/broofa/node-mime/issues/135)- [**closed**] requested features [#131](https://github.com/broofa/node-mime/issues/131)- [**closed**] Make types.json loading optional? [#129](https://github.com/broofa/node-mime/issues/129)- [**closed**] Cannot find module './types.json' [#120](https://github.com/broofa/node-mime/issues/120)- [**V2**] .wav files show up as "audio/x-wav" instead of "audio/x-wave" [#118](https://github.com/broofa/node-mime/issues/118)- [**closed**] Don't be a pain in the ass for node community [#108](https://github.com/broofa/node-mime/issues/108)- [**closed**] don't make default_type global [#78](https://github.com/broofa/node-mime/issues/78)- [**closed**] mime.extension() fails if the content-type is parameterized [#74](https://github.com/broofa/node-mime/issues/74)---## v1.3.6 (11/05/2017)- [**closed**] .md should be text/markdown as of March 2016 [#154](https://github.com/broofa/node-mime/issues/154)- [**closed**] Error while installing mime [#153](https://github.com/broofa/node-mime/issues/153)- [**closed**] application/manifest+json [#149](https://github.com/broofa/node-mime/issues/149)- [**closed**] Dynamic adaptive streaming over HTTP (DASH) file extension typo [#141](https://github.com/broofa/node-mime/issues/141)- [**closed**] charsets image/png undefined [#140](https://github.com/broofa/node-mime/issues/140)- [**closed**] Mime-db dependency out of date [#130](https://github.com/broofa/node-mime/issues/130)- [**closed**] how to support plist? [#126](https://github.com/broofa/node-mime/issues/126)- [**closed**] how does .types file format look like? [#123](https://github.com/broofa/node-mime/issues/123)- [**closed**] Feature: support for expanding MIME patterns [#121](https://github.com/broofa/node-mime/issues/121)- [**closed**] DEBUG_MIME doesn't work [#117](https://github.com/broofa/node-mime/issues/117)---## v1.3.4 (06/02/2015)*No changelog for this release.*---## v1.3.3 (06/02/2015)*No changelog for this release.*---## v1.3.1 (05/02/2015)- [**closed**] Consider adding support for Handlebars .hbs file ending [#111](https://github.com/broofa/node-mime/issues/111)- [**closed**] Consider adding support for hjson. [#110](https://github.com/broofa/node-mime/issues/110)- [**closed**] Add mime type for Opus audio files [#94](https://github.com/broofa/node-mime/issues/94)- [**closed**] Consider making the `Requesting New Types` information more visible [#77](https://github.com/broofa/node-mime/issues/77)---## v1.3.0 (05/02/2015)- [**closed**] Add common name? [#114](https://github.com/broofa/node-mime/issues/114)- [**closed**] application/x-yaml [#104](https://github.com/broofa/node-mime/issues/104)- [**closed**] Add mime type for WOFF file format 2.0 [#102](https://github.com/broofa/node-mime/issues/102)- [**closed**] application/x-msi for .msi [#99](https://github.com/broofa/node-mime/issues/99)- [**closed**] Add mimetype for gettext translation files [#98](https://github.com/broofa/node-mime/issues/98)- [**closed**] collaborators [#88](https://github.com/broofa/node-mime/issues/88)- [**closed**] getting errot in installation of mime module...any1 can help? [#87](https://github.com/broofa/node-mime/issues/87)- [**closed**] should application/json's charset be utf8? [#86](https://github.com/broofa/node-mime/issues/86)- [**closed**] Add "license" and "licenses" to package.json [#81](https://github.com/broofa/node-mime/issues/81)- [**closed**] lookup with extension-less file on Windows returns wrong type [#68](https://github.com/broofa/node-mime/issues/68)---## v1.2.11 (15/08/2013)- [**closed**] Update mime.types [#65](https://github.com/broofa/node-mime/issues/65)- [**closed**] Publish a new version [#63](https://github.com/broofa/node-mime/issues/63)- [**closed**] README should state upfront that "application/octet-stream" is default for unknown extension [#55](https://github.com/broofa/node-mime/issues/55)- [**closed**] Suggested improvement to the charset API [#52](https://github.com/broofa/node-mime/issues/52)---## v1.2.10 (25/07/2013)- [**closed**] Mime type for woff files should be application/font-woff and not application/x-font-woff [#62](https://github.com/broofa/node-mime/issues/62)- [**closed**] node.types in conflict with mime.types [#51](https://github.com/broofa/node-mime/issues/51)---## v1.2.9 (17/01/2013)- [**closed**] Please update "mime" NPM [#49](https://github.com/broofa/node-mime/issues/49)- [**closed**] Please add semicolon [#46](https://github.com/broofa/node-mime/issues/46)- [**closed**] parse full mime types [#43](https://github.com/broofa/node-mime/issues/43)---## v1.2.8 (10/01/2013)- [**closed**] /js directory mime is application/javascript. Is it correct? [#47](https://github.com/broofa/node-mime/issues/47)- [**closed**] Add mime types for lua code. [#45](https://github.com/broofa/node-mime/issues/45)---## v1.2.7 (19/10/2012)- [**closed**] cannot install 1.2.7 via npm [#41](https://github.com/broofa/node-mime/issues/41)- [**closed**] Transfer ownership to @broofa [#36](https://github.com/broofa/node-mime/issues/36)- [**closed**] it's wrong to set charset to UTF-8 for text [#30](https://github.com/broofa/node-mime/issues/30)- [**closed**] Allow multiple instances of MIME types container [#27](https://github.com/broofa/node-mime/issues/27)---## v1.2.5 (16/02/2012)- [**closed**] When looking up a types, check hasOwnProperty [#23](https://github.com/broofa/node-mime/issues/23)- [**closed**] Bump version to 1.2.2 [#18](https://github.com/broofa/node-mime/issues/18)- [**closed**] No license [#16](https://github.com/broofa/node-mime/issues/16)- [**closed**] Some types missing that are used by html5/css3 [#13](https://github.com/broofa/node-mime/issues/13)- [**closed**] npm install fails for 1.2.1 [#12](https://github.com/broofa/node-mime/issues/12)- [**closed**] image/pjpeg + image/x-png [#10](https://github.com/broofa/node-mime/issues/10)- [**closed**] symlink [#8](https://github.com/broofa/node-mime/issues/8)- [**closed**] gzip [#2](https://github.com/broofa/node-mime/issues/2)- [**closed**] ALL CAPS filenames return incorrect mime type [#1](https://github.com/broofa/node-mime/issues/1)
var baseRest = require('./_baseRest'),unzipWith = require('./unzipWith');/*** This method is like `_.zip` except that it accepts `iteratee` to specify* how grouped values should be combined. The iteratee is invoked with the* elements of each group: (...group).** @static* @memberOf _* @since 3.8.0* @category Array* @param {...Array} [arrays] The arrays to process.* @param {Function} [iteratee=_.identity] The function to combine* grouped values.* @returns {Array} Returns the new array of grouped elements.* @example** _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {* return a + b + c;* });* // => [111, 222]*/var zipWith = baseRest(function(arrays) {var length = arrays.length,iteratee = length > 1 ? arrays[length - 1] : undefined;iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;return unzipWith(arrays, iteratee);});module.exports = zipWith;
var baseSet = require('./_baseSet'),baseZipObject = require('./_baseZipObject');/*** This method is like `_.zipObject` except that it supports property paths.** @static* @memberOf _* @since 4.1.0* @category Array* @param {Array} [props=[]] The property identifiers.* @param {Array} [values=[]] The property values.* @returns {Object} Returns the new object.* @example** _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }*/function zipObjectDeep(props, values) {return baseZipObject(props || [], values || [], baseSet);}module.exports = zipObjectDeep;
var assignValue = require('./_assignValue'),baseZipObject = require('./_baseZipObject');/*** This method is like `_.fromPairs` except that it accepts two arrays,* one of property identifiers and one of corresponding values.** @static* @memberOf _* @since 0.4.0* @category Array* @param {Array} [props=[]] The property identifiers.* @param {Array} [values=[]] The property values.* @returns {Object} Returns the new object.* @example** _.zipObject(['a', 'b'], [1, 2]);* // => { 'a': 1, 'b': 2 }*/function zipObject(props, values) {return baseZipObject(props || [], values || [], assignValue);}module.exports = zipObject;
var baseRest = require('./_baseRest'),unzip = require('./unzip');/*** Creates an array of grouped elements, the first of which contains the* first elements of the given arrays, the second of which contains the* second elements of the given arrays, and so on.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to process.* @returns {Array} Returns the new array of grouped elements.* @example** _.zip(['a', 'b'], [1, 2], [true, false]);* // => [['a', 1, true], ['b', 2, false]]*/var zip = baseRest(unzip);module.exports = zip;
var arrayFilter = require('./_arrayFilter'),baseRest = require('./_baseRest'),baseXor = require('./_baseXor'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.xor` except that it accepts `comparator` which is* invoked to compare elements of `arrays`. The order of result values is* determined by the order they occur in the arrays. The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.xorWith(objects, others, _.isEqual);* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]*/var xorWith = baseRest(function(arrays) {var comparator = last(arrays);comparator = typeof comparator == 'function' ? comparator : undefined;return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);});module.exports = xorWith;
var arrayFilter = require('./_arrayFilter'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),baseXor = require('./_baseXor'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.xor` except that it accepts `iteratee` which is* invoked for each element of each `arrays` to generate the criterion by* which by which they're compared. The order of result values is determined* by the order they occur in the arrays. The iteratee is invoked with one* argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [1.2, 3.4]** // The `_.property` iteratee shorthand.* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 2 }]*/var xorBy = baseRest(function(arrays) {var iteratee = last(arrays);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee, 2));});module.exports = xorBy;
var arrayFilter = require('./_arrayFilter'),baseRest = require('./_baseRest'),baseXor = require('./_baseXor'),isArrayLikeObject = require('./isArrayLikeObject');/*** Creates an array of unique values that is the* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)* of the given arrays. The order of result values is determined by the order* they occur in the arrays.** @static* @memberOf _* @since 2.4.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of filtered values.* @see _.difference, _.without* @example** _.xor([2, 1], [2, 3]);* // => [1, 3]*/var xor = baseRest(function(arrays) {return baseXor(arrayFilter(arrays, isArrayLikeObject));});module.exports = xor;
var baseWrapperValue = require('./_baseWrapperValue');/*** Executes the chain sequence to resolve the unwrapped value.** @name value* @memberOf _* @since 0.1.0* @alias toJSON, valueOf* @category Seq* @returns {*} Returns the resolved unwrapped value.* @example** _([1, 2, 3]).value();* // => [1, 2, 3]*/function wrapperValue() {return baseWrapperValue(this.__wrapped__, this.__actions__);}module.exports = wrapperValue;
var LazyWrapper = require('./_LazyWrapper'),LodashWrapper = require('./_LodashWrapper'),reverse = require('./reverse'),thru = require('./thru');/*** This method is the wrapper version of `_.reverse`.** **Note:** This method mutates the wrapped array.** @name reverse* @memberOf _* @since 0.1.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var array = [1, 2, 3];** _(array).reverse().value()* // => [3, 2, 1]** console.log(array);* // => [3, 2, 1]*/function wrapperReverse() {var value = this.__wrapped__;if (value instanceof LazyWrapper) {var wrapped = value;if (this.__actions__.length) {wrapped = new LazyWrapper(this);}wrapped = wrapped.reverse();wrapped.__actions__.push({'func': thru,'args': [reverse],'thisArg': undefined});return new LodashWrapper(wrapped, this.__chain__);}return this.thru(reverse);}module.exports = wrapperReverse;
var LazyWrapper = require('./_LazyWrapper'),LodashWrapper = require('./_LodashWrapper'),baseLodash = require('./_baseLodash'),isArray = require('./isArray'),isObjectLike = require('./isObjectLike'),wrapperClone = require('./_wrapperClone');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Creates a `lodash` object which wraps `value` to enable implicit method* chain sequences. Methods that operate on and return arrays, collections,* and functions can be chained together. Methods that retrieve a single value* or may return a primitive value will automatically end the chain sequence* and return the unwrapped value. Otherwise, the value must be unwrapped* with `_#value`.** Explicit chain sequences, which must be unwrapped with `_#value`, may be* enabled using `_.chain`.** The execution of chained methods is lazy, that is, it's deferred until* `_#value` is implicitly or explicitly called.** Lazy evaluation allows several methods to support shortcut fusion.* Shortcut fusion is an optimization to merge iteratee calls; this avoids* the creation of intermediate arrays and can greatly reduce the number of* iteratee executions. Sections of a chain sequence qualify for shortcut* fusion if the section is applied to an array and iteratees accept only* one argument. The heuristic for whether a section qualifies for shortcut* fusion is subject to change.** Chaining is supported in custom builds as long as the `_#value` method is* directly or indirectly included in the build.** In addition to lodash methods, wrappers have `Array` and `String` methods.** The wrapper `Array` methods are:* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`** The wrapper `String` methods are:* `replace` and `split`** The wrapper methods that support shortcut fusion are:* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`** The chainable wrapper methods are:* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,* `zipObject`, `zipObjectDeep`, and `zipWith`** The wrapper methods that are **not** chainable by default are:* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,* `upperFirst`, `value`, and `words`** @name _* @constructor* @category Seq* @param {*} value The value to wrap in a `lodash` instance.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** function square(n) {* return n * n;* }** var wrapped = _([1, 2, 3]);** // Returns an unwrapped value.* wrapped.reduce(_.add);* // => 6** // Returns a wrapped value.* var squares = wrapped.map(square);** _.isArray(squares);* // => false** _.isArray(squares.value());* // => true*/function lodash(value) {if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {if (value instanceof LodashWrapper) {return value;}if (hasOwnProperty.call(value, '__wrapped__')) {return wrapperClone(value);}}return new LodashWrapper(value);}// Ensure wrappers are instances of `baseLodash`.lodash.prototype = baseLodash.prototype;lodash.prototype.constructor = lodash;module.exports = lodash;
var chain = require('./chain');/*** Creates a `lodash` wrapper instance with explicit method chain sequences enabled.** @name chain* @memberOf _* @since 0.1.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 }* ];** // A sequence without explicit chaining.* _(users).head();* // => { 'user': 'barney', 'age': 36 }** // A sequence with explicit chaining.* _(users)* .chain()* .head()* .pick('user')* .value();* // => { 'user': 'barney' }*/function wrapperChain() {return chain(this);}module.exports = wrapperChain;
var LazyWrapper = require('./_LazyWrapper'),LodashWrapper = require('./_LodashWrapper'),baseAt = require('./_baseAt'),flatRest = require('./_flatRest'),isIndex = require('./_isIndex'),thru = require('./thru');/*** This method is the wrapper version of `_.at`.** @name at* @memberOf _* @since 1.0.0* @category Seq* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };** _(object).at(['a[0].b.c', 'a[1]']).value();* // => [3, 4]*/var wrapperAt = flatRest(function(paths) {var length = paths.length,start = length ? paths[0] : 0,value = this.__wrapped__,interceptor = function(object) { return baseAt(object, paths); };if (length > 1 || this.__actions__.length ||!(value instanceof LazyWrapper) || !isIndex(start)) {return this.thru(interceptor);}value = value.slice(start, +start + (length ? 1 : 0));value.__actions__.push({'func': thru,'args': [interceptor],'thisArg': undefined});return new LodashWrapper(value, this.__chain__).thru(function(array) {if (length && !array.length) {array.push(undefined);}return array;});});module.exports = wrapperAt;
var castFunction = require('./_castFunction'),partial = require('./partial');/*** Creates a function that provides `value` to `wrapper` as its first* argument. Any additional arguments provided to the function are appended* to those provided to the `wrapper`. The wrapper is invoked with the `this`* binding of the created function.** @static* @memberOf _* @since 0.1.0* @category Function* @param {*} value The value to wrap.* @param {Function} [wrapper=identity] The wrapper function.* @returns {Function} Returns the new function.* @example** var p = _.wrap(_.escape, function(func, text) {* return '<p>' + func(text) + '</p>';* });** p('fred, barney, & pebbles');* // => '<p>fred, barney, & pebbles</p>'*/function wrap(value, wrapper) {return partial(castFunction(wrapper), value);}module.exports = wrap;
var asciiWords = require('./_asciiWords'),hasUnicodeWord = require('./_hasUnicodeWord'),toString = require('./toString'),unicodeWords = require('./_unicodeWords');/*** Splits `string` into an array of its words.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {RegExp|string} [pattern] The pattern to match words.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the words of `string`.* @example** _.words('fred, barney, & pebbles');* // => ['fred', 'barney', 'pebbles']** _.words('fred, barney, & pebbles', /[^, ]+/g);* // => ['fred', 'barney', '&', 'pebbles']*/function words(string, pattern, guard) {string = toString(string);pattern = guard ? undefined : pattern;if (pattern === undefined) {return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);}return string.match(pattern) || [];}module.exports = words;
var baseDifference = require('./_baseDifference'),baseRest = require('./_baseRest'),isArrayLikeObject = require('./isArrayLikeObject');/*** Creates an array excluding all given values using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** **Note:** Unlike `_.pull`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {...*} [values] The values to exclude.* @returns {Array} Returns the new array of filtered values.* @see _.difference, _.xor* @example** _.without([2, 1, 2, 3], 1, 2);* // => [3]*/var without = baseRest(function(array, values) {return isArrayLikeObject(array)? baseDifference(array, values): [];});module.exports = without;
var baseValues = require('./_baseValues'),keysIn = require('./keysIn');/*** Creates an array of the own and inherited enumerable string keyed property* values of `object`.** **Note:** Non-object values are coerced to objects.** @static* @memberOf _* @since 3.0.0* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property values.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.valuesIn(new Foo);* // => [1, 2, 3] (iteration order is not guaranteed)*/function valuesIn(object) {return object == null ? [] : baseValues(object, keysIn(object));}module.exports = valuesIn;
var baseValues = require('./_baseValues'),keys = require('./keys');/*** Creates an array of the own enumerable string keyed property values of `object`.** **Note:** Non-object values are coerced to objects.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property values.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.values(new Foo);* // => [1, 2] (iteration order is not guaranteed)** _.values('hi');* // => ['h', 'i']*/function values(object) {return object == null ? [] : baseValues(object, keys(object));}module.exports = values;
module.exports = require('./wrapperValue');
module.exports = require('./wrapperValue');
module.exports = {'attempt': require('./attempt'),'bindAll': require('./bindAll'),'cond': require('./cond'),'conforms': require('./conforms'),'constant': require('./constant'),'defaultTo': require('./defaultTo'),'flow': require('./flow'),'flowRight': require('./flowRight'),'identity': require('./identity'),'iteratee': require('./iteratee'),'matches': require('./matches'),'matchesProperty': require('./matchesProperty'),'method': require('./method'),'methodOf': require('./methodOf'),'mixin': require('./mixin'),'noop': require('./noop'),'nthArg': require('./nthArg'),'over': require('./over'),'overEvery': require('./overEvery'),'overSome': require('./overSome'),'property': require('./property'),'propertyOf': require('./propertyOf'),'range': require('./range'),'rangeRight': require('./rangeRight'),'stubArray': require('./stubArray'),'stubFalse': require('./stubFalse'),'stubObject': require('./stubObject'),'stubString': require('./stubString'),'stubTrue': require('./stubTrue'),'times': require('./times'),'toPath': require('./toPath'),'uniqueId': require('./uniqueId')};
var createCaseFirst = require('./_createCaseFirst');/*** Converts the first character of `string` to upper case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the converted string.* @example** _.upperFirst('fred');* // => 'Fred'** _.upperFirst('FRED');* // => 'FRED'*/var upperFirst = createCaseFirst('toUpperCase');module.exports = upperFirst;
var createCompounder = require('./_createCompounder');/*** Converts `string`, as space separated words, to upper case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the upper cased string.* @example** _.upperCase('--foo-bar');* // => 'FOO BAR'** _.upperCase('fooBar');* // => 'FOO BAR'** _.upperCase('__foo_bar__');* // => 'FOO BAR'*/var upperCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + word.toUpperCase();});module.exports = upperCase;
var baseUpdate = require('./_baseUpdate'),castFunction = require('./_castFunction');/*** This method is like `_.update` except that it accepts `customizer` which is* invoked to produce the objects of `path`. If `customizer` returns `undefined`* path creation is handled by the method instead. The `customizer` is invoked* with three arguments: (nsValue, key, nsObject).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.6.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {Function} updater The function to produce the updated value.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @example** var object = {};** _.updateWith(object, '[0][1]', _.constant('a'), Object);* // => { '0': { '1': 'a' } }*/function updateWith(object, path, updater, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);}module.exports = updateWith;
var baseUpdate = require('./_baseUpdate'),castFunction = require('./_castFunction');/*** This method is like `_.set` except that accepts `updater` to produce the* value to set. Use `_.updateWith` to customize `path` creation. The `updater`* is invoked with one argument: (value).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.6.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {Function} updater The function to produce the updated value.* @returns {Object} Returns `object`.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.update(object, 'a[0].b.c', function(n) { return n * n; });* console.log(object.a[0].b.c);* // => 9** _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });* console.log(object.x[0].y.z);* // => 0*/function update(object, path, updater) {return object == null ? object : baseUpdate(object, path, castFunction(updater));}module.exports = update;
var apply = require('./_apply'),arrayMap = require('./_arrayMap'),unzip = require('./unzip');/*** This method is like `_.unzip` except that it accepts `iteratee` to specify* how regrouped values should be combined. The iteratee is invoked with the* elements of each group: (...group).** @static* @memberOf _* @since 3.8.0* @category Array* @param {Array} array The array of grouped elements to process.* @param {Function} [iteratee=_.identity] The function to combine* regrouped values.* @returns {Array} Returns the new array of regrouped elements.* @example** var zipped = _.zip([1, 2], [10, 20], [100, 200]);* // => [[1, 10, 100], [2, 20, 200]]** _.unzipWith(zipped, _.add);* // => [3, 30, 300]*/function unzipWith(array, iteratee) {if (!(array && array.length)) {return [];}var result = unzip(array);if (iteratee == null) {return result;}return arrayMap(result, function(group) {return apply(iteratee, undefined, group);});}module.exports = unzipWith;
var arrayFilter = require('./_arrayFilter'),arrayMap = require('./_arrayMap'),baseProperty = require('./_baseProperty'),baseTimes = require('./_baseTimes'),isArrayLikeObject = require('./isArrayLikeObject');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** This method is like `_.zip` except that it accepts an array of grouped* elements and creates an array regrouping the elements to their pre-zip* configuration.** @static* @memberOf _* @since 1.2.0* @category Array* @param {Array} array The array of grouped elements to process.* @returns {Array} Returns the new array of regrouped elements.* @example** var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);* // => [['a', 1, true], ['b', 2, false]]** _.unzip(zipped);* // => [['a', 'b'], [1, 2], [true, false]]*/function unzip(array) {if (!(array && array.length)) {return [];}var length = 0;array = arrayFilter(array, function(group) {if (isArrayLikeObject(group)) {length = nativeMax(group.length, length);return true;}});return baseTimes(length, function(index) {return arrayMap(array, baseProperty(index));});}module.exports = unzip;
var baseUnset = require('./_baseUnset');/*** Removes the property at `path` of `object`.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to unset.* @returns {boolean} Returns `true` if the property is deleted, else `false`.* @example** var object = { 'a': [{ 'b': { 'c': 7 } }] };* _.unset(object, 'a[0].b.c');* // => true** console.log(object);* // => { 'a': [{ 'b': {} }] };** _.unset(object, ['a', '0', 'b', 'c']);* // => true** console.log(object);* // => { 'a': [{ 'b': {} }] };*/function unset(object, path) {return object == null ? true : baseUnset(object, path);}module.exports = unset;
var toString = require('./toString');/** Used to generate unique IDs. */var idCounter = 0;/*** Generates a unique ID. If `prefix` is given, the ID is appended to it.** @static* @since 0.1.0* @memberOf _* @category Util* @param {string} [prefix=''] The value to prefix the ID with.* @returns {string} Returns the unique ID.* @example** _.uniqueId('contact_');* // => 'contact_104'** _.uniqueId();* // => '105'*/function uniqueId(prefix) {var id = ++idCounter;return toString(prefix) + id;}module.exports = uniqueId;
var baseUniq = require('./_baseUniq');/*** This method is like `_.uniq` except that it accepts `comparator` which* is invoked to compare elements of `array`. The order of result values is* determined by the order they occur in the array.The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.uniqWith(objects, _.isEqual);* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]*/function uniqWith(array, comparator) {comparator = typeof comparator == 'function' ? comparator : undefined;return (array && array.length) ? baseUniq(array, undefined, comparator) : [];}module.exports = uniqWith;
var baseIteratee = require('./_baseIteratee'),baseUniq = require('./_baseUniq');/*** This method is like `_.uniq` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* uniqueness is computed. The order of result values is determined by the* order they occur in the array. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** _.uniqBy([2.1, 1.2, 2.3], Math.floor);* // => [2.1, 1.2]** // The `_.property` iteratee shorthand.* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }, { 'x': 2 }]*/function uniqBy(array, iteratee) {return (array && array.length) ? baseUniq(array, baseIteratee(iteratee, 2)) : [];}module.exports = uniqBy;
var baseUniq = require('./_baseUniq');/*** Creates a duplicate-free version of an array, using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons, in which only the first occurrence of each element* is kept. The order of result values is determined by the order they occur* in the array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @returns {Array} Returns the new duplicate free array.* @example** _.uniq([2, 1, 2]);* // => [2, 1]*/function uniq(array) {return (array && array.length) ? baseUniq(array) : [];}module.exports = uniq;
var baseFlatten = require('./_baseFlatten'),baseRest = require('./_baseRest'),baseUniq = require('./_baseUniq'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.union` except that it accepts `comparator` which* is invoked to compare elements of `arrays`. Result values are chosen from* the first array in which the value occurs. The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of combined values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.unionWith(objects, others, _.isEqual);* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]*/var unionWith = baseRest(function(arrays) {var comparator = last(arrays);comparator = typeof comparator == 'function' ? comparator : undefined;return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);});module.exports = unionWith;
var baseFlatten = require('./_baseFlatten'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),baseUniq = require('./_baseUniq'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.union` except that it accepts `iteratee` which is* invoked for each element of each `arrays` to generate the criterion by* which uniqueness is computed. Result values are chosen from the first* array in which the value occurs. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of combined values.* @example** _.unionBy([2.1], [1.2, 2.3], Math.floor);* // => [2.1, 1.2]** // The `_.property` iteratee shorthand.* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }, { 'x': 2 }]*/var unionBy = baseRest(function(arrays) {var iteratee = last(arrays);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2));});module.exports = unionBy;
var baseFlatten = require('./_baseFlatten'),baseRest = require('./_baseRest'),baseUniq = require('./_baseUniq'),isArrayLikeObject = require('./isArrayLikeObject');/*** Creates an array of unique values, in order, from all given arrays using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of combined values.* @example** _.union([2], [1, 2]);* // => [2, 1]*/var union = baseRest(function(arrays) {return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));});module.exports = union;
var toString = require('./toString'),unescapeHtmlChar = require('./_unescapeHtmlChar');/** Used to match HTML entities and HTML characters. */var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,reHasEscapedHtml = RegExp(reEscapedHtml.source);/*** The inverse of `_.escape`; this method converts the HTML entities* `&`, `<`, `>`, `"`, and `'` in `string` to* their corresponding characters.** **Note:** No other HTML entities are unescaped. To unescape additional* HTML entities use a third-party library like [_he_](https://mths.be/he).** @static* @memberOf _* @since 0.6.0* @category String* @param {string} [string=''] The string to unescape.* @returns {string} Returns the unescaped string.* @example** _.unescape('fred, barney, & pebbles');* // => 'fred, barney, & pebbles'*/function unescape(string) {string = toString(string);return (string && reHasEscapedHtml.test(string))? string.replace(reEscapedHtml, unescapeHtmlChar): string;}module.exports = unescape;
var ary = require('./ary');/*** Creates a function that accepts up to one argument, ignoring any* additional arguments.** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to cap arguments for.* @returns {Function} Returns the new capped function.* @example** _.map(['6', '8', '10'], _.unary(parseInt));* // => [6, 8, 10]*/function unary(func) {return ary(func, 1);}module.exports = unary;
var baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),hasUnicode = require('./_hasUnicode'),isObject = require('./isObject'),isRegExp = require('./isRegExp'),stringSize = require('./_stringSize'),stringToArray = require('./_stringToArray'),toInteger = require('./toInteger'),toString = require('./toString');/** Used as default options for `_.truncate`. */var DEFAULT_TRUNC_LENGTH = 30,DEFAULT_TRUNC_OMISSION = '...';/** Used to match `RegExp` flags from their coerced string values. */var reFlags = /\w*$/;/*** Truncates `string` if it's longer than the given maximum string length.* The last characters of the truncated string are replaced with the omission* string which defaults to "...".** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to truncate.* @param {Object} [options={}] The options object.* @param {number} [options.length=30] The maximum string length.* @param {string} [options.omission='...'] The string to indicate text is omitted.* @param {RegExp|string} [options.separator] The separator pattern to truncate to.* @returns {string} Returns the truncated string.* @example** _.truncate('hi-diddly-ho there, neighborino');* // => 'hi-diddly-ho there, neighbo...'** _.truncate('hi-diddly-ho there, neighborino', {* 'length': 24,* 'separator': ' '* });* // => 'hi-diddly-ho there,...'** _.truncate('hi-diddly-ho there, neighborino', {* 'length': 24,* 'separator': /,? +/* });* // => 'hi-diddly-ho there...'** _.truncate('hi-diddly-ho there, neighborino', {* 'omission': ' [...]'* });* // => 'hi-diddly-ho there, neig [...]'*/function truncate(string, options) {var length = DEFAULT_TRUNC_LENGTH,omission = DEFAULT_TRUNC_OMISSION;if (isObject(options)) {var separator = 'separator' in options ? options.separator : separator;length = 'length' in options ? toInteger(options.length) : length;omission = 'omission' in options ? baseToString(options.omission) : omission;}string = toString(string);var strLength = string.length;if (hasUnicode(string)) {var strSymbols = stringToArray(string);strLength = strSymbols.length;}if (length >= strLength) {return string;}var end = length - stringSize(omission);if (end < 1) {return omission;}var result = strSymbols? castSlice(strSymbols, 0, end).join(''): string.slice(0, end);if (separator === undefined) {return result + omission;}if (strSymbols) {end += (result.length - end);}if (isRegExp(separator)) {if (string.slice(end).search(separator)) {var match,substring = result;if (!separator.global) {separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');}separator.lastIndex = 0;while ((match = separator.exec(substring))) {var newEnd = match.index;}result = result.slice(0, newEnd === undefined ? end : newEnd);}} else if (string.indexOf(baseToString(separator), end) != end) {var index = result.lastIndexOf(separator);if (index > -1) {result = result.slice(0, index);}}return result + omission;}module.exports = truncate;
var baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),charsStartIndex = require('./_charsStartIndex'),stringToArray = require('./_stringToArray'),toString = require('./toString');/** Used to match leading and trailing whitespace. */var reTrimStart = /^\s+/;/*** Removes leading whitespace or specified characters from `string`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trimStart(' abc ');* // => 'abc '** _.trimStart('-_-abc-_-', '_-');* // => 'abc-_-'*/function trimStart(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrimStart, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),start = charsStartIndex(strSymbols, stringToArray(chars));return castSlice(strSymbols, start).join('');}module.exports = trimStart;
var baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),charsEndIndex = require('./_charsEndIndex'),stringToArray = require('./_stringToArray'),toString = require('./toString');/** Used to match leading and trailing whitespace. */var reTrimEnd = /\s+$/;/*** Removes trailing whitespace or specified characters from `string`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trimEnd(' abc ');* // => ' abc'** _.trimEnd('-_-abc-_-', '_-');* // => '-_-abc'*/function trimEnd(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrimEnd, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;return castSlice(strSymbols, 0, end).join('');}module.exports = trimEnd;
var baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),charsEndIndex = require('./_charsEndIndex'),charsStartIndex = require('./_charsStartIndex'),stringToArray = require('./_stringToArray'),toString = require('./toString');/** Used to match leading and trailing whitespace. */var reTrim = /^\s+|\s+$/g;/*** Removes leading and trailing whitespace or specified characters from `string`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trim(' abc ');* // => 'abc'** _.trim('-_-abc-_-', '_-');* // => 'abc'** _.map([' foo ', ' bar '], _.trim);* // => ['foo', 'bar']*/function trim(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrim, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),chrSymbols = stringToArray(chars),start = charsStartIndex(strSymbols, chrSymbols),end = charsEndIndex(strSymbols, chrSymbols) + 1;return castSlice(strSymbols, start, end).join('');}module.exports = trim;
var arrayEach = require('./_arrayEach'),baseCreate = require('./_baseCreate'),baseForOwn = require('./_baseForOwn'),baseIteratee = require('./_baseIteratee'),getPrototype = require('./_getPrototype'),isArray = require('./isArray'),isBuffer = require('./isBuffer'),isFunction = require('./isFunction'),isObject = require('./isObject'),isTypedArray = require('./isTypedArray');/*** An alternative to `_.reduce`; this method transforms `object` to a new* `accumulator` object which is the result of running each of its own* enumerable string keyed properties thru `iteratee`, with each invocation* potentially mutating the `accumulator` object. If `accumulator` is not* provided, a new object with the same `[[Prototype]]` will be used. The* iteratee is invoked with four arguments: (accumulator, value, key, object).* Iteratee functions may exit iteration early by explicitly returning `false`.** @static* @memberOf _* @since 1.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The custom accumulator value.* @returns {*} Returns the accumulated value.* @example** _.transform([2, 3, 4], function(result, n) {* result.push(n *= n);* return n % 2 == 0;* }, []);* // => [4, 9]** _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {* (result[value] || (result[value] = [])).push(key);* }, {});* // => { '1': ['a', 'c'], '2': ['b'] }*/function transform(object, iteratee, accumulator) {var isArr = isArray(object),isArrLike = isArr || isBuffer(object) || isTypedArray(object);iteratee = baseIteratee(iteratee, 4);if (accumulator == null) {var Ctor = object && object.constructor;if (isArrLike) {accumulator = isArr ? new Ctor : [];}else if (isObject(object)) {accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};}else {accumulator = {};}}(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {return iteratee(accumulator, value, index, object);});return accumulator;}module.exports = transform;
var toString = require('./toString');/*** Converts `string`, as a whole, to upper case just like* [String#toUpperCase](https://mdn.io/toUpperCase).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the upper cased string.* @example** _.toUpper('--foo-bar--');* // => '--FOO-BAR--'** _.toUpper('fooBar');* // => 'FOOBAR'** _.toUpper('__foo_bar__');* // => '__FOO_BAR__'*/function toUpper(value) {return toString(value).toUpperCase();}module.exports = toUpper;
var baseToString = require('./_baseToString');/*** Converts `value` to a string. An empty string is returned for `null`* and `undefined` values. The sign of `-0` is preserved.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {string} Returns the converted string.* @example** _.toString(null);* // => ''** _.toString(-0);* // => '-0'** _.toString([1, 2, 3]);* // => '1,2,3'*/function toString(value) {return value == null ? '' : baseToString(value);}module.exports = toString;
var baseClamp = require('./_baseClamp'),toInteger = require('./toInteger');/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/*** Converts `value` to a safe integer. A safe integer can be compared and* represented correctly.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toSafeInteger(3.2);* // => 3** _.toSafeInteger(Number.MIN_VALUE);* // => 0** _.toSafeInteger(Infinity);* // => 9007199254740991** _.toSafeInteger('3.2');* // => 3*/function toSafeInteger(value) {return value? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER): (value === 0 ? value : 0);}module.exports = toSafeInteger;
var copyObject = require('./_copyObject'),keysIn = require('./keysIn');/*** Converts `value` to a plain object flattening inherited enumerable string* keyed properties of `value` to own properties of the plain object.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to convert.* @returns {Object} Returns the converted plain object.* @example** function Foo() {* this.b = 2;* }** Foo.prototype.c = 3;** _.assign({ 'a': 1 }, new Foo);* // => { 'a': 1, 'b': 2 }** _.assign({ 'a': 1 }, _.toPlainObject(new Foo));* // => { 'a': 1, 'b': 2, 'c': 3 }*/function toPlainObject(value) {return copyObject(value, keysIn(value));}module.exports = toPlainObject;
var arrayMap = require('./_arrayMap'),copyArray = require('./_copyArray'),isArray = require('./isArray'),isSymbol = require('./isSymbol'),stringToPath = require('./_stringToPath'),toKey = require('./_toKey'),toString = require('./toString');/*** Converts `value` to a property path array.** @static* @memberOf _* @since 4.0.0* @category Util* @param {*} value The value to convert.* @returns {Array} Returns the new property path array.* @example** _.toPath('a.b.c');* // => ['a', 'b', 'c']** _.toPath('a[0].b.c');* // => ['a', '0', 'b', 'c']*/function toPath(value) {if (isArray(value)) {return arrayMap(value, toKey);}return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));}module.exports = toPath;
var createToPairs = require('./_createToPairs'),keysIn = require('./keysIn');/*** Creates an array of own and inherited enumerable string keyed-value pairs* for `object` which can be consumed by `_.fromPairs`. If `object` is a map* or set, its entries are returned.** @static* @memberOf _* @since 4.0.0* @alias entriesIn* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the key-value pairs.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.toPairsIn(new Foo);* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)*/var toPairsIn = createToPairs(keysIn);module.exports = toPairsIn;
var createToPairs = require('./_createToPairs'),keys = require('./keys');/*** Creates an array of own enumerable string keyed-value pairs for `object`* which can be consumed by `_.fromPairs`. If `object` is a map or set, its* entries are returned.** @static* @memberOf _* @since 4.0.0* @alias entries* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the key-value pairs.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.toPairs(new Foo);* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)*/var toPairs = createToPairs(keys);module.exports = toPairs;
var isObject = require('./isObject'),isSymbol = require('./isSymbol');/** Used as references for various `Number` constants. */var NAN = 0 / 0;/** Used to match leading and trailing whitespace. */var reTrim = /^\s+|\s+$/g;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary = /^0b[01]+$/i;/** Used to detect octal string values. */var reIsOctal = /^0o[0-7]+$/i;/** Built-in method references without a dependency on `root`. */var freeParseInt = parseInt;/*** Converts `value` to a number.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to process.* @returns {number} Returns the number.* @example** _.toNumber(3.2);* // => 3.2** _.toNumber(Number.MIN_VALUE);* // => 5e-324** _.toNumber(Infinity);* // => Infinity** _.toNumber('3.2');* // => 3.2*/function toNumber(value) {if (typeof value == 'number') {return value;}if (isSymbol(value)) {return NAN;}if (isObject(value)) {var other = typeof value.valueOf == 'function' ? value.valueOf() : value;value = isObject(other) ? (other + '') : other;}if (typeof value != 'string') {return value === 0 ? value : +value;}value = value.replace(reTrim, '');var isBinary = reIsBinary.test(value);return (isBinary || reIsOctal.test(value))? freeParseInt(value.slice(2), isBinary ? 2 : 8): (reIsBadHex.test(value) ? NAN : +value);}module.exports = toNumber;
var toString = require('./toString');/*** Converts `string`, as a whole, to lower case just like* [String#toLowerCase](https://mdn.io/toLowerCase).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the lower cased string.* @example** _.toLower('--Foo-Bar--');* // => '--foo-bar--'** _.toLower('fooBar');* // => 'foobar'** _.toLower('__FOO_BAR__');* // => '__foo_bar__'*/function toLower(value) {return toString(value).toLowerCase();}module.exports = toLower;
var baseClamp = require('./_baseClamp'),toInteger = require('./toInteger');/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295;/*** Converts `value` to an integer suitable for use as the length of an* array-like object.** **Note:** This method is based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toLength(3.2);* // => 3** _.toLength(Number.MIN_VALUE);* // => 0** _.toLength(Infinity);* // => 4294967295** _.toLength('3.2');* // => 3*/function toLength(value) {return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;}module.exports = toLength;
module.exports = require('./wrapperValue');
/*** Enables the wrapper to be iterable.** @name Symbol.iterator* @memberOf _* @since 4.0.0* @category Seq* @returns {Object} Returns the wrapper object.* @example** var wrapped = _([1, 2]);** wrapped[Symbol.iterator]() === wrapped;* // => true** Array.from(wrapped);* // => [1, 2]*/function wrapperToIterator() {return this;}module.exports = wrapperToIterator;
var toFinite = require('./toFinite');/*** Converts `value` to an integer.** **Note:** This method is loosely based on* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toInteger(3.2);* // => 3** _.toInteger(Number.MIN_VALUE);* // => 0** _.toInteger(Infinity);* // => 1.7976931348623157e+308** _.toInteger('3.2');* // => 3*/function toInteger(value) {var result = toFinite(value),remainder = result % 1;return result === result ? (remainder ? result - remainder : result) : 0;}module.exports = toInteger;
var toNumber = require('./toNumber');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0,MAX_INTEGER = 1.7976931348623157e+308;/*** Converts `value` to a finite number.** @static* @memberOf _* @since 4.12.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted number.* @example** _.toFinite(3.2);* // => 3.2** _.toFinite(Number.MIN_VALUE);* // => 5e-324** _.toFinite(Infinity);* // => 1.7976931348623157e+308** _.toFinite('3.2');* // => 3.2*/function toFinite(value) {if (!value) {return value === 0 ? value : 0;}value = toNumber(value);if (value === INFINITY || value === -INFINITY) {var sign = (value < 0 ? -1 : 1);return sign * MAX_INTEGER;}return value === value ? value : 0;}module.exports = toFinite;
var Symbol = require('./_Symbol'),copyArray = require('./_copyArray'),getTag = require('./_getTag'),isArrayLike = require('./isArrayLike'),isString = require('./isString'),iteratorToArray = require('./_iteratorToArray'),mapToArray = require('./_mapToArray'),setToArray = require('./_setToArray'),stringToArray = require('./_stringToArray'),values = require('./values');/** `Object#toString` result references. */var mapTag = '[object Map]',setTag = '[object Set]';/** Built-in value references. */var symIterator = Symbol ? Symbol.iterator : undefined;/*** Converts `value` to an array.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to convert.* @returns {Array} Returns the converted array.* @example** _.toArray({ 'a': 1, 'b': 2 });* // => [1, 2]** _.toArray('abc');* // => ['a', 'b', 'c']** _.toArray(1);* // => []** _.toArray(null);* // => []*/function toArray(value) {if (!value) {return [];}if (isArrayLike(value)) {return isString(value) ? stringToArray(value) : copyArray(value);}if (symIterator && value[symIterator]) {return iteratorToArray(value[symIterator]());}var tag = getTag(value),func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);return func(value);}module.exports = toArray;
var baseTimes = require('./_baseTimes'),castFunction = require('./_castFunction'),toInteger = require('./toInteger');/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** Invokes the iteratee `n` times, returning an array of the results of* each invocation. The iteratee is invoked with one argument; (index).** @static* @since 0.1.0* @memberOf _* @category Util* @param {number} n The number of times to invoke `iteratee`.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the array of results.* @example** _.times(3, String);* // => ['0', '1', '2']** _.times(4, _.constant(0));* // => [0, 0, 0, 0]*/function times(n, iteratee) {n = toInteger(n);if (n < 1 || n > MAX_SAFE_INTEGER) {return [];}var index = MAX_ARRAY_LENGTH,length = nativeMin(n, MAX_ARRAY_LENGTH);iteratee = castFunction(iteratee);n -= MAX_ARRAY_LENGTH;var result = baseTimes(length, iteratee);while (++index < n) {iteratee(index);}return result;}module.exports = times;
/*** This method is like `_.tap` except that it returns the result of `interceptor`.* The purpose of this method is to "pass thru" values replacing intermediate* results in a method chain sequence.** @static* @memberOf _* @since 3.0.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns the result of `interceptor`.* @example** _(' abc ')* .chain()* .trim()* .thru(function(value) {* return [value];* })* .value();* // => ['abc']*/function thru(value, interceptor) {return interceptor(value);}module.exports = thru;
var debounce = require('./debounce'),isObject = require('./isObject');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a throttled function that only invokes `func` at most once per* every `wait` milliseconds. The throttled function comes with a `cancel`* method to cancel delayed `func` invocations and a `flush` method to* immediately invoke them. Provide `options` to indicate whether `func`* should be invoked on the leading and/or trailing edge of the `wait`* timeout. The `func` is invoked with the last arguments provided to the* throttled function. Subsequent calls to the throttled function return the* result of the last `func` invocation.** **Note:** If `leading` and `trailing` options are `true`, `func` is* invoked on the trailing edge of the timeout only if the throttled function* is invoked more than once during the `wait` timeout.** If `wait` is `0` and `leading` is `false`, `func` invocation is deferred* until to the next tick, similar to `setTimeout` with a timeout of `0`.** See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)* for details over the differences between `_.throttle` and `_.debounce`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to throttle.* @param {number} [wait=0] The number of milliseconds to throttle invocations to.* @param {Object} [options={}] The options object.* @param {boolean} [options.leading=true]* Specify invoking on the leading edge of the timeout.* @param {boolean} [options.trailing=true]* Specify invoking on the trailing edge of the timeout.* @returns {Function} Returns the new throttled function.* @example** // Avoid excessively updating the position while scrolling.* jQuery(window).on('scroll', _.throttle(updatePosition, 100));** // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });* jQuery(element).on('click', throttled);** // Cancel the trailing throttled invocation.* jQuery(window).on('popstate', throttled.cancel);*/function throttle(func, wait, options) {var leading = true,trailing = true;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}if (isObject(options)) {leading = 'leading' in options ? !!options.leading : leading;trailing = 'trailing' in options ? !!options.trailing : trailing;}return debounce(func, wait, {'leading': leading,'maxWait': wait,'trailing': trailing});}module.exports = throttle;
var escape = require('./escape'),reEscape = require('./_reEscape'),reEvaluate = require('./_reEvaluate'),reInterpolate = require('./_reInterpolate');/*** By default, the template delimiters used by lodash are like those in* embedded Ruby (ERB) as well as ES2015 template strings. Change the* following template settings to use alternative delimiters.** @static* @memberOf _* @type {Object}*/var templateSettings = {/*** Used to detect `data` property values to be HTML-escaped.** @memberOf _.templateSettings* @type {RegExp}*/'escape': reEscape,/*** Used to detect code to be evaluated.** @memberOf _.templateSettings* @type {RegExp}*/'evaluate': reEvaluate,/*** Used to detect `data` property values to inject.** @memberOf _.templateSettings* @type {RegExp}*/'interpolate': reInterpolate,/*** Used to reference the data object in the template text.** @memberOf _.templateSettings* @type {string}*/'variable': '',/*** Used to import variables into the compiled template.** @memberOf _.templateSettings* @type {Object}*/'imports': {/*** A reference to the `lodash` function.** @memberOf _.templateSettings.imports* @type {Function}*/'_': { 'escape': escape }}};module.exports = templateSettings;
var assignInWith = require('./assignInWith'),attempt = require('./attempt'),baseValues = require('./_baseValues'),customDefaultsAssignIn = require('./_customDefaultsAssignIn'),escapeStringChar = require('./_escapeStringChar'),isError = require('./isError'),isIterateeCall = require('./_isIterateeCall'),keys = require('./keys'),reInterpolate = require('./_reInterpolate'),templateSettings = require('./templateSettings'),toString = require('./toString');/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading = /\b__p \+= '';/g,reEmptyStringMiddle = /\b(__p \+=) '' \+/g,reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;/*** Used to match* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).*/var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch = /($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString = /['\n\r\u2028\u2029\\]/g;/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Creates a compiled template function that can interpolate data properties* in "interpolate" delimiters, HTML-escape interpolated data properties in* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data* properties may be accessed as free variables in the template. If a setting* object is given, it takes precedence over `_.templateSettings` values.** **Note:** In the development build `_.template` utilizes* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)* for easier debugging.** For more information on precompiling templates see* [lodash's custom builds documentation](https://lodash.com/custom-builds).** For more information on Chrome extension sandboxes see* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).** @static* @since 0.1.0* @memberOf _* @category String* @param {string} [string=''] The template string.* @param {Object} [options={}] The options object.* @param {RegExp} [options.escape=_.templateSettings.escape]* The HTML "escape" delimiter.* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]* The "evaluate" delimiter.* @param {Object} [options.imports=_.templateSettings.imports]* An object to import into the template as free variables.* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]* The "interpolate" delimiter.* @param {string} [options.sourceURL='templateSources[n]']* The sourceURL of the compiled template.* @param {string} [options.variable='obj']* The data object variable name.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the compiled template function.* @example** // Use the "interpolate" delimiter to create a compiled template.* var compiled = _.template('hello <%= user %>!');* compiled({ 'user': 'fred' });* // => 'hello fred!'** // Use the HTML "escape" delimiter to escape data property values.* var compiled = _.template('<b><%- value %></b>');* compiled({ 'value': '<script>' });* // => '<b><script></b>'** // Use the "evaluate" delimiter to execute JavaScript and generate HTML.* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');* compiled({ 'users': ['fred', 'barney'] });* // => '<li>fred</li><li>barney</li>'** // Use the internal `print` function in "evaluate" delimiters.* var compiled = _.template('<% print("hello " + user); %>!');* compiled({ 'user': 'barney' });* // => 'hello barney!'** // Use the ES template literal delimiter as an "interpolate" delimiter.* // Disable support by replacing the "interpolate" delimiter.* var compiled = _.template('hello ${ user }!');* compiled({ 'user': 'pebbles' });* // => 'hello pebbles!'** // Use backslashes to treat delimiters as plain text.* var compiled = _.template('<%= "\\<%- value %\\>" %>');* compiled({ 'value': 'ignored' });* // => '<%- value %>'** // Use the `imports` option to import `jQuery` as `jq`.* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });* compiled({ 'users': ['fred', 'barney'] });* // => '<li>fred</li><li>barney</li>'** // Use the `sourceURL` option to specify a custom sourceURL for the template.* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });* compiled(data);* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.** // Use the `variable` option to ensure a with-statement isn't used in the compiled template.* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });* compiled.source;* // => function(data) {* // var __t, __p = '';* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';* // return __p;* // }** // Use custom template delimiters.* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;* var compiled = _.template('hello {{ user }}!');* compiled({ 'user': 'mustache' });* // => 'hello mustache!'** // Use the `source` property to inline compiled templates for meaningful* // line numbers in error messages and stack traces.* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\* var JST = {\* "main": ' + _.template(mainText).source + '\* };\* ');*/function template(string, options, guard) {// Based on John Resig's `tmpl` implementation// (http://ejohn.org/blog/javascript-micro-templating/)// and Laura Doktorova's doT.js (https://github.com/olado/doT).var settings = templateSettings.imports._.templateSettings || templateSettings;if (guard && isIterateeCall(string, options, guard)) {options = undefined;}string = toString(string);options = assignInWith({}, options, settings, customDefaultsAssignIn);var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),importsKeys = keys(imports),importsValues = baseValues(imports, importsKeys);var isEscaping,isEvaluating,index = 0,interpolate = options.interpolate || reNoMatch,source = "__p += '";// Compile the regexp to match each delimiter.var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' +interpolate.source + '|' +(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +(options.evaluate || reNoMatch).source + '|$', 'g');// Use a sourceURL for easier debugging.// The sourceURL gets injected into the source that's eval-ed, so be careful// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in// and escape the comment, thus injecting code that gets evaled.var sourceURL = hasOwnProperty.call(options, 'sourceURL')? ('//# sourceURL=' +(options.sourceURL + '').replace(/\s/g, ' ') +'\n'): '';string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {interpolateValue || (interpolateValue = esTemplateValue);// Escape characters that can't be included in string literals.source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);// Replace delimiters with snippets.if (escapeValue) {isEscaping = true;source += "' +\n__e(" + escapeValue + ") +\n'";}if (evaluateValue) {isEvaluating = true;source += "';\n" + evaluateValue + ";\n__p += '";}if (interpolateValue) {source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";}index = offset + match.length;// The JS engine embedded in Adobe products needs `match` returned in// order to produce the correct `offset` value.return match;});source += "';\n";// If `variable` is not specified wrap a with-statement around the generated// code to add the data object to the top of the scope chain.var variable = hasOwnProperty.call(options, 'variable') && options.variable;if (!variable) {source = 'with (obj) {\n' + source + '\n}\n';}// Cleanup code by stripping empty strings.source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;');// Frame code as the function body.source = 'function(' + (variable || 'obj') + ') {\n' +(variable? '': 'obj || (obj = {});\n') +"var __t, __p = ''" +(isEscaping? ', __e = _.escape': '') +(isEvaluating? ', __j = Array.prototype.join;\n' +"function print() { __p += __j.call(arguments, '') }\n": ';\n') +source +'return __p\n}';var result = attempt(function() {return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);});// Provide the compiled function's source by its `toString` method or// the `source` property as a convenience for inlining compiled templates.result.source = source;if (isError(result)) {throw result;}return result;}module.exports = template;
/*** This method invokes `interceptor` and returns `value`. The interceptor* is invoked with one argument; (value). The purpose of this method is to* "tap into" a method chain sequence in order to modify intermediate results.** @static* @memberOf _* @since 0.1.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns `value`.* @example** _([1, 2, 3])* .tap(function(array) {* // Mutate input array.* array.pop();* })* .reverse()* .value();* // => [2, 1]*/function tap(value, interceptor) {interceptor(value);return value;}module.exports = tap;
var baseIteratee = require('./_baseIteratee'),baseWhile = require('./_baseWhile');/*** Creates a slice of `array` with elements taken from the beginning. Elements* are taken until `predicate` returns falsey. The predicate is invoked with* three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.takeWhile(users, function(o) { return !o.active; });* // => objects for ['barney', 'fred']** // The `_.matches` iteratee shorthand.* _.takeWhile(users, { 'user': 'barney', 'active': false });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.takeWhile(users, ['active', false]);* // => objects for ['barney', 'fred']** // The `_.property` iteratee shorthand.* _.takeWhile(users, 'active');* // => []*/function takeWhile(array, predicate) {return (array && array.length)? baseWhile(array, baseIteratee(predicate, 3)): [];}module.exports = takeWhile;
var baseIteratee = require('./_baseIteratee'),baseWhile = require('./_baseWhile');/*** Creates a slice of `array` with elements taken from the end. Elements are* taken until `predicate` returns falsey. The predicate is invoked with* three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.takeRightWhile(users, function(o) { return !o.active; });* // => objects for ['fred', 'pebbles']** // The `_.matches` iteratee shorthand.* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });* // => objects for ['pebbles']** // The `_.matchesProperty` iteratee shorthand.* _.takeRightWhile(users, ['active', false]);* // => objects for ['fred', 'pebbles']** // The `_.property` iteratee shorthand.* _.takeRightWhile(users, 'active');* // => []*/function takeRightWhile(array, predicate) {return (array && array.length)? baseWhile(array, baseIteratee(predicate, 3), false, true): [];}module.exports = takeRightWhile;
var baseSlice = require('./_baseSlice'),toInteger = require('./toInteger');/*** Creates a slice of `array` with `n` elements taken from the end.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to take.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.takeRight([1, 2, 3]);* // => [3]** _.takeRight([1, 2, 3], 2);* // => [2, 3]** _.takeRight([1, 2, 3], 5);* // => [1, 2, 3]** _.takeRight([1, 2, 3], 0);* // => []*/function takeRight(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);n = length - n;return baseSlice(array, n < 0 ? 0 : n, length);}module.exports = takeRight;
var baseSlice = require('./_baseSlice'),toInteger = require('./toInteger');/*** Creates a slice of `array` with `n` elements taken from the beginning.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to take.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.take([1, 2, 3]);* // => [1]** _.take([1, 2, 3], 2);* // => [1, 2]** _.take([1, 2, 3], 5);* // => [1, 2, 3]** _.take([1, 2, 3], 0);* // => []*/function take(array, n, guard) {if (!(array && array.length)) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);return baseSlice(array, 0, n < 0 ? 0 : n);}module.exports = take;
var baseSlice = require('./_baseSlice');/*** Gets all but the first element of `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to query.* @returns {Array} Returns the slice of `array`.* @example** _.tail([1, 2, 3]);* // => [2, 3]*/function tail(array) {var length = array == null ? 0 : array.length;return length ? baseSlice(array, 1, length) : [];}module.exports = tail;
var baseIteratee = require('./_baseIteratee'),baseSum = require('./_baseSum');/*** This method is like `_.sum` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the value to be summed.* The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the sum.* @example** var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];** _.sumBy(objects, function(o) { return o.n; });* // => 20** // The `_.property` iteratee shorthand.* _.sumBy(objects, 'n');* // => 20*/function sumBy(array, iteratee) {return (array && array.length)? baseSum(array, baseIteratee(iteratee, 2)): 0;}module.exports = sumBy;
var baseSum = require('./_baseSum'),identity = require('./identity');/*** Computes the sum of the values in `array`.** @static* @memberOf _* @since 3.4.0* @category Math* @param {Array} array The array to iterate over.* @returns {number} Returns the sum.* @example** _.sum([4, 2, 8, 6]);* // => 20*/function sum(array) {return (array && array.length)? baseSum(array, identity): 0;}module.exports = sum;
var createMathOperation = require('./_createMathOperation');/*** Subtract two numbers.** @static* @memberOf _* @since 4.0.0* @category Math* @param {number} minuend The first number in a subtraction.* @param {number} subtrahend The second number in a subtraction.* @returns {number} Returns the difference.* @example** _.subtract(6, 4);* // => 2*/var subtract = createMathOperation(function(minuend, subtrahend) {return minuend - subtrahend;}, 0);module.exports = subtract;
/*** This method returns `true`.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {boolean} Returns `true`.* @example** _.times(2, _.stubTrue);* // => [true, true]*/function stubTrue() {return true;}module.exports = stubTrue;
/*** This method returns an empty string.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {string} Returns the empty string.* @example** _.times(2, _.stubString);* // => ['', '']*/function stubString() {return '';}module.exports = stubString;
/*** This method returns a new empty object.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {Object} Returns the new empty object.* @example** var objects = _.times(2, _.stubObject);** console.log(objects);* // => [{}, {}]** console.log(objects[0] === objects[1]);* // => false*/function stubObject() {return {};}module.exports = stubObject;
/*** This method returns `false`.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {boolean} Returns `false`.* @example** _.times(2, _.stubFalse);* // => [false, false]*/function stubFalse() {return false;}module.exports = stubFalse;
/*** This method returns a new empty array.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {Array} Returns the new empty array.* @example** var arrays = _.times(2, _.stubArray);** console.log(arrays);* // => [[], []]** console.log(arrays[0] === arrays[1]);* // => false*/function stubArray() {return [];}module.exports = stubArray;
module.exports = {'camelCase': require('./camelCase'),'capitalize': require('./capitalize'),'deburr': require('./deburr'),'endsWith': require('./endsWith'),'escape': require('./escape'),'escapeRegExp': require('./escapeRegExp'),'kebabCase': require('./kebabCase'),'lowerCase': require('./lowerCase'),'lowerFirst': require('./lowerFirst'),'pad': require('./pad'),'padEnd': require('./padEnd'),'padStart': require('./padStart'),'parseInt': require('./parseInt'),'repeat': require('./repeat'),'replace': require('./replace'),'snakeCase': require('./snakeCase'),'split': require('./split'),'startCase': require('./startCase'),'startsWith': require('./startsWith'),'template': require('./template'),'templateSettings': require('./templateSettings'),'toLower': require('./toLower'),'toUpper': require('./toUpper'),'trim': require('./trim'),'trimEnd': require('./trimEnd'),'trimStart': require('./trimStart'),'truncate': require('./truncate'),'unescape': require('./unescape'),'upperCase': require('./upperCase'),'upperFirst': require('./upperFirst'),'words': require('./words')};
var baseClamp = require('./_baseClamp'),baseToString = require('./_baseToString'),toInteger = require('./toInteger'),toString = require('./toString');/*** Checks if `string` starts with the given target string.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {string} [target] The string to search for.* @param {number} [position=0] The position to search from.* @returns {boolean} Returns `true` if `string` starts with `target`,* else `false`.* @example** _.startsWith('abc', 'a');* // => true** _.startsWith('abc', 'b');* // => false** _.startsWith('abc', 'b', 1);* // => true*/function startsWith(string, target, position) {string = toString(string);position = position == null? 0: baseClamp(toInteger(position), 0, string.length);target = baseToString(target);return string.slice(position, position + target.length) == target;}module.exports = startsWith;
var createCompounder = require('./_createCompounder'),upperFirst = require('./upperFirst');/*** Converts `string` to* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).** @static* @memberOf _* @since 3.1.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the start cased string.* @example** _.startCase('--foo-bar--');* // => 'Foo Bar'** _.startCase('fooBar');* // => 'Foo Bar'** _.startCase('__FOO_BAR__');* // => 'FOO BAR'*/var startCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + upperFirst(word);});module.exports = startCase;
var apply = require('./_apply'),arrayPush = require('./_arrayPush'),baseRest = require('./_baseRest'),castSlice = require('./_castSlice'),toInteger = require('./toInteger');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** Creates a function that invokes `func` with the `this` binding of the* create function and an array of arguments much like* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).** **Note:** This method is based on the* [spread operator](https://mdn.io/spread_operator).** @static* @memberOf _* @since 3.2.0* @category Function* @param {Function} func The function to spread arguments over.* @param {number} [start=0] The start position of the spread.* @returns {Function} Returns the new function.* @example** var say = _.spread(function(who, what) {* return who + ' says ' + what;* });** say(['fred', 'hello']);* // => 'fred says hello'** var numbers = Promise.all([* Promise.resolve(40),* Promise.resolve(36)* ]);** numbers.then(_.spread(function(x, y) {* return x + y;* }));* // => a Promise of 76*/function spread(func, start) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}start = start == null ? 0 : nativeMax(toInteger(start), 0);return baseRest(function(args) {var array = args[start],otherArgs = castSlice(args, 0, start);if (array) {arrayPush(otherArgs, array);}return apply(func, this, otherArgs);});}module.exports = spread;
var baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),hasUnicode = require('./_hasUnicode'),isIterateeCall = require('./_isIterateeCall'),isRegExp = require('./isRegExp'),stringToArray = require('./_stringToArray'),toString = require('./toString');/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295;/*** Splits `string` by `separator`.** **Note:** This method is based on* [`String#split`](https://mdn.io/String/split).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to split.* @param {RegExp|string} separator The separator pattern to split by.* @param {number} [limit] The length to truncate results to.* @returns {Array} Returns the string segments.* @example** _.split('a-b-c', '-', 2);* // => ['a', 'b']*/function split(string, separator, limit) {if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {separator = limit = undefined;}limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;if (!limit) {return [];}string = toString(string);if (string && (typeof separator == 'string' ||(separator != null && !isRegExp(separator)))) {separator = baseToString(separator);if (!separator && hasUnicode(string)) {return castSlice(stringToArray(string), 0, limit);}}return string.split(separator, limit);}module.exports = split;
var baseIteratee = require('./_baseIteratee'),baseSortedUniq = require('./_baseSortedUniq');/*** This method is like `_.uniqBy` except that it's designed and optimized* for sorted arrays.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);* // => [1.1, 2.3]*/function sortedUniqBy(array, iteratee) {return (array && array.length)? baseSortedUniq(array, baseIteratee(iteratee, 2)): [];}module.exports = sortedUniqBy;
var baseSortedUniq = require('./_baseSortedUniq');/*** This method is like `_.uniq` except that it's designed and optimized* for sorted arrays.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @returns {Array} Returns the new duplicate free array.* @example** _.sortedUniq([1, 1, 2]);* // => [1, 2]*/function sortedUniq(array) {return (array && array.length)? baseSortedUniq(array): [];}module.exports = sortedUniq;
var baseSortedIndex = require('./_baseSortedIndex'),eq = require('./eq');/*** This method is like `_.lastIndexOf` except that it performs a binary* search on a sorted `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);* // => 3*/function sortedLastIndexOf(array, value) {var length = array == null ? 0 : array.length;if (length) {var index = baseSortedIndex(array, value, true) - 1;if (eq(array[index], value)) {return index;}}return -1;}module.exports = sortedLastIndexOf;
var baseIteratee = require('./_baseIteratee'),baseSortedIndexBy = require('./_baseSortedIndexBy');/*** This method is like `_.sortedLastIndex` except that it accepts `iteratee`* which is invoked for `value` and each element of `array` to compute their* sort ranking. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** var objects = [{ 'x': 4 }, { 'x': 5 }];** _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });* // => 1** // The `_.property` iteratee shorthand.* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');* // => 1*/function sortedLastIndexBy(array, value, iteratee) {return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true);}module.exports = sortedLastIndexBy;
var baseSortedIndex = require('./_baseSortedIndex');/*** This method is like `_.sortedIndex` except that it returns the highest* index at which `value` should be inserted into `array` in order to* maintain its sort order.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** _.sortedLastIndex([4, 5, 5, 5, 6], 5);* // => 4*/function sortedLastIndex(array, value) {return baseSortedIndex(array, value, true);}module.exports = sortedLastIndex;
var baseSortedIndex = require('./_baseSortedIndex'),eq = require('./eq');/*** This method is like `_.indexOf` except that it performs a binary* search on a sorted `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.sortedIndexOf([4, 5, 5, 5, 6], 5);* // => 1*/function sortedIndexOf(array, value) {var length = array == null ? 0 : array.length;if (length) {var index = baseSortedIndex(array, value);if (index < length && eq(array[index], value)) {return index;}}return -1;}module.exports = sortedIndexOf;
var baseIteratee = require('./_baseIteratee'),baseSortedIndexBy = require('./_baseSortedIndexBy');/*** This method is like `_.sortedIndex` except that it accepts `iteratee`* which is invoked for `value` and each element of `array` to compute their* sort ranking. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** var objects = [{ 'x': 4 }, { 'x': 5 }];** _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });* // => 0** // The `_.property` iteratee shorthand.* _.sortedIndexBy(objects, { 'x': 4 }, 'x');* // => 0*/function sortedIndexBy(array, value, iteratee) {return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2));}module.exports = sortedIndexBy;
var baseSortedIndex = require('./_baseSortedIndex');/*** Uses a binary search to determine the lowest index at which `value`* should be inserted into `array` in order to maintain its sort order.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** _.sortedIndex([30, 50], 40);* // => 1*/function sortedIndex(array, value) {return baseSortedIndex(array, value);}module.exports = sortedIndex;
var baseFlatten = require('./_baseFlatten'),baseOrderBy = require('./_baseOrderBy'),baseRest = require('./_baseRest'),isIterateeCall = require('./_isIterateeCall');/*** Creates an array of elements, sorted in ascending order by the results of* running each element in a collection thru each iteratee. This method* performs a stable sort, that is, it preserves the original sort order of* equal elements. The iteratees are invoked with one argument: (value).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {...(Function|Function[])} [iteratees=[_.identity]]* The iteratees to sort by.* @returns {Array} Returns the new sorted array.* @example** var users = [* { 'user': 'fred', 'age': 48 },* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 30 },* { 'user': 'barney', 'age': 34 }* ];** _.sortBy(users, [function(o) { return o.user; }]);* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]** _.sortBy(users, ['user', 'age']);* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]*/var sortBy = baseRest(function(collection, iteratees) {if (collection == null) {return [];}var length = iteratees.length;if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {iteratees = [];} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {iteratees = [iteratees[0]];}return baseOrderBy(collection, baseFlatten(iteratees, 1), []);});module.exports = sortBy;
var arraySome = require('./_arraySome'),baseIteratee = require('./_baseIteratee'),baseSome = require('./_baseSome'),isArray = require('./isArray'),isIterateeCall = require('./_isIterateeCall');/*** Checks if `predicate` returns truthy for **any** element of `collection`.* Iteration is stopped once `predicate` returns truthy. The predicate is* invoked with three arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.* @example** _.some([null, 0, 'yes', false], Boolean);* // => true** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.some(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.some(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.some(users, 'active');* // => true*/function some(collection, predicate, guard) {var func = isArray(collection) ? arraySome : baseSome;if (guard && isIterateeCall(collection, predicate, guard)) {predicate = undefined;}return func(collection, baseIteratee(predicate, 3));}module.exports = some;
var createCompounder = require('./_createCompounder');/*** Converts `string` to* [snake case](https://en.wikipedia.org/wiki/Snake_case).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the snake cased string.* @example** _.snakeCase('Foo Bar');* // => 'foo_bar'** _.snakeCase('fooBar');* // => 'foo_bar'** _.snakeCase('--FOO-BAR--');* // => 'foo_bar'*/var snakeCase = createCompounder(function(result, word, index) {return result + (index ? '_' : '') + word.toLowerCase();});module.exports = snakeCase;
var baseSlice = require('./_baseSlice'),isIterateeCall = require('./_isIterateeCall'),toInteger = require('./toInteger');/*** Creates a slice of `array` from `start` up to, but not including, `end`.** **Note:** This method is used instead of* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are* returned.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function slice(array, start, end) {var length = array == null ? 0 : array.length;if (!length) {return [];}if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {start = 0;end = length;}else {start = start == null ? 0 : toInteger(start);end = end === undefined ? length : toInteger(end);}return baseSlice(array, start, end);}module.exports = slice;
var baseKeys = require('./_baseKeys'),getTag = require('./_getTag'),isArrayLike = require('./isArrayLike'),isString = require('./isString'),stringSize = require('./_stringSize');/** `Object#toString` result references. */var mapTag = '[object Map]',setTag = '[object Set]';/*** Gets the size of `collection` by returning its length for array-like* values or the number of own enumerable string keyed properties for objects.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object|string} collection The collection to inspect.* @returns {number} Returns the collection size.* @example** _.size([1, 2, 3]);* // => 3** _.size({ 'a': 1, 'b': 2 });* // => 2** _.size('pebbles');* // => 7*/function size(collection) {if (collection == null) {return 0;}if (isArrayLike(collection)) {return isString(collection) ? stringSize(collection) : collection.length;}var tag = getTag(collection);if (tag == mapTag || tag == setTag) {return collection.size;}return baseKeys(collection).length;}module.exports = size;
var arrayShuffle = require('./_arrayShuffle'),baseShuffle = require('./_baseShuffle'),isArray = require('./isArray');/*** Creates an array of shuffled values, using a version of the* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to shuffle.* @returns {Array} Returns the new shuffled array.* @example** _.shuffle([1, 2, 3, 4]);* // => [4, 1, 3, 2]*/function shuffle(collection) {var func = isArray(collection) ? arrayShuffle : baseShuffle;return func(collection);}module.exports = shuffle;
var baseSet = require('./_baseSet');/*** This method is like `_.set` except that it accepts `customizer` which is* invoked to produce the objects of `path`. If `customizer` returns `undefined`* path creation is handled by the method instead. The `customizer` is invoked* with three arguments: (nsValue, key, nsObject).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @example** var object = {};** _.setWith(object, '[0][1]', 'a', Object);* // => { '0': { '1': 'a' } }*/function setWith(object, path, value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return object == null ? object : baseSet(object, path, value, customizer);}module.exports = setWith;
var baseSet = require('./_baseSet');/*** Sets the value at `path` of `object`. If a portion of `path` doesn't exist,* it's created. Arrays are created for missing index properties while objects* are created for all other missing properties. Use `_.setWith` to customize* `path` creation.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 3.7.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @returns {Object} Returns `object`.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.set(object, 'a[0].b.c', 4);* console.log(object.a[0].b.c);* // => 4** _.set(object, ['x', '0', 'y', 'z'], 5);* console.log(object.x[0].y.z);* // => 5*/function set(object, path, value) {return object == null ? object : baseSet(object, path, value);}module.exports = set;
module.exports = {'at': require('./wrapperAt'),'chain': require('./chain'),'commit': require('./commit'),'lodash': require('./wrapperLodash'),'next': require('./next'),'plant': require('./plant'),'reverse': require('./wrapperReverse'),'tap': require('./tap'),'thru': require('./thru'),'toIterator': require('./toIterator'),'toJSON': require('./toJSON'),'value': require('./wrapperValue'),'valueOf': require('./valueOf'),'wrapperChain': require('./wrapperChain')};
var arraySampleSize = require('./_arraySampleSize'),baseSampleSize = require('./_baseSampleSize'),isArray = require('./isArray'),isIterateeCall = require('./_isIterateeCall'),toInteger = require('./toInteger');/*** Gets `n` random elements at unique keys from `collection` up to the* size of `collection`.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to sample.* @param {number} [n=1] The number of elements to sample.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the random elements.* @example** _.sampleSize([1, 2, 3], 2);* // => [3, 1]** _.sampleSize([1, 2, 3], 4);* // => [2, 3, 1]*/function sampleSize(collection, n, guard) {if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {n = 1;} else {n = toInteger(n);}var func = isArray(collection) ? arraySampleSize : baseSampleSize;return func(collection, n);}module.exports = sampleSize;
var arraySample = require('./_arraySample'),baseSample = require('./_baseSample'),isArray = require('./isArray');/*** Gets a random element from `collection`.** @static* @memberOf _* @since 2.0.0* @category Collection* @param {Array|Object} collection The collection to sample.* @returns {*} Returns the random element.* @example** _.sample([1, 2, 3, 4]);* // => 2*/function sample(collection) {var func = isArray(collection) ? arraySample : baseSample;return func(collection);}module.exports = sample;
var createRound = require('./_createRound');/*** Computes `number` rounded to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round.* @param {number} [precision=0] The precision to round to.* @returns {number} Returns the rounded number.* @example** _.round(4.006);* // => 4** _.round(4.006, 2);* // => 4.01** _.round(4060, -2);* // => 4100*/var round = createRound('round');module.exports = round;
/** Used for built-in method references. */var arrayProto = Array.prototype;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeReverse = arrayProto.reverse;/*** Reverses `array` so that the first element becomes the last, the second* element becomes the second to last, and so on.** **Note:** This method mutates `array` and is based on* [`Array#reverse`](https://mdn.io/Array/reverse).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @returns {Array} Returns `array`.* @example** var array = [1, 2, 3];** _.reverse(array);* // => [3, 2, 1]** console.log(array);* // => [3, 2, 1]*/function reverse(array) {return array == null ? array : nativeReverse.call(array);}module.exports = reverse;
var castPath = require('./_castPath'),isFunction = require('./isFunction'),toKey = require('./_toKey');/*** This method is like `_.get` except that if the resolved value is a* function it's invoked with the `this` binding of its parent object and* its result is returned.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the property to resolve.* @param {*} [defaultValue] The value returned for `undefined` resolved values.* @returns {*} Returns the resolved value.* @example** var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };** _.result(object, 'a[0].b.c1');* // => 3** _.result(object, 'a[0].b.c2');* // => 4** _.result(object, 'a[0].b.c3', 'default');* // => 'default'** _.result(object, 'a[0].b.c3', _.constant('default'));* // => 'default'*/function result(object, path, defaultValue) {path = castPath(path, object);var index = -1,length = path.length;// Ensure the loop is entered when path is empty.if (!length) {length = 1;object = undefined;}while (++index < length) {var value = object == null ? undefined : object[toKey(path[index])];if (value === undefined) {index = length;value = defaultValue;}object = isFunction(value) ? value.call(object) : value;}return object;}module.exports = result;
var baseRest = require('./_baseRest'),toInteger = require('./toInteger');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a function that invokes `func` with the `this` binding of the* created function and arguments from `start` and beyond provided as* an array.** **Note:** This method is based on the* [rest parameter](https://mdn.io/rest_parameters).** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @returns {Function} Returns the new function.* @example** var say = _.rest(function(what, names) {* return what + ' ' + _.initial(names).join(', ') +* (_.size(names) > 1 ? ', & ' : '') + _.last(names);* });** say('hello', 'fred', 'barney', 'pebbles');* // => 'hello fred, barney, & pebbles'*/function rest(func, start) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}start = start === undefined ? start : toInteger(start);return baseRest(func, start);}module.exports = rest;
var toString = require('./toString');/*** Replaces matches for `pattern` in `string` with `replacement`.** **Note:** This method is based on* [`String#replace`](https://mdn.io/String/replace).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to modify.* @param {RegExp|string} pattern The pattern to replace.* @param {Function|string} replacement The match replacement.* @returns {string} Returns the modified string.* @example** _.replace('Hi Fred', 'Fred', 'Barney');* // => 'Hi Barney'*/function replace() {var args = arguments,string = toString(args[0]);return args.length < 3 ? string : string.replace(args[1], args[2]);}module.exports = replace;
var baseRepeat = require('./_baseRepeat'),isIterateeCall = require('./_isIterateeCall'),toInteger = require('./toInteger'),toString = require('./toString');/*** Repeats the given string `n` times.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to repeat.* @param {number} [n=1] The number of times to repeat the string.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the repeated string.* @example** _.repeat('*', 3);* // => '***'** _.repeat('abc', 2);* // => 'abcabc'** _.repeat('abc', 0);* // => ''*/function repeat(string, n, guard) {if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {n = 1;} else {n = toInteger(n);}return baseRepeat(toString(string), n);}module.exports = repeat;
var baseIteratee = require('./_baseIteratee'),basePullAt = require('./_basePullAt');/*** Removes all elements from `array` that `predicate` returns truthy for* and returns an array of the removed elements. The predicate is invoked* with three arguments: (value, index, array).** **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`* to pull elements from an array by value.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to modify.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new array of removed elements.* @example** var array = [1, 2, 3, 4];* var evens = _.remove(array, function(n) {* return n % 2 == 0;* });** console.log(array);* // => [1, 3]** console.log(evens);* // => [2, 4]*/function remove(array, predicate) {var result = [];if (!(array && array.length)) {return result;}var index = -1,indexes = [],length = array.length;predicate = baseIteratee(predicate, 3);while (++index < length) {var value = array[index];if (predicate(value, index, array)) {result.push(value);indexes.push(index);}}basePullAt(array, indexes);return result;}module.exports = remove;
var arrayFilter = require('./_arrayFilter'),baseFilter = require('./_baseFilter'),baseIteratee = require('./_baseIteratee'),isArray = require('./isArray'),negate = require('./negate');/*** The opposite of `_.filter`; this method returns the elements of `collection`* that `predicate` does **not** return truthy for.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new filtered array.* @see _.filter* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': true }* ];** _.reject(users, function(o) { return !o.active; });* // => objects for ['fred']** // The `_.matches` iteratee shorthand.* _.reject(users, { 'age': 40, 'active': true });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.reject(users, ['active', false]);* // => objects for ['fred']** // The `_.property` iteratee shorthand.* _.reject(users, 'active');* // => objects for ['barney']*/function reject(collection, predicate) {var func = isArray(collection) ? arrayFilter : baseFilter;return func(collection, negate(baseIteratee(predicate, 3)));}module.exports = reject;
var arrayReduceRight = require('./_arrayReduceRight'),baseEachRight = require('./_baseEachRight'),baseIteratee = require('./_baseIteratee'),baseReduce = require('./_baseReduce'),isArray = require('./isArray');/*** This method is like `_.reduce` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The initial value.* @returns {*} Returns the accumulated value.* @see _.reduce* @example** var array = [[0, 1], [2, 3], [4, 5]];** _.reduceRight(array, function(flattened, other) {* return flattened.concat(other);* }, []);* // => [4, 5, 2, 3, 0, 1]*/function reduceRight(collection, iteratee, accumulator) {var func = isArray(collection) ? arrayReduceRight : baseReduce,initAccum = arguments.length < 3;return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);}module.exports = reduceRight;
var arrayReduce = require('./_arrayReduce'),baseEach = require('./_baseEach'),baseIteratee = require('./_baseIteratee'),baseReduce = require('./_baseReduce'),isArray = require('./isArray');/*** Reduces `collection` to a value which is the accumulated result of running* each element in `collection` thru `iteratee`, where each successive* invocation is supplied the return value of the previous. If `accumulator`* is not given, the first element of `collection` is used as the initial* value. The iteratee is invoked with four arguments:* (accumulator, value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.reduce`, `_.reduceRight`, and `_.transform`.** The guarded methods are:* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,* and `sortBy`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The initial value.* @returns {*} Returns the accumulated value.* @see _.reduceRight* @example** _.reduce([1, 2], function(sum, n) {* return sum + n;* }, 0);* // => 3** _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {* (result[value] || (result[value] = [])).push(key);* return result;* }, {});* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)*/function reduce(collection, iteratee, accumulator) {var func = isArray(collection) ? arrayReduce : baseReduce,initAccum = arguments.length < 3;return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);}module.exports = reduce;
var createWrap = require('./_createWrap'),flatRest = require('./_flatRest');/** Used to compose bitmasks for function metadata. */var WRAP_REARG_FLAG = 256;/*** Creates a function that invokes `func` with arguments arranged according* to the specified `indexes` where the argument value at the first index is* provided as the first argument, the argument value at the second index is* provided as the second argument, and so on.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to rearrange arguments for.* @param {...(number|number[])} indexes The arranged argument indexes.* @returns {Function} Returns the new function.* @example** var rearged = _.rearg(function(a, b, c) {* return [a, b, c];* }, [2, 0, 1]);** rearged('b', 'c', 'a')* // => ['a', 'b', 'c']*/var rearg = flatRest(function(func, indexes) {return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);});module.exports = rearg;
var createRange = require('./_createRange');/*** This method is like `_.range` except that it populates values in* descending order.** @static* @memberOf _* @since 4.0.0* @category Util* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @param {number} [step=1] The value to increment or decrement by.* @returns {Array} Returns the range of numbers.* @see _.inRange, _.range* @example** _.rangeRight(4);* // => [3, 2, 1, 0]** _.rangeRight(-4);* // => [-3, -2, -1, 0]** _.rangeRight(1, 5);* // => [4, 3, 2, 1]** _.rangeRight(0, 20, 5);* // => [15, 10, 5, 0]** _.rangeRight(0, -4, -1);* // => [-3, -2, -1, 0]** _.rangeRight(1, 4, 0);* // => [1, 1, 1]** _.rangeRight(0);* // => []*/var rangeRight = createRange(true);module.exports = rangeRight;
var createRange = require('./_createRange');/*** Creates an array of numbers (positive and/or negative) progressing from* `start` up to, but not including, `end`. A step of `-1` is used if a negative* `start` is specified without an `end` or `step`. If `end` is not specified,* it's set to `start` with `start` then set to `0`.** **Note:** JavaScript follows the IEEE-754 standard for resolving* floating-point values which can produce unexpected results.** @static* @since 0.1.0* @memberOf _* @category Util* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @param {number} [step=1] The value to increment or decrement by.* @returns {Array} Returns the range of numbers.* @see _.inRange, _.rangeRight* @example** _.range(4);* // => [0, 1, 2, 3]** _.range(-4);* // => [0, -1, -2, -3]** _.range(1, 5);* // => [1, 2, 3, 4]** _.range(0, 20, 5);* // => [0, 5, 10, 15]** _.range(0, -4, -1);* // => [0, -1, -2, -3]** _.range(1, 4, 0);* // => [1, 1, 1]** _.range(0);* // => []*/var range = createRange();module.exports = range;
var baseRandom = require('./_baseRandom'),isIterateeCall = require('./_isIterateeCall'),toFinite = require('./toFinite');/** Built-in method references without a dependency on `root`. */var freeParseFloat = parseFloat;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min,nativeRandom = Math.random;/*** Produces a random number between the inclusive `lower` and `upper` bounds.* If only one argument is provided a number between `0` and the given number* is returned. If `floating` is `true`, or either `lower` or `upper` are* floats, a floating-point number is returned instead of an integer.** **Note:** JavaScript follows the IEEE-754 standard for resolving* floating-point values which can produce unexpected results.** @static* @memberOf _* @since 0.7.0* @category Number* @param {number} [lower=0] The lower bound.* @param {number} [upper=1] The upper bound.* @param {boolean} [floating] Specify returning a floating-point number.* @returns {number} Returns the random number.* @example** _.random(0, 5);* // => an integer between 0 and 5** _.random(5);* // => also an integer between 0 and 5** _.random(5, true);* // => a floating-point number between 0 and 5** _.random(1.2, 5.2);* // => a floating-point number between 1.2 and 5.2*/function random(lower, upper, floating) {if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {upper = floating = undefined;}if (floating === undefined) {if (typeof upper == 'boolean') {floating = upper;upper = undefined;}else if (typeof lower == 'boolean') {floating = lower;lower = undefined;}}if (lower === undefined && upper === undefined) {lower = 0;upper = 1;}else {lower = toFinite(lower);if (upper === undefined) {upper = lower;lower = 0;} else {upper = toFinite(upper);}}if (lower > upper) {var temp = lower;lower = upper;upper = temp;}if (floating || lower % 1 || upper % 1) {var rand = nativeRandom();return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);}return baseRandom(lower, upper);}module.exports = random;
var arrayMap = require('./_arrayMap'),baseAt = require('./_baseAt'),basePullAt = require('./_basePullAt'),compareAscending = require('./_compareAscending'),flatRest = require('./_flatRest'),isIndex = require('./_isIndex');/*** Removes elements from `array` corresponding to `indexes` and returns an* array of removed elements.** **Note:** Unlike `_.at`, this method mutates `array`.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to modify.* @param {...(number|number[])} [indexes] The indexes of elements to remove.* @returns {Array} Returns the new array of removed elements.* @example** var array = ['a', 'b', 'c', 'd'];* var pulled = _.pullAt(array, [1, 3]);** console.log(array);* // => ['a', 'c']** console.log(pulled);* // => ['b', 'd']*/var pullAt = flatRest(function(array, indexes) {var length = array == null ? 0 : array.length,result = baseAt(array, indexes);basePullAt(array, arrayMap(indexes, function(index) {return isIndex(index, length) ? +index : index;}).sort(compareAscending));return result;});module.exports = pullAt;
var basePullAll = require('./_basePullAll');/*** This method is like `_.pullAll` except that it accepts `comparator` which* is invoked to compare elements of `array` to `values`. The comparator is* invoked with two arguments: (arrVal, othVal).** **Note:** Unlike `_.differenceWith`, this method mutates `array`.** @static* @memberOf _* @since 4.6.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns `array`.* @example** var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];** _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);* console.log(array);* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]*/function pullAllWith(array, values, comparator) {return (array && array.length && values && values.length)? basePullAll(array, values, undefined, comparator): array;}module.exports = pullAllWith;
var baseIteratee = require('./_baseIteratee'),basePullAll = require('./_basePullAll');/*** This method is like `_.pullAll` except that it accepts `iteratee` which is* invoked for each element of `array` and `values` to generate the criterion* by which they're compared. The iteratee is invoked with one argument: (value).** **Note:** Unlike `_.differenceBy`, this method mutates `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns `array`.* @example** var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];** _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');* console.log(array);* // => [{ 'x': 2 }]*/function pullAllBy(array, values, iteratee) {return (array && array.length && values && values.length)? basePullAll(array, values, baseIteratee(iteratee, 2)): array;}module.exports = pullAllBy;
var basePullAll = require('./_basePullAll');/*** This method is like `_.pull` except that it accepts an array of values to remove.** **Note:** Unlike `_.difference`, this method mutates `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @returns {Array} Returns `array`.* @example** var array = ['a', 'b', 'c', 'a', 'b', 'c'];** _.pullAll(array, ['a', 'c']);* console.log(array);* // => ['b', 'b']*/function pullAll(array, values) {return (array && array.length && values && values.length)? basePullAll(array, values): array;}module.exports = pullAll;
var baseRest = require('./_baseRest'),pullAll = require('./pullAll');/*** Removes all given values from `array` using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`* to remove elements from an array by predicate.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to modify.* @param {...*} [values] The values to remove.* @returns {Array} Returns `array`.* @example** var array = ['a', 'b', 'c', 'a', 'b', 'c'];** _.pull(array, 'a', 'c');* console.log(array);* // => ['b', 'b']*/var pull = baseRest(pullAll);module.exports = pull;
var baseGet = require('./_baseGet');/*** The opposite of `_.property`; this method creates a function that returns* the value at a given path of `object`.** @static* @memberOf _* @since 3.0.0* @category Util* @param {Object} object The object to query.* @returns {Function} Returns the new accessor function.* @example** var array = [0, 1, 2],* object = { 'a': array, 'b': array, 'c': array };** _.map(['a[2]', 'c[0]'], _.propertyOf(object));* // => [2, 0]** _.map([['a', '2'], ['c', '0']], _.propertyOf(object));* // => [2, 0]*/function propertyOf(object) {return function(path) {return object == null ? undefined : baseGet(object, path);};}module.exports = propertyOf;
var baseProperty = require('./_baseProperty'),basePropertyDeep = require('./_basePropertyDeep'),isKey = require('./_isKey'),toKey = require('./_toKey');/*** Creates a function that returns the value at `path` of a given object.** @static* @memberOf _* @since 2.4.0* @category Util* @param {Array|string} path The path of the property to get.* @returns {Function} Returns the new accessor function.* @example** var objects = [* { 'a': { 'b': 2 } },* { 'a': { 'b': 1 } }* ];** _.map(objects, _.property('a.b'));* // => [2, 1]** _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');* // => [1, 2]*/function property(path) {return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);}module.exports = property;
var baseLodash = require('./_baseLodash'),wrapperClone = require('./_wrapperClone');/*** Creates a clone of the chain sequence planting `value` as the wrapped value.** @name plant* @memberOf _* @since 3.2.0* @category Seq* @param {*} value The value to plant.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** function square(n) {* return n * n;* }** var wrapped = _([1, 2]).map(square);* var other = wrapped.plant([3, 4]);** other.value();* // => [9, 16]** wrapped.value();* // => [1, 4]*/function wrapperPlant(value) {var result,parent = this;while (parent instanceof baseLodash) {var clone = wrapperClone(parent);clone.__index__ = 0;clone.__values__ = undefined;if (result) {previous.__wrapped__ = clone;} else {result = clone;}var previous = clone;parent = parent.__wrapped__;}previous.__wrapped__ = value;return result;}module.exports = wrapperPlant;
var arrayMap = require('./_arrayMap'),baseIteratee = require('./_baseIteratee'),basePickBy = require('./_basePickBy'),getAllKeysIn = require('./_getAllKeysIn');/*** Creates an object composed of the `object` properties `predicate` returns* truthy for. The predicate is invoked with two arguments: (value, key).** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The source object.* @param {Function} [predicate=_.identity] The function invoked per property.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.pickBy(object, _.isNumber);* // => { 'a': 1, 'c': 3 }*/function pickBy(object, predicate) {if (object == null) {return {};}var props = arrayMap(getAllKeysIn(object), function(prop) {return [prop];});predicate = baseIteratee(predicate);return basePickBy(object, props, function(value, path) {return predicate(value, path[0]);});}module.exports = pickBy;
var basePick = require('./_basePick'),flatRest = require('./_flatRest');/*** Creates an object composed of the picked `object` properties.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The source object.* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.pick(object, ['a', 'c']);* // => { 'a': 1, 'c': 3 }*/var pick = flatRest(function(object, paths) {return object == null ? {} : basePick(object, paths);});module.exports = pick;
var createAggregator = require('./_createAggregator');/*** Creates an array of elements split into two groups, the first of which* contains elements `predicate` returns truthy for, the second of which* contains elements `predicate` returns falsey for. The predicate is* invoked with one argument: (value).** @static* @memberOf _* @since 3.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the array of grouped elements.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': true },* { 'user': 'pebbles', 'age': 1, 'active': false }* ];** _.partition(users, function(o) { return o.active; });* // => objects for [['fred'], ['barney', 'pebbles']]** // The `_.matches` iteratee shorthand.* _.partition(users, { 'age': 1, 'active': false });* // => objects for [['pebbles'], ['barney', 'fred']]** // The `_.matchesProperty` iteratee shorthand.* _.partition(users, ['active', false]);* // => objects for [['barney', 'pebbles'], ['fred']]** // The `_.property` iteratee shorthand.* _.partition(users, 'active');* // => objects for [['fred'], ['barney', 'pebbles']]*/var partition = createAggregator(function(result, value, key) {result[key ? 0 : 1].push(value);}, function() { return [[], []]; });module.exports = partition;
var baseRest = require('./_baseRest'),createWrap = require('./_createWrap'),getHolder = require('./_getHolder'),replaceHolders = require('./_replaceHolders');/** Used to compose bitmasks for function metadata. */var WRAP_PARTIAL_RIGHT_FLAG = 64;/*** This method is like `_.partial` except that partially applied arguments* are appended to the arguments it receives.** The `_.partialRight.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** **Note:** This method doesn't set the "length" property of partially* applied functions.** @static* @memberOf _* @since 1.0.0* @category Function* @param {Function} func The function to partially apply arguments to.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new partially applied function.* @example** function greet(greeting, name) {* return greeting + ' ' + name;* }** var greetFred = _.partialRight(greet, 'fred');* greetFred('hi');* // => 'hi fred'** // Partially applied with placeholders.* var sayHelloTo = _.partialRight(greet, 'hello', _);* sayHelloTo('fred');* // => 'hello fred'*/var partialRight = baseRest(function(func, partials) {var holders = replaceHolders(partials, getHolder(partialRight));return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);});// Assign default placeholders.partialRight.placeholder = {};module.exports = partialRight;
var baseRest = require('./_baseRest'),createWrap = require('./_createWrap'),getHolder = require('./_getHolder'),replaceHolders = require('./_replaceHolders');/** Used to compose bitmasks for function metadata. */var WRAP_PARTIAL_FLAG = 32;/*** Creates a function that invokes `func` with `partials` prepended to the* arguments it receives. This method is like `_.bind` except it does **not*** alter the `this` binding.** The `_.partial.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** **Note:** This method doesn't set the "length" property of partially* applied functions.** @static* @memberOf _* @since 0.2.0* @category Function* @param {Function} func The function to partially apply arguments to.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new partially applied function.* @example** function greet(greeting, name) {* return greeting + ' ' + name;* }** var sayHelloTo = _.partial(greet, 'hello');* sayHelloTo('fred');* // => 'hello fred'** // Partially applied with placeholders.* var greetFred = _.partial(greet, _, 'fred');* greetFred('hi');* // => 'hi fred'*/var partial = baseRest(function(func, partials) {var holders = replaceHolders(partials, getHolder(partial));return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);});// Assign default placeholders.partial.placeholder = {};module.exports = partial;
var root = require('./_root'),toString = require('./toString');/** Used to match leading and trailing whitespace. */var reTrimStart = /^\s+/;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeParseInt = root.parseInt;/*** Converts `string` to an integer of the specified radix. If `radix` is* `undefined` or `0`, a `radix` of `10` is used unless `value` is a* hexadecimal, in which case a `radix` of `16` is used.** **Note:** This method aligns with the* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.** @static* @memberOf _* @since 1.1.0* @category String* @param {string} string The string to convert.* @param {number} [radix=10] The radix to interpret `value` by.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {number} Returns the converted integer.* @example** _.parseInt('08');* // => 8** _.map(['6', '08', '10'], _.parseInt);* // => [6, 8, 10]*/function parseInt(string, radix, guard) {if (guard || radix == null) {radix = 0;} else if (radix) {radix = +radix;}return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);}module.exports = parseInt;
var createPadding = require('./_createPadding'),stringSize = require('./_stringSize'),toInteger = require('./toInteger'),toString = require('./toString');/*** Pads `string` on the left side if it's shorter than `length`. Padding* characters are truncated if they exceed `length`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.padStart('abc', 6);* // => ' abc'** _.padStart('abc', 6, '_-');* // => '_-_abc'** _.padStart('abc', 3);* // => 'abc'*/function padStart(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;return (length && strLength < length)? (createPadding(length - strLength, chars) + string): string;}module.exports = padStart;
var createPadding = require('./_createPadding'),stringSize = require('./_stringSize'),toInteger = require('./toInteger'),toString = require('./toString');/*** Pads `string` on the right side if it's shorter than `length`. Padding* characters are truncated if they exceed `length`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.padEnd('abc', 6);* // => 'abc '** _.padEnd('abc', 6, '_-');* // => 'abc_-_'** _.padEnd('abc', 3);* // => 'abc'*/function padEnd(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;return (length && strLength < length)? (string + createPadding(length - strLength, chars)): string;}module.exports = padEnd;
var createPadding = require('./_createPadding'),stringSize = require('./_stringSize'),toInteger = require('./toInteger'),toString = require('./toString');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil,nativeFloor = Math.floor;/*** Pads `string` on the left and right sides if it's shorter than `length`.* Padding characters are truncated if they can't be evenly divided by `length`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.pad('abc', 8);* // => ' abc '** _.pad('abc', 8, '_-');* // => '_-abc_-_'** _.pad('abc', 3);* // => 'abc'*/function pad(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;if (!length || strLength >= length) {return string;}var mid = (length - strLength) / 2;return (createPadding(nativeFloor(mid), chars) +string +createPadding(nativeCeil(mid), chars));}module.exports = pad;
{"_from": "lodash@^4.17.14","_id": "lodash@4.17.20","_inBundle": false,"_integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==","_location": "/lodash","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "lodash@^4.17.14","name": "lodash","escapedName": "lodash","rawSpec": "^4.17.14","saveSpec": null,"fetchSpec": "^4.17.14"},"_requiredBy": ["/async"],"_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","_shasum": "b44a9b6297bcb698f1c51a3545a2b3b368d59c52","_spec": "lodash@^4.17.14","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/async","author": {"name": "John-David Dalton","email": "john.david.dalton@gmail.com"},"bugs": {"url": "https://github.com/lodash/lodash/issues"},"bundleDependencies": false,"contributors": [{"name": "John-David Dalton","email": "john.david.dalton@gmail.com"},{"name": "Mathias Bynens","email": "mathias@qiwi.be"}],"deprecated": false,"description": "Lodash modular utilities.","homepage": "https://lodash.com/","icon": "https://lodash.com/icon.svg","keywords": ["modules","stdlib","util"],"license": "MIT","main": "lodash.js","name": "lodash","repository": {"type": "git","url": "git+https://github.com/lodash/lodash.git"},"scripts": {"test": "echo \"See https://travis-ci.org/lodash-archive/lodash-cli for testing details.\""},"version": "4.17.20"}
var arraySome = require('./_arraySome'),createOver = require('./_createOver');/*** Creates a function that checks if **any** of the `predicates` return* truthy when invoked with the arguments it receives.** Following shorthands are possible for providing predicates.* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [predicates=[_.identity]]* The predicates to check.* @returns {Function} Returns the new function.* @example** var func = _.overSome([Boolean, isFinite]);** func('1');* // => true** func(null);* // => true** func(NaN);* // => false** var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])*/var overSome = createOver(arraySome);module.exports = overSome;
var arrayEvery = require('./_arrayEvery'),createOver = require('./_createOver');/*** Creates a function that checks if **all** of the `predicates` return* truthy when invoked with the arguments it receives.** Following shorthands are possible for providing predicates.* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [predicates=[_.identity]]* The predicates to check.* @returns {Function} Returns the new function.* @example** var func = _.overEvery([Boolean, isFinite]);** func('1');* // => true** func(null);* // => false** func(NaN);* // => false*/var overEvery = createOver(arrayEvery);module.exports = overEvery;
var apply = require('./_apply'),arrayMap = require('./_arrayMap'),baseFlatten = require('./_baseFlatten'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),baseUnary = require('./_baseUnary'),castRest = require('./_castRest'),isArray = require('./isArray');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** Creates a function that invokes `func` with its arguments transformed.** @static* @since 4.0.0* @memberOf _* @category Function* @param {Function} func The function to wrap.* @param {...(Function|Function[])} [transforms=[_.identity]]* The argument transforms.* @returns {Function} Returns the new function.* @example** function doubled(n) {* return n * 2;* }** function square(n) {* return n * n;* }** var func = _.overArgs(function(x, y) {* return [x, y];* }, [square, doubled]);** func(9, 3);* // => [81, 6]** func(10, 5);* // => [100, 10]*/var overArgs = castRest(function(func, transforms) {transforms = (transforms.length == 1 && isArray(transforms[0]))? arrayMap(transforms[0], baseUnary(baseIteratee)): arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));var funcsLength = transforms.length;return baseRest(function(args) {var index = -1,length = nativeMin(args.length, funcsLength);while (++index < length) {args[index] = transforms[index].call(this, args[index]);}return apply(func, this, args);});});module.exports = overArgs;
var arrayMap = require('./_arrayMap'),createOver = require('./_createOver');/*** Creates a function that invokes `iteratees` with the arguments it receives* and returns their results.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [iteratees=[_.identity]]* The iteratees to invoke.* @returns {Function} Returns the new function.* @example** var func = _.over([Math.max, Math.min]);** func(1, 2, 3, 4);* // => [4, 1]*/var over = createOver(arrayMap);module.exports = over;
var baseOrderBy = require('./_baseOrderBy'),isArray = require('./isArray');/*** This method is like `_.sortBy` except that it allows specifying the sort* orders of the iteratees to sort by. If `orders` is unspecified, all values* are sorted in ascending order. Otherwise, specify an order of "desc" for* descending or "asc" for ascending sort order of corresponding values.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]* The iteratees to sort by.* @param {string[]} [orders] The sort orders of `iteratees`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.* @returns {Array} Returns the new sorted array.* @example** var users = [* { 'user': 'fred', 'age': 48 },* { 'user': 'barney', 'age': 34 },* { 'user': 'fred', 'age': 40 },* { 'user': 'barney', 'age': 36 }* ];** // Sort by `user` in ascending order and by `age` in descending order.* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]*/function orderBy(collection, iteratees, orders, guard) {if (collection == null) {return [];}if (!isArray(iteratees)) {iteratees = iteratees == null ? [] : [iteratees];}orders = guard ? undefined : orders;if (!isArray(orders)) {orders = orders == null ? [] : [orders];}return baseOrderBy(collection, iteratees, orders);}module.exports = orderBy;
var before = require('./before');/*** Creates a function that is restricted to invoking `func` once. Repeat calls* to the function return the value of the first invocation. The `func` is* invoked with the `this` binding and arguments of the created function.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** var initialize = _.once(createApplication);* initialize();* initialize();* // => `createApplication` is invoked once*/function once(func) {return before(2, func);}module.exports = once;
var baseIteratee = require('./_baseIteratee'),negate = require('./negate'),pickBy = require('./pickBy');/*** The opposite of `_.pickBy`; this method creates an object composed of* the own and inherited enumerable string keyed properties of `object` that* `predicate` doesn't return truthy for. The predicate is invoked with two* arguments: (value, key).** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The source object.* @param {Function} [predicate=_.identity] The function invoked per property.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.omitBy(object, _.isNumber);* // => { 'b': '2' }*/function omitBy(object, predicate) {return pickBy(object, negate(baseIteratee(predicate)));}module.exports = omitBy;
var arrayMap = require('./_arrayMap'),baseClone = require('./_baseClone'),baseUnset = require('./_baseUnset'),castPath = require('./_castPath'),copyObject = require('./_copyObject'),customOmitClone = require('./_customOmitClone'),flatRest = require('./_flatRest'),getAllKeysIn = require('./_getAllKeysIn');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1,CLONE_FLAT_FLAG = 2,CLONE_SYMBOLS_FLAG = 4;/*** The opposite of `_.pick`; this method creates an object composed of the* own and inherited enumerable property paths of `object` that are not omitted.** **Note:** This method is considerably slower than `_.pick`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The source object.* @param {...(string|string[])} [paths] The property paths to omit.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.omit(object, ['a', 'c']);* // => { 'b': '2' }*/var omit = flatRest(function(object, paths) {var result = {};if (object == null) {return result;}var isDeep = false;paths = arrayMap(paths, function(path) {path = castPath(path, object);isDeep || (isDeep = path.length > 1);return path;});copyObject(object, getAllKeysIn(object), result);if (isDeep) {result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);}var length = paths.length;while (length--) {baseUnset(result, paths[length]);}return result;});module.exports = omit;
module.exports = {'assign': require('./assign'),'assignIn': require('./assignIn'),'assignInWith': require('./assignInWith'),'assignWith': require('./assignWith'),'at': require('./at'),'create': require('./create'),'defaults': require('./defaults'),'defaultsDeep': require('./defaultsDeep'),'entries': require('./entries'),'entriesIn': require('./entriesIn'),'extend': require('./extend'),'extendWith': require('./extendWith'),'findKey': require('./findKey'),'findLastKey': require('./findLastKey'),'forIn': require('./forIn'),'forInRight': require('./forInRight'),'forOwn': require('./forOwn'),'forOwnRight': require('./forOwnRight'),'functions': require('./functions'),'functionsIn': require('./functionsIn'),'get': require('./get'),'has': require('./has'),'hasIn': require('./hasIn'),'invert': require('./invert'),'invertBy': require('./invertBy'),'invoke': require('./invoke'),'keys': require('./keys'),'keysIn': require('./keysIn'),'mapKeys': require('./mapKeys'),'mapValues': require('./mapValues'),'merge': require('./merge'),'mergeWith': require('./mergeWith'),'omit': require('./omit'),'omitBy': require('./omitBy'),'pick': require('./pick'),'pickBy': require('./pickBy'),'result': require('./result'),'set': require('./set'),'setWith': require('./setWith'),'toPairs': require('./toPairs'),'toPairsIn': require('./toPairsIn'),'transform': require('./transform'),'unset': require('./unset'),'update': require('./update'),'updateWith': require('./updateWith'),'values': require('./values'),'valuesIn': require('./valuesIn')};
module.exports = {'clamp': require('./clamp'),'inRange': require('./inRange'),'random': require('./random')};
var baseNth = require('./_baseNth'),baseRest = require('./_baseRest'),toInteger = require('./toInteger');/*** Creates a function that gets the argument at index `n`. If `n` is negative,* the nth argument from the end is returned.** @static* @memberOf _* @since 4.0.0* @category Util* @param {number} [n=0] The index of the argument to return.* @returns {Function} Returns the new pass-thru function.* @example** var func = _.nthArg(1);* func('a', 'b', 'c', 'd');* // => 'b'** var func = _.nthArg(-2);* func('a', 'b', 'c', 'd');* // => 'c'*/function nthArg(n) {n = toInteger(n);return baseRest(function(args) {return baseNth(args, n);});}module.exports = nthArg;
var baseNth = require('./_baseNth'),toInteger = require('./toInteger');/*** Gets the element at index `n` of `array`. If `n` is negative, the nth* element from the end is returned.** @static* @memberOf _* @since 4.11.0* @category Array* @param {Array} array The array to query.* @param {number} [n=0] The index of the element to return.* @returns {*} Returns the nth element of `array`.* @example** var array = ['a', 'b', 'c', 'd'];** _.nth(array, 1);* // => 'b'** _.nth(array, -2);* // => 'c';*/function nth(array, n) {return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;}module.exports = nth;
var root = require('./_root');/*** Gets the timestamp of the number of milliseconds that have elapsed since* the Unix epoch (1 January 1970 00:00:00 UTC).** @static* @memberOf _* @since 2.4.0* @category Date* @returns {number} Returns the timestamp.* @example** _.defer(function(stamp) {* console.log(_.now() - stamp);* }, _.now());* // => Logs the number of milliseconds it took for the deferred invocation.*/var now = function() {return root.Date.now();};module.exports = now;
/*** This method returns `undefined`.** @static* @memberOf _* @since 2.3.0* @category Util* @example** _.times(2, _.noop);* // => [undefined, undefined]*/function noop() {// No operation performed.}module.exports = noop;
var toArray = require('./toArray');/*** Gets the next value on a wrapped object following the* [iterator protocol](https://mdn.io/iteration_protocols#iterator).** @name next* @memberOf _* @since 4.0.0* @category Seq* @returns {Object} Returns the next iterator value.* @example** var wrapped = _([1, 2]);** wrapped.next();* // => { 'done': false, 'value': 1 }** wrapped.next();* // => { 'done': false, 'value': 2 }** wrapped.next();* // => { 'done': true, 'value': undefined }*/function wrapperNext() {if (this.__values__ === undefined) {this.__values__ = toArray(this.value());}var done = this.__index__ >= this.__values__.length,value = done ? undefined : this.__values__[this.__index__++];return { 'done': done, 'value': value };}module.exports = wrapperNext;
/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a function that negates the result of the predicate `func`. The* `func` predicate is invoked with the `this` binding and arguments of the* created function.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} predicate The predicate to negate.* @returns {Function} Returns the new negated function.* @example** function isEven(n) {* return n % 2 == 0;* }** _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));* // => [1, 3, 5]*/function negate(predicate) {if (typeof predicate != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return function() {var args = arguments;switch (args.length) {case 0: return !predicate.call(this);case 1: return !predicate.call(this, args[0]);case 2: return !predicate.call(this, args[0], args[1]);case 3: return !predicate.call(this, args[0], args[1], args[2]);}return !predicate.apply(this, args);};}module.exports = negate;
var createMathOperation = require('./_createMathOperation');/*** Multiply two numbers.** @static* @memberOf _* @since 4.7.0* @category Math* @param {number} multiplier The first number in a multiplication.* @param {number} multiplicand The second number in a multiplication.* @returns {number} Returns the product.* @example** _.multiply(6, 4);* // => 24*/var multiply = createMathOperation(function(multiplier, multiplicand) {return multiplier * multiplicand;}, 1);module.exports = multiply;
var arrayEach = require('./_arrayEach'),arrayPush = require('./_arrayPush'),baseFunctions = require('./_baseFunctions'),copyArray = require('./_copyArray'),isFunction = require('./isFunction'),isObject = require('./isObject'),keys = require('./keys');/*** Adds all own enumerable string keyed function properties of a source* object to the destination object. If `object` is a function, then methods* are added to its prototype as well.** **Note:** Use `_.runInContext` to create a pristine `lodash` function to* avoid conflicts caused by modifying the original.** @static* @since 0.1.0* @memberOf _* @category Util* @param {Function|Object} [object=lodash] The destination object.* @param {Object} source The object of functions to add.* @param {Object} [options={}] The options object.* @param {boolean} [options.chain=true] Specify whether mixins are chainable.* @returns {Function|Object} Returns `object`.* @example** function vowels(string) {* return _.filter(string, function(v) {* return /[aeiou]/i.test(v);* });* }** _.mixin({ 'vowels': vowels });* _.vowels('fred');* // => ['e']** _('fred').vowels().value();* // => ['e']** _.mixin({ 'vowels': vowels }, { 'chain': false });* _('fred').vowels();* // => ['e']*/function mixin(object, source, options) {var props = keys(source),methodNames = baseFunctions(source, props);var chain = !(isObject(options) && 'chain' in options) || !!options.chain,isFunc = isFunction(object);arrayEach(methodNames, function(methodName) {var func = source[methodName];object[methodName] = func;if (isFunc) {object.prototype[methodName] = function() {var chainAll = this.__chain__;if (chain || chainAll) {var result = object(this.__wrapped__),actions = result.__actions__ = copyArray(this.__actions__);actions.push({ 'func': func, 'args': arguments, 'thisArg': object });result.__chain__ = chainAll;return result;}return func.apply(object, arrayPush([this.value()], arguments));};}});return object;}module.exports = mixin;
var baseExtremum = require('./_baseExtremum'),baseIteratee = require('./_baseIteratee'),baseLt = require('./_baseLt');/*** This method is like `_.min` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* the value is ranked. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {*} Returns the minimum value.* @example** var objects = [{ 'n': 1 }, { 'n': 2 }];** _.minBy(objects, function(o) { return o.n; });* // => { 'n': 1 }** // The `_.property` iteratee shorthand.* _.minBy(objects, 'n');* // => { 'n': 1 }*/function minBy(array, iteratee) {return (array && array.length)? baseExtremum(array, baseIteratee(iteratee, 2), baseLt): undefined;}module.exports = minBy;
var baseExtremum = require('./_baseExtremum'),baseLt = require('./_baseLt'),identity = require('./identity');/*** Computes the minimum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the minimum value.* @example** _.min([4, 2, 8, 6]);* // => 2** _.min([]);* // => undefined*/function min(array) {return (array && array.length)? baseExtremum(array, identity, baseLt): undefined;}module.exports = min;
var baseInvoke = require('./_baseInvoke'),baseRest = require('./_baseRest');/*** The opposite of `_.method`; this method creates a function that invokes* the method at a given path of `object`. Any additional arguments are* provided to the invoked method.** @static* @memberOf _* @since 3.7.0* @category Util* @param {Object} object The object to query.* @param {...*} [args] The arguments to invoke the method with.* @returns {Function} Returns the new invoker function.* @example** var array = _.times(3, _.constant),* object = { 'a': array, 'b': array, 'c': array };** _.map(['a[2]', 'c[0]'], _.methodOf(object));* // => [2, 0]** _.map([['a', '2'], ['c', '0']], _.methodOf(object));* // => [2, 0]*/var methodOf = baseRest(function(object, args) {return function(path) {return baseInvoke(object, path, args);};});module.exports = methodOf;
var baseInvoke = require('./_baseInvoke'),baseRest = require('./_baseRest');/*** Creates a function that invokes the method at `path` of a given object.* Any additional arguments are provided to the invoked method.** @static* @memberOf _* @since 3.7.0* @category Util* @param {Array|string} path The path of the method to invoke.* @param {...*} [args] The arguments to invoke the method with.* @returns {Function} Returns the new invoker function.* @example** var objects = [* { 'a': { 'b': _.constant(2) } },* { 'a': { 'b': _.constant(1) } }* ];** _.map(objects, _.method('a.b'));* // => [2, 1]** _.map(objects, _.method(['a', 'b']));* // => [2, 1]*/var method = baseRest(function(path, args) {return function(object) {return baseInvoke(object, path, args);};});module.exports = method;
var baseMerge = require('./_baseMerge'),createAssigner = require('./_createAssigner');/*** This method is like `_.merge` except that it accepts `customizer` which* is invoked to produce the merged values of the destination and source* properties. If `customizer` returns `undefined`, merging is handled by the* method instead. The `customizer` is invoked with six arguments:* (objValue, srcValue, key, object, source, stack).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} customizer The function to customize assigned values.* @returns {Object} Returns `object`.* @example** function customizer(objValue, srcValue) {* if (_.isArray(objValue)) {* return objValue.concat(srcValue);* }* }** var object = { 'a': [1], 'b': [2] };* var other = { 'a': [3], 'b': [4] };** _.mergeWith(object, other, customizer);* // => { 'a': [1, 3], 'b': [2, 4] }*/var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {baseMerge(object, source, srcIndex, customizer);});module.exports = mergeWith;
var baseMerge = require('./_baseMerge'),createAssigner = require('./_createAssigner');/*** This method is like `_.assign` except that it recursively merges own and* inherited enumerable string keyed properties of source objects into the* destination object. Source properties that resolve to `undefined` are* skipped if a destination value exists. Array and plain object properties* are merged recursively. Other objects and value types are overridden by* assignment. Source objects are applied from left to right. Subsequent* sources overwrite property assignments of previous sources.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 0.5.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @example** var object = {* 'a': [{ 'b': 2 }, { 'd': 4 }]* };** var other = {* 'a': [{ 'c': 3 }, { 'e': 5 }]* };** _.merge(object, other);* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }*/var merge = createAssigner(function(object, source, srcIndex) {baseMerge(object, source, srcIndex);});module.exports = merge;
var MapCache = require('./_MapCache');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a function that memoizes the result of `func`. If `resolver` is* provided, it determines the cache key for storing the result based on the* arguments provided to the memoized function. By default, the first argument* provided to the memoized function is used as the map cache key. The `func`* is invoked with the `this` binding of the memoized function.** **Note:** The cache is exposed as the `cache` property on the memoized* function. Its creation may be customized by replacing the `_.memoize.Cache`* constructor with one whose instances implement the* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)* method interface of `clear`, `delete`, `get`, `has`, and `set`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to have its output memoized.* @param {Function} [resolver] The function to resolve the cache key.* @returns {Function} Returns the new memoized function.* @example** var object = { 'a': 1, 'b': 2 };* var other = { 'c': 3, 'd': 4 };** var values = _.memoize(_.values);* values(object);* // => [1, 2]** values(other);* // => [3, 4]** object.a = 2;* values(object);* // => [1, 2]** // Modify the result cache.* values.cache.set(object, ['a', 'b']);* values(object);* // => ['a', 'b']** // Replace `_.memoize.Cache`.* _.memoize.Cache = WeakMap;*/function memoize(func, resolver) {if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {throw new TypeError(FUNC_ERROR_TEXT);}var memoized = function() {var args = arguments,key = resolver ? resolver.apply(this, args) : args[0],cache = memoized.cache;if (cache.has(key)) {return cache.get(key);}var result = func.apply(this, args);memoized.cache = cache.set(key, result) || cache;return result;};memoized.cache = new (memoize.Cache || MapCache);return memoized;}// Expose `MapCache`.memoize.Cache = MapCache;module.exports = memoize;
var baseIteratee = require('./_baseIteratee'),baseMean = require('./_baseMean');/*** This method is like `_.mean` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the value to be averaged.* The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.7.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the mean.* @example** var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];** _.meanBy(objects, function(o) { return o.n; });* // => 5** // The `_.property` iteratee shorthand.* _.meanBy(objects, 'n');* // => 5*/function meanBy(array, iteratee) {return baseMean(array, baseIteratee(iteratee, 2));}module.exports = meanBy;
var baseMean = require('./_baseMean'),identity = require('./identity');/*** Computes the mean of the values in `array`.** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @returns {number} Returns the mean.* @example** _.mean([4, 2, 8, 6]);* // => 5*/function mean(array) {return baseMean(array, identity);}module.exports = mean;
var baseExtremum = require('./_baseExtremum'),baseGt = require('./_baseGt'),baseIteratee = require('./_baseIteratee');/*** This method is like `_.max` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* the value is ranked. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {*} Returns the maximum value.* @example** var objects = [{ 'n': 1 }, { 'n': 2 }];** _.maxBy(objects, function(o) { return o.n; });* // => { 'n': 2 }** // The `_.property` iteratee shorthand.* _.maxBy(objects, 'n');* // => { 'n': 2 }*/function maxBy(array, iteratee) {return (array && array.length)? baseExtremum(array, baseIteratee(iteratee, 2), baseGt): undefined;}module.exports = maxBy;
var baseExtremum = require('./_baseExtremum'),baseGt = require('./_baseGt'),identity = require('./identity');/*** Computes the maximum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the maximum value.* @example** _.max([4, 2, 8, 6]);* // => 8** _.max([]);* // => undefined*/function max(array) {return (array && array.length)? baseExtremum(array, identity, baseGt): undefined;}module.exports = max;
module.exports = {'add': require('./add'),'ceil': require('./ceil'),'divide': require('./divide'),'floor': require('./floor'),'max': require('./max'),'maxBy': require('./maxBy'),'mean': require('./mean'),'meanBy': require('./meanBy'),'min': require('./min'),'minBy': require('./minBy'),'multiply': require('./multiply'),'round': require('./round'),'subtract': require('./subtract'),'sum': require('./sum'),'sumBy': require('./sumBy')};
var baseClone = require('./_baseClone'),baseMatchesProperty = require('./_baseMatchesProperty');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1;/*** Creates a function that performs a partial deep comparison between the* value at `path` of a given object to `srcValue`, returning `true` if the* object value is equivalent, else `false`.** **Note:** Partial comparisons will match empty array and empty object* `srcValue` values against any array or object value, respectively. See* `_.isEqual` for a list of supported value comparisons.** **Note:** Multiple values can be checked by combining several matchers* using `_.overSome`** @static* @memberOf _* @since 3.2.0* @category Util* @param {Array|string} path The path of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 1, 'b': 2, 'c': 3 },* { 'a': 4, 'b': 5, 'c': 6 }* ];** _.find(objects, _.matchesProperty('a', 4));* // => { 'a': 4, 'b': 5, 'c': 6 }** // Checking for several possible values* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]*/function matchesProperty(path, srcValue) {return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));}module.exports = matchesProperty;
var baseClone = require('./_baseClone'),baseMatches = require('./_baseMatches');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1;/*** Creates a function that performs a partial deep comparison between a given* object and `source`, returning `true` if the given object has equivalent* property values, else `false`.** **Note:** The created function is equivalent to `_.isMatch` with `source`* partially applied.** Partial comparisons will match empty array and empty object `source`* values against any array or object value, respectively. See `_.isEqual`* for a list of supported value comparisons.** **Note:** Multiple values can be checked by combining several matchers* using `_.overSome`** @static* @memberOf _* @since 3.0.0* @category Util* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 1, 'b': 2, 'c': 3 },* { 'a': 4, 'b': 5, 'c': 6 }* ];** _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));* // => [{ 'a': 4, 'b': 5, 'c': 6 }]** // Checking for several possible values* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]*/function matches(source) {return baseMatches(baseClone(source, CLONE_DEEP_FLAG));}module.exports = matches;
var baseAssignValue = require('./_baseAssignValue'),baseForOwn = require('./_baseForOwn'),baseIteratee = require('./_baseIteratee');/*** Creates an object with the same keys as `object` and values generated* by running each own enumerable string keyed property of `object` thru* `iteratee`. The iteratee is invoked with three arguments:* (value, key, object).** @static* @memberOf _* @since 2.4.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns the new mapped object.* @see _.mapKeys* @example** var users = {* 'fred': { 'user': 'fred', 'age': 40 },* 'pebbles': { 'user': 'pebbles', 'age': 1 }* };** _.mapValues(users, function(o) { return o.age; });* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)** // The `_.property` iteratee shorthand.* _.mapValues(users, 'age');* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)*/function mapValues(object, iteratee) {var result = {};iteratee = baseIteratee(iteratee, 3);baseForOwn(object, function(value, key, object) {baseAssignValue(result, key, iteratee(value, key, object));});return result;}module.exports = mapValues;
var baseAssignValue = require('./_baseAssignValue'),baseForOwn = require('./_baseForOwn'),baseIteratee = require('./_baseIteratee');/*** The opposite of `_.mapValues`; this method creates an object with the* same values as `object` and keys generated by running each own enumerable* string keyed property of `object` thru `iteratee`. The iteratee is invoked* with three arguments: (value, key, object).** @static* @memberOf _* @since 3.8.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns the new mapped object.* @see _.mapValues* @example** _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {* return key + value;* });* // => { 'a1': 1, 'b2': 2 }*/function mapKeys(object, iteratee) {var result = {};iteratee = baseIteratee(iteratee, 3);baseForOwn(object, function(value, key, object) {baseAssignValue(result, iteratee(value, key, object), value);});return result;}module.exports = mapKeys;
var arrayMap = require('./_arrayMap'),baseIteratee = require('./_baseIteratee'),baseMap = require('./_baseMap'),isArray = require('./isArray');/*** Creates an array of values by running each element in `collection` thru* `iteratee`. The iteratee is invoked with three arguments:* (value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.** The guarded methods are:* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,* `template`, `trim`, `trimEnd`, `trimStart`, and `words`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new mapped array.* @example** function square(n) {* return n * n;* }** _.map([4, 8], square);* // => [16, 64]** _.map({ 'a': 4, 'b': 8 }, square);* // => [16, 64] (iteration order is not guaranteed)** var users = [* { 'user': 'barney' },* { 'user': 'fred' }* ];** // The `_.property` iteratee shorthand.* _.map(users, 'user');* // => ['barney', 'fred']*/function map(collection, iteratee) {var func = isArray(collection) ? arrayMap : baseMap;return func(collection, baseIteratee(iteratee, 3));}module.exports = map;
var createRelationalOperation = require('./_createRelationalOperation');/*** Checks if `value` is less than or equal to `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than or equal to* `other`, else `false`.* @see _.gte* @example** _.lte(1, 3);* // => true** _.lte(3, 3);* // => true** _.lte(3, 1);* // => false*/var lte = createRelationalOperation(function(value, other) {return value <= other;});module.exports = lte;
var baseLt = require('./_baseLt'),createRelationalOperation = require('./_createRelationalOperation');/*** Checks if `value` is less than `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than `other`,* else `false`.* @see _.gt* @example** _.lt(1, 3);* // => true** _.lt(3, 3);* // => false** _.lt(3, 1);* // => false*/var lt = createRelationalOperation(baseLt);module.exports = lt;
var createCaseFirst = require('./_createCaseFirst');/*** Converts the first character of `string` to lower case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the converted string.* @example** _.lowerFirst('Fred');* // => 'fred'** _.lowerFirst('FRED');* // => 'fRED'*/var lowerFirst = createCaseFirst('toLowerCase');module.exports = lowerFirst;
var createCompounder = require('./_createCompounder');/*** Converts `string`, as space separated words, to lower case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the lower cased string.* @example** _.lowerCase('--Foo-Bar--');* // => 'foo bar'** _.lowerCase('fooBar');* // => 'foo bar'** _.lowerCase('__FOO_BAR__');* // => 'foo bar'*/var lowerCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + word.toLowerCase();});module.exports = lowerCase;
/*** @license* Lodash <https://lodash.com/>* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>* Released under MIT license <https://lodash.com/license>* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors*/(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&t(n[r],r,n)!==!1;);return n}function e(n,t){for(var r=null==n?0:n.length;r--&&t(n[r],r,n)!==!1;);return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!!(null==n?0:n.length)&&y(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function p(n){return n.split("")}function _(n){return n.match(Bt)||[]}function v(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function g(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function y(n,t,r){return t===t?q(n,t,r):g(n,b,r)}function d(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function b(n){return n!==n}function w(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:Sn}function m(n){return function(t){return null==t?Y:t[n]}}function x(n){return function(t){return null==n?Y:n[t]}}function j(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function A(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==Y&&(r=r===Y?i:r+i);}return r}function O(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function I(n,t){return c(t,function(t){return[t,n[t]]})}function R(n){return function(t){return n(t)}}function z(n,t){return c(t,function(t){return n[t]})}function E(n,t){return n.has(t)}function S(n,t){for(var r=-1,e=n.length;++r<e&&y(t,n[r],0)>-1;);return r}function W(n,t){for(var r=n.length;r--&&y(t,n[r],0)>-1;);return r}function L(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}function C(n){return"\\"+Gr[n]}function U(n,t){return null==n?Y:n[t]}function B(n){return Dr.test(n)}function T(n){return Mr.test(n)}function $(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function D(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function M(n,t){return function(r){return n(t(r))}}function F(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==un||(n[r]=un,i[u++]=r)}return i}function N(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function P(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function q(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}function Z(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}function K(n){return B(n)?G(n):se(n)}function V(n){return B(n)?H(n):p(n)}function G(n){for(var t=Tr.lastIndex=0;Tr.test(n);)++t;return t}function H(n){return n.match(Tr)||[]}function J(n){return n.match($r)||[]}var Y,Q="4.17.20",X=200,nn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",tn="Expected a function",rn="__lodash_hash_undefined__",en=500,un="__lodash_placeholder__",on=1,fn=2,cn=4,an=1,ln=2,sn=1,hn=2,pn=4,_n=8,vn=16,gn=32,yn=64,dn=128,bn=256,wn=512,mn=30,xn="...",jn=800,An=16,kn=1,On=2,In=3,Rn=1/0,zn=9007199254740991,En=1.7976931348623157e308,Sn=NaN,Wn=4294967295,Ln=Wn-1,Cn=Wn>>>1,Un=[["ary",dn],["bind",sn],["bindKey",hn],["curry",_n],["curryRight",vn],["flip",wn],["partial",gn],["partialRight",yn],["rearg",bn]],Bn="[object Arguments]",Tn="[object Array]",$n="[object AsyncFunction]",Dn="[object Boolean]",Mn="[object Date]",Fn="[object DOMException]",Nn="[object Error]",Pn="[object Function]",qn="[object GeneratorFunction]",Zn="[object Map]",Kn="[object Number]",Vn="[object Null]",Gn="[object Object]",Hn="[object Promise]",Jn="[object Proxy]",Yn="[object RegExp]",Qn="[object Set]",Xn="[object String]",nt="[object Symbol]",tt="[object Undefined]",rt="[object WeakMap]",et="[object WeakSet]",ut="[object ArrayBuffer]",it="[object DataView]",ot="[object Float32Array]",ft="[object Float64Array]",ct="[object Int8Array]",at="[object Int16Array]",lt="[object Int32Array]",st="[object Uint8Array]",ht="[object Uint8ClampedArray]",pt="[object Uint16Array]",_t="[object Uint32Array]",vt=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dt=/&(?:amp|lt|gt|quot|#39);/g,bt=/[&<>"']/g,wt=RegExp(dt.source),mt=RegExp(bt.source),xt=/<%-([\s\S]+?)%>/g,jt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,kt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ot=/^\w*$/,It=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rt=/[\\^$.*+?()[\]{}|]/g,zt=RegExp(Rt.source),Et=/^\s+|\s+$/g,St=/^\s+/,Wt=/\s+$/,Lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ct=/\{\n\/\* \[wrapped with (.+)\] \*/,Ut=/,? & /,Bt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Tt=/\\(\\)?/g,$t=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Dt=/\w*$/,Mt=/^[-+]0x[0-9a-f]+$/i,Ft=/^0b[01]+$/i,Nt=/^\[object .+?Constructor\]$/,Pt=/^0o[0-7]+$/i,qt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kt=/($^)/,Vt=/['\n\r\u2028\u2029\\]/g,Gt="\\ud800-\\udfff",Ht="\\u0300-\\u036f",Jt="\\ufe20-\\ufe2f",Yt="\\u20d0-\\u20ff",Qt=Ht+Jt+Yt,Xt="\\u2700-\\u27bf",nr="a-z\\xdf-\\xf6\\xf8-\\xff",tr="\\xac\\xb1\\xd7\\xf7",rr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",er="\\u2000-\\u206f",ur=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ir="A-Z\\xc0-\\xd6\\xd8-\\xde",or="\\ufe0e\\ufe0f",fr=tr+rr+er+ur,cr="['\u2019]",ar="["+Gt+"]",lr="["+fr+"]",sr="["+Qt+"]",hr="\\d+",pr="["+Xt+"]",_r="["+nr+"]",vr="[^"+Gt+fr+hr+Xt+nr+ir+"]",gr="\\ud83c[\\udffb-\\udfff]",yr="(?:"+sr+"|"+gr+")",dr="[^"+Gt+"]",br="(?:\\ud83c[\\udde6-\\uddff]){2}",wr="[\\ud800-\\udbff][\\udc00-\\udfff]",mr="["+ir+"]",xr="\\u200d",jr="(?:"+_r+"|"+vr+")",Ar="(?:"+mr+"|"+vr+")",kr="(?:"+cr+"(?:d|ll|m|re|s|t|ve))?",Or="(?:"+cr+"(?:D|LL|M|RE|S|T|VE))?",Ir=yr+"?",Rr="["+or+"]?",zr="(?:"+xr+"(?:"+[dr,br,wr].join("|")+")"+Rr+Ir+")*",Er="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wr=Rr+Ir+zr,Lr="(?:"+[pr,br,wr].join("|")+")"+Wr,Cr="(?:"+[dr+sr+"?",sr,br,wr,ar].join("|")+")",Ur=RegExp(cr,"g"),Br=RegExp(sr,"g"),Tr=RegExp(gr+"(?="+gr+")|"+Cr+Wr,"g"),$r=RegExp([mr+"?"+_r+"+"+kr+"(?="+[lr,mr,"$"].join("|")+")",Ar+"+"+Or+"(?="+[lr,mr+jr,"$"].join("|")+")",mr+"?"+jr+"+"+kr,mr+"+"+Or,Sr,Er,hr,Lr].join("|"),"g"),Dr=RegExp("["+xr+Gt+Qt+or+"]"),Mr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nr=-1,Pr={};Pr[ot]=Pr[ft]=Pr[ct]=Pr[at]=Pr[lt]=Pr[st]=Pr[ht]=Pr[pt]=Pr[_t]=!0,Pr[Bn]=Pr[Tn]=Pr[ut]=Pr[Dn]=Pr[it]=Pr[Mn]=Pr[Nn]=Pr[Pn]=Pr[Zn]=Pr[Kn]=Pr[Gn]=Pr[Yn]=Pr[Qn]=Pr[Xn]=Pr[rt]=!1;var qr={};qr[Bn]=qr[Tn]=qr[ut]=qr[it]=qr[Dn]=qr[Mn]=qr[ot]=qr[ft]=qr[ct]=qr[at]=qr[lt]=qr[Zn]=qr[Kn]=qr[Gn]=qr[Yn]=qr[Qn]=qr[Xn]=qr[nt]=qr[st]=qr[ht]=qr[pt]=qr[_t]=!0,qr[Nn]=qr[Pn]=qr[rt]=!1;var Zr={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Kr={"&":"&","<":"<",">":">",'"':""","'":"'"},Vr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Hr=parseFloat,Jr=parseInt,Yr="object"==typeof global&&global&&global.Object===Object&&global,Qr="object"==typeof self&&self&&self.Object===Object&&self,Xr=Yr||Qr||Function("return this")(),ne="object"==typeof exports&&exports&&!exports.nodeType&&exports,te=ne&&"object"==typeof module&&module&&!module.nodeType&&module,re=te&&te.exports===ne,ee=re&&Yr.process,ue=function(){try{var n=te&&te.require&&te.require("util").types;return n?n:ee&&ee.binding&&ee.binding("util")}catch(n){}}(),ie=ue&&ue.isArrayBuffer,oe=ue&&ue.isDate,fe=ue&&ue.isMap,ce=ue&&ue.isRegExp,ae=ue&&ue.isSet,le=ue&&ue.isTypedArray,se=m("length"),he=x(Zr),pe=x(Kr),_e=x(Vr),ve=function p(x){function q(n){if(oc(n)&&!yh(n)&&!(n instanceof Bt)){if(n instanceof H)return n;if(yl.call(n,"__wrapped__"))return to(n)}return new H(n)}function G(){}function H(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=Y}function Bt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Wn,this.__views__=[]}function Gt(){var n=new Bt(this.__wrapped__);return n.__actions__=Uu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Uu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Uu(this.__views__),n}function Ht(){if(this.__filtered__){var n=new Bt(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Jt(){var n=this.__wrapped__.value(),t=this.__dir__,r=yh(n),e=t<0,u=r?n.length:0,i=Ai(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=Vl(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return du(n,this.__actions__);var _=[];n:for(;c--&&h<p;){a+=t;for(var v=-1,g=n[a];++v<s;){var y=l[v],d=y.iteratee,b=y.type,w=d(g);if(b==On)g=w;else if(!w){if(b==kn)continue n;break n}}_[h++]=g}return _}function Yt(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Qt(){this.__data__=es?es(null):{},this.size=0}function Xt(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function nr(n){var t=this.__data__;if(es){var r=t[n];return r===rn?Y:r}return yl.call(t,n)?t[n]:Y}function tr(n){var t=this.__data__;return es?t[n]!==Y:yl.call(t,n)}function rr(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=es&&t===Y?rn:t,this}function er(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function ur(){this.__data__=[],this.size=0}function ir(n){var t=this.__data__,r=Er(t,n);return!(r<0)&&(r==t.length-1?t.pop():Sl.call(t,r,1),--this.size,!0)}function or(n){var t=this.__data__,r=Er(t,n);return r<0?Y:t[r][1]}function fr(n){return Er(this.__data__,n)>-1}function cr(n,t){var r=this.__data__,e=Er(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function ar(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function lr(){this.size=0,this.__data__={hash:new Yt,map:new(Xl||er),string:new Yt}}function sr(n){var t=wi(this,n).delete(n);return this.size-=t?1:0,t}function hr(n){return wi(this,n).get(n)}function pr(n){return wi(this,n).has(n)}function _r(n,t){var r=wi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this}function vr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new ar;++t<r;)this.add(n[t])}function gr(n){return this.__data__.set(n,rn),this}function yr(n){return this.__data__.has(n)}function dr(n){this.size=(this.__data__=new er(n)).size}function br(){this.__data__=new er,this.size=0}function wr(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r}function mr(n){return this.__data__.get(n)}function xr(n){return this.__data__.has(n)}function jr(n,t){var r=this.__data__;if(r instanceof er){var e=r.__data__;if(!Xl||e.length<X-1)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new ar(e)}return r.set(n,t),this.size=r.size,this}function Ar(n,t){var r=yh(n),e=!r&&gh(n),u=!r&&!e&&bh(n),i=!r&&!e&&!u&&Ah(n),o=r||e||u||i,f=o?O(n.length,ll):[],c=f.length;for(var a in n)!t&&!yl.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Wi(a,c))||f.push(a);return f}function kr(n){var t=n.length;return t?n[Xe(0,t-1)]:Y}function Or(n,t){return Yi(Uu(n),$r(t,0,n.length))}function Ir(n){return Yi(Uu(n))}function Rr(n,t,r){(r===Y||Kf(n[t],r))&&(r!==Y||t in n)||Cr(n,t,r)}function zr(n,t,r){var e=n[t];yl.call(n,t)&&Kf(e,r)&&(r!==Y||t in n)||Cr(n,t,r)}function Er(n,t){for(var r=n.length;r--;)if(Kf(n[r][0],t))return r;return-1}function Sr(n,t,r,e){return vs(n,function(n,u,i){t(e,n,r(n),i)}),e}function Wr(n,t){return n&&Bu(t,Fc(t),n)}function Lr(n,t){return n&&Bu(t,Nc(t),n)}function Cr(n,t,r){"__proto__"==t&&Ul?Ul(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Tr(n,t){for(var r=-1,e=t.length,u=el(e),i=null==n;++r<e;)u[r]=i?Y:$c(n,t[r]);return u}function $r(n,t,r){return n===n&&(r!==Y&&(n=n<=r?n:r),t!==Y&&(n=n>=t?n:t)),n}function Dr(n,t,e,u,i,o){var f,c=t&on,a=t&fn,l=t&cn;if(e&&(f=i?e(n,u,i,o):e(n)),f!==Y)return f;if(!ic(n))return n;var s=yh(n);if(s){if(f=Ii(n),!c)return Uu(n,f)}else{var h=Is(n),p=h==Pn||h==qn;if(bh(n))return ku(n,c);if(h==Gn||h==Bn||p&&!i){if(f=a||p?{}:Ri(n),!c)return a?$u(n,Lr(f,n)):Tu(n,Wr(f,n))}else{if(!qr[h])return i?n:{};f=zi(n,h,c)}}o||(o=new dr);var _=o.get(n);if(_)return _;o.set(n,f),jh(n)?n.forEach(function(r){f.add(Dr(r,t,e,r,n,o))}):mh(n)&&n.forEach(function(r,u){f.set(u,Dr(r,t,e,u,n,o))});var v=l?a?gi:vi:a?Nc:Fc,g=s?Y:v(n);return r(g||n,function(r,u){g&&(u=r,r=n[u]),zr(f,u,Dr(r,t,e,u,n,o))}),f}function Mr(n){var t=Fc(n);return function(r){return Zr(r,n,t)}}function Zr(n,t,r){var e=r.length;if(null==n)return!e;for(n=cl(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===Y&&!(u in n)||!i(o))return!1}return!0}function Kr(n,t,r){if("function"!=typeof n)throw new sl(tn);return Es(function(){n.apply(Y,r)},t)}function Vr(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,R(r))),e?(i=f,a=!1):t.length>=X&&(i=E,a=!1,t=new vr(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p);if(p=e||0!==p?p:0,a&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function Gr(n,t){var r=!0;return vs(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Yr(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===Y?o===o&&!yc(o):r(o,f)))var f=o,c=i}return c}function Qr(n,t,r,e){var u=n.length;for(r=jc(r),r<0&&(r=-r>u?0:u+r),e=e===Y||e>u?u:jc(e),e<0&&(e+=u),e=r>e?0:Ac(e);r<e;)n[r++]=t;return n}function ne(n,t){var r=[];return vs(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function te(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Si),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?te(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function ee(n,t){return n&&ys(n,t,Fc)}function ue(n,t){return n&&ds(n,t,Fc)}function se(n,t){return i(t,function(t){return rc(n[t])})}function ve(n,t){t=ju(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[Qi(t[r++])];return r&&r==e?n:Y}function ye(n,t,r){var e=t(n);return yh(n)?e:a(e,r(n))}function de(n){return null==n?n===Y?tt:Vn:Cl&&Cl in cl(n)?ji(n):qi(n)}function be(n,t){return n>t}function we(n,t){return null!=n&&yl.call(n,t)}function me(n,t){return null!=n&&t in cl(n)}function xe(n,t,r){return n>=Vl(t,r)&&n<Kl(t,r)}function je(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=el(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,R(t))),s=Vl(p.length,s),l[a]=!r&&(t||u>=120&&p.length>=120)?new vr(a&&p):Y}p=n[0];var _=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],y=t?t(g):g;if(g=r||0!==g?g:0,!(v?E(v,y):e(h,y,r))){for(a=i;--a;){var d=l[a];if(!(d?E(d,y):e(n[a],y,r)))continue n}v&&v.push(y),h.push(g)}}return h}function Ae(n,t,r,e){return ee(n,function(n,u,i){t(e,r(n),u,i)}),e}function ke(t,r,e){r=ju(r,t),t=Ki(t,r);var u=null==t?t:t[Qi(mo(r))];return null==u?Y:n(u,t,e)}function Oe(n){return oc(n)&&de(n)==Bn}function Ie(n){return oc(n)&&de(n)==ut}function Re(n){return oc(n)&&de(n)==Mn}function ze(n,t,r,e,u){return n===t||(null==n||null==t||!oc(n)&&!oc(t)?n!==n&&t!==t:Ee(n,t,r,e,ze,u))}function Ee(n,t,r,e,u,i){var o=yh(n),f=yh(t),c=o?Tn:Is(n),a=f?Tn:Is(t);c=c==Bn?Gn:c,a=a==Bn?Gn:a;var l=c==Gn,s=a==Gn,h=c==a;if(h&&bh(n)){if(!bh(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new dr),o||Ah(n)?si(n,t,r,e,u,i):hi(n,t,c,r,e,u,i);if(!(r&an)){var p=l&&yl.call(n,"__wrapped__"),_=s&&yl.call(t,"__wrapped__");if(p||_){var v=p?n.value():n,g=_?t.value():t;return i||(i=new dr),u(v,g,r,e,i)}}return!!h&&(i||(i=new dr),pi(n,t,r,e,u,i));}function Se(n){return oc(n)&&Is(n)==Zn}function We(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=cl(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){f=r[u];var c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===Y&&!(c in n))return!1}else{var s=new dr;if(e)var h=e(a,l,c,n,t,s);if(!(h===Y?ze(l,a,an|ln,e,s):h))return!1}}return!0}function Le(n){return!(!ic(n)||Ti(n))&&(rc(n)?jl:Nt).test(Xi(n))}function Ce(n){return oc(n)&&de(n)==Yn}function Ue(n){return oc(n)&&Is(n)==Qn;}function Be(n){return oc(n)&&uc(n.length)&&!!Pr[de(n)]}function Te(n){return"function"==typeof n?n:null==n?Sa:"object"==typeof n?yh(n)?Pe(n[0],n[1]):Ne(n):Da(n)}function $e(n){if(!$i(n))return Zl(n);var t=[];for(var r in cl(n))yl.call(n,r)&&"constructor"!=r&&t.push(r);return t}function De(n){if(!ic(n))return Pi(n);var t=$i(n),r=[];for(var e in n)("constructor"!=e||!t&&yl.call(n,e))&&r.push(e);return r}function Me(n,t){return n<t}function Fe(n,t){var r=-1,e=Vf(n)?el(n.length):[];return vs(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Ne(n){var t=mi(n);return 1==t.length&&t[0][2]?Mi(t[0][0],t[0][1]):function(r){return r===n||We(r,n,t)}}function Pe(n,t){return Ci(n)&&Di(t)?Mi(Qi(n),t):function(r){var e=$c(r,n);return e===Y&&e===t?Mc(r,n):ze(t,e,an|ln)}}function qe(n,t,r,e,u){n!==t&&ys(t,function(i,o){if(u||(u=new dr),ic(i))Ze(n,t,o,r,qe,e,u);else{var f=e?e(Gi(n,o),i,o+"",n,t,u):Y;f===Y&&(f=i),Rr(n,o,f)}},Nc)}function Ze(n,t,r,e,u,i,o){var f=Gi(n,r),c=Gi(t,r),a=o.get(c);if(a)return Rr(n,r,a),Y;var l=i?i(f,c,r+"",n,t,o):Y,s=l===Y;if(s){var h=yh(c),p=!h&&bh(c),_=!h&&!p&&Ah(c);l=c,h||p||_?yh(f)?l=f:Gf(f)?l=Uu(f):p?(s=!1,l=ku(c,!0)):_?(s=!1,l=Eu(c,!0)):l=[]:_c(c)||gh(c)?(l=f,gh(f)?l=Oc(f):ic(f)&&!rc(f)||(l=Ri(c))):s=!1}s&&(o.set(c,l),u(l,c,e,i,o),o.delete(c)),Rr(n,r,l)}function Ke(n,t){var r=n.length;if(r)return t+=t<0?r:0,Wi(t,r)?n[t]:Y}function Ve(n,t,r){t=t.length?c(t,function(n){return yh(n)?function(t){return ve(t,1===n.length?n[0]:n)}:n}):[Sa];var e=-1;return t=c(t,R(bi())),A(Fe(n,function(n,r,u){return{criteria:c(t,function(t){return t(n)}),index:++e,value:n}}),function(n,t){return Wu(n,t,r)})}function Ge(n,t){return He(n,t,function(t,r){return Mc(n,r)})}function He(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=ve(n,o);r(f,o)&&iu(i,ju(o,n),f)}return i}function Je(n){return function(t){return ve(t,n)}}function Ye(n,t,r,e){var u=e?d:y,i=-1,o=t.length,f=n;for(n===t&&(t=Uu(t)),r&&(f=c(n,R(r)));++i<o;)for(var a=0,l=t[i],s=r?r(l):l;(a=u(f,s,a,e))>-1;)f!==n&&Sl.call(f,a,1),Sl.call(n,a,1);return n}function Qe(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Wi(u)?Sl.call(n,u,1):vu(n,u)}}return n}function Xe(n,t){return n+Ml(Jl()*(t-n+1))}function nu(n,t,r,e){for(var u=-1,i=Kl(Dl((t-n)/(r||1)),0),o=el(i);i--;)o[e?i:++u]=n,n+=r;return o}function tu(n,t){var r="";if(!n||t<1||t>zn)return r;do t%2&&(r+=n),t=Ml(t/2),t&&(n+=n);while(t);return r}function ru(n,t){return Ss(Zi(n,t,Sa),n+"")}function eu(n){return kr(na(n))}function uu(n,t){var r=na(n);return Yi(r,$r(t,0,r.length))}function iu(n,t,r,e){if(!ic(n))return n;t=ju(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=Qi(t[u]),a=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(u!=o){var l=f[c];a=e?e(l,c,f):Y,a===Y&&(a=ic(l)?l:Wi(t[u+1])?[]:{})}zr(f,c,a),f=f[c]}return n}function ou(n){return Yi(na(n))}function fu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=el(u);++e<u;)i[e]=n[e+t];return i}function cu(n,t){var r;return vs(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function au(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t===t&&u<=Cn){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!yc(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return lu(n,t,Sa,r)}function lu(n,t,r,e){var u=0,i=null==n?0:n.length;if(0===i)return 0;t=r(t);for(var o=t!==t,f=null===t,c=yc(t),a=t===Y;u<i;){var l=Ml((u+i)/2),s=r(n[l]),h=s!==Y,p=null===s,_=s===s,v=yc(s);if(o)var g=e||_;else g=a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):!p&&!v&&(e?s<=t:s<t);g?u=l+1:i=l}return Vl(i,Ln)}function su(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Kf(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function hu(n){return"number"==typeof n?n:yc(n)?Sn:+n}function pu(n){if("string"==typeof n)return n;if(yh(n))return c(n,pu)+"";if(yc(n))return ps?ps.call(n):"";var t=n+"";return"0"==t&&1/n==-Rn?"-0":t}function _u(n,t,r){var e=-1,u=o,i=n.length,c=!0,a=[],l=a;if(r)c=!1,u=f;else if(i>=X){var s=t?null:js(n);if(s)return N(s);c=!1,u=E,l=new vr}else l=t?[]:a;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,c&&p===p){for(var _=l.length;_--;)if(l[_]===p)continue n;t&&l.push(p),a.push(h)}else u(l,p,r)||(l!==a&&l.push(p),a.push(h))}return a}function vu(n,t){return t=ju(t,n),n=Ki(n,t),null==n||delete n[Qi(mo(t))]}function gu(n,t,r,e){return iu(n,t,r(ve(n,t)),e)}function yu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?fu(n,e?0:i,e?i+1:u):fu(n,e?i+1:0,e?u:i)}function du(n,t){var r=n;return r instanceof Bt&&(r=r.value()),l(t,function(n,t){return t.func.apply(t.thisArg,a([n],t.args))},r)}function bu(n,t,r){var e=n.length;if(e<2)return e?_u(n[0]):[];for(var u=-1,i=el(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Vr(i[u]||o,n[f],t,r));return _u(te(i,1),t,r)}function wu(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){r(o,n[e],e<i?t[e]:Y)}return o}function mu(n){return Gf(n)?n:[]}function xu(n){return"function"==typeof n?n:Sa}function ju(n,t){return yh(n)?n:Ci(n,t)?[n]:Ws(Rc(n))}function Au(n,t,r){var e=n.length;return r=r===Y?e:r,!t&&r>=e?n:fu(n,t,r)}function ku(n,t){if(t)return n.slice();var r=n.length,e=Il?Il(r):new n.constructor(r);return n.copy(e),e}function Ou(n){var t=new n.constructor(n.byteLength);return new Ol(t).set(new Ol(n)),t}function Iu(n,t){return new n.constructor(t?Ou(n.buffer):n.buffer,n.byteOffset,n.byteLength)}function Ru(n){var t=new n.constructor(n.source,Dt.exec(n));return t.lastIndex=n.lastIndex,t}function zu(n){return hs?cl(hs.call(n)):{}}function Eu(n,t){return new n.constructor(t?Ou(n.buffer):n.buffer,n.byteOffset,n.length)}function Su(n,t){if(n!==t){var r=n!==Y,e=null===n,u=n===n,i=yc(n),o=t!==Y,f=null===t,c=t===t,a=yc(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Wu(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var c=Su(u[e],i[e]);if(c){if(e>=f)return c;return c*("desc"==r[e]?-1:1)}}return n.index-t.index}function Lu(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Kl(i-o,0),l=el(c+a),s=!e;++f<c;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l;}function Cu(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Kl(i-f,0),s=el(l+a),h=!e;++u<l;)s[u]=n[u];for(var p=u;++c<a;)s[p+c]=t[c];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Uu(n,t){var r=-1,e=n.length;for(t||(t=el(e));++r<e;)t[r]=n[r];return t}function Bu(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):Y;c===Y&&(c=n[f]),u?Cr(r,f,c):zr(r,f,c)}return r}function Tu(n,t){return Bu(n,ks(n),t)}function $u(n,t){return Bu(n,Os(n),t);}function Du(n,r){return function(e,u){var i=yh(e)?t:Sr,o=r?r():{};return i(e,n,bi(u,2),o)}}function Mu(n){return ru(function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:Y,o=u>2?r[2]:Y;for(i=n.length>3&&"function"==typeof i?(u--,i):Y,o&&Li(r[0],r[1],o)&&(i=u<3?Y:i,u=1),t=cl(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t})}function Fu(n,t){return function(r,e){if(null==r)return r;if(!Vf(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=cl(r);(t?i--:++i<u)&&e(o[i],i,o)!==!1;);return r}}function Nu(n){return function(t,r,e){for(var u=-1,i=cl(t),o=e(t),f=o.length;f--;){var c=o[n?f:++u];if(r(i[c],c,i)===!1)break}return t}}function Pu(n,t,r){function e(){return(this&&this!==Xr&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=t&sn,i=Ku(n);return e}function qu(n){return function(t){t=Rc(t);var r=B(t)?V(t):Y,e=r?r[0]:t.charAt(0),u=r?Au(r,1).join(""):t.slice(1);return e[n]()+u}}function Zu(n){return function(t){return l(Oa(oa(t).replace(Ur,"")),n,"")}}function Ku(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=_s(n.prototype),e=n.apply(r,t);return ic(e)?e:r}}function Vu(t,r,e){function u(){for(var o=arguments.length,f=el(o),c=o,a=di(u);c--;)f[c]=arguments[c];var l=o<3&&f[0]!==a&&f[o-1]!==a?[]:F(f,a);return o-=l.length,o<e?ui(t,r,Ju,u.placeholder,Y,f,l,Y,Y,e-o):n(this&&this!==Xr&&this instanceof u?i:t,this,f)}var i=Ku(t);return u}function Gu(n){return function(t,r,e){var u=cl(t);if(!Vf(t)){var i=bi(r,3);t=Fc(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:Y}}function Hu(n){return _i(function(t){var r=t.length,e=r,u=H.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new sl(tn);if(u&&!o&&"wrapper"==yi(i))var o=new H([],!0)}for(e=o?e:r;++e<r;){i=t[e];var f=yi(i),c="wrapper"==f?As(i):Y;o=c&&Bi(c[0])&&c[1]==(dn|_n|gn|bn)&&!c[4].length&&1==c[9]?o[yi(c[0])].apply(o,c[3]):1==i.length&&Bi(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&yh(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function Ju(n,t,r,e,u,i,o,f,c,a){function l(){for(var y=arguments.length,d=el(y),b=y;b--;)d[b]=arguments[b];if(_)var w=di(l),m=L(d,w);if(e&&(d=Lu(d,e,u,_)),i&&(d=Cu(d,i,o,_)),y-=m,_&&y<a){return ui(n,t,Ju,l.placeholder,r,d,F(d,w),f,c,a-y)}var x=h?r:this,j=p?x[n]:n;return y=d.length,f?d=Vi(d,f):v&&y>1&&d.reverse(),s&&c<y&&(d.length=c),this&&this!==Xr&&this instanceof l&&(j=g||Ku(j)),j.apply(x,d)}var s=t&dn,h=t&sn,p=t&hn,_=t&(_n|vn),v=t&wn,g=p?Y:Ku(n);return l}function Yu(n,t){return function(r,e){return Ae(r,n,t(e),{})}}function Qu(n,t){return function(r,e){var u;if(r===Y&&e===Y)return t;if(r!==Y&&(u=r),e!==Y){if(u===Y)return e;"string"==typeof r||"string"==typeof e?(r=pu(r),e=pu(e)):(r=hu(r),e=hu(e)),u=n(r,e)}return u}}function Xu(t){return _i(function(r){return r=c(r,R(bi())),ru(function(e){var u=this;return t(r,function(t){return n(t,u,e)})})})}function ni(n,t){t=t===Y?" ":pu(t);var r=t.length;if(r<2)return r?tu(t,n):t;var e=tu(t,Dl(n/K(t)));return B(t)?Au(V(e),0,n).join(""):e.slice(0,n)}function ti(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=el(l+c),h=this&&this!==Xr&&this instanceof i?f:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++r];return n(h,o?e:this,s)}var o=r&sn,f=Ku(t);return i}function ri(n){return function(t,r,e){return e&&"number"!=typeof e&&Li(t,r,e)&&(r=e=Y),t=xc(t),r===Y?(r=t,t=0):r=xc(r),e=e===Y?t<r?1:-1:xc(e),nu(t,r,e,n)}}function ei(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=kc(t),r=kc(r)),n(t,r)}}function ui(n,t,r,e,u,i,o,f,c,a){var l=t&_n,s=l?o:Y,h=l?Y:o,p=l?i:Y,_=l?Y:i;t|=l?gn:yn,t&=~(l?yn:gn),t&pn||(t&=~(sn|hn));var v=[n,t,u,p,s,_,h,f,c,a],g=r.apply(Y,v);return Bi(n)&&zs(g,v),g.placeholder=e,Hi(g,n,t)}function ii(n){var t=fl[n];return function(n,r){if(n=kc(n),r=null==r?0:Vl(jc(r),292),r&&Pl(n)){var e=(Rc(n)+"e").split("e");return e=(Rc(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"),+(e[0]+"e"+(+e[1]-r))}return t(n)}}function oi(n){return function(t){var r=Is(t);return r==Zn?D(t):r==Qn?P(t):I(t,n(t))}}function fi(n,t,r,e,u,i,o,f){var c=t&hn;if(!c&&"function"!=typeof n)throw new sl(tn);var a=e?e.length:0;if(a||(t&=~(gn|yn),e=u=Y),o=o===Y?o:Kl(jc(o),0),f=f===Y?f:jc(f),a-=u?u.length:0,t&yn){var l=e,s=u;e=u=Y}var h=c?Y:As(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&Ni(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],f=p[9]=p[9]===Y?c?0:n.length:Kl(p[9]-a,0),!f&&t&(_n|vn)&&(t&=~(_n|vn)),t&&t!=sn)_=t==_n||t==vn?Vu(n,t,f):t!=gn&&t!=(sn|gn)||u.length?Ju.apply(Y,p):ti(n,t,r,e);else var _=Pu(n,t,r);return Hi((h?bs:zs)(_,p),n,t)}function ci(n,t,r,e){return n===Y||Kf(n,_l[r])&&!yl.call(e,r)?t:n}function ai(n,t,r,e,u,i){return ic(n)&&ic(t)&&(i.set(t,n),qe(n,t,Y,ai,i),i.delete(t)),n}function li(n){return _c(n)?Y:n}function si(n,t,r,e,u,i){var o=r&an,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=r&ln?new vr:Y;for(i.set(n,t),i.set(t,n);++s<f;){var v=n[s],g=t[s];if(e)var y=o?e(g,v,s,t,n,i):e(v,g,s,n,t,i);if(y!==Y){if(y)continue;p=!1;break}if(_){if(!h(t,function(n,t){if(!E(_,t)&&(v===n||u(v,n,r,e,i)))return _.push(t)})){p=!1;break}}else if(v!==g&&!u(v,g,r,e,i)){p=!1;break}}return i.delete(n),i.delete(t),p}function hi(n,t,r,e,u,i,o){switch(r){case it:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case ut:return!(n.byteLength!=t.byteLength||!i(new Ol(n),new Ol(t)));case Dn:case Mn:case Kn:return Kf(+n,+t);case Nn:return n.name==t.name&&n.message==t.message;case Yn:case Xn:return n==t+"";case Zn:var f=D;case Qn:var c=e&an;if(f||(f=N),n.size!=t.size&&!c)return!1;var a=o.get(n);if(a)return a==t;e|=ln,o.set(n,t);var l=si(f(n),f(t),e,u,i,o);return o.delete(n),l;case nt:if(hs)return hs.call(n)==hs.call(t)}return!1}function pi(n,t,r,e,u,i){var o=r&an,f=vi(n),c=f.length;if(c!=vi(t).length&&!o)return!1;for(var a=c;a--;){var l=f[a];if(!(o?l in t:yl.call(t,l)))return!1}var s=i.get(n),h=i.get(t);if(s&&h)return s==t&&h==n;var p=!0;i.set(n,t),i.set(t,n);for(var _=o;++a<c;){l=f[a];var v=n[l],g=t[l];if(e)var y=o?e(g,v,l,t,n,i):e(v,g,l,n,t,i);if(!(y===Y?v===g||u(v,g,r,e,i):y)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=n.constructor,b=t.constructor;d!=b&&"constructor"in n&&"constructor"in t&&!("function"==typeof d&&d instanceof d&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(n),i.delete(t),p}function _i(n){return Ss(Zi(n,Y,ho),n+"")}function vi(n){return ye(n,Fc,ks)}function gi(n){return ye(n,Nc,Os)}function yi(n){for(var t=n.name+"",r=is[t],e=yl.call(is,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function di(n){return(yl.call(q,"placeholder")?q:n).placeholder}function bi(){var n=q.iteratee||Wa;return n=n===Wa?Te:n,arguments.length?n(arguments[0],arguments[1]):n}function wi(n,t){var r=n.__data__;return Ui(t)?r["string"==typeof t?"string":"hash"]:r.map;}function mi(n){for(var t=Fc(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Di(u)]}return t}function xi(n,t){var r=U(n,t);return Le(r)?r:Y}function ji(n){var t=yl.call(n,Cl),r=n[Cl];try{n[Cl]=Y;var e=!0}catch(n){}var u=wl.call(n);return e&&(t?n[Cl]=r:delete n[Cl]),u}function Ai(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Vl(t,n+o);break;case"takeRight":n=Kl(n,t-o)}}return{start:n,end:t}}function ki(n){var t=n.match(Ct);return t?t[1].split(Ut):[]}function Oi(n,t,r){t=ju(t,n);for(var e=-1,u=t.length,i=!1;++e<u;){var o=Qi(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&uc(u)&&Wi(o,u)&&(yh(n)||gh(n)))}function Ii(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&yl.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ri(n){return"function"!=typeof n.constructor||$i(n)?{}:_s(Rl(n))}function zi(n,t,r){var e=n.constructor;switch(t){case ut:return Ou(n);case Dn:case Mn:return new e(+n);case it:return Iu(n,r);case ot:case ft:case ct:case at:case lt:case st:case ht:case pt:case _t:return Eu(n,r);case Zn:return new e;case Kn:case Xn:return new e(n);case Yn:return Ru(n);case Qn:return new e;case nt:return zu(n)}}function Ei(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Lt,"{\n/* [wrapped with "+t+"] */\n")}function Si(n){return yh(n)||gh(n)||!!(Wl&&n&&n[Wl])}function Wi(n,t){var r=typeof n;return t=null==t?zn:t,!!t&&("number"==r||"symbol"!=r&&qt.test(n))&&n>-1&&n%1==0&&n<t}function Li(n,t,r){if(!ic(r))return!1;var e=typeof t;return!!("number"==e?Vf(r)&&Wi(t,r.length):"string"==e&&t in r)&&Kf(r[t],n)}function Ci(n,t){if(yh(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!yc(n))||(Ot.test(n)||!kt.test(n)||null!=t&&n in cl(t))}function Ui(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function Bi(n){var t=yi(n),r=q[t];if("function"!=typeof r||!(t in Bt.prototype))return!1;if(n===r)return!0;var e=As(r);return!!e&&n===e[0]}function Ti(n){return!!bl&&bl in n}function $i(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||_l)}function Di(n){return n===n&&!ic(n)}function Mi(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==Y||n in cl(r)))}}function Fi(n){var t=Wf(n,function(n){return r.size===en&&r.clear(),n}),r=t.cache;return t}function Ni(n,t){var r=n[1],e=t[1],u=r|e,i=u<(sn|hn|dn),o=e==dn&&r==_n||e==dn&&r==bn&&n[7].length<=t[8]||e==(dn|bn)&&t[7].length<=t[8]&&r==_n;if(!i&&!o)return n;e&sn&&(n[2]=t[2],u|=r&sn?0:pn);var f=t[3];if(f){var c=n[3];n[3]=c?Lu(c,f,t[4]):f,n[4]=c?F(n[3],un):t[4]}return f=t[5],f&&(c=n[5],n[5]=c?Cu(c,f,t[6]):f,n[6]=c?F(n[5],un):t[6]),f=t[7],f&&(n[7]=f),e&dn&&(n[8]=null==n[8]?t[8]:Vl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u,n}function Pi(n){var t=[];if(null!=n)for(var r in cl(n))t.push(r);return t}function qi(n){return wl.call(n)}function Zi(t,r,e){return r=Kl(r===Y?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=Kl(u.length-r,0),f=el(o);++i<o;)f[i]=u[r+i];i=-1;for(var c=el(r+1);++i<r;)c[i]=u[i];return c[r]=e(f),n(t,this,c)}}function Ki(n,t){return t.length<2?n:ve(n,fu(t,0,-1))}function Vi(n,t){for(var r=n.length,e=Vl(t.length,r),u=Uu(n);e--;){var i=t[e];n[e]=Wi(i,r)?u[i]:Y}return n}function Gi(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}function Hi(n,t,r){var e=t+"";return Ss(n,Ei(e,no(ki(e),r)))}function Ji(n){var t=0,r=0;return function(){var e=Gl(),u=An-(e-r);if(r=e,u>0){if(++t>=jn)return arguments[0]}else t=0;return n.apply(Y,arguments)}}function Yi(n,t){var r=-1,e=n.length,u=e-1;for(t=t===Y?e:t;++r<t;){var i=Xe(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function Qi(n){if("string"==typeof n||yc(n))return n;var t=n+"";return"0"==t&&1/n==-Rn?"-0":t}function Xi(n){if(null!=n){try{return gl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function no(n,t){return r(Un,function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e)}),n.sort()}function to(n){if(n instanceof Bt)return n.clone();var t=new H(n.__wrapped__,n.__chain__);return t.__actions__=Uu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function ro(n,t,r){t=(r?Li(n,t,r):t===Y)?1:Kl(jc(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=el(Dl(e/t));u<e;)o[i++]=fu(n,u,u+=t);return o}function eo(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u}function uo(){var n=arguments.length;if(!n)return[];for(var t=el(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return a(yh(r)?Uu(r):[r],te(t,1));}function io(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===Y?1:jc(t),fu(n,t<0?0:t,e)):[]}function oo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===Y?1:jc(t),t=e-t,fu(n,0,t<0?0:t)):[]}function fo(n,t){return n&&n.length?yu(n,bi(t,3),!0,!0):[]}function co(n,t){return n&&n.length?yu(n,bi(t,3),!0):[]}function ao(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&Li(n,t,r)&&(r=0,e=u),Qr(n,t,r,e)):[]}function lo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:jc(r);return u<0&&(u=Kl(e+u,0)),g(n,bi(t,3),u)}function so(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==Y&&(u=jc(r),u=r<0?Kl(e+u,0):Vl(u,e-1)),g(n,bi(t,3),u,!0)}function ho(n){return(null==n?0:n.length)?te(n,1):[]}function po(n){return(null==n?0:n.length)?te(n,Rn):[]}function _o(n,t){return(null==n?0:n.length)?(t=t===Y?1:jc(t),te(n,t)):[]}function vo(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e}function go(n){return n&&n.length?n[0]:Y}function yo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:jc(r);return u<0&&(u=Kl(e+u,0)),y(n,t,u)}function bo(n){return(null==n?0:n.length)?fu(n,0,-1):[]}function wo(n,t){return null==n?"":ql.call(n,t)}function mo(n){var t=null==n?0:n.length;return t?n[t-1]:Y}function xo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==Y&&(u=jc(r),u=u<0?Kl(e+u,0):Vl(u,e-1)),t===t?Z(n,t,u):g(n,b,u,!0)}function jo(n,t){return n&&n.length?Ke(n,jc(t)):Y}function Ao(n,t){return n&&n.length&&t&&t.length?Ye(n,t):n;}function ko(n,t,r){return n&&n.length&&t&&t.length?Ye(n,t,bi(r,2)):n}function Oo(n,t,r){return n&&n.length&&t&&t.length?Ye(n,t,Y,r):n}function Io(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=bi(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return Qe(n,u),r}function Ro(n){return null==n?n:Yl.call(n)}function zo(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&Li(n,t,r)?(t=0,r=e):(t=null==t?0:jc(t),r=r===Y?e:jc(r)),fu(n,t,r)):[]}function Eo(n,t){return au(n,t)}function So(n,t,r){return lu(n,t,bi(r,2))}function Wo(n,t){var r=null==n?0:n.length;if(r){var e=au(n,t);if(e<r&&Kf(n[e],t))return e}return-1}function Lo(n,t){return au(n,t,!0)}function Co(n,t,r){return lu(n,t,bi(r,2),!0)}function Uo(n,t){if(null==n?0:n.length){var r=au(n,t,!0)-1;if(Kf(n[r],t))return r}return-1}function Bo(n){return n&&n.length?su(n):[]}function To(n,t){return n&&n.length?su(n,bi(t,2)):[]}function $o(n){var t=null==n?0:n.length;return t?fu(n,1,t):[]}function Do(n,t,r){return n&&n.length?(t=r||t===Y?1:jc(t),fu(n,0,t<0?0:t)):[]}function Mo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===Y?1:jc(t),t=e-t,fu(n,t<0?0:t,e)):[]}function Fo(n,t){return n&&n.length?yu(n,bi(t,3),!1,!0):[]}function No(n,t){return n&&n.length?yu(n,bi(t,3)):[]}function Po(n){return n&&n.length?_u(n):[]}function qo(n,t){return n&&n.length?_u(n,bi(t,2)):[]}function Zo(n,t){return t="function"==typeof t?t:Y,n&&n.length?_u(n,Y,t):[]}function Ko(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){if(Gf(n))return t=Kl(n.length,t),!0}),O(t,function(t){return c(n,m(t))})}function Vo(t,r){if(!t||!t.length)return[];var e=Ko(t);return null==r?e:c(e,function(t){return n(r,Y,t)})}function Go(n,t){return wu(n||[],t||[],zr)}function Ho(n,t){return wu(n||[],t||[],iu)}function Jo(n){var t=q(n);return t.__chain__=!0,t}function Yo(n,t){return t(n),n}function Qo(n,t){return t(n)}function Xo(){return Jo(this)}function nf(){return new H(this.value(),this.__chain__)}function tf(){this.__values__===Y&&(this.__values__=mc(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?Y:this.__values__[this.__index__++]}}function rf(){return this}function ef(n){for(var t,r=this;r instanceof G;){var e=to(r);e.__index__=0,e.__values__=Y,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t}function uf(){var n=this.__wrapped__;if(n instanceof Bt){var t=n;return this.__actions__.length&&(t=new Bt(this)),t=t.reverse(),t.__actions__.push({func:Qo,args:[Ro],thisArg:Y}),new H(t,this.__chain__)}return this.thru(Ro);}function of(){return du(this.__wrapped__,this.__actions__)}function ff(n,t,r){var e=yh(n)?u:Gr;return r&&Li(n,t,r)&&(t=Y),e(n,bi(t,3))}function cf(n,t){return(yh(n)?i:ne)(n,bi(t,3))}function af(n,t){return te(vf(n,t),1)}function lf(n,t){return te(vf(n,t),Rn)}function sf(n,t,r){return r=r===Y?1:jc(r),te(vf(n,t),r)}function hf(n,t){return(yh(n)?r:vs)(n,bi(t,3))}function pf(n,t){return(yh(n)?e:gs)(n,bi(t,3))}function _f(n,t,r,e){n=Vf(n)?n:na(n),r=r&&!e?jc(r):0;var u=n.length;return r<0&&(r=Kl(u+r,0)),gc(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&y(n,t,r)>-1}function vf(n,t){return(yh(n)?c:Fe)(n,bi(t,3))}function gf(n,t,r,e){return null==n?[]:(yh(t)||(t=null==t?[]:[t]),r=e?Y:r,yh(r)||(r=null==r?[]:[r]),Ve(n,t,r))}function yf(n,t,r){var e=yh(n)?l:j,u=arguments.length<3;return e(n,bi(t,4),r,u,vs)}function df(n,t,r){var e=yh(n)?s:j,u=arguments.length<3;return e(n,bi(t,4),r,u,gs)}function bf(n,t){return(yh(n)?i:ne)(n,Lf(bi(t,3)))}function wf(n){return(yh(n)?kr:eu)(n)}function mf(n,t,r){return t=(r?Li(n,t,r):t===Y)?1:jc(t),(yh(n)?Or:uu)(n,t)}function xf(n){return(yh(n)?Ir:ou)(n)}function jf(n){if(null==n)return 0;if(Vf(n))return gc(n)?K(n):n.length;var t=Is(n);return t==Zn||t==Qn?n.size:$e(n).length}function Af(n,t,r){var e=yh(n)?h:cu;return r&&Li(n,t,r)&&(t=Y),e(n,bi(t,3))}function kf(n,t){if("function"!=typeof t)throw new sl(tn);return n=jc(n),function(){if(--n<1)return t.apply(this,arguments)}}function Of(n,t,r){return t=r?Y:t,t=n&&null==t?n.length:t,fi(n,dn,Y,Y,Y,Y,t)}function If(n,t){var r;if("function"!=typeof t)throw new sl(tn);return n=jc(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=Y),r}}function Rf(n,t,r){t=r?Y:t;var e=fi(n,_n,Y,Y,Y,Y,Y,t);return e.placeholder=Rf.placeholder,e}function zf(n,t,r){t=r?Y:t;var e=fi(n,vn,Y,Y,Y,Y,Y,t);return e.placeholder=zf.placeholder,e}function Ef(n,t,r){function e(t){var r=h,e=p;return h=p=Y,d=t,v=n.apply(e,r)}function u(n){return d=n,g=Es(f,t),b?e(n):v}function i(n){var r=n-y,e=n-d,u=t-r;return w?Vl(u,_-e):u}function o(n){var r=n-y,e=n-d;return y===Y||r>=t||r<0||w&&e>=_;}function f(){var n=ih();return o(n)?c(n):(g=Es(f,i(n)),Y)}function c(n){return g=Y,m&&h?e(n):(h=p=Y,v)}function a(){g!==Y&&xs(g),d=0,h=y=p=g=Y}function l(){return g===Y?v:c(ih())}function s(){var n=ih(),r=o(n);if(h=arguments,p=this,y=n,r){if(g===Y)return u(y);if(w)return xs(g),g=Es(f,t),e(y)}return g===Y&&(g=Es(f,t)),v}var h,p,_,v,g,y,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new sl(tn);return t=kc(t)||0,ic(r)&&(b=!!r.leading,w="maxWait"in r,_=w?Kl(kc(r.maxWait)||0,t):_,m="trailing"in r?!!r.trailing:m),s.cancel=a,s.flush=l,s}function Sf(n){return fi(n,wn)}function Wf(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new sl(tn);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Wf.Cache||ar),r}function Lf(n){if("function"!=typeof n)throw new sl(tn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Cf(n){return If(2,n)}function Uf(n,t){if("function"!=typeof n)throw new sl(tn);return t=t===Y?t:jc(t),ru(n,t)}function Bf(t,r){if("function"!=typeof t)throw new sl(tn);return r=null==r?0:Kl(jc(r),0),ru(function(e){var u=e[r],i=Au(e,0,r);return u&&a(i,u),n(t,this,i)})}function Tf(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new sl(tn);return ic(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Ef(n,t,{leading:e,maxWait:t,trailing:u})}function $f(n){return Of(n,1)}function Df(n,t){return sh(xu(t),n)}function Mf(){if(!arguments.length)return[];var n=arguments[0];return yh(n)?n:[n]}function Ff(n){return Dr(n,cn)}function Nf(n,t){return t="function"==typeof t?t:Y,Dr(n,cn,t)}function Pf(n){return Dr(n,on|cn)}function qf(n,t){return t="function"==typeof t?t:Y,Dr(n,on|cn,t)}function Zf(n,t){return null==t||Zr(n,t,Fc(t))}function Kf(n,t){return n===t||n!==n&&t!==t}function Vf(n){return null!=n&&uc(n.length)&&!rc(n);}function Gf(n){return oc(n)&&Vf(n)}function Hf(n){return n===!0||n===!1||oc(n)&&de(n)==Dn}function Jf(n){return oc(n)&&1===n.nodeType&&!_c(n)}function Yf(n){if(null==n)return!0;if(Vf(n)&&(yh(n)||"string"==typeof n||"function"==typeof n.splice||bh(n)||Ah(n)||gh(n)))return!n.length;var t=Is(n);if(t==Zn||t==Qn)return!n.size;if($i(n))return!$e(n).length;for(var r in n)if(yl.call(n,r))return!1;return!0}function Qf(n,t){return ze(n,t)}function Xf(n,t,r){r="function"==typeof r?r:Y;var e=r?r(n,t):Y;return e===Y?ze(n,t,Y,r):!!e;}function nc(n){if(!oc(n))return!1;var t=de(n);return t==Nn||t==Fn||"string"==typeof n.message&&"string"==typeof n.name&&!_c(n)}function tc(n){return"number"==typeof n&&Pl(n)}function rc(n){if(!ic(n))return!1;var t=de(n);return t==Pn||t==qn||t==$n||t==Jn}function ec(n){return"number"==typeof n&&n==jc(n)}function uc(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=zn}function ic(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function oc(n){return null!=n&&"object"==typeof n}function fc(n,t){return n===t||We(n,t,mi(t))}function cc(n,t,r){return r="function"==typeof r?r:Y,We(n,t,mi(t),r)}function ac(n){return pc(n)&&n!=+n}function lc(n){if(Rs(n))throw new il(nn);return Le(n)}function sc(n){return null===n}function hc(n){return null==n}function pc(n){return"number"==typeof n||oc(n)&&de(n)==Kn}function _c(n){if(!oc(n)||de(n)!=Gn)return!1;var t=Rl(n);if(null===t)return!0;var r=yl.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&gl.call(r)==ml}function vc(n){return ec(n)&&n>=-zn&&n<=zn}function gc(n){return"string"==typeof n||!yh(n)&&oc(n)&&de(n)==Xn}function yc(n){return"symbol"==typeof n||oc(n)&&de(n)==nt}function dc(n){return n===Y}function bc(n){return oc(n)&&Is(n)==rt}function wc(n){return oc(n)&&de(n)==et}function mc(n){if(!n)return[];if(Vf(n))return gc(n)?V(n):Uu(n);if(Ll&&n[Ll])return $(n[Ll]());var t=Is(n);return(t==Zn?D:t==Qn?N:na)(n)}function xc(n){if(!n)return 0===n?n:0;if(n=kc(n),n===Rn||n===-Rn){return(n<0?-1:1)*En}return n===n?n:0}function jc(n){var t=xc(n),r=t%1;return t===t?r?t-r:t:0}function Ac(n){return n?$r(jc(n),0,Wn):0}function kc(n){if("number"==typeof n)return n;if(yc(n))return Sn;if(ic(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=ic(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Et,"");var r=Ft.test(n);return r||Pt.test(n)?Jr(n.slice(2),r?2:8):Mt.test(n)?Sn:+n}function Oc(n){return Bu(n,Nc(n))}function Ic(n){return n?$r(jc(n),-zn,zn):0===n?n:0}function Rc(n){return null==n?"":pu(n)}function zc(n,t){var r=_s(n);return null==t?r:Wr(r,t)}function Ec(n,t){return v(n,bi(t,3),ee)}function Sc(n,t){return v(n,bi(t,3),ue)}function Wc(n,t){return null==n?n:ys(n,bi(t,3),Nc)}function Lc(n,t){return null==n?n:ds(n,bi(t,3),Nc)}function Cc(n,t){return n&&ee(n,bi(t,3))}function Uc(n,t){return n&&ue(n,bi(t,3))}function Bc(n){return null==n?[]:se(n,Fc(n))}function Tc(n){return null==n?[]:se(n,Nc(n))}function $c(n,t,r){var e=null==n?Y:ve(n,t);return e===Y?r:e}function Dc(n,t){return null!=n&&Oi(n,t,we)}function Mc(n,t){return null!=n&&Oi(n,t,me);}function Fc(n){return Vf(n)?Ar(n):$e(n)}function Nc(n){return Vf(n)?Ar(n,!0):De(n)}function Pc(n,t){var r={};return t=bi(t,3),ee(n,function(n,e,u){Cr(r,t(n,e,u),n)}),r}function qc(n,t){var r={};return t=bi(t,3),ee(n,function(n,e,u){Cr(r,e,t(n,e,u))}),r}function Zc(n,t){return Kc(n,Lf(bi(t)))}function Kc(n,t){if(null==n)return{};var r=c(gi(n),function(n){return[n]});return t=bi(t),He(n,r,function(n,r){return t(n,r[0])})}function Vc(n,t,r){t=ju(t,n);var e=-1,u=t.length;for(u||(u=1,n=Y);++e<u;){var i=null==n?Y:n[Qi(t[e])];i===Y&&(e=u,i=r),n=rc(i)?i.call(n):i}return n}function Gc(n,t,r){return null==n?n:iu(n,t,r)}function Hc(n,t,r,e){return e="function"==typeof e?e:Y,null==n?n:iu(n,t,r,e)}function Jc(n,t,e){var u=yh(n),i=u||bh(n)||Ah(n);if(t=bi(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:ic(n)&&rc(o)?_s(Rl(n)):{}}return(i?r:ee)(n,function(n,r,u){return t(e,n,r,u)}),e}function Yc(n,t){return null==n||vu(n,t)}function Qc(n,t,r){return null==n?n:gu(n,t,xu(r))}function Xc(n,t,r,e){return e="function"==typeof e?e:Y,null==n?n:gu(n,t,xu(r),e)}function na(n){return null==n?[]:z(n,Fc(n))}function ta(n){return null==n?[]:z(n,Nc(n))}function ra(n,t,r){return r===Y&&(r=t,t=Y),r!==Y&&(r=kc(r),r=r===r?r:0),t!==Y&&(t=kc(t),t=t===t?t:0),$r(kc(n),t,r)}function ea(n,t,r){return t=xc(t),r===Y?(r=t,t=0):r=xc(r),n=kc(n),xe(n,t,r)}function ua(n,t,r){if(r&&"boolean"!=typeof r&&Li(n,t,r)&&(t=r=Y),r===Y&&("boolean"==typeof t?(r=t,t=Y):"boolean"==typeof n&&(r=n,n=Y)),n===Y&&t===Y?(n=0,t=1):(n=xc(n),t===Y?(t=n,n=0):t=xc(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=Jl();return Vl(n+u*(t-n+Hr("1e-"+((u+"").length-1))),t)}return Xe(n,t)}function ia(n){return Jh(Rc(n).toLowerCase())}function oa(n){return n=Rc(n),n&&n.replace(Zt,he).replace(Br,"")}function fa(n,t,r){n=Rc(n),t=pu(t);var e=n.length;r=r===Y?e:$r(jc(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function ca(n){return n=Rc(n),n&&mt.test(n)?n.replace(bt,pe):n}function aa(n){return n=Rc(n),n&&zt.test(n)?n.replace(Rt,"\\$&"):n}function la(n,t,r){n=Rc(n),t=jc(t);var e=t?K(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ni(Ml(u),r)+n+ni(Dl(u),r)}function sa(n,t,r){n=Rc(n),t=jc(t);var e=t?K(n):0;return t&&e<t?n+ni(t-e,r):n}function ha(n,t,r){n=Rc(n),t=jc(t);var e=t?K(n):0;return t&&e<t?ni(t-e,r)+n:n}function pa(n,t,r){return r||null==t?t=0:t&&(t=+t),Hl(Rc(n).replace(St,""),t||0)}function _a(n,t,r){return t=(r?Li(n,t,r):t===Y)?1:jc(t),tu(Rc(n),t)}function va(){var n=arguments,t=Rc(n[0]);return n.length<3?t:t.replace(n[1],n[2])}function ga(n,t,r){return r&&"number"!=typeof r&&Li(n,t,r)&&(t=r=Y),(r=r===Y?Wn:r>>>0)?(n=Rc(n),n&&("string"==typeof t||null!=t&&!xh(t))&&(t=pu(t),!t&&B(n))?Au(V(n),0,r):n.split(t,r)):[]}function ya(n,t,r){return n=Rc(n),r=null==r?0:$r(jc(r),0,n.length),t=pu(t),n.slice(r,r+t.length)==t}function da(n,t,r){var e=q.templateSettings;r&&Li(n,t,r)&&(t=Y),n=Rc(n),t=zh({},t,e,ci);var u,i,o=zh({},t.imports,e.imports,ci),f=Fc(o),c=z(o,f),a=0,l=t.interpolate||Kt,s="__p += '",h=al((t.escape||Kt).source+"|"+l.source+"|"+(l===At?$t:Kt).source+"|"+(t.evaluate||Kt).source+"|$","g"),p="//# sourceURL="+(yl.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nr+"]")+"\n";n.replace(h,function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(Vt,C),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t}),s+="';\n";var _=yl.call(t,"variable")&&t.variable;_||(s="with (obj) {\n"+s+"\n}\n"),s=(i?s.replace(vt,""):s).replace(gt,"$1").replace(yt,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var v=Yh(function(){return ol(f,p+"return "+s).apply(Y,c)});if(v.source=s,nc(v))throw v;return v}function ba(n){return Rc(n).toLowerCase()}function wa(n){return Rc(n).toUpperCase()}function ma(n,t,r){if(n=Rc(n),n&&(r||t===Y))return n.replace(Et,"");if(!n||!(t=pu(t)))return n;var e=V(n),u=V(t);return Au(e,S(e,u),W(e,u)+1).join("")}function xa(n,t,r){if(n=Rc(n),n&&(r||t===Y))return n.replace(Wt,"");if(!n||!(t=pu(t)))return n;var e=V(n);return Au(e,0,W(e,V(t))+1).join("")}function ja(n,t,r){if(n=Rc(n),n&&(r||t===Y))return n.replace(St,"");if(!n||!(t=pu(t)))return n;var e=V(n);return Au(e,S(e,V(t))).join("")}function Aa(n,t){var r=mn,e=xn;if(ic(t)){var u="separator"in t?t.separator:u;r="length"in t?jc(t.length):r,e="omission"in t?pu(t.omission):e}n=Rc(n);var i=n.length;if(B(n)){var o=V(n);i=o.length}if(r>=i)return n;var f=r-K(e);if(f<1)return e;var c=o?Au(o,0,f).join(""):n.slice(0,f);if(u===Y)return c+e;if(o&&(f+=c.length-f),xh(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=al(u.source,Rc(Dt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index;c=c.slice(0,s===Y?f:s)}}else if(n.indexOf(pu(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e}function ka(n){return n=Rc(n),n&&wt.test(n)?n.replace(dt,_e):n}function Oa(n,t,r){return n=Rc(n),t=r?Y:t,t===Y?T(n)?J(n):_(n):n.match(t)||[]}function Ia(t){var r=null==t?0:t.length,e=bi();return t=r?c(t,function(n){if("function"!=typeof n[1])throw new sl(tn);return[e(n[0]),n[1]]}):[],ru(function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e);}})}function Ra(n){return Mr(Dr(n,on))}function za(n){return function(){return n}}function Ea(n,t){return null==n||n!==n?t:n}function Sa(n){return n}function Wa(n){return Te("function"==typeof n?n:Dr(n,on))}function La(n){return Ne(Dr(n,on))}function Ca(n,t){return Pe(n,Dr(t,on))}function Ua(n,t,e){var u=Fc(t),i=se(t,u);null!=e||ic(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=se(t,Fc(t)));var o=!(ic(e)&&"chain"in e&&!e.chain),f=rc(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Uu(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function Ba(){return Xr._===this&&(Xr._=xl),this}function Ta(){}function $a(n){return n=jc(n),ru(function(t){return Ke(t,n)})}function Da(n){return Ci(n)?m(Qi(n)):Je(n)}function Ma(n){return function(t){return null==n?Y:ve(n,t)}}function Fa(){return[]}function Na(){return!1}function Pa(){return{};}function qa(){return""}function Za(){return!0}function Ka(n,t){if(n=jc(n),n<1||n>zn)return[];var r=Wn,e=Vl(n,Wn);t=bi(t),n-=Wn;for(var u=O(e,t);++r<n;)t(r);return u}function Va(n){return yh(n)?c(n,Qi):yc(n)?[n]:Uu(Ws(Rc(n)))}function Ga(n){var t=++dl;return Rc(n)+t}function Ha(n){return n&&n.length?Yr(n,Sa,be):Y}function Ja(n,t){return n&&n.length?Yr(n,bi(t,2),be):Y}function Ya(n){return w(n,Sa)}function Qa(n,t){return w(n,bi(t,2))}function Xa(n){return n&&n.length?Yr(n,Sa,Me):Y}function nl(n,t){return n&&n.length?Yr(n,bi(t,2),Me):Y}function tl(n){return n&&n.length?k(n,Sa):0}function rl(n,t){return n&&n.length?k(n,bi(t,2)):0}x=null==x?Xr:ge.defaults(Xr.Object(),x,ge.pick(Xr,Fr));var el=x.Array,ul=x.Date,il=x.Error,ol=x.Function,fl=x.Math,cl=x.Object,al=x.RegExp,ll=x.String,sl=x.TypeError,hl=el.prototype,pl=ol.prototype,_l=cl.prototype,vl=x["__core-js_shared__"],gl=pl.toString,yl=_l.hasOwnProperty,dl=0,bl=function(){var n=/[^.]+$/.exec(vl&&vl.keys&&vl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:"";}(),wl=_l.toString,ml=gl.call(cl),xl=Xr._,jl=al("^"+gl.call(yl).replace(Rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Al=re?x.Buffer:Y,kl=x.Symbol,Ol=x.Uint8Array,Il=Al?Al.allocUnsafe:Y,Rl=M(cl.getPrototypeOf,cl),zl=cl.create,El=_l.propertyIsEnumerable,Sl=hl.splice,Wl=kl?kl.isConcatSpreadable:Y,Ll=kl?kl.iterator:Y,Cl=kl?kl.toStringTag:Y,Ul=function(){try{var n=xi(cl,"defineProperty");return n({},"",{}),n}catch(n){}}(),Bl=x.clearTimeout!==Xr.clearTimeout&&x.clearTimeout,Tl=ul&&ul.now!==Xr.Date.now&&ul.now,$l=x.setTimeout!==Xr.setTimeout&&x.setTimeout,Dl=fl.ceil,Ml=fl.floor,Fl=cl.getOwnPropertySymbols,Nl=Al?Al.isBuffer:Y,Pl=x.isFinite,ql=hl.join,Zl=M(cl.keys,cl),Kl=fl.max,Vl=fl.min,Gl=ul.now,Hl=x.parseInt,Jl=fl.random,Yl=hl.reverse,Ql=xi(x,"DataView"),Xl=xi(x,"Map"),ns=xi(x,"Promise"),ts=xi(x,"Set"),rs=xi(x,"WeakMap"),es=xi(cl,"create"),us=rs&&new rs,is={},os=Xi(Ql),fs=Xi(Xl),cs=Xi(ns),as=Xi(ts),ls=Xi(rs),ss=kl?kl.prototype:Y,hs=ss?ss.valueOf:Y,ps=ss?ss.toString:Y,_s=function(){function n(){}return function(t){if(!ic(t))return{};if(zl)return zl(t);n.prototype=t;var r=new n;return n.prototype=Y,r}}();q.templateSettings={escape:xt,evaluate:jt,interpolate:At,variable:"",imports:{_:q}},q.prototype=G.prototype,q.prototype.constructor=q,H.prototype=_s(G.prototype),H.prototype.constructor=H,Bt.prototype=_s(G.prototype),Bt.prototype.constructor=Bt,Yt.prototype.clear=Qt,Yt.prototype.delete=Xt,Yt.prototype.get=nr,Yt.prototype.has=tr,Yt.prototype.set=rr,er.prototype.clear=ur,er.prototype.delete=ir,er.prototype.get=or,er.prototype.has=fr,er.prototype.set=cr,ar.prototype.clear=lr,ar.prototype.delete=sr,ar.prototype.get=hr,ar.prototype.has=pr,ar.prototype.set=_r,vr.prototype.add=vr.prototype.push=gr,vr.prototype.has=yr,dr.prototype.clear=br,dr.prototype.delete=wr,dr.prototype.get=mr,dr.prototype.has=xr,dr.prototype.set=jr;var vs=Fu(ee),gs=Fu(ue,!0),ys=Nu(),ds=Nu(!0),bs=us?function(n,t){return us.set(n,t),n}:Sa,ws=Ul?function(n,t){return Ul(n,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:Sa,ms=ru,xs=Bl||function(n){return Xr.clearTimeout(n)},js=ts&&1/N(new ts([,-0]))[1]==Rn?function(n){return new ts(n)}:Ta,As=us?function(n){return us.get(n)}:Ta,ks=Fl?function(n){return null==n?[]:(n=cl(n),i(Fl(n),function(t){return El.call(n,t)}))}:Fa,Os=Fl?function(n){for(var t=[];n;)a(t,ks(n)),n=Rl(n);return t}:Fa,Is=de;(Ql&&Is(new Ql(new ArrayBuffer(1)))!=it||Xl&&Is(new Xl)!=Zn||ns&&Is(ns.resolve())!=Hn||ts&&Is(new ts)!=Qn||rs&&Is(new rs)!=rt)&&(Is=function(n){var t=de(n),r=t==Gn?n.constructor:Y,e=r?Xi(r):"";if(e)switch(e){case os:return it;case fs:return Zn;case cs:return Hn;case as:return Qn;case ls:return rt}return t});var Rs=vl?rc:Na,zs=Ji(bs),Es=$l||function(n,t){return Xr.setTimeout(n,t)},Ss=Ji(ws),Ws=Fi(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(It,function(n,r,e,u){t.push(e?u.replace(Tt,"$1"):r||n)}),t}),Ls=ru(function(n,t){return Gf(n)?Vr(n,te(t,1,Gf,!0)):[]}),Cs=ru(function(n,t){var r=mo(t);return Gf(r)&&(r=Y),Gf(n)?Vr(n,te(t,1,Gf,!0),bi(r,2)):[]}),Us=ru(function(n,t){var r=mo(t);return Gf(r)&&(r=Y),Gf(n)?Vr(n,te(t,1,Gf,!0),Y,r):[]}),Bs=ru(function(n){var t=c(n,mu);return t.length&&t[0]===n[0]?je(t):[]}),Ts=ru(function(n){var t=mo(n),r=c(n,mu);return t===mo(r)?t=Y:r.pop(),r.length&&r[0]===n[0]?je(r,bi(t,2)):[]}),$s=ru(function(n){var t=mo(n),r=c(n,mu);return t="function"==typeof t?t:Y,t&&r.pop(),r.length&&r[0]===n[0]?je(r,Y,t):[]}),Ds=ru(Ao),Ms=_i(function(n,t){var r=null==n?0:n.length,e=Tr(n,t);return Qe(n,c(t,function(n){return Wi(n,r)?+n:n}).sort(Su)),e}),Fs=ru(function(n){return _u(te(n,1,Gf,!0))}),Ns=ru(function(n){var t=mo(n);return Gf(t)&&(t=Y),_u(te(n,1,Gf,!0),bi(t,2))}),Ps=ru(function(n){var t=mo(n);return t="function"==typeof t?t:Y,_u(te(n,1,Gf,!0),Y,t)}),qs=ru(function(n,t){return Gf(n)?Vr(n,t):[]}),Zs=ru(function(n){return bu(i(n,Gf))}),Ks=ru(function(n){var t=mo(n);return Gf(t)&&(t=Y),bu(i(n,Gf),bi(t,2))}),Vs=ru(function(n){var t=mo(n);return t="function"==typeof t?t:Y,bu(i(n,Gf),Y,t)}),Gs=ru(Ko),Hs=ru(function(n){var t=n.length,r=t>1?n[t-1]:Y;return r="function"==typeof r?(n.pop(),r):Y,Vo(n,r)}),Js=_i(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return Tr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof Bt&&Wi(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:Qo,args:[u],thisArg:Y}),new H(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(Y),n})):this.thru(u)}),Ys=Du(function(n,t,r){yl.call(n,r)?++n[r]:Cr(n,r,1)}),Qs=Gu(lo),Xs=Gu(so),nh=Du(function(n,t,r){yl.call(n,r)?n[r].push(t):Cr(n,r,[t])}),th=ru(function(t,r,e){var u=-1,i="function"==typeof r,o=Vf(t)?el(t.length):[];return vs(t,function(t){o[++u]=i?n(r,t,e):ke(t,r,e)}),o}),rh=Du(function(n,t,r){Cr(n,r,t)}),eh=Du(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),uh=ru(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Li(n,t[0],t[1])?t=[]:r>2&&Li(t[0],t[1],t[2])&&(t=[t[0]]),Ve(n,te(t,1),[])}),ih=Tl||function(){return Xr.Date.now()},oh=ru(function(n,t,r){var e=sn;if(r.length){var u=F(r,di(oh));e|=gn}return fi(n,e,t,r,u)}),fh=ru(function(n,t,r){var e=sn|hn;if(r.length){var u=F(r,di(fh));e|=gn;}return fi(t,e,n,r,u)}),ch=ru(function(n,t){return Kr(n,1,t)}),ah=ru(function(n,t,r){return Kr(n,kc(t)||0,r)});Wf.Cache=ar;var lh=ms(function(t,r){r=1==r.length&&yh(r[0])?c(r[0],R(bi())):c(te(r,1),R(bi()));var e=r.length;return ru(function(u){for(var i=-1,o=Vl(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);return n(t,this,u)})}),sh=ru(function(n,t){return fi(n,gn,Y,t,F(t,di(sh)))}),hh=ru(function(n,t){return fi(n,yn,Y,t,F(t,di(hh)))}),ph=_i(function(n,t){return fi(n,bn,Y,Y,Y,t)}),_h=ei(be),vh=ei(function(n,t){return n>=t}),gh=Oe(function(){return arguments}())?Oe:function(n){return oc(n)&&yl.call(n,"callee")&&!El.call(n,"callee")},yh=el.isArray,dh=ie?R(ie):Ie,bh=Nl||Na,wh=oe?R(oe):Re,mh=fe?R(fe):Se,xh=ce?R(ce):Ce,jh=ae?R(ae):Ue,Ah=le?R(le):Be,kh=ei(Me),Oh=ei(function(n,t){return n<=t}),Ih=Mu(function(n,t){if($i(t)||Vf(t))return Bu(t,Fc(t),n),Y;for(var r in t)yl.call(t,r)&&zr(n,r,t[r])}),Rh=Mu(function(n,t){Bu(t,Nc(t),n)}),zh=Mu(function(n,t,r,e){Bu(t,Nc(t),n,e)}),Eh=Mu(function(n,t,r,e){Bu(t,Fc(t),n,e);}),Sh=_i(Tr),Wh=ru(function(n,t){n=cl(n);var r=-1,e=t.length,u=e>2?t[2]:Y;for(u&&Li(t[0],t[1],u)&&(e=1);++r<e;)for(var i=t[r],o=Nc(i),f=-1,c=o.length;++f<c;){var a=o[f],l=n[a];(l===Y||Kf(l,_l[a])&&!yl.call(n,a))&&(n[a]=i[a])}return n}),Lh=ru(function(t){return t.push(Y,ai),n($h,Y,t)}),Ch=Yu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=wl.call(t)),n[t]=r},za(Sa)),Uh=Yu(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=wl.call(t)),yl.call(n,t)?n[t].push(r):n[t]=[r]},bi),Bh=ru(ke),Th=Mu(function(n,t,r){qe(n,t,r)}),$h=Mu(function(n,t,r,e){qe(n,t,r,e)}),Dh=_i(function(n,t){var r={};if(null==n)return r;var e=!1;t=c(t,function(t){return t=ju(t,n),e||(e=t.length>1),t}),Bu(n,gi(n),r),e&&(r=Dr(r,on|fn|cn,li));for(var u=t.length;u--;)vu(r,t[u]);return r}),Mh=_i(function(n,t){return null==n?{}:Ge(n,t)}),Fh=oi(Fc),Nh=oi(Nc),Ph=Zu(function(n,t,r){return t=t.toLowerCase(),n+(r?ia(t):t)}),qh=Zu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Zh=Zu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Kh=qu("toLowerCase"),Vh=Zu(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Gh=Zu(function(n,t,r){return n+(r?" ":"")+Jh(t)}),Hh=Zu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Jh=qu("toUpperCase"),Yh=ru(function(t,r){try{return n(t,Y,r)}catch(n){return nc(n)?n:new il(n)}}),Qh=_i(function(n,t){return r(t,function(t){t=Qi(t),Cr(n,t,oh(n[t],n))}),n}),Xh=Hu(),np=Hu(!0),tp=ru(function(n,t){return function(r){return ke(r,n,t)}}),rp=ru(function(n,t){return function(r){return ke(n,r,t)}}),ep=Xu(c),up=Xu(u),ip=Xu(h),op=ri(),fp=ri(!0),cp=Qu(function(n,t){return n+t},0),ap=ii("ceil"),lp=Qu(function(n,t){return n/t},1),sp=ii("floor"),hp=Qu(function(n,t){return n*t},1),pp=ii("round"),_p=Qu(function(n,t){return n-t},0);return q.after=kf,q.ary=Of,q.assign=Ih,q.assignIn=Rh,q.assignInWith=zh,q.assignWith=Eh,q.at=Sh,q.before=If,q.bind=oh,q.bindAll=Qh,q.bindKey=fh,q.castArray=Mf,q.chain=Jo,q.chunk=ro,q.compact=eo,q.concat=uo,q.cond=Ia,q.conforms=Ra,q.constant=za,q.countBy=Ys,q.create=zc,q.curry=Rf,q.curryRight=zf,q.debounce=Ef,q.defaults=Wh,q.defaultsDeep=Lh,q.defer=ch,q.delay=ah,q.difference=Ls,q.differenceBy=Cs,q.differenceWith=Us,q.drop=io,q.dropRight=oo,q.dropRightWhile=fo,q.dropWhile=co,q.fill=ao,q.filter=cf,q.flatMap=af,q.flatMapDeep=lf,q.flatMapDepth=sf,q.flatten=ho,q.flattenDeep=po,q.flattenDepth=_o,q.flip=Sf,q.flow=Xh,q.flowRight=np,q.fromPairs=vo,q.functions=Bc,q.functionsIn=Tc,q.groupBy=nh,q.initial=bo,q.intersection=Bs,q.intersectionBy=Ts,q.intersectionWith=$s,q.invert=Ch,q.invertBy=Uh,q.invokeMap=th,q.iteratee=Wa,q.keyBy=rh,q.keys=Fc,q.keysIn=Nc,q.map=vf,q.mapKeys=Pc,q.mapValues=qc,q.matches=La,q.matchesProperty=Ca,q.memoize=Wf,q.merge=Th,q.mergeWith=$h,q.method=tp,q.methodOf=rp,q.mixin=Ua,q.negate=Lf,q.nthArg=$a,q.omit=Dh,q.omitBy=Zc,q.once=Cf,q.orderBy=gf,q.over=ep,q.overArgs=lh,q.overEvery=up,q.overSome=ip,q.partial=sh,q.partialRight=hh,q.partition=eh,q.pick=Mh,q.pickBy=Kc,q.property=Da,q.propertyOf=Ma,q.pull=Ds,q.pullAll=Ao,q.pullAllBy=ko,q.pullAllWith=Oo,q.pullAt=Ms,q.range=op,q.rangeRight=fp,q.rearg=ph,q.reject=bf,q.remove=Io,q.rest=Uf,q.reverse=Ro,q.sampleSize=mf,q.set=Gc,q.setWith=Hc,q.shuffle=xf,q.slice=zo,q.sortBy=uh,q.sortedUniq=Bo,q.sortedUniqBy=To,q.split=ga,q.spread=Bf,q.tail=$o,q.take=Do,q.takeRight=Mo,q.takeRightWhile=Fo,q.takeWhile=No,q.tap=Yo,q.throttle=Tf,q.thru=Qo,q.toArray=mc,q.toPairs=Fh,q.toPairsIn=Nh,q.toPath=Va,q.toPlainObject=Oc,q.transform=Jc,q.unary=$f,q.union=Fs,q.unionBy=Ns,q.unionWith=Ps,q.uniq=Po,q.uniqBy=qo,q.uniqWith=Zo,q.unset=Yc,q.unzip=Ko,q.unzipWith=Vo,q.update=Qc,q.updateWith=Xc,q.values=na,q.valuesIn=ta,q.without=qs,q.words=Oa,q.wrap=Df,q.xor=Zs,q.xorBy=Ks,q.xorWith=Vs,q.zip=Gs,q.zipObject=Go,q.zipObjectDeep=Ho,q.zipWith=Hs,q.entries=Fh,q.entriesIn=Nh,q.extend=Rh,q.extendWith=zh,Ua(q,q),q.add=cp,q.attempt=Yh,q.camelCase=Ph,q.capitalize=ia,q.ceil=ap,q.clamp=ra,q.clone=Ff,q.cloneDeep=Pf,q.cloneDeepWith=qf,q.cloneWith=Nf,q.conformsTo=Zf,q.deburr=oa,q.defaultTo=Ea,q.divide=lp,q.endsWith=fa,q.eq=Kf,q.escape=ca,q.escapeRegExp=aa,q.every=ff,q.find=Qs,q.findIndex=lo,q.findKey=Ec,q.findLast=Xs,q.findLastIndex=so,q.findLastKey=Sc,q.floor=sp,q.forEach=hf,q.forEachRight=pf,q.forIn=Wc,q.forInRight=Lc,q.forOwn=Cc,q.forOwnRight=Uc,q.get=$c,q.gt=_h,q.gte=vh,q.has=Dc,q.hasIn=Mc,q.head=go,q.identity=Sa,q.includes=_f,q.indexOf=yo,q.inRange=ea,q.invoke=Bh,q.isArguments=gh,q.isArray=yh,q.isArrayBuffer=dh,q.isArrayLike=Vf,q.isArrayLikeObject=Gf,q.isBoolean=Hf,q.isBuffer=bh,q.isDate=wh,q.isElement=Jf,q.isEmpty=Yf,q.isEqual=Qf,q.isEqualWith=Xf,q.isError=nc,q.isFinite=tc,q.isFunction=rc,q.isInteger=ec,q.isLength=uc,q.isMap=mh,q.isMatch=fc,q.isMatchWith=cc,q.isNaN=ac,q.isNative=lc,q.isNil=hc,q.isNull=sc,q.isNumber=pc,q.isObject=ic,q.isObjectLike=oc,q.isPlainObject=_c,q.isRegExp=xh,q.isSafeInteger=vc,q.isSet=jh,q.isString=gc,q.isSymbol=yc,q.isTypedArray=Ah,q.isUndefined=dc,q.isWeakMap=bc,q.isWeakSet=wc,q.join=wo,q.kebabCase=qh,q.last=mo,q.lastIndexOf=xo,q.lowerCase=Zh,q.lowerFirst=Kh,q.lt=kh,q.lte=Oh,q.max=Ha,q.maxBy=Ja,q.mean=Ya,q.meanBy=Qa,q.min=Xa,q.minBy=nl,q.stubArray=Fa,q.stubFalse=Na,q.stubObject=Pa,q.stubString=qa,q.stubTrue=Za,q.multiply=hp,q.nth=jo,q.noConflict=Ba,q.noop=Ta,q.now=ih,q.pad=la,q.padEnd=sa,q.padStart=ha,q.parseInt=pa,q.random=ua,q.reduce=yf,q.reduceRight=df,q.repeat=_a,q.replace=va,q.result=Vc,q.round=pp,q.runInContext=p,q.sample=wf,q.size=jf,q.snakeCase=Vh,q.some=Af,q.sortedIndex=Eo,q.sortedIndexBy=So,q.sortedIndexOf=Wo,q.sortedLastIndex=Lo,q.sortedLastIndexBy=Co,q.sortedLastIndexOf=Uo,q.startCase=Gh,q.startsWith=ya,q.subtract=_p,q.sum=tl,q.sumBy=rl,q.template=da,q.times=Ka,q.toFinite=xc,q.toInteger=jc,q.toLength=Ac,q.toLower=ba,q.toNumber=kc,q.toSafeInteger=Ic,q.toString=Rc,q.toUpper=wa,q.trim=ma,q.trimEnd=xa,q.trimStart=ja,q.truncate=Aa,q.unescape=ka,q.uniqueId=Ga,q.upperCase=Hh,q.upperFirst=Jh,q.each=hf,q.eachRight=pf,q.first=go,Ua(q,function(){var n={};return ee(q,function(t,r){yl.call(q.prototype,r)||(n[r]=t)}),n}(),{chain:!1}),q.VERSION=Q,r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){q[n].placeholder=q}),r(["drop","take"],function(n,t){Bt.prototype[n]=function(r){r=r===Y?1:Kl(jc(r),0);var e=this.__filtered__&&!t?new Bt(this):this.clone();return e.__filtered__?e.__takeCount__=Vl(r,e.__takeCount__):e.__views__.push({size:Vl(r,Wn),type:n+(e.__dir__<0?"Right":"")}),e},Bt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==kn||r==In;Bt.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:bi(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Bt.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Bt.prototype[n]=function(){return this.__filtered__?new Bt(this):this[r](1)}}),Bt.prototype.compact=function(){return this.filter(Sa)},Bt.prototype.find=function(n){return this.filter(n).head()},Bt.prototype.findLast=function(n){return this.reverse().find(n)},Bt.prototype.invokeMap=ru(function(n,t){return"function"==typeof n?new Bt(this):this.map(function(r){return ke(r,n,t)})}),Bt.prototype.reject=function(n){return this.filter(Lf(bi(n)))},Bt.prototype.slice=function(n,t){n=jc(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Bt(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Y&&(t=jc(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},Bt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Bt.prototype.toArray=function(){return this.take(Wn)},ee(Bt.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=q[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(q.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof Bt,c=o[0],l=f||yh(t),s=function(n){var t=u.apply(q,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new Bt(this);var g=n.apply(t,o);return g.__actions__.push({func:Qo,args:[s],thisArg:Y}),new H(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){var t=hl[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);q.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(yh(u)?u:[],n)}return this[r](function(r){return t.apply(yh(r)?r:[],n)})}}),ee(Bt.prototype,function(n,t){var r=q[t];if(r){var e=r.name+"";yl.call(is,e)||(is[e]=[]),is[e].push({name:t,func:r})}}),is[Ju(Y,hn).name]=[{name:"wrapper",func:Y}],Bt.prototype.clone=Gt,Bt.prototype.reverse=Ht,Bt.prototype.value=Jt,q.prototype.at=Js,q.prototype.chain=Xo,q.prototype.commit=nf,q.prototype.next=tf,q.prototype.plant=ef,q.prototype.reverse=uf,q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=of,q.prototype.first=q.prototype.head,Ll&&(q.prototype[Ll]=rf),q},ge=ve();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Xr._=ge,define(function(){return ge})):te?((te.exports=ge)._=ge,ne._=ge):Xr._=ge}).call(this);
/*** @license* Lodash <https://lodash.com/>* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>* Released under MIT license <https://lodash.com/license>* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors*/;(function() {/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined;/** Used as the semantic version number. */var VERSION = '4.17.20';/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE = 200;/** Error message constants. */var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',FUNC_ERROR_TEXT = 'Expected a function';/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED = '__lodash_hash_undefined__';/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE = 500;/** Used as the internal argument placeholder. */var PLACEHOLDER = '__lodash_placeholder__';/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1,CLONE_FLAT_FLAG = 2,CLONE_SYMBOLS_FLAG = 4;/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_BOUND_FLAG = 4,WRAP_CURRY_FLAG = 8,WRAP_CURRY_RIGHT_FLAG = 16,WRAP_PARTIAL_FLAG = 32,WRAP_PARTIAL_RIGHT_FLAG = 64,WRAP_ARY_FLAG = 128,WRAP_REARG_FLAG = 256,WRAP_FLIP_FLAG = 512;/** Used as default options for `_.truncate`. */var DEFAULT_TRUNC_LENGTH = 30,DEFAULT_TRUNC_OMISSION = '...';/** Used to detect hot functions by number of calls within a span of milliseconds. */var HOT_COUNT = 800,HOT_SPAN = 16;/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG = 1,LAZY_MAP_FLAG = 2,LAZY_WHILE_FLAG = 3;/** Used as references for various `Number` constants. */var INFINITY = 1 / 0,MAX_SAFE_INTEGER = 9007199254740991,MAX_INTEGER = 1.7976931348623157e+308,NAN = 0 / 0;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295,MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;/** Used to associate wrap methods with their bit flags. */var wrapFlags = [['ary', WRAP_ARY_FLAG],['bind', WRAP_BIND_FLAG],['bindKey', WRAP_BIND_KEY_FLAG],['curry', WRAP_CURRY_FLAG],['curryRight', WRAP_CURRY_RIGHT_FLAG],['flip', WRAP_FLIP_FLAG],['partial', WRAP_PARTIAL_FLAG],['partialRight', WRAP_PARTIAL_RIGHT_FLAG],['rearg', WRAP_REARG_FLAG]];/** `Object#toString` result references. */var argsTag = '[object Arguments]',arrayTag = '[object Array]',asyncTag = '[object AsyncFunction]',boolTag = '[object Boolean]',dateTag = '[object Date]',domExcTag = '[object DOMException]',errorTag = '[object Error]',funcTag = '[object Function]',genTag = '[object GeneratorFunction]',mapTag = '[object Map]',numberTag = '[object Number]',nullTag = '[object Null]',objectTag = '[object Object]',promiseTag = '[object Promise]',proxyTag = '[object Proxy]',regexpTag = '[object RegExp]',setTag = '[object Set]',stringTag = '[object String]',symbolTag = '[object Symbol]',undefinedTag = '[object Undefined]',weakMapTag = '[object WeakMap]',weakSetTag = '[object WeakSet]';var arrayBufferTag = '[object ArrayBuffer]',dataViewTag = '[object DataView]',float32Tag = '[object Float32Array]',float64Tag = '[object Float64Array]',int8Tag = '[object Int8Array]',int16Tag = '[object Int16Array]',int32Tag = '[object Int32Array]',uint8Tag = '[object Uint8Array]',uint8ClampedTag = '[object Uint8ClampedArray]',uint16Tag = '[object Uint16Array]',uint32Tag = '[object Uint32Array]';/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading = /\b__p \+= '';/g,reEmptyStringMiddle = /\b(__p \+=) '' \+/g,reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;/** Used to match HTML entities and HTML characters. */var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml = /[&<>"']/g,reHasEscapedHtml = RegExp(reEscapedHtml.source),reHasUnescapedHtml = RegExp(reUnescapedHtml.source);/** Used to match template delimiters. */var reEscape = /<%-([\s\S]+?)%>/g,reEvaluate = /<%([\s\S]+?)%>/g,reInterpolate = /<%=([\s\S]+?)%>/g;/** Used to match property names within property paths. */var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp = /^\w*$/,rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/*** Used to match `RegExp`* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).*/var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,reHasRegExpChar = RegExp(reRegExpChar.source);/** Used to match leading and trailing whitespace. */var reTrim = /^\s+|\s+$/g,reTrimStart = /^\s+/,reTrimEnd = /\s+$/;/** Used to match wrap detail comments. */var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails = /,? & /;/** Used to match words composed of alphanumeric characters. */var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;/** Used to match backslashes in property paths. */var reEscapeChar = /\\(\\)?/g;/*** Used to match* [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).*/var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags = /\w*$/;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary = /^0b[01]+$/i;/** Used to detect host constructors (Safari). */var reIsHostCtor = /^\[object .+?Constructor\]$/;/** Used to detect octal string values. */var reIsOctal = /^0o[0-7]+$/i;/** Used to detect unsigned integer values. */var reIsUint = /^(?:0|[1-9]\d*)$/;/** Used to match Latin Unicode letters (excluding mathematical operators). */var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch = /($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString = /['\n\r\u2028\u2029\\]/g;/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff',rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,rsDingbatRange = '\\u2700-\\u27bf',rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',rsPunctuationRange = '\\u2000-\\u206f',rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',rsVarRange = '\\ufe0e\\ufe0f',rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;/** Used to compose unicode capture groups. */var rsApos = "['\u2019]",rsAstral = '[' + rsAstralRange + ']',rsBreak = '[' + rsBreakRange + ']',rsCombo = '[' + rsComboRange + ']',rsDigits = '\\d+',rsDingbat = '[' + rsDingbatRange + ']',rsLower = '[' + rsLowerRange + ']',rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',rsFitz = '\\ud83c[\\udffb-\\udfff]',rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',rsNonAstral = '[^' + rsAstralRange + ']',rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',rsUpper = '[' + rsUpperRange + ']',rsZWJ = '\\u200d';/** Used to compose unicode regexes. */var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',reOptMod = rsModifier + '?',rsOptVar = '[' + rsVarRange + ']?',rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',rsSeq = rsOptVar + reOptMod + rsOptJoin,rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';/** Used to match apostrophes. */var reApos = RegExp(rsApos, 'g');/*** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).*/var reComboMark = RegExp(rsCombo, 'g');/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');/** Used to match complex or compound words. */var reUnicodeWord = RegExp([rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,rsUpper + '+' + rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'), 'g');/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');/** Used to detect strings that need a more robust regexp to match words. */var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;/** Used to assign default `context` object properties. */var contextProps = ['Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array','Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object','Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array','Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap','_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'];/** Used to make template sourceURLs easier to identify. */var templateCounter = -1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags = {};typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =typedArrayTags[uint32Tag] = true;typedArrayTags[argsTag] = typedArrayTags[arrayTag] =typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =typedArrayTags[errorTag] = typedArrayTags[funcTag] =typedArrayTags[mapTag] = typedArrayTags[numberTag] =typedArrayTags[objectTag] = typedArrayTags[regexpTag] =typedArrayTags[setTag] = typedArrayTags[stringTag] =typedArrayTags[weakMapTag] = false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags = {};cloneableTags[argsTag] = cloneableTags[arrayTag] =cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =cloneableTags[boolTag] = cloneableTags[dateTag] =cloneableTags[float32Tag] = cloneableTags[float64Tag] =cloneableTags[int8Tag] = cloneableTags[int16Tag] =cloneableTags[int32Tag] = cloneableTags[mapTag] =cloneableTags[numberTag] = cloneableTags[objectTag] =cloneableTags[regexpTag] = cloneableTags[setTag] =cloneableTags[stringTag] = cloneableTags[symbolTag] =cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;cloneableTags[errorTag] = cloneableTags[funcTag] =cloneableTags[weakMapTag] = false;/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters = {// Latin-1 Supplement block.'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A','\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a','\xc7': 'C', '\xe7': 'c','\xd0': 'D', '\xf0': 'd','\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E','\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e','\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I','\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i','\xd1': 'N', '\xf1': 'n','\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O','\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o','\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U','\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u','\xdd': 'Y', '\xfd': 'y', '\xff': 'y','\xc6': 'Ae', '\xe6': 'ae','\xde': 'Th', '\xfe': 'th','\xdf': 'ss',// Latin Extended-A block.'\u0100': 'A', '\u0102': 'A', '\u0104': 'A','\u0101': 'a', '\u0103': 'a', '\u0105': 'a','\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C','\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c','\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd','\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E','\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e','\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G','\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g','\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h','\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I','\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i','\u0134': 'J', '\u0135': 'j','\u0136': 'K', '\u0137': 'k', '\u0138': 'k','\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L','\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l','\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N','\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n','\u014c': 'O', '\u014e': 'O', '\u0150': 'O','\u014d': 'o', '\u014f': 'o', '\u0151': 'o','\u0154': 'R', '\u0156': 'R', '\u0158': 'R','\u0155': 'r', '\u0157': 'r', '\u0159': 'r','\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S','\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's','\u0162': 'T', '\u0164': 'T', '\u0166': 'T','\u0163': 't', '\u0165': 't', '\u0167': 't','\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U','\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u','\u0174': 'W', '\u0175': 'w','\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y','\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z','\u017a': 'z', '\u017c': 'z', '\u017e': 'z','\u0132': 'IJ', '\u0133': 'ij','\u0152': 'Oe', '\u0153': 'oe','\u0149': "'n", '\u017f': 's'};/** Used to map characters to HTML entities. */var htmlEscapes = {'&': '&','<': '<','>': '>','"': '"',"'": '''};/** Used to map HTML entities to characters. */var htmlUnescapes = {'&': '&','<': '<','>': '>','"': '"',''': "'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes = {'\\': '\\',"'": "'",'\n': 'n','\r': 'r','\u2028': 'u2028','\u2029': 'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat = parseFloat,freeParseInt = parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;/** Detect free variable `self`. */var freeSelf = typeof self == 'object' && self && self.Object === Object && self;/** Used as a reference to the global object. */var root = freeGlobal || freeSelf || Function('return this')();/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports = freeModule && freeModule.exports === freeExports;/** Detect free variable `process` from Node.js. */var freeProcess = moduleExports && freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil = (function() {try {// Use `util.types` for Node.js 10+.var types = freeModule && freeModule.require && freeModule.require('util').types;if (types) {return types;}// Legacy `process.binding('util')` for Node.js < 10.return freeProcess && freeProcess.binding && freeProcess.binding('util');} catch (e) {}}());/* Node.js helper references. */var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,nodeIsDate = nodeUtil && nodeUtil.isDate,nodeIsMap = nodeUtil && nodeUtil.isMap,nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,nodeIsSet = nodeUtil && nodeUtil.isSet,nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;/*--------------------------------------------------------------------------*//*** A faster alternative to `Function#apply`, this function invokes `func`* with the `this` binding of `thisArg` and the arguments of `args`.** @private* @param {Function} func The function to invoke.* @param {*} thisArg The `this` binding of `func`.* @param {Array} args The arguments to invoke `func` with.* @returns {*} Returns the result of `func`.*/function apply(func, thisArg, args) {switch (args.length) {case 0: return func.call(thisArg);case 1: return func.call(thisArg, args[0]);case 2: return func.call(thisArg, args[0], args[1]);case 3: return func.call(thisArg, args[0], args[1], args[2]);}return func.apply(thisArg, args);}/*** A specialized version of `baseAggregator` for arrays.** @private* @param {Array} [array] The array to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform keys.* @param {Object} accumulator The initial aggregated object.* @returns {Function} Returns `accumulator`.*/function arrayAggregator(array, setter, iteratee, accumulator) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {var value = array[index];setter(accumulator, value, iteratee(value), array);}return accumulator;}/*** A specialized version of `_.forEach` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns `array`.*/function arrayEach(array, iteratee) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (iteratee(array[index], index, array) === false) {break;}}return array;}/*** A specialized version of `_.forEachRight` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns `array`.*/function arrayEachRight(array, iteratee) {var length = array == null ? 0 : array.length;while (length--) {if (iteratee(array[length], length, array) === false) {break;}}return array;}/*** A specialized version of `_.every` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`.*/function arrayEvery(array, predicate) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (!predicate(array[index], index, array)) {return false;}}return true;}/*** A specialized version of `_.filter` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {Array} Returns the new filtered array.*/function arrayFilter(array, predicate) {var index = -1,length = array == null ? 0 : array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (predicate(value, index, array)) {result[resIndex++] = value;}}return result;}/*** A specialized version of `_.includes` for arrays without support for* specifying an index to search from.** @private* @param {Array} [array] The array to inspect.* @param {*} target The value to search for.* @returns {boolean} Returns `true` if `target` is found, else `false`.*/function arrayIncludes(array, value) {var length = array == null ? 0 : array.length;return !!length && baseIndexOf(array, value, 0) > -1;}/*** This function is like `arrayIncludes` except that it accepts a comparator.** @private* @param {Array} [array] The array to inspect.* @param {*} target The value to search for.* @param {Function} comparator The comparator invoked per element.* @returns {boolean} Returns `true` if `target` is found, else `false`.*/function arrayIncludesWith(array, value, comparator) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (comparator(value, array[index])) {return true;}}return false;}/*** A specialized version of `_.map` for arrays without support for iteratee* shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function arrayMap(array, iteratee) {var index = -1,length = array == null ? 0 : array.length,result = Array(length);while (++index < length) {result[index] = iteratee(array[index], index, array);}return result;}/*** Appends the elements of `values` to `array`.** @private* @param {Array} array The array to modify.* @param {Array} values The values to append.* @returns {Array} Returns `array`.*/function arrayPush(array, values) {var index = -1,length = values.length,offset = array.length;while (++index < length) {array[offset + index] = values[index];}return array;}/*** A specialized version of `_.reduce` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} [accumulator] The initial value.* @param {boolean} [initAccum] Specify using the first element of `array` as* the initial value.* @returns {*} Returns the accumulated value.*/function arrayReduce(array, iteratee, accumulator, initAccum) {var index = -1,length = array == null ? 0 : array.length;if (initAccum && length) {accumulator = array[++index];}while (++index < length) {accumulator = iteratee(accumulator, array[index], index, array);}return accumulator;}/*** A specialized version of `_.reduceRight` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} [accumulator] The initial value.* @param {boolean} [initAccum] Specify using the last element of `array` as* the initial value.* @returns {*} Returns the accumulated value.*/function arrayReduceRight(array, iteratee, accumulator, initAccum) {var length = array == null ? 0 : array.length;if (initAccum && length) {accumulator = array[--length];}while (length--) {accumulator = iteratee(accumulator, array[length], length, array);}return accumulator;}/*** A specialized version of `_.some` for arrays without support for iteratee* shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.*/function arraySome(array, predicate) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (predicate(array[index], index, array)) {return true;}}return false;}/*** Gets the size of an ASCII `string`.** @private* @param {string} string The string inspect.* @returns {number} Returns the string size.*/var asciiSize = baseProperty('length');/*** Converts an ASCII `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function asciiToArray(string) {return string.split('');}/*** Splits an ASCII `string` into an array of its words.** @private* @param {string} The string to inspect.* @returns {Array} Returns the words of `string`.*/function asciiWords(string) {return string.match(reAsciiWord) || [];}/*** The base implementation of methods like `_.findKey` and `_.findLastKey`,* without support for iteratee shorthands, which iterates over `collection`* using `eachFunc`.** @private* @param {Array|Object} collection The collection to inspect.* @param {Function} predicate The function invoked per iteration.* @param {Function} eachFunc The function to iterate over `collection`.* @returns {*} Returns the found element or its key, else `undefined`.*/function baseFindKey(collection, predicate, eachFunc) {var result;eachFunc(collection, function(value, key, collection) {if (predicate(value, key, collection)) {result = key;return false;}});return result;}/*** The base implementation of `_.findIndex` and `_.findLastIndex` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} predicate The function invoked per iteration.* @param {number} fromIndex The index to search from.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseFindIndex(array, predicate, fromIndex, fromRight) {var length = array.length,index = fromIndex + (fromRight ? 1 : -1);while ((fromRight ? index-- : ++index < length)) {if (predicate(array[index], index, array)) {return index;}}return -1;}/*** The base implementation of `_.indexOf` without `fromIndex` bounds checks.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseIndexOf(array, value, fromIndex) {return value === value? strictIndexOf(array, value, fromIndex): baseFindIndex(array, baseIsNaN, fromIndex);}/*** This function is like `baseIndexOf` except that it accepts a comparator.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @param {Function} comparator The comparator invoked per element.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseIndexOfWith(array, value, fromIndex, comparator) {var index = fromIndex - 1,length = array.length;while (++index < length) {if (comparator(array[index], value)) {return index;}}return -1;}/*** The base implementation of `_.isNaN` without support for number objects.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.*/function baseIsNaN(value) {return value !== value;}/*** The base implementation of `_.mean` and `_.meanBy` without support for* iteratee shorthands.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {number} Returns the mean.*/function baseMean(array, iteratee) {var length = array == null ? 0 : array.length;return length ? (baseSum(array, iteratee) / length) : NAN;}/*** The base implementation of `_.property` without support for deep paths.** @private* @param {string} key The key of the property to get.* @returns {Function} Returns the new accessor function.*/function baseProperty(key) {return function(object) {return object == null ? undefined : object[key];};}/*** The base implementation of `_.propertyOf` without support for deep paths.** @private* @param {Object} object The object to query.* @returns {Function} Returns the new accessor function.*/function basePropertyOf(object) {return function(key) {return object == null ? undefined : object[key];};}/*** The base implementation of `_.reduce` and `_.reduceRight`, without support* for iteratee shorthands, which iterates over `collection` using `eachFunc`.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} accumulator The initial value.* @param {boolean} initAccum Specify using the first or last element of* `collection` as the initial value.* @param {Function} eachFunc The function to iterate over `collection`.* @returns {*} Returns the accumulated value.*/function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {eachFunc(collection, function(value, index, collection) {accumulator = initAccum? (initAccum = false, value): iteratee(accumulator, value, index, collection);});return accumulator;}/*** The base implementation of `_.sortBy` which uses `comparer` to define the* sort order of `array` and replaces criteria objects with their corresponding* values.** @private* @param {Array} array The array to sort.* @param {Function} comparer The function to define sort order.* @returns {Array} Returns `array`.*/function baseSortBy(array, comparer) {var length = array.length;array.sort(comparer);while (length--) {array[length] = array[length].value;}return array;}/*** The base implementation of `_.sum` and `_.sumBy` without support for* iteratee shorthands.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {number} Returns the sum.*/function baseSum(array, iteratee) {var result,index = -1,length = array.length;while (++index < length) {var current = iteratee(array[index]);if (current !== undefined) {result = result === undefined ? current : (result + current);}}return result;}/*** The base implementation of `_.times` without support for iteratee shorthands* or max array length checks.** @private* @param {number} n The number of times to invoke `iteratee`.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the array of results.*/function baseTimes(n, iteratee) {var index = -1,result = Array(n);while (++index < n) {result[index] = iteratee(index);}return result;}/*** The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array* of key-value pairs for `object` corresponding to the property names of `props`.** @private* @param {Object} object The object to query.* @param {Array} props The property names to get values for.* @returns {Object} Returns the key-value pairs.*/function baseToPairs(object, props) {return arrayMap(props, function(key) {return [key, object[key]];});}/*** The base implementation of `_.unary` without support for storing metadata.** @private* @param {Function} func The function to cap arguments for.* @returns {Function} Returns the new capped function.*/function baseUnary(func) {return function(value) {return func(value);};}/*** The base implementation of `_.values` and `_.valuesIn` which creates an* array of `object` property values corresponding to the property names* of `props`.** @private* @param {Object} object The object to query.* @param {Array} props The property names to get values for.* @returns {Object} Returns the array of property values.*/function baseValues(object, props) {return arrayMap(props, function(key) {return object[key];});}/*** Checks if a `cache` value for `key` exists.** @private* @param {Object} cache The cache to query.* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function cacheHas(cache, key) {return cache.has(key);}/*** Used by `_.trim` and `_.trimStart` to get the index of the first string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the first unmatched string symbol.*/function charsStartIndex(strSymbols, chrSymbols) {var index = -1,length = strSymbols.length;while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}/*** Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the last unmatched string symbol.*/function charsEndIndex(strSymbols, chrSymbols) {var index = strSymbols.length;while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}/*** Gets the number of `placeholder` occurrences in `array`.** @private* @param {Array} array The array to inspect.* @param {*} placeholder The placeholder to search for.* @returns {number} Returns the placeholder count.*/function countHolders(array, placeholder) {var length = array.length,result = 0;while (length--) {if (array[length] === placeholder) {++result;}}return result;}/*** Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A* letters to basic Latin letters.** @private* @param {string} letter The matched letter to deburr.* @returns {string} Returns the deburred letter.*/var deburrLetter = basePropertyOf(deburredLetters);/*** Used by `_.escape` to convert characters to HTML entities.** @private* @param {string} chr The matched character to escape.* @returns {string} Returns the escaped character.*/var escapeHtmlChar = basePropertyOf(htmlEscapes);/*** Used by `_.template` to escape characters for inclusion in compiled string literals.** @private* @param {string} chr The matched character to escape.* @returns {string} Returns the escaped character.*/function escapeStringChar(chr) {return '\\' + stringEscapes[chr];}/*** Gets the value at `key` of `object`.** @private* @param {Object} [object] The object to query.* @param {string} key The key of the property to get.* @returns {*} Returns the property value.*/function getValue(object, key) {return object == null ? undefined : object[key];}/*** Checks if `string` contains Unicode symbols.** @private* @param {string} string The string to inspect.* @returns {boolean} Returns `true` if a symbol is found, else `false`.*/function hasUnicode(string) {return reHasUnicode.test(string);}/*** Checks if `string` contains a word composed of Unicode symbols.** @private* @param {string} string The string to inspect.* @returns {boolean} Returns `true` if a word is found, else `false`.*/function hasUnicodeWord(string) {return reHasUnicodeWord.test(string);}/*** Converts `iterator` to an array.** @private* @param {Object} iterator The iterator to convert.* @returns {Array} Returns the converted array.*/function iteratorToArray(iterator) {var data,result = [];while (!(data = iterator.next()).done) {result.push(data.value);}return result;}/*** Converts `map` to its key-value pairs.** @private* @param {Object} map The map to convert.* @returns {Array} Returns the key-value pairs.*/function mapToArray(map) {var index = -1,result = Array(map.size);map.forEach(function(value, key) {result[++index] = [key, value];});return result;}/*** Creates a unary function that invokes `func` with its argument transformed.** @private* @param {Function} func The function to wrap.* @param {Function} transform The argument transform.* @returns {Function} Returns the new function.*/function overArg(func, transform) {return function(arg) {return func(transform(arg));};}/*** Replaces all `placeholder` elements in `array` with an internal placeholder* and returns an array of their indexes.** @private* @param {Array} array The array to modify.* @param {*} placeholder The placeholder to replace.* @returns {Array} Returns the new array of placeholder indexes.*/function replaceHolders(array, placeholder) {var index = -1,length = array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (value === placeholder || value === PLACEHOLDER) {array[index] = PLACEHOLDER;result[resIndex++] = index;}}return result;}/*** Converts `set` to an array of its values.** @private* @param {Object} set The set to convert.* @returns {Array} Returns the values.*/function setToArray(set) {var index = -1,result = Array(set.size);set.forEach(function(value) {result[++index] = value;});return result;}/*** Converts `set` to its value-value pairs.** @private* @param {Object} set The set to convert.* @returns {Array} Returns the value-value pairs.*/function setToPairs(set) {var index = -1,result = Array(set.size);set.forEach(function(value) {result[++index] = [value, value];});return result;}/*** A specialized version of `_.indexOf` which performs strict equality* comparisons of values, i.e. `===`.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function strictIndexOf(array, value, fromIndex) {var index = fromIndex - 1,length = array.length;while (++index < length) {if (array[index] === value) {return index;}}return -1;}/*** A specialized version of `_.lastIndexOf` which performs strict equality* comparisons of values, i.e. `===`.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function strictLastIndexOf(array, value, fromIndex) {var index = fromIndex + 1;while (index--) {if (array[index] === value) {return index;}}return index;}/*** Gets the number of symbols in `string`.** @private* @param {string} string The string to inspect.* @returns {number} Returns the string size.*/function stringSize(string) {return hasUnicode(string)? unicodeSize(string): asciiSize(string);}/*** Converts `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function stringToArray(string) {return hasUnicode(string)? unicodeToArray(string): asciiToArray(string);}/*** Used by `_.unescape` to convert HTML entities to characters.** @private* @param {string} chr The matched character to unescape.* @returns {string} Returns the unescaped character.*/var unescapeHtmlChar = basePropertyOf(htmlUnescapes);/*** Gets the size of a Unicode `string`.** @private* @param {string} string The string inspect.* @returns {number} Returns the string size.*/function unicodeSize(string) {var result = reUnicode.lastIndex = 0;while (reUnicode.test(string)) {++result;}return result;}/*** Converts a Unicode `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function unicodeToArray(string) {return string.match(reUnicode) || [];}/*** Splits a Unicode `string` into an array of its words.** @private* @param {string} The string to inspect.* @returns {Array} Returns the words of `string`.*/function unicodeWords(string) {return string.match(reUnicodeWord) || [];}/*--------------------------------------------------------------------------*//*** Create a new pristine `lodash` function using the `context` object.** @static* @memberOf _* @since 1.1.0* @category Util* @param {Object} [context=root] The context object.* @returns {Function} Returns a new `lodash` function.* @example** _.mixin({ 'foo': _.constant('foo') });** var lodash = _.runInContext();* lodash.mixin({ 'bar': lodash.constant('bar') });** _.isFunction(_.foo);* // => true* _.isFunction(_.bar);* // => false** lodash.isFunction(lodash.foo);* // => false* lodash.isFunction(lodash.bar);* // => true** // Create a suped-up `defer` in Node.js.* var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;*/var runInContext = (function runInContext(context) {context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));/** Built-in constructor references. */var Array = context.Array,Date = context.Date,Error = context.Error,Function = context.Function,Math = context.Math,Object = context.Object,RegExp = context.RegExp,String = context.String,TypeError = context.TypeError;/** Used for built-in method references. */var arrayProto = Array.prototype,funcProto = Function.prototype,objectProto = Object.prototype;/** Used to detect overreaching core-js shims. */var coreJsData = context['__core-js_shared__'];/** Used to resolve the decompiled source of functions. */var funcToString = funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/** Used to generate unique IDs. */var idCounter = 0;/** Used to detect methods masquerading as native. */var maskSrcKey = (function() {var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');return uid ? ('Symbol(src)_1.' + uid) : '';}());/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/** Used to infer the `Object` constructor. */var objectCtorString = funcToString.call(Object);/** Used to restore the original `_` reference in `_.noConflict`. */var oldDash = root._;/** Used to detect if a method is native. */var reIsNative = RegExp('^' +funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');/** Built-in value references. */var Buffer = moduleExports ? context.Buffer : undefined,Symbol = context.Symbol,Uint8Array = context.Uint8Array,allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,getPrototype = overArg(Object.getPrototypeOf, Object),objectCreate = Object.create,propertyIsEnumerable = objectProto.propertyIsEnumerable,splice = arrayProto.splice,spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,symIterator = Symbol ? Symbol.iterator : undefined,symToStringTag = Symbol ? Symbol.toStringTag : undefined;var defineProperty = (function() {try {var func = getNative(Object, 'defineProperty');func({}, '', {});return func;} catch (e) {}}());/** Mocked built-ins. */var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,ctxNow = Date && Date.now !== root.Date.now && Date.now,ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil,nativeFloor = Math.floor,nativeGetSymbols = Object.getOwnPropertySymbols,nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,nativeIsFinite = context.isFinite,nativeJoin = arrayProto.join,nativeKeys = overArg(Object.keys, Object),nativeMax = Math.max,nativeMin = Math.min,nativeNow = Date.now,nativeParseInt = context.parseInt,nativeRandom = Math.random,nativeReverse = arrayProto.reverse;/* Built-in method references that are verified to be native. */var DataView = getNative(context, 'DataView'),Map = getNative(context, 'Map'),Promise = getNative(context, 'Promise'),Set = getNative(context, 'Set'),WeakMap = getNative(context, 'WeakMap'),nativeCreate = getNative(Object, 'create');/** Used to store function metadata. */var metaMap = WeakMap && new WeakMap;/** Used to lookup unminified function names. */var realNames = {};/** Used to detect maps, sets, and weakmaps. */var dataViewCtorString = toSource(DataView),mapCtorString = toSource(Map),promiseCtorString = toSource(Promise),setCtorString = toSource(Set),weakMapCtorString = toSource(WeakMap);/** Used to convert symbols to primitives and strings. */var symbolProto = Symbol ? Symbol.prototype : undefined,symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,symbolToString = symbolProto ? symbolProto.toString : undefined;/*------------------------------------------------------------------------*//*** Creates a `lodash` object which wraps `value` to enable implicit method* chain sequences. Methods that operate on and return arrays, collections,* and functions can be chained together. Methods that retrieve a single value* or may return a primitive value will automatically end the chain sequence* and return the unwrapped value. Otherwise, the value must be unwrapped* with `_#value`.** Explicit chain sequences, which must be unwrapped with `_#value`, may be* enabled using `_.chain`.** The execution of chained methods is lazy, that is, it's deferred until* `_#value` is implicitly or explicitly called.** Lazy evaluation allows several methods to support shortcut fusion.* Shortcut fusion is an optimization to merge iteratee calls; this avoids* the creation of intermediate arrays and can greatly reduce the number of* iteratee executions. Sections of a chain sequence qualify for shortcut* fusion if the section is applied to an array and iteratees accept only* one argument. The heuristic for whether a section qualifies for shortcut* fusion is subject to change.** Chaining is supported in custom builds as long as the `_#value` method is* directly or indirectly included in the build.** In addition to lodash methods, wrappers have `Array` and `String` methods.** The wrapper `Array` methods are:* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`** The wrapper `String` methods are:* `replace` and `split`** The wrapper methods that support shortcut fusion are:* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`** The chainable wrapper methods are:* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,* `zipObject`, `zipObjectDeep`, and `zipWith`** The wrapper methods that are **not** chainable by default are:* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,* `upperFirst`, `value`, and `words`** @name _* @constructor* @category Seq* @param {*} value The value to wrap in a `lodash` instance.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** function square(n) {* return n * n;* }** var wrapped = _([1, 2, 3]);** // Returns an unwrapped value.* wrapped.reduce(_.add);* // => 6** // Returns a wrapped value.* var squares = wrapped.map(square);** _.isArray(squares);* // => false** _.isArray(squares.value());* // => true*/function lodash(value) {if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {if (value instanceof LodashWrapper) {return value;}if (hasOwnProperty.call(value, '__wrapped__')) {return wrapperClone(value);}}return new LodashWrapper(value);}/*** The base implementation of `_.create` without support for assigning* properties to the created object.** @private* @param {Object} proto The object to inherit from.* @returns {Object} Returns the new object.*/var baseCreate = (function() {function object() {}return function(proto) {if (!isObject(proto)) {return {};}if (objectCreate) {return objectCreate(proto);}object.prototype = proto;var result = new object;object.prototype = undefined;return result;};}());/*** The function whose prototype chain sequence wrappers inherit from.** @private*/function baseLodash() {// No operation performed.}/*** The base constructor for creating `lodash` wrapper objects.** @private* @param {*} value The value to wrap.* @param {boolean} [chainAll] Enable explicit method chain sequences.*/function LodashWrapper(value, chainAll) {this.__wrapped__ = value;this.__actions__ = [];this.__chain__ = !!chainAll;this.__index__ = 0;this.__values__ = undefined;}/*** By default, the template delimiters used by lodash are like those in* embedded Ruby (ERB) as well as ES2015 template strings. Change the* following template settings to use alternative delimiters.** @static* @memberOf _* @type {Object}*/lodash.templateSettings = {/*** Used to detect `data` property values to be HTML-escaped.** @memberOf _.templateSettings* @type {RegExp}*/'escape': reEscape,/*** Used to detect code to be evaluated.** @memberOf _.templateSettings* @type {RegExp}*/'evaluate': reEvaluate,/*** Used to detect `data` property values to inject.** @memberOf _.templateSettings* @type {RegExp}*/'interpolate': reInterpolate,/*** Used to reference the data object in the template text.** @memberOf _.templateSettings* @type {string}*/'variable': '',/*** Used to import variables into the compiled template.** @memberOf _.templateSettings* @type {Object}*/'imports': {/*** A reference to the `lodash` function.** @memberOf _.templateSettings.imports* @type {Function}*/'_': lodash}};// Ensure wrappers are instances of `baseLodash`.lodash.prototype = baseLodash.prototype;lodash.prototype.constructor = lodash;LodashWrapper.prototype = baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor = LodashWrapper;/*------------------------------------------------------------------------*//*** Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.** @private* @constructor* @param {*} value The value to wrap.*/function LazyWrapper(value) {this.__wrapped__ = value;this.__actions__ = [];this.__dir__ = 1;this.__filtered__ = false;this.__iteratees__ = [];this.__takeCount__ = MAX_ARRAY_LENGTH;this.__views__ = [];}/*** Creates a clone of the lazy wrapper object.** @private* @name clone* @memberOf LazyWrapper* @returns {Object} Returns the cloned `LazyWrapper` object.*/function lazyClone() {var result = new LazyWrapper(this.__wrapped__);result.__actions__ = copyArray(this.__actions__);result.__dir__ = this.__dir__;result.__filtered__ = this.__filtered__;result.__iteratees__ = copyArray(this.__iteratees__);result.__takeCount__ = this.__takeCount__;result.__views__ = copyArray(this.__views__);return result;}/*** Reverses the direction of lazy iteration.** @private* @name reverse* @memberOf LazyWrapper* @returns {Object} Returns the new reversed `LazyWrapper` object.*/function lazyReverse() {if (this.__filtered__) {var result = new LazyWrapper(this);result.__dir__ = -1;result.__filtered__ = true;} else {result = this.clone();result.__dir__ *= -1;}return result;}/*** Extracts the unwrapped value from its lazy wrapper.** @private* @name value* @memberOf LazyWrapper* @returns {*} Returns the unwrapped value.*/function lazyValue() {var array = this.__wrapped__.value(),dir = this.__dir__,isArr = isArray(array),isRight = dir < 0,arrLength = isArr ? array.length : 0,view = getView(0, arrLength, this.__views__),start = view.start,end = view.end,length = end - start,index = isRight ? end : (start - 1),iteratees = this.__iteratees__,iterLength = iteratees.length,resIndex = 0,takeCount = nativeMin(length, this.__takeCount__);if (!isArr || (!isRight && arrLength == length && takeCount == length)) {return baseWrapperValue(array, this.__actions__);}var result = [];outer:while (length-- && resIndex < takeCount) {index += dir;var iterIndex = -1,value = array[index];while (++iterIndex < iterLength) {var data = iteratees[iterIndex],iteratee = data.iteratee,type = data.type,computed = iteratee(value);if (type == LAZY_MAP_FLAG) {value = computed;} else if (!computed) {if (type == LAZY_FILTER_FLAG) {continue outer;} else {break outer;}}}result[resIndex++] = value;}return result;}// Ensure `LazyWrapper` is an instance of `baseLodash`.LazyWrapper.prototype = baseCreate(baseLodash.prototype);LazyWrapper.prototype.constructor = LazyWrapper;/*------------------------------------------------------------------------*//*** Creates a hash object.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function Hash(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}/*** Removes all key-value entries from the hash.** @private* @name clear* @memberOf Hash*/function hashClear() {this.__data__ = nativeCreate ? nativeCreate(null) : {};this.size = 0;}/*** Removes `key` and its value from the hash.** @private* @name delete* @memberOf Hash* @param {Object} hash The hash to modify.* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function hashDelete(key) {var result = this.has(key) && delete this.__data__[key];this.size -= result ? 1 : 0;return result;}/*** Gets the hash value for `key`.** @private* @name get* @memberOf Hash* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function hashGet(key) {var data = this.__data__;if (nativeCreate) {var result = data[key];return result === HASH_UNDEFINED ? undefined : result;}return hasOwnProperty.call(data, key) ? data[key] : undefined;}/*** Checks if a hash value for `key` exists.** @private* @name has* @memberOf Hash* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function hashHas(key) {var data = this.__data__;return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);}/*** Sets the hash `key` to `value`.** @private* @name set* @memberOf Hash* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the hash instance.*/function hashSet(key, value) {var data = this.__data__;this.size += this.has(key) ? 0 : 1;data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;return this;}// Add methods to `Hash`.Hash.prototype.clear = hashClear;Hash.prototype['delete'] = hashDelete;Hash.prototype.get = hashGet;Hash.prototype.has = hashHas;Hash.prototype.set = hashSet;/*------------------------------------------------------------------------*//*** Creates an list cache object.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function ListCache(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}/*** Removes all key-value entries from the list cache.** @private* @name clear* @memberOf ListCache*/function listCacheClear() {this.__data__ = [];this.size = 0;}/*** Removes `key` and its value from the list cache.** @private* @name delete* @memberOf ListCache* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function listCacheDelete(key) {var data = this.__data__,index = assocIndexOf(data, key);if (index < 0) {return false;}var lastIndex = data.length - 1;if (index == lastIndex) {data.pop();} else {splice.call(data, index, 1);}--this.size;return true;}/*** Gets the list cache value for `key`.** @private* @name get* @memberOf ListCache* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function listCacheGet(key) {var data = this.__data__,index = assocIndexOf(data, key);return index < 0 ? undefined : data[index][1];}/*** Checks if a list cache value for `key` exists.** @private* @name has* @memberOf ListCache* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function listCacheHas(key) {return assocIndexOf(this.__data__, key) > -1;}/*** Sets the list cache `key` to `value`.** @private* @name set* @memberOf ListCache* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the list cache instance.*/function listCacheSet(key, value) {var data = this.__data__,index = assocIndexOf(data, key);if (index < 0) {++this.size;data.push([key, value]);} else {data[index][1] = value;}return this;}// Add methods to `ListCache`.ListCache.prototype.clear = listCacheClear;ListCache.prototype['delete'] = listCacheDelete;ListCache.prototype.get = listCacheGet;ListCache.prototype.has = listCacheHas;ListCache.prototype.set = listCacheSet;/*------------------------------------------------------------------------*//*** Creates a map cache object to store key-value pairs.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function MapCache(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}/*** Removes all key-value entries from the map.** @private* @name clear* @memberOf MapCache*/function mapCacheClear() {this.size = 0;this.__data__ = {'hash': new Hash,'map': new (Map || ListCache),'string': new Hash};}/*** Removes `key` and its value from the map.** @private* @name delete* @memberOf MapCache* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function mapCacheDelete(key) {var result = getMapData(this, key)['delete'](key);this.size -= result ? 1 : 0;return result;}/*** Gets the map value for `key`.** @private* @name get* @memberOf MapCache* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function mapCacheGet(key) {return getMapData(this, key).get(key);}/*** Checks if a map value for `key` exists.** @private* @name has* @memberOf MapCache* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function mapCacheHas(key) {return getMapData(this, key).has(key);}/*** Sets the map `key` to `value`.** @private* @name set* @memberOf MapCache* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the map cache instance.*/function mapCacheSet(key, value) {var data = getMapData(this, key),size = data.size;data.set(key, value);this.size += data.size == size ? 0 : 1;return this;}// Add methods to `MapCache`.MapCache.prototype.clear = mapCacheClear;MapCache.prototype['delete'] = mapCacheDelete;MapCache.prototype.get = mapCacheGet;MapCache.prototype.has = mapCacheHas;MapCache.prototype.set = mapCacheSet;/*------------------------------------------------------------------------*//**** Creates an array cache object to store unique values.** @private* @constructor* @param {Array} [values] The values to cache.*/function SetCache(values) {var index = -1,length = values == null ? 0 : values.length;this.__data__ = new MapCache;while (++index < length) {this.add(values[index]);}}/*** Adds `value` to the array cache.** @private* @name add* @memberOf SetCache* @alias push* @param {*} value The value to cache.* @returns {Object} Returns the cache instance.*/function setCacheAdd(value) {this.__data__.set(value, HASH_UNDEFINED);return this;}/*** Checks if `value` is in the array cache.** @private* @name has* @memberOf SetCache* @param {*} value The value to search for.* @returns {number} Returns `true` if `value` is found, else `false`.*/function setCacheHas(value) {return this.__data__.has(value);}// Add methods to `SetCache`.SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;SetCache.prototype.has = setCacheHas;/*------------------------------------------------------------------------*//*** Creates a stack cache object to store key-value pairs.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function Stack(entries) {var data = this.__data__ = new ListCache(entries);this.size = data.size;}/*** Removes all key-value entries from the stack.** @private* @name clear* @memberOf Stack*/function stackClear() {this.__data__ = new ListCache;this.size = 0;}/*** Removes `key` and its value from the stack.** @private* @name delete* @memberOf Stack* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function stackDelete(key) {var data = this.__data__,result = data['delete'](key);this.size = data.size;return result;}/*** Gets the stack value for `key`.** @private* @name get* @memberOf Stack* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function stackGet(key) {return this.__data__.get(key);}/*** Checks if a stack value for `key` exists.** @private* @name has* @memberOf Stack* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function stackHas(key) {return this.__data__.has(key);}/*** Sets the stack `key` to `value`.** @private* @name set* @memberOf Stack* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the stack cache instance.*/function stackSet(key, value) {var data = this.__data__;if (data instanceof ListCache) {var pairs = data.__data__;if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {pairs.push([key, value]);this.size = ++data.size;return this;}data = this.__data__ = new MapCache(pairs);}data.set(key, value);this.size = data.size;return this;}// Add methods to `Stack`.Stack.prototype.clear = stackClear;Stack.prototype['delete'] = stackDelete;Stack.prototype.get = stackGet;Stack.prototype.has = stackHas;Stack.prototype.set = stackSet;/*------------------------------------------------------------------------*//*** Creates an array of the enumerable property names of the array-like `value`.** @private* @param {*} value The value to query.* @param {boolean} inherited Specify returning inherited property names.* @returns {Array} Returns the array of property names.*/function arrayLikeKeys(value, inherited) {var isArr = isArray(value),isArg = !isArr && isArguments(value),isBuff = !isArr && !isArg && isBuffer(value),isType = !isArr && !isArg && !isBuff && isTypedArray(value),skipIndexes = isArr || isArg || isBuff || isType,result = skipIndexes ? baseTimes(value.length, String) : [],length = result.length;for (var key in value) {if ((inherited || hasOwnProperty.call(value, key)) &&!(skipIndexes && (// Safari 9 has enumerable `arguments.length` in strict mode.key == 'length' ||// Node.js 0.10 has enumerable non-index properties on buffers.(isBuff && (key == 'offset' || key == 'parent')) ||// PhantomJS 2 has enumerable non-index properties on typed arrays.(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||// Skip index properties.isIndex(key, length)))) {result.push(key);}}return result;}/*** A specialized version of `_.sample` for arrays.** @private* @param {Array} array The array to sample.* @returns {*} Returns the random element.*/function arraySample(array) {var length = array.length;return length ? array[baseRandom(0, length - 1)] : undefined;}/*** A specialized version of `_.sampleSize` for arrays.** @private* @param {Array} array The array to sample.* @param {number} n The number of elements to sample.* @returns {Array} Returns the random elements.*/function arraySampleSize(array, n) {return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));}/*** A specialized version of `_.shuffle` for arrays.** @private* @param {Array} array The array to shuffle.* @returns {Array} Returns the new shuffled array.*/function arrayShuffle(array) {return shuffleSelf(copyArray(array));}/*** This function is like `assignValue` except that it doesn't assign* `undefined` values.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function assignMergeValue(object, key, value) {if ((value !== undefined && !eq(object[key], value)) ||(value === undefined && !(key in object))) {baseAssignValue(object, key, value);}}/*** Assigns `value` to `key` of `object` if the existing value is not equivalent* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function assignValue(object, key, value) {var objValue = object[key];if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||(value === undefined && !(key in object))) {baseAssignValue(object, key, value);}}/*** Gets the index at which the `key` is found in `array` of key-value pairs.** @private* @param {Array} array The array to inspect.* @param {*} key The key to search for.* @returns {number} Returns the index of the matched value, else `-1`.*/function assocIndexOf(array, key) {var length = array.length;while (length--) {if (eq(array[length][0], key)) {return length;}}return -1;}/*** Aggregates elements of `collection` on `accumulator` with keys transformed* by `iteratee` and values set by `setter`.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform keys.* @param {Object} accumulator The initial aggregated object.* @returns {Function} Returns `accumulator`.*/function baseAggregator(collection, setter, iteratee, accumulator) {baseEach(collection, function(value, key, collection) {setter(accumulator, value, iteratee(value), collection);});return accumulator;}/*** The base implementation of `_.assign` without support for multiple sources* or `customizer` functions.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @returns {Object} Returns `object`.*/function baseAssign(object, source) {return object && copyObject(source, keys(source), object);}/*** The base implementation of `_.assignIn` without support for multiple sources* or `customizer` functions.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @returns {Object} Returns `object`.*/function baseAssignIn(object, source) {return object && copyObject(source, keysIn(source), object);}/*** The base implementation of `assignValue` and `assignMergeValue` without* value checks.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function baseAssignValue(object, key, value) {if (key == '__proto__' && defineProperty) {defineProperty(object, key, {'configurable': true,'enumerable': true,'value': value,'writable': true});} else {object[key] = value;}}/*** The base implementation of `_.at` without support for individual paths.** @private* @param {Object} object The object to iterate over.* @param {string[]} paths The property paths to pick.* @returns {Array} Returns the picked elements.*/function baseAt(object, paths) {var index = -1,length = paths.length,result = Array(length),skip = object == null;while (++index < length) {result[index] = skip ? undefined : get(object, paths[index]);}return result;}/*** The base implementation of `_.clamp` which doesn't coerce arguments.** @private* @param {number} number The number to clamp.* @param {number} [lower] The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the clamped number.*/function baseClamp(number, lower, upper) {if (number === number) {if (upper !== undefined) {number = number <= upper ? number : upper;}if (lower !== undefined) {number = number >= lower ? number : lower;}}return number;}/*** The base implementation of `_.clone` and `_.cloneDeep` which tracks* traversed objects.** @private* @param {*} value The value to clone.* @param {boolean} bitmask The bitmask flags.* 1 - Deep clone* 2 - Flatten inherited properties* 4 - Clone symbols* @param {Function} [customizer] The function to customize cloning.* @param {string} [key] The key of `value`.* @param {Object} [object] The parent object of `value`.* @param {Object} [stack] Tracks traversed objects and their clone counterparts.* @returns {*} Returns the cloned value.*/function baseClone(value, bitmask, customizer, key, object, stack) {var result,isDeep = bitmask & CLONE_DEEP_FLAG,isFlat = bitmask & CLONE_FLAT_FLAG,isFull = bitmask & CLONE_SYMBOLS_FLAG;if (customizer) {result = object ? customizer(value, key, object, stack) : customizer(value);}if (result !== undefined) {return result;}if (!isObject(value)) {return value;}var isArr = isArray(value);if (isArr) {result = initCloneArray(value);if (!isDeep) {return copyArray(value, result);}} else {var tag = getTag(value),isFunc = tag == funcTag || tag == genTag;if (isBuffer(value)) {return cloneBuffer(value, isDeep);}if (tag == objectTag || tag == argsTag || (isFunc && !object)) {result = (isFlat || isFunc) ? {} : initCloneObject(value);if (!isDeep) {return isFlat? copySymbolsIn(value, baseAssignIn(result, value)): copySymbols(value, baseAssign(result, value));}} else {if (!cloneableTags[tag]) {return object ? value : {};}result = initCloneByTag(value, tag, isDeep);}}// Check for circular references and return its corresponding clone.stack || (stack = new Stack);var stacked = stack.get(value);if (stacked) {return stacked;}stack.set(value, result);if (isSet(value)) {value.forEach(function(subValue) {result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));});} else if (isMap(value)) {value.forEach(function(subValue, key) {result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));});}var keysFunc = isFull? (isFlat ? getAllKeysIn : getAllKeys): (isFlat ? keysIn : keys);var props = isArr ? undefined : keysFunc(value);arrayEach(props || value, function(subValue, key) {if (props) {key = subValue;subValue = value[key];}// Recursively populate clone (susceptible to call stack limits).assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));});return result;}/*** The base implementation of `_.conforms` which doesn't clone `source`.** @private* @param {Object} source The object of property predicates to conform to.* @returns {Function} Returns the new spec function.*/function baseConforms(source) {var props = keys(source);return function(object) {return baseConformsTo(object, source, props);};}/*** The base implementation of `_.conformsTo` which accepts `props` to check.** @private* @param {Object} object The object to inspect.* @param {Object} source The object of property predicates to conform to.* @returns {boolean} Returns `true` if `object` conforms, else `false`.*/function baseConformsTo(object, source, props) {var length = props.length;if (object == null) {return !length;}object = Object(object);while (length--) {var key = props[length],predicate = source[key],value = object[key];if ((value === undefined && !(key in object)) || !predicate(value)) {return false;}}return true;}/*** The base implementation of `_.delay` and `_.defer` which accepts `args`* to provide to `func`.** @private* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {Array} args The arguments to provide to `func`.* @returns {number|Object} Returns the timer id or timeout object.*/function baseDelay(func, wait, args) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function() { func.apply(undefined, args); }, wait);}/*** The base implementation of methods like `_.difference` without support* for excluding multiple arrays or iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Array} values The values to exclude.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.*/function baseDifference(array, values, iteratee, comparator) {var index = -1,includes = arrayIncludes,isCommon = true,length = array.length,result = [],valuesLength = values.length;if (!length) {return result;}if (iteratee) {values = arrayMap(values, baseUnary(iteratee));}if (comparator) {includes = arrayIncludesWith;isCommon = false;}else if (values.length >= LARGE_ARRAY_SIZE) {includes = cacheHas;isCommon = false;values = new SetCache(values);}outer:while (++index < length) {var value = array[index],computed = iteratee == null ? value : iteratee(value);value = (comparator || value !== 0) ? value : 0;if (isCommon && computed === computed) {var valuesIndex = valuesLength;while (valuesIndex--) {if (values[valuesIndex] === computed) {continue outer;}}result.push(value);}else if (!includes(values, computed, comparator)) {result.push(value);}}return result;}/*** The base implementation of `_.forEach` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array|Object} Returns `collection`.*/var baseEach = createBaseEach(baseForOwn);/*** The base implementation of `_.forEachRight` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array|Object} Returns `collection`.*/var baseEachRight = createBaseEach(baseForOwnRight, true);/*** The base implementation of `_.every` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`*/function baseEvery(collection, predicate) {var result = true;baseEach(collection, function(value, index, collection) {result = !!predicate(value, index, collection);return result;});return result;}/*** The base implementation of methods like `_.max` and `_.min` which accepts a* `comparator` to determine the extremum value.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The iteratee invoked per iteration.* @param {Function} comparator The comparator used to compare values.* @returns {*} Returns the extremum value.*/function baseExtremum(array, iteratee, comparator) {var index = -1,length = array.length;while (++index < length) {var value = array[index],current = iteratee(value);if (current != null && (computed === undefined? (current === current && !isSymbol(current)): comparator(current, computed))) {var computed = current,result = value;}}return result;}/*** The base implementation of `_.fill` without an iteratee call guard.** @private* @param {Array} array The array to fill.* @param {*} value The value to fill `array` with.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns `array`.*/function baseFill(array, value, start, end) {var length = array.length;start = toInteger(start);if (start < 0) {start = -start > length ? 0 : (length + start);}end = (end === undefined || end > length) ? length : toInteger(end);if (end < 0) {end += length;}end = start > end ? 0 : toLength(end);while (start < end) {array[start++] = value;}return array;}/*** The base implementation of `_.filter` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {Array} Returns the new filtered array.*/function baseFilter(collection, predicate) {var result = [];baseEach(collection, function(value, index, collection) {if (predicate(value, index, collection)) {result.push(value);}});return result;}/*** The base implementation of `_.flatten` with support for restricting flattening.** @private* @param {Array} array The array to flatten.* @param {number} depth The maximum recursion depth.* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.* @param {Array} [result=[]] The initial result value.* @returns {Array} Returns the new flattened array.*/function baseFlatten(array, depth, predicate, isStrict, result) {var index = -1,length = array.length;predicate || (predicate = isFlattenable);result || (result = []);while (++index < length) {var value = array[index];if (depth > 0 && predicate(value)) {if (depth > 1) {// Recursively flatten arrays (susceptible to call stack limits).baseFlatten(value, depth - 1, predicate, isStrict, result);} else {arrayPush(result, value);}} else if (!isStrict) {result[result.length] = value;}}return result;}/*** The base implementation of `baseForOwn` which iterates over `object`* properties returned by `keysFunc` and invokes `iteratee` for each property.* Iteratee functions may exit iteration early by explicitly returning `false`.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseFor = createBaseFor();/*** This function is like `baseFor` except that it iterates over properties* in the opposite order.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseForRight = createBaseFor(true);/*** The base implementation of `_.forOwn` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwn(object, iteratee) {return object && baseFor(object, iteratee, keys);}/*** The base implementation of `_.forOwnRight` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwnRight(object, iteratee) {return object && baseForRight(object, iteratee, keys);}/*** The base implementation of `_.functions` which creates an array of* `object` function property names filtered from `props`.** @private* @param {Object} object The object to inspect.* @param {Array} props The property names to filter.* @returns {Array} Returns the function names.*/function baseFunctions(object, props) {return arrayFilter(props, function(key) {return isFunction(object[key]);});}/*** The base implementation of `_.get` without support for default values.** @private* @param {Object} object The object to query.* @param {Array|string} path The path of the property to get.* @returns {*} Returns the resolved value.*/function baseGet(object, path) {path = castPath(path, object);var index = 0,length = path.length;while (object != null && index < length) {object = object[toKey(path[index++])];}return (index && index == length) ? object : undefined;}/*** The base implementation of `getAllKeys` and `getAllKeysIn` which uses* `keysFunc` and `symbolsFunc` to get the enumerable property names and* symbols of `object`.** @private* @param {Object} object The object to query.* @param {Function} keysFunc The function to get the keys of `object`.* @param {Function} symbolsFunc The function to get the symbols of `object`.* @returns {Array} Returns the array of property names and symbols.*/function baseGetAllKeys(object, keysFunc, symbolsFunc) {var result = keysFunc(object);return isArray(object) ? result : arrayPush(result, symbolsFunc(object));}/*** The base implementation of `getTag` without fallbacks for buggy environments.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/function baseGetTag(value) {if (value == null) {return value === undefined ? undefinedTag : nullTag;}return (symToStringTag && symToStringTag in Object(value))? getRawTag(value): objectToString(value);}/*** The base implementation of `_.gt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than `other`,* else `false`.*/function baseGt(value, other) {return value > other;}/*** The base implementation of `_.has` without support for deep paths.** @private* @param {Object} [object] The object to query.* @param {Array|string} key The key to check.* @returns {boolean} Returns `true` if `key` exists, else `false`.*/function baseHas(object, key) {return object != null && hasOwnProperty.call(object, key);}/*** The base implementation of `_.hasIn` without support for deep paths.** @private* @param {Object} [object] The object to query.* @param {Array|string} key The key to check.* @returns {boolean} Returns `true` if `key` exists, else `false`.*/function baseHasIn(object, key) {return object != null && key in Object(object);}/*** The base implementation of `_.inRange` which doesn't coerce arguments.** @private* @param {number} number The number to check.* @param {number} start The start of the range.* @param {number} end The end of the range.* @returns {boolean} Returns `true` if `number` is in the range, else `false`.*/function baseInRange(number, start, end) {return number >= nativeMin(start, end) && number < nativeMax(start, end);}/*** The base implementation of methods like `_.intersection`, without support* for iteratee shorthands, that accepts an array of arrays to inspect.** @private* @param {Array} arrays The arrays to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of shared values.*/function baseIntersection(arrays, iteratee, comparator) {var includes = comparator ? arrayIncludesWith : arrayIncludes,length = arrays[0].length,othLength = arrays.length,othIndex = othLength,caches = Array(othLength),maxLength = Infinity,result = [];while (othIndex--) {var array = arrays[othIndex];if (othIndex && iteratee) {array = arrayMap(array, baseUnary(iteratee));}maxLength = nativeMin(array.length, maxLength);caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))? new SetCache(othIndex && array): undefined;}array = arrays[0];var index = -1,seen = caches[0];outer:while (++index < length && result.length < maxLength) {var value = array[index],computed = iteratee ? iteratee(value) : value;value = (comparator || value !== 0) ? value : 0;if (!(seen? cacheHas(seen, computed): includes(result, computed, comparator))) {othIndex = othLength;while (--othIndex) {var cache = caches[othIndex];if (!(cache? cacheHas(cache, computed): includes(arrays[othIndex], computed, comparator))) {continue outer;}}if (seen) {seen.push(computed);}result.push(value);}}return result;}/*** The base implementation of `_.invert` and `_.invertBy` which inverts* `object` with values transformed by `iteratee` and set by `setter`.** @private* @param {Object} object The object to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform values.* @param {Object} accumulator The initial inverted object.* @returns {Function} Returns `accumulator`.*/function baseInverter(object, setter, iteratee, accumulator) {baseForOwn(object, function(value, key, object) {setter(accumulator, iteratee(value), key, object);});return accumulator;}/*** The base implementation of `_.invoke` without support for individual* method arguments.** @private* @param {Object} object The object to query.* @param {Array|string} path The path of the method to invoke.* @param {Array} args The arguments to invoke the method with.* @returns {*} Returns the result of the invoked method.*/function baseInvoke(object, path, args) {path = castPath(path, object);object = parent(object, path);var func = object == null ? object : object[toKey(last(path))];return func == null ? undefined : apply(func, object, args);}/*** The base implementation of `_.isArguments`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,*/function baseIsArguments(value) {return isObjectLike(value) && baseGetTag(value) == argsTag;}/*** The base implementation of `_.isArrayBuffer` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.*/function baseIsArrayBuffer(value) {return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;}/*** The base implementation of `_.isDate` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.*/function baseIsDate(value) {return isObjectLike(value) && baseGetTag(value) == dateTag;}/*** The base implementation of `_.isEqual` which supports partial comparisons* and tracks traversed objects.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @param {boolean} bitmask The bitmask flags.* 1 - Unordered comparison* 2 - Partial comparison* @param {Function} [customizer] The function to customize comparisons.* @param {Object} [stack] Tracks traversed `value` and `other` objects.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.*/function baseIsEqual(value, other, bitmask, customizer, stack) {if (value === other) {return true;}if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {return value !== value && other !== other;}return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);}/*** A specialized version of `baseIsEqual` for arrays and objects which performs* deep comparisons and tracks traversed objects enabling objects with circular* references to be compared.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} [stack] Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {var objIsArr = isArray(object),othIsArr = isArray(other),objTag = objIsArr ? arrayTag : getTag(object),othTag = othIsArr ? arrayTag : getTag(other);objTag = objTag == argsTag ? objectTag : objTag;othTag = othTag == argsTag ? objectTag : othTag;var objIsObj = objTag == objectTag,othIsObj = othTag == objectTag,isSameTag = objTag == othTag;if (isSameTag && isBuffer(object)) {if (!isBuffer(other)) {return false;}objIsArr = true;objIsObj = false;}if (isSameTag && !objIsObj) {stack || (stack = new Stack);return (objIsArr || isTypedArray(object))? equalArrays(object, other, bitmask, customizer, equalFunc, stack): equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);}if (!(bitmask & COMPARE_PARTIAL_FLAG)) {var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');if (objIsWrapped || othIsWrapped) {var objUnwrapped = objIsWrapped ? object.value() : object,othUnwrapped = othIsWrapped ? other.value() : other;stack || (stack = new Stack);return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);}}if (!isSameTag) {return false;}stack || (stack = new Stack);return equalObjects(object, other, bitmask, customizer, equalFunc, stack);}/*** The base implementation of `_.isMap` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a map, else `false`.*/function baseIsMap(value) {return isObjectLike(value) && getTag(value) == mapTag;}/*** The base implementation of `_.isMatch` without support for iteratee shorthands.** @private* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @param {Array} matchData The property names, values, and compare flags to match.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if `object` is a match, else `false`.*/function baseIsMatch(object, source, matchData, customizer) {var index = matchData.length,length = index,noCustomizer = !customizer;if (object == null) {return !length;}object = Object(object);while (index--) {var data = matchData[index];if ((noCustomizer && data[2])? data[1] !== object[data[0]]: !(data[0] in object)) {return false;}}while (++index < length) {data = matchData[index];var key = data[0],objValue = object[key],srcValue = data[1];if (noCustomizer && data[2]) {if (objValue === undefined && !(key in object)) {return false;}} else {var stack = new Stack;if (customizer) {var result = customizer(objValue, srcValue, key, object, source, stack);}if (!(result === undefined? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack): result)) {return false;}}}return true;}/*** The base implementation of `_.isNative` without bad shim checks.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a native function,* else `false`.*/function baseIsNative(value) {if (!isObject(value) || isMasked(value)) {return false;}var pattern = isFunction(value) ? reIsNative : reIsHostCtor;return pattern.test(toSource(value));}/*** The base implementation of `_.isRegExp` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.*/function baseIsRegExp(value) {return isObjectLike(value) && baseGetTag(value) == regexpTag;}/*** The base implementation of `_.isSet` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a set, else `false`.*/function baseIsSet(value) {return isObjectLike(value) && getTag(value) == setTag;}/*** The base implementation of `_.isTypedArray` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.*/function baseIsTypedArray(value) {return isObjectLike(value) &&isLength(value.length) && !!typedArrayTags[baseGetTag(value)];}/*** The base implementation of `_.iteratee`.** @private* @param {*} [value=_.identity] The value to convert to an iteratee.* @returns {Function} Returns the iteratee.*/function baseIteratee(value) {// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.if (typeof value == 'function') {return value;}if (value == null) {return identity;}if (typeof value == 'object') {return isArray(value)? baseMatchesProperty(value[0], value[1]): baseMatches(value);}return property(value);}/*** The base implementation of `_.keys` which doesn't treat sparse arrays as dense.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function baseKeys(object) {if (!isPrototype(object)) {return nativeKeys(object);}var result = [];for (var key in Object(object)) {if (hasOwnProperty.call(object, key) && key != 'constructor') {result.push(key);}}return result;}/*** The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function baseKeysIn(object) {if (!isObject(object)) {return nativeKeysIn(object);}var isProto = isPrototype(object),result = [];for (var key in object) {if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {result.push(key);}}return result;}/*** The base implementation of `_.lt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than `other`,* else `false`.*/function baseLt(value, other) {return value < other;}/*** The base implementation of `_.map` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function baseMap(collection, iteratee) {var index = -1,result = isArrayLike(collection) ? Array(collection.length) : [];baseEach(collection, function(value, key, collection) {result[++index] = iteratee(value, key, collection);});return result;}/*** The base implementation of `_.matches` which doesn't clone `source`.** @private* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.*/function baseMatches(source) {var matchData = getMatchData(source);if (matchData.length == 1 && matchData[0][2]) {return matchesStrictComparable(matchData[0][0], matchData[0][1]);}return function(object) {return object === source || baseIsMatch(object, source, matchData);};}/*** The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.** @private* @param {string} path The path of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.*/function baseMatchesProperty(path, srcValue) {if (isKey(path) && isStrictComparable(srcValue)) {return matchesStrictComparable(toKey(path), srcValue);}return function(object) {var objValue = get(object, path);return (objValue === undefined && objValue === srcValue)? hasIn(object, path): baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);};}/*** The base implementation of `_.merge` without support for multiple sources.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @param {number} srcIndex The index of `source`.* @param {Function} [customizer] The function to customize merged values.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.*/function baseMerge(object, source, srcIndex, customizer, stack) {if (object === source) {return;}baseFor(source, function(srcValue, key) {stack || (stack = new Stack);if (isObject(srcValue)) {baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);}else {var newValue = customizer? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack): undefined;if (newValue === undefined) {newValue = srcValue;}assignMergeValue(object, key, newValue);}}, keysIn);}/*** A specialized version of `baseMerge` for arrays and objects which performs* deep merges and tracks traversed objects enabling objects with circular* references to be merged.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @param {string} key The key of the value to merge.* @param {number} srcIndex The index of `source`.* @param {Function} mergeFunc The function to merge values.* @param {Function} [customizer] The function to customize assigned values.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.*/function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {var objValue = safeGet(object, key),srcValue = safeGet(source, key),stacked = stack.get(srcValue);if (stacked) {assignMergeValue(object, key, stacked);return;}var newValue = customizer? customizer(objValue, srcValue, (key + ''), object, source, stack): undefined;var isCommon = newValue === undefined;if (isCommon) {var isArr = isArray(srcValue),isBuff = !isArr && isBuffer(srcValue),isTyped = !isArr && !isBuff && isTypedArray(srcValue);newValue = srcValue;if (isArr || isBuff || isTyped) {if (isArray(objValue)) {newValue = objValue;}else if (isArrayLikeObject(objValue)) {newValue = copyArray(objValue);}else if (isBuff) {isCommon = false;newValue = cloneBuffer(srcValue, true);}else if (isTyped) {isCommon = false;newValue = cloneTypedArray(srcValue, true);}else {newValue = [];}}else if (isPlainObject(srcValue) || isArguments(srcValue)) {newValue = objValue;if (isArguments(objValue)) {newValue = toPlainObject(objValue);}else if (!isObject(objValue) || isFunction(objValue)) {newValue = initCloneObject(srcValue);}}else {isCommon = false;}}if (isCommon) {// Recursively merge objects and arrays (susceptible to call stack limits).stack.set(srcValue, newValue);mergeFunc(newValue, srcValue, srcIndex, customizer, stack);stack['delete'](srcValue);}assignMergeValue(object, key, newValue);}/*** The base implementation of `_.nth` which doesn't coerce arguments.** @private* @param {Array} array The array to query.* @param {number} n The index of the element to return.* @returns {*} Returns the nth element of `array`.*/function baseNth(array, n) {var length = array.length;if (!length) {return;}n += n < 0 ? length : 0;return isIndex(n, length) ? array[n] : undefined;}/*** The base implementation of `_.orderBy` without param guards.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.* @param {string[]} orders The sort orders of `iteratees`.* @returns {Array} Returns the new sorted array.*/function baseOrderBy(collection, iteratees, orders) {if (iteratees.length) {iteratees = arrayMap(iteratees, function(iteratee) {if (isArray(iteratee)) {return function(value) {return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);}}return iteratee;});} else {iteratees = [identity];}var index = -1;iteratees = arrayMap(iteratees, baseUnary(getIteratee()));var result = baseMap(collection, function(value, key, collection) {var criteria = arrayMap(iteratees, function(iteratee) {return iteratee(value);});return { 'criteria': criteria, 'index': ++index, 'value': value };});return baseSortBy(result, function(object, other) {return compareMultiple(object, other, orders);});}/*** The base implementation of `_.pick` without support for individual* property identifiers.** @private* @param {Object} object The source object.* @param {string[]} paths The property paths to pick.* @returns {Object} Returns the new object.*/function basePick(object, paths) {return basePickBy(object, paths, function(value, path) {return hasIn(object, path);});}/*** The base implementation of `_.pickBy` without support for iteratee shorthands.** @private* @param {Object} object The source object.* @param {string[]} paths The property paths to pick.* @param {Function} predicate The function invoked per property.* @returns {Object} Returns the new object.*/function basePickBy(object, paths, predicate) {var index = -1,length = paths.length,result = {};while (++index < length) {var path = paths[index],value = baseGet(object, path);if (predicate(value, path)) {baseSet(result, castPath(path, object), value);}}return result;}/*** A specialized version of `baseProperty` which supports deep paths.** @private* @param {Array|string} path The path of the property to get.* @returns {Function} Returns the new accessor function.*/function basePropertyDeep(path) {return function(object) {return baseGet(object, path);};}/*** The base implementation of `_.pullAllBy` without support for iteratee* shorthands.** @private* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns `array`.*/function basePullAll(array, values, iteratee, comparator) {var indexOf = comparator ? baseIndexOfWith : baseIndexOf,index = -1,length = values.length,seen = array;if (array === values) {values = copyArray(values);}if (iteratee) {seen = arrayMap(array, baseUnary(iteratee));}while (++index < length) {var fromIndex = 0,value = values[index],computed = iteratee ? iteratee(value) : value;while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {if (seen !== array) {splice.call(seen, fromIndex, 1);}splice.call(array, fromIndex, 1);}}return array;}/*** The base implementation of `_.pullAt` without support for individual* indexes or capturing the removed elements.** @private* @param {Array} array The array to modify.* @param {number[]} indexes The indexes of elements to remove.* @returns {Array} Returns `array`.*/function basePullAt(array, indexes) {var length = array ? indexes.length : 0,lastIndex = length - 1;while (length--) {var index = indexes[length];if (length == lastIndex || index !== previous) {var previous = index;if (isIndex(index)) {splice.call(array, index, 1);} else {baseUnset(array, index);}}}return array;}/*** The base implementation of `_.random` without support for returning* floating-point numbers.** @private* @param {number} lower The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the random number.*/function baseRandom(lower, upper) {return lower + nativeFloor(nativeRandom() * (upper - lower + 1));}/*** The base implementation of `_.range` and `_.rangeRight` which doesn't* coerce arguments.** @private* @param {number} start The start of the range.* @param {number} end The end of the range.* @param {number} step The value to increment or decrement by.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Array} Returns the range of numbers.*/function baseRange(start, end, step, fromRight) {var index = -1,length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),result = Array(length);while (length--) {result[fromRight ? length : ++index] = start;start += step;}return result;}/*** The base implementation of `_.repeat` which doesn't coerce arguments.** @private* @param {string} string The string to repeat.* @param {number} n The number of times to repeat the string.* @returns {string} Returns the repeated string.*/function baseRepeat(string, n) {var result = '';if (!string || n < 1 || n > MAX_SAFE_INTEGER) {return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat.// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.do {if (n % 2) {result += string;}n = nativeFloor(n / 2);if (n) {string += string;}} while (n);return result;}/*** The base implementation of `_.rest` which doesn't validate or coerce arguments.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @returns {Function} Returns the new function.*/function baseRest(func, start) {return setToString(overRest(func, start, identity), func + '');}/*** The base implementation of `_.sample`.** @private* @param {Array|Object} collection The collection to sample.* @returns {*} Returns the random element.*/function baseSample(collection) {return arraySample(values(collection));}/*** The base implementation of `_.sampleSize` without param guards.** @private* @param {Array|Object} collection The collection to sample.* @param {number} n The number of elements to sample.* @returns {Array} Returns the random elements.*/function baseSampleSize(collection, n) {var array = values(collection);return shuffleSelf(array, baseClamp(n, 0, array.length));}/*** The base implementation of `_.set`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @param {Function} [customizer] The function to customize path creation.* @returns {Object} Returns `object`.*/function baseSet(object, path, value, customizer) {if (!isObject(object)) {return object;}path = castPath(path, object);var index = -1,length = path.length,lastIndex = length - 1,nested = object;while (nested != null && ++index < length) {var key = toKey(path[index]),newValue = value;if (key === '__proto__' || key === 'constructor' || key === 'prototype') {return object;}if (index != lastIndex) {var objValue = nested[key];newValue = customizer ? customizer(objValue, key, nested) : undefined;if (newValue === undefined) {newValue = isObject(objValue)? objValue: (isIndex(path[index + 1]) ? [] : {});}}assignValue(nested, key, newValue);nested = nested[key];}return object;}/*** The base implementation of `setData` without support for hot loop shorting.** @private* @param {Function} func The function to associate metadata with.* @param {*} data The metadata.* @returns {Function} Returns `func`.*/var baseSetData = !metaMap ? identity : function(func, data) {metaMap.set(func, data);return func;};/*** The base implementation of `setToString` without support for hot loop shorting.** @private* @param {Function} func The function to modify.* @param {Function} string The `toString` result.* @returns {Function} Returns `func`.*/var baseSetToString = !defineProperty ? identity : function(func, string) {return defineProperty(func, 'toString', {'configurable': true,'enumerable': false,'value': constant(string),'writable': true});};/*** The base implementation of `_.shuffle`.** @private* @param {Array|Object} collection The collection to shuffle.* @returns {Array} Returns the new shuffled array.*/function baseShuffle(collection) {return shuffleSelf(values(collection));}/*** The base implementation of `_.slice` without an iteratee call guard.** @private* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function baseSlice(array, start, end) {var index = -1,length = array.length;if (start < 0) {start = -start > length ? 0 : (length + start);}end = end > length ? length : end;if (end < 0) {end += length;}length = start > end ? 0 : ((end - start) >>> 0);start >>>= 0;var result = Array(length);while (++index < length) {result[index] = array[index + start];}return result;}/*** The base implementation of `_.some` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.*/function baseSome(collection, predicate) {var result;baseEach(collection, function(value, index, collection) {result = predicate(value, index, collection);return !result;});return !!result;}/*** The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which* performs a binary search of `array` to determine the index at which `value`* should be inserted into `array` in order to maintain its sort order.** @private* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {boolean} [retHighest] Specify returning the highest qualified index.* @returns {number} Returns the index at which `value` should be inserted* into `array`.*/function baseSortedIndex(array, value, retHighest) {var low = 0,high = array == null ? low : array.length;if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {while (low < high) {var mid = (low + high) >>> 1,computed = array[mid];if (computed !== null && !isSymbol(computed) &&(retHighest ? (computed <= value) : (computed < value))) {low = mid + 1;} else {high = mid;}}return high;}return baseSortedIndexBy(array, value, identity, retHighest);}/*** The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`* which invokes `iteratee` for `value` and each element of `array` to compute* their sort ranking. The iteratee is invoked with one argument; (value).** @private* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} iteratee The iteratee invoked per element.* @param {boolean} [retHighest] Specify returning the highest qualified index.* @returns {number} Returns the index at which `value` should be inserted* into `array`.*/function baseSortedIndexBy(array, value, iteratee, retHighest) {var low = 0,high = array == null ? 0 : array.length;if (high === 0) {return 0;}value = iteratee(value);var valIsNaN = value !== value,valIsNull = value === null,valIsSymbol = isSymbol(value),valIsUndefined = value === undefined;while (low < high) {var mid = nativeFloor((low + high) / 2),computed = iteratee(array[mid]),othIsDefined = computed !== undefined,othIsNull = computed === null,othIsReflexive = computed === computed,othIsSymbol = isSymbol(computed);if (valIsNaN) {var setLow = retHighest || othIsReflexive;} else if (valIsUndefined) {setLow = othIsReflexive && (retHighest || othIsDefined);} else if (valIsNull) {setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);} else if (valIsSymbol) {setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);} else if (othIsNull || othIsSymbol) {setLow = false;} else {setLow = retHighest ? (computed <= value) : (computed < value);}if (setLow) {low = mid + 1;} else {high = mid;}}return nativeMin(high, MAX_ARRAY_INDEX);}/*** The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.*/function baseSortedUniq(array, iteratee) {var index = -1,length = array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index],computed = iteratee ? iteratee(value) : value;if (!index || !eq(computed, seen)) {var seen = computed;result[resIndex++] = value === 0 ? 0 : value;}}return result;}/*** The base implementation of `_.toNumber` which doesn't ensure correct* conversions of binary, hexadecimal, or octal string values.** @private* @param {*} value The value to process.* @returns {number} Returns the number.*/function baseToNumber(value) {if (typeof value == 'number') {return value;}if (isSymbol(value)) {return NAN;}return +value;}/*** The base implementation of `_.toString` which doesn't convert nullish* values to empty strings.** @private* @param {*} value The value to process.* @returns {string} Returns the string.*/function baseToString(value) {// Exit early for strings to avoid a performance hit in some environments.if (typeof value == 'string') {return value;}if (isArray(value)) {// Recursively convert values (susceptible to call stack limits).return arrayMap(value, baseToString) + '';}if (isSymbol(value)) {return symbolToString ? symbolToString.call(value) : '';}var result = (value + '');return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;}/*** The base implementation of `_.uniqBy` without support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new duplicate free array.*/function baseUniq(array, iteratee, comparator) {var index = -1,includes = arrayIncludes,length = array.length,isCommon = true,result = [],seen = result;if (comparator) {isCommon = false;includes = arrayIncludesWith;}else if (length >= LARGE_ARRAY_SIZE) {var set = iteratee ? null : createSet(array);if (set) {return setToArray(set);}isCommon = false;includes = cacheHas;seen = new SetCache;}else {seen = iteratee ? [] : result;}outer:while (++index < length) {var value = array[index],computed = iteratee ? iteratee(value) : value;value = (comparator || value !== 0) ? value : 0;if (isCommon && computed === computed) {var seenIndex = seen.length;while (seenIndex--) {if (seen[seenIndex] === computed) {continue outer;}}if (iteratee) {seen.push(computed);}result.push(value);}else if (!includes(seen, computed, comparator)) {if (seen !== result) {seen.push(computed);}result.push(value);}}return result;}/*** The base implementation of `_.unset`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The property path to unset.* @returns {boolean} Returns `true` if the property is deleted, else `false`.*/function baseUnset(object, path) {path = castPath(path, object);object = parent(object, path);return object == null || delete object[toKey(last(path))];}/*** The base implementation of `_.update`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to update.* @param {Function} updater The function to produce the updated value.* @param {Function} [customizer] The function to customize path creation.* @returns {Object} Returns `object`.*/function baseUpdate(object, path, updater, customizer) {return baseSet(object, path, updater(baseGet(object, path)), customizer);}/*** The base implementation of methods like `_.dropWhile` and `_.takeWhile`* without support for iteratee shorthands.** @private* @param {Array} array The array to query.* @param {Function} predicate The function invoked per iteration.* @param {boolean} [isDrop] Specify dropping elements instead of taking them.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Array} Returns the slice of `array`.*/function baseWhile(array, predicate, isDrop, fromRight) {var length = array.length,index = fromRight ? length : -1;while ((fromRight ? index-- : ++index < length) &&predicate(array[index], index, array)) {}return isDrop? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)): baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));}/*** The base implementation of `wrapperValue` which returns the result of* performing a sequence of actions on the unwrapped `value`, where each* successive action is supplied the return value of the previous.** @private* @param {*} value The unwrapped value.* @param {Array} actions Actions to perform to resolve the unwrapped value.* @returns {*} Returns the resolved value.*/function baseWrapperValue(value, actions) {var result = value;if (result instanceof LazyWrapper) {result = result.value();}return arrayReduce(actions, function(result, action) {return action.func.apply(action.thisArg, arrayPush([result], action.args));}, result);}/*** The base implementation of methods like `_.xor`, without support for* iteratee shorthands, that accepts an array of arrays to inspect.** @private* @param {Array} arrays The arrays to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of values.*/function baseXor(arrays, iteratee, comparator) {var length = arrays.length;if (length < 2) {return length ? baseUniq(arrays[0]) : [];}var index = -1,result = Array(length);while (++index < length) {var array = arrays[index],othIndex = -1;while (++othIndex < length) {if (othIndex != index) {result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);}}}return baseUniq(baseFlatten(result, 1), iteratee, comparator);}/*** This base implementation of `_.zipObject` which assigns values using `assignFunc`.** @private* @param {Array} props The property identifiers.* @param {Array} values The property values.* @param {Function} assignFunc The function to assign values.* @returns {Object} Returns the new object.*/function baseZipObject(props, values, assignFunc) {var index = -1,length = props.length,valsLength = values.length,result = {};while (++index < length) {var value = index < valsLength ? values[index] : undefined;assignFunc(result, props[index], value);}return result;}/*** Casts `value` to an empty array if it's not an array like object.** @private* @param {*} value The value to inspect.* @returns {Array|Object} Returns the cast array-like object.*/function castArrayLikeObject(value) {return isArrayLikeObject(value) ? value : [];}/*** Casts `value` to `identity` if it's not a function.** @private* @param {*} value The value to inspect.* @returns {Function} Returns cast function.*/function castFunction(value) {return typeof value == 'function' ? value : identity;}/*** Casts `value` to a path array if it's not one.** @private* @param {*} value The value to inspect.* @param {Object} [object] The object to query keys on.* @returns {Array} Returns the cast property path array.*/function castPath(value, object) {if (isArray(value)) {return value;}return isKey(value, object) ? [value] : stringToPath(toString(value));}/*** A `baseRest` alias which can be replaced with `identity` by module* replacement plugins.** @private* @type {Function}* @param {Function} func The function to apply a rest parameter to.* @returns {Function} Returns the new function.*/var castRest = baseRest;/*** Casts `array` to a slice if it's needed.** @private* @param {Array} array The array to inspect.* @param {number} start The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the cast slice.*/function castSlice(array, start, end) {var length = array.length;end = end === undefined ? length : end;return (!start && end >= length) ? array : baseSlice(array, start, end);}/*** A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).** @private* @param {number|Object} id The timer id or timeout object of the timer to clear.*/var clearTimeout = ctxClearTimeout || function(id) {return root.clearTimeout(id);};/*** Creates a clone of `buffer`.** @private* @param {Buffer} buffer The buffer to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Buffer} Returns the cloned buffer.*/function cloneBuffer(buffer, isDeep) {if (isDeep) {return buffer.slice();}var length = buffer.length,result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);buffer.copy(result);return result;}/*** Creates a clone of `arrayBuffer`.** @private* @param {ArrayBuffer} arrayBuffer The array buffer to clone.* @returns {ArrayBuffer} Returns the cloned array buffer.*/function cloneArrayBuffer(arrayBuffer) {var result = new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}/*** Creates a clone of `dataView`.** @private* @param {Object} dataView The data view to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the cloned data view.*/function cloneDataView(dataView, isDeep) {var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);}/*** Creates a clone of `regexp`.** @private* @param {Object} regexp The regexp to clone.* @returns {Object} Returns the cloned regexp.*/function cloneRegExp(regexp) {var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));result.lastIndex = regexp.lastIndex;return result;}/*** Creates a clone of the `symbol` object.** @private* @param {Object} symbol The symbol object to clone.* @returns {Object} Returns the cloned symbol object.*/function cloneSymbol(symbol) {return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};}/*** Creates a clone of `typedArray`.** @private* @param {Object} typedArray The typed array to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the cloned typed array.*/function cloneTypedArray(typedArray, isDeep) {var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);}/*** Compares values to sort them in ascending order.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {number} Returns the sort order indicator for `value`.*/function compareAscending(value, other) {if (value !== other) {var valIsDefined = value !== undefined,valIsNull = value === null,valIsReflexive = value === value,valIsSymbol = isSymbol(value);var othIsDefined = other !== undefined,othIsNull = other === null,othIsReflexive = other === other,othIsSymbol = isSymbol(other);if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||(valIsNull && othIsDefined && othIsReflexive) ||(!valIsDefined && othIsReflexive) ||!valIsReflexive) {return 1;}if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||(othIsNull && valIsDefined && valIsReflexive) ||(!othIsDefined && valIsReflexive) ||!othIsReflexive) {return -1;}}return 0;}/*** Used by `_.orderBy` to compare multiple properties of a value to another* and stable sort them.** If `orders` is unspecified, all values are sorted in ascending order. Otherwise,* specify an order of "desc" for descending or "asc" for ascending sort order* of corresponding values.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {boolean[]|string[]} orders The order to sort by for each property.* @returns {number} Returns the sort order indicator for `object`.*/function compareMultiple(object, other, orders) {var index = -1,objCriteria = object.criteria,othCriteria = other.criteria,length = objCriteria.length,ordersLength = orders.length;while (++index < length) {var result = compareAscending(objCriteria[index], othCriteria[index]);if (result) {if (index >= ordersLength) {return result;}var order = orders[index];return result * (order == 'desc' ? -1 : 1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications// that causes it, under certain circumstances, to provide the same value for// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247// for more details.//// This also ensures a stable sort in V8 and other engines.// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.return object.index - other.index;}/*** Creates an array that is the composition of partially applied arguments,* placeholders, and provided arguments into a single array of arguments.** @private* @param {Array} args The provided arguments.* @param {Array} partials The arguments to prepend to those provided.* @param {Array} holders The `partials` placeholder indexes.* @params {boolean} [isCurried] Specify composing for a curried function.* @returns {Array} Returns the new array of composed arguments.*/function composeArgs(args, partials, holders, isCurried) {var argsIndex = -1,argsLength = args.length,holdersLength = holders.length,leftIndex = -1,leftLength = partials.length,rangeLength = nativeMax(argsLength - holdersLength, 0),result = Array(leftLength + rangeLength),isUncurried = !isCurried;while (++leftIndex < leftLength) {result[leftIndex] = partials[leftIndex];}while (++argsIndex < holdersLength) {if (isUncurried || argsIndex < argsLength) {result[holders[argsIndex]] = args[argsIndex];}}while (rangeLength--) {result[leftIndex++] = args[argsIndex++];}return result;}/*** This function is like `composeArgs` except that the arguments composition* is tailored for `_.partialRight`.** @private* @param {Array} args The provided arguments.* @param {Array} partials The arguments to append to those provided.* @param {Array} holders The `partials` placeholder indexes.* @params {boolean} [isCurried] Specify composing for a curried function.* @returns {Array} Returns the new array of composed arguments.*/function composeArgsRight(args, partials, holders, isCurried) {var argsIndex = -1,argsLength = args.length,holdersIndex = -1,holdersLength = holders.length,rightIndex = -1,rightLength = partials.length,rangeLength = nativeMax(argsLength - holdersLength, 0),result = Array(rangeLength + rightLength),isUncurried = !isCurried;while (++argsIndex < rangeLength) {result[argsIndex] = args[argsIndex];}var offset = argsIndex;while (++rightIndex < rightLength) {result[offset + rightIndex] = partials[rightIndex];}while (++holdersIndex < holdersLength) {if (isUncurried || argsIndex < argsLength) {result[offset + holders[holdersIndex]] = args[argsIndex++];}}return result;}/*** Copies the values of `source` to `array`.** @private* @param {Array} source The array to copy values from.* @param {Array} [array=[]] The array to copy values to.* @returns {Array} Returns `array`.*/function copyArray(source, array) {var index = -1,length = source.length;array || (array = Array(length));while (++index < length) {array[index] = source[index];}return array;}/*** Copies properties of `source` to `object`.** @private* @param {Object} source The object to copy properties from.* @param {Array} props The property identifiers to copy.* @param {Object} [object={}] The object to copy properties to.* @param {Function} [customizer] The function to customize copied values.* @returns {Object} Returns `object`.*/function copyObject(source, props, object, customizer) {var isNew = !object;object || (object = {});var index = -1,length = props.length;while (++index < length) {var key = props[index];var newValue = customizer? customizer(object[key], source[key], key, object, source): undefined;if (newValue === undefined) {newValue = source[key];}if (isNew) {baseAssignValue(object, key, newValue);} else {assignValue(object, key, newValue);}}return object;}/*** Copies own symbols of `source` to `object`.** @private* @param {Object} source The object to copy symbols from.* @param {Object} [object={}] The object to copy symbols to.* @returns {Object} Returns `object`.*/function copySymbols(source, object) {return copyObject(source, getSymbols(source), object);}/*** Copies own and inherited symbols of `source` to `object`.** @private* @param {Object} source The object to copy symbols from.* @param {Object} [object={}] The object to copy symbols to.* @returns {Object} Returns `object`.*/function copySymbolsIn(source, object) {return copyObject(source, getSymbolsIn(source), object);}/*** Creates a function like `_.groupBy`.** @private* @param {Function} setter The function to set accumulator values.* @param {Function} [initializer] The accumulator object initializer.* @returns {Function} Returns the new aggregator function.*/function createAggregator(setter, initializer) {return function(collection, iteratee) {var func = isArray(collection) ? arrayAggregator : baseAggregator,accumulator = initializer ? initializer() : {};return func(collection, setter, getIteratee(iteratee, 2), accumulator);};}/*** Creates a function like `_.assign`.** @private* @param {Function} assigner The function to assign values.* @returns {Function} Returns the new assigner function.*/function createAssigner(assigner) {return baseRest(function(object, sources) {var index = -1,length = sources.length,customizer = length > 1 ? sources[length - 1] : undefined,guard = length > 2 ? sources[2] : undefined;customizer = (assigner.length > 3 && typeof customizer == 'function')? (length--, customizer): undefined;if (guard && isIterateeCall(sources[0], sources[1], guard)) {customizer = length < 3 ? undefined : customizer;length = 1;}object = Object(object);while (++index < length) {var source = sources[index];if (source) {assigner(object, source, index, customizer);}}return object;});}/*** Creates a `baseEach` or `baseEachRight` function.** @private* @param {Function} eachFunc The function to iterate over a collection.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseEach(eachFunc, fromRight) {return function(collection, iteratee) {if (collection == null) {return collection;}if (!isArrayLike(collection)) {return eachFunc(collection, iteratee);}var length = collection.length,index = fromRight ? length : -1,iterable = Object(collection);while ((fromRight ? index-- : ++index < length)) {if (iteratee(iterable[index], index, iterable) === false) {break;}}return collection;};}/*** Creates a base function for methods like `_.forIn` and `_.forOwn`.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseFor(fromRight) {return function(object, iteratee, keysFunc) {var index = -1,iterable = Object(object),props = keysFunc(object),length = props.length;while (length--) {var key = props[fromRight ? length : ++index];if (iteratee(iterable[key], key, iterable) === false) {break;}}return object;};}/*** Creates a function that wraps `func` to invoke it with the optional `this`* binding of `thisArg`.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} [thisArg] The `this` binding of `func`.* @returns {Function} Returns the new wrapped function.*/function createBind(func, bitmask, thisArg) {var isBind = bitmask & WRAP_BIND_FLAG,Ctor = createCtor(func);function wrapper() {var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;return fn.apply(isBind ? thisArg : this, arguments);}return wrapper;}/*** Creates a function like `_.lowerFirst`.** @private* @param {string} methodName The name of the `String` case method to use.* @returns {Function} Returns the new case function.*/function createCaseFirst(methodName) {return function(string) {string = toString(string);var strSymbols = hasUnicode(string)? stringToArray(string): undefined;var chr = strSymbols? strSymbols[0]: string.charAt(0);var trailing = strSymbols? castSlice(strSymbols, 1).join(''): string.slice(1);return chr[methodName]() + trailing;};}/*** Creates a function like `_.camelCase`.** @private* @param {Function} callback The function to combine each word.* @returns {Function} Returns the new compounder function.*/function createCompounder(callback) {return function(string) {return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');};}/*** Creates a function that produces an instance of `Ctor` regardless of* whether it was invoked as part of a `new` expression or by `call` or `apply`.** @private* @param {Function} Ctor The constructor to wrap.* @returns {Function} Returns the new wrapped function.*/function createCtor(Ctor) {return function() {// Use a `switch` statement to work with class constructors. See// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist// for more details.var args = arguments;switch (args.length) {case 0: return new Ctor;case 1: return new Ctor(args[0]);case 2: return new Ctor(args[0], args[1]);case 3: return new Ctor(args[0], args[1], args[2]);case 4: return new Ctor(args[0], args[1], args[2], args[3]);case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}var thisBinding = baseCreate(Ctor.prototype),result = Ctor.apply(thisBinding, args);// Mimic the constructor's `return` behavior.// See https://es5.github.io/#x13.2.2 for more details.return isObject(result) ? result : thisBinding;};}/*** Creates a function that wraps `func` to enable currying.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {number} arity The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createCurry(func, bitmask, arity) {var Ctor = createCtor(func);function wrapper() {var length = arguments.length,args = Array(length),index = length,placeholder = getHolder(wrapper);while (index--) {args[index] = arguments[index];}var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)? []: replaceHolders(args, placeholder);length -= holders.length;if (length < arity) {return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined,args, holders, undefined, undefined, arity - length);}var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;return apply(fn, this, args);}return wrapper;}/*** Creates a `_.find` or `_.findLast` function.** @private* @param {Function} findIndexFunc The function to find the collection index.* @returns {Function} Returns the new find function.*/function createFind(findIndexFunc) {return function(collection, predicate, fromIndex) {var iterable = Object(collection);if (!isArrayLike(collection)) {var iteratee = getIteratee(predicate, 3);collection = keys(collection);predicate = function(key) { return iteratee(iterable[key], key, iterable); };}var index = findIndexFunc(collection, predicate, fromIndex);return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;};}/*** Creates a `_.flow` or `_.flowRight` function.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new flow function.*/function createFlow(fromRight) {return flatRest(function(funcs) {var length = funcs.length,index = length,prereq = LodashWrapper.prototype.thru;if (fromRight) {funcs.reverse();}while (index--) {var func = funcs[index];if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}if (prereq && !wrapper && getFuncName(func) == 'wrapper') {var wrapper = new LodashWrapper([], true);}}index = wrapper ? index : length;while (++index < length) {func = funcs[index];var funcName = getFuncName(func),data = funcName == 'wrapper' ? getData(func) : undefined;if (data && isLaziable(data[0]) &&data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&!data[4].length && data[9] == 1) {wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);} else {wrapper = (func.length == 1 && isLaziable(func))? wrapper[funcName](): wrapper.thru(func);}}return function() {var args = arguments,value = args[0];if (wrapper && args.length == 1 && isArray(value)) {return wrapper.plant(value).value();}var index = 0,result = length ? funcs[index].apply(this, args) : value;while (++index < length) {result = funcs[index].call(this, result);}return result;};});}/*** Creates a function that wraps `func` to invoke it with optional `this`* binding of `thisArg`, partial application, and currying.** @private* @param {Function|string} func The function or method name to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to prepend to those provided to* the new function.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [partialsRight] The arguments to append to those provided* to the new function.* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {var isAry = bitmask & WRAP_ARY_FLAG,isBind = bitmask & WRAP_BIND_FLAG,isBindKey = bitmask & WRAP_BIND_KEY_FLAG,isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),isFlip = bitmask & WRAP_FLIP_FLAG,Ctor = isBindKey ? undefined : createCtor(func);function wrapper() {var length = arguments.length,args = Array(length),index = length;while (index--) {args[index] = arguments[index];}if (isCurried) {var placeholder = getHolder(wrapper),holdersCount = countHolders(args, placeholder);}if (partials) {args = composeArgs(args, partials, holders, isCurried);}if (partialsRight) {args = composeArgsRight(args, partialsRight, holdersRight, isCurried);}length -= holdersCount;if (isCurried && length < arity) {var newHolders = replaceHolders(args, placeholder);return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg,args, newHolders, argPos, ary, arity - length);}var thisBinding = isBind ? thisArg : this,fn = isBindKey ? thisBinding[func] : func;length = args.length;if (argPos) {args = reorder(args, argPos);} else if (isFlip && length > 1) {args.reverse();}if (isAry && ary < length) {args.length = ary;}if (this && this !== root && this instanceof wrapper) {fn = Ctor || createCtor(fn);}return fn.apply(thisBinding, args);}return wrapper;}/*** Creates a function like `_.invertBy`.** @private* @param {Function} setter The function to set accumulator values.* @param {Function} toIteratee The function to resolve iteratees.* @returns {Function} Returns the new inverter function.*/function createInverter(setter, toIteratee) {return function(object, iteratee) {return baseInverter(object, setter, toIteratee(iteratee), {});};}/*** Creates a function that performs a mathematical operation on two values.** @private* @param {Function} operator The function to perform the operation.* @param {number} [defaultValue] The value used for `undefined` arguments.* @returns {Function} Returns the new mathematical operation function.*/function createMathOperation(operator, defaultValue) {return function(value, other) {var result;if (value === undefined && other === undefined) {return defaultValue;}if (value !== undefined) {result = value;}if (other !== undefined) {if (result === undefined) {return other;}if (typeof value == 'string' || typeof other == 'string') {value = baseToString(value);other = baseToString(other);} else {value = baseToNumber(value);other = baseToNumber(other);}result = operator(value, other);}return result;};}/*** Creates a function like `_.over`.** @private* @param {Function} arrayFunc The function to iterate over iteratees.* @returns {Function} Returns the new over function.*/function createOver(arrayFunc) {return flatRest(function(iteratees) {iteratees = arrayMap(iteratees, baseUnary(getIteratee()));return baseRest(function(args) {var thisArg = this;return arrayFunc(iteratees, function(iteratee) {return apply(iteratee, thisArg, args);});});});}/*** Creates the padding for `string` based on `length`. The `chars` string* is truncated if the number of characters exceeds `length`.** @private* @param {number} length The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padding for `string`.*/function createPadding(length, chars) {chars = chars === undefined ? ' ' : baseToString(chars);var charsLength = chars.length;if (charsLength < 2) {return charsLength ? baseRepeat(chars, length) : chars;}var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));return hasUnicode(chars)? castSlice(stringToArray(result), 0, length).join(''): result.slice(0, length);}/*** Creates a function that wraps `func` to invoke it with the `this` binding* of `thisArg` and `partials` prepended to the arguments it receives.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} thisArg The `this` binding of `func`.* @param {Array} partials The arguments to prepend to those provided to* the new function.* @returns {Function} Returns the new wrapped function.*/function createPartial(func, bitmask, thisArg, partials) {var isBind = bitmask & WRAP_BIND_FLAG,Ctor = createCtor(func);function wrapper() {var argsIndex = -1,argsLength = arguments.length,leftIndex = -1,leftLength = partials.length,args = Array(leftLength + argsLength),fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;while (++leftIndex < leftLength) {args[leftIndex] = partials[leftIndex];}while (argsLength--) {args[leftIndex++] = arguments[++argsIndex];}return apply(fn, isBind ? thisArg : this, args);}return wrapper;}/*** Creates a `_.range` or `_.rangeRight` function.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new range function.*/function createRange(fromRight) {return function(start, end, step) {if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {end = step = undefined;}// Ensure the sign of `-0` is preserved.start = toFinite(start);if (end === undefined) {end = start;start = 0;} else {end = toFinite(end);}step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);return baseRange(start, end, step, fromRight);};}/*** Creates a function that performs a relational operation on two values.** @private* @param {Function} operator The function to perform the operation.* @returns {Function} Returns the new relational operation function.*/function createRelationalOperation(operator) {return function(value, other) {if (!(typeof value == 'string' && typeof other == 'string')) {value = toNumber(value);other = toNumber(other);}return operator(value, other);};}/*** Creates a function that wraps `func` to continue currying.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {Function} wrapFunc The function to create the `func` wrapper.* @param {*} placeholder The placeholder value.* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to prepend to those provided to* the new function.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {var isCurry = bitmask & WRAP_CURRY_FLAG,newHolders = isCurry ? holders : undefined,newHoldersRight = isCurry ? undefined : holders,newPartials = isCurry ? partials : undefined,newPartialsRight = isCurry ? undefined : partials;bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);}var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,newHoldersRight, argPos, ary, arity];var result = wrapFunc.apply(undefined, newData);if (isLaziable(func)) {setData(result, newData);}result.placeholder = placeholder;return setWrapToString(result, func, bitmask);}/*** Creates a function like `_.round`.** @private* @param {string} methodName The name of the `Math` method to use when rounding.* @returns {Function} Returns the new round function.*/function createRound(methodName) {var func = Math[methodName];return function(number, precision) {number = toNumber(number);precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);if (precision && nativeIsFinite(number)) {// Shift with exponential notation to avoid floating-point issues.// See [MDN](https://mdn.io/round#Examples) for more details.var pair = (toString(number) + 'e').split('e'),value = func(pair[0] + 'e' + (+pair[1] + precision));pair = (toString(value) + 'e').split('e');return +(pair[0] + 'e' + (+pair[1] - precision));}return func(number);};}/*** Creates a set object of `values`.** @private* @param {Array} values The values to add to the set.* @returns {Object} Returns the new set.*/var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {return new Set(values);};/*** Creates a `_.toPairs` or `_.toPairsIn` function.** @private* @param {Function} keysFunc The function to get the keys of a given object.* @returns {Function} Returns the new pairs function.*/function createToPairs(keysFunc) {return function(object) {var tag = getTag(object);if (tag == mapTag) {return mapToArray(object);}if (tag == setTag) {return setToPairs(object);}return baseToPairs(object, keysFunc(object));};}/*** Creates a function that either curries or invokes `func` with optional* `this` binding and partially applied arguments.** @private* @param {Function|string} func The function or method name to wrap.* @param {number} bitmask The bitmask flags.* 1 - `_.bind`* 2 - `_.bindKey`* 4 - `_.curry` or `_.curryRight` of a bound function* 8 - `_.curry`* 16 - `_.curryRight`* 32 - `_.partial`* 64 - `_.partialRight`* 128 - `_.rearg`* 256 - `_.ary`* 512 - `_.flip`* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to be partially applied.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;if (!isBindKey && typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}var length = partials ? partials.length : 0;if (!length) {bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);partials = holders = undefined;}ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);arity = arity === undefined ? arity : toInteger(arity);length -= holders ? holders.length : 0;if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {var partialsRight = partials,holdersRight = holders;partials = holders = undefined;}var data = isBindKey ? undefined : getData(func);var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,argPos, ary, arity];if (data) {mergeData(newData, data);}func = newData[0];bitmask = newData[1];thisArg = newData[2];partials = newData[3];holders = newData[4];arity = newData[9] = newData[9] === undefined? (isBindKey ? 0 : func.length): nativeMax(newData[9] - length, 0);if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);}if (!bitmask || bitmask == WRAP_BIND_FLAG) {var result = createBind(func, bitmask, thisArg);} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {result = createCurry(func, bitmask, arity);} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {result = createPartial(func, bitmask, thisArg, partials);} else {result = createHybrid.apply(undefined, newData);}var setter = data ? baseSetData : setData;return setWrapToString(setter(result, newData), func, bitmask);}/*** Used by `_.defaults` to customize its `_.assignIn` use to assign properties* of source objects to the destination object for all destination properties* that resolve to `undefined`.** @private* @param {*} objValue The destination value.* @param {*} srcValue The source value.* @param {string} key The key of the property to assign.* @param {Object} object The parent object of `objValue`.* @returns {*} Returns the value to assign.*/function customDefaultsAssignIn(objValue, srcValue, key, object) {if (objValue === undefined ||(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {return srcValue;}return objValue;}/*** Used by `_.defaultsDeep` to customize its `_.merge` use to merge source* objects into destination objects that are passed thru.** @private* @param {*} objValue The destination value.* @param {*} srcValue The source value.* @param {string} key The key of the property to merge.* @param {Object} object The parent object of `objValue`.* @param {Object} source The parent object of `srcValue`.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.* @returns {*} Returns the value to assign.*/function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {if (isObject(objValue) && isObject(srcValue)) {// Recursively merge objects and arrays (susceptible to call stack limits).stack.set(srcValue, objValue);baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);stack['delete'](srcValue);}return objValue;}/*** Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain* objects.** @private* @param {*} value The value to inspect.* @param {string} key The key of the property to inspect.* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.*/function customOmitClone(value) {return isPlainObject(value) ? undefined : value;}/*** A specialized version of `baseIsEqualDeep` for arrays with support for* partial deep comparisons.** @private* @param {Array} array The array to compare.* @param {Array} other The other array to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `array` and `other` objects.* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.*/function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,arrLength = array.length,othLength = other.length;if (arrLength != othLength && !(isPartial && othLength > arrLength)) {return false;}// Check that cyclic values are equal.var arrStacked = stack.get(array);var othStacked = stack.get(other);if (arrStacked && othStacked) {return arrStacked == other && othStacked == array;}var index = -1,result = true,seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;stack.set(array, other);stack.set(other, array);// Ignore non-index properties.while (++index < arrLength) {var arrValue = array[index],othValue = other[index];if (customizer) {var compared = isPartial? customizer(othValue, arrValue, index, other, array, stack): customizer(arrValue, othValue, index, array, other, stack);}if (compared !== undefined) {if (compared) {continue;}result = false;break;}// Recursively compare arrays (susceptible to call stack limits).if (seen) {if (!arraySome(other, function(othValue, othIndex) {if (!cacheHas(seen, othIndex) &&(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {return seen.push(othIndex);}})) {result = false;break;}} else if (!(arrValue === othValue ||equalFunc(arrValue, othValue, bitmask, customizer, stack))) {result = false;break;}}stack['delete'](array);stack['delete'](other);return result;}/*** A specialized version of `baseIsEqualDeep` for comparing objects of* the same `toStringTag`.** **Note:** This function only supports comparing values with tags of* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {string} tag The `toStringTag` of the objects to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {switch (tag) {case dataViewTag:if ((object.byteLength != other.byteLength) ||(object.byteOffset != other.byteOffset)) {return false;}object = object.buffer;other = other.buffer;case arrayBufferTag:if ((object.byteLength != other.byteLength) ||!equalFunc(new Uint8Array(object), new Uint8Array(other))) {return false;}return true;case boolTag:case dateTag:case numberTag:// Coerce booleans to `1` or `0` and dates to milliseconds.// Invalid dates are coerced to `NaN`.return eq(+object, +other);case errorTag:return object.name == other.name && object.message == other.message;case regexpTag:case stringTag:// Coerce regexes to strings and treat strings, primitives and objects,// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring// for more details.return object == (other + '');case mapTag:var convert = mapToArray;case setTag:var isPartial = bitmask & COMPARE_PARTIAL_FLAG;convert || (convert = setToArray);if (object.size != other.size && !isPartial) {return false;}// Assume cyclic values are equal.var stacked = stack.get(object);if (stacked) {return stacked == other;}bitmask |= COMPARE_UNORDERED_FLAG;// Recursively compare objects (susceptible to call stack limits).stack.set(object, other);var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);stack['delete'](object);return result;case symbolTag:if (symbolValueOf) {return symbolValueOf.call(object) == symbolValueOf.call(other);}}return false;}/*** A specialized version of `baseIsEqualDeep` for objects with support for* partial deep comparisons.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,objProps = getAllKeys(object),objLength = objProps.length,othProps = getAllKeys(other),othLength = othProps.length;if (objLength != othLength && !isPartial) {return false;}var index = objLength;while (index--) {var key = objProps[index];if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {return false;}}// Check that cyclic values are equal.var objStacked = stack.get(object);var othStacked = stack.get(other);if (objStacked && othStacked) {return objStacked == other && othStacked == object;}var result = true;stack.set(object, other);stack.set(other, object);var skipCtor = isPartial;while (++index < objLength) {key = objProps[index];var objValue = object[key],othValue = other[key];if (customizer) {var compared = isPartial? customizer(othValue, objValue, key, other, object, stack): customizer(objValue, othValue, key, object, other, stack);}// Recursively compare objects (susceptible to call stack limits).if (!(compared === undefined? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)): compared)) {result = false;break;}skipCtor || (skipCtor = key == 'constructor');}if (result && !skipCtor) {var objCtor = object.constructor,othCtor = other.constructor;// Non `Object` object instances with different constructors are not equal.if (objCtor != othCtor &&('constructor' in object && 'constructor' in other) &&!(typeof objCtor == 'function' && objCtor instanceof objCtor &&typeof othCtor == 'function' && othCtor instanceof othCtor)) {result = false;}}stack['delete'](object);stack['delete'](other);return result;}/*** A specialized version of `baseRest` which flattens the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @returns {Function} Returns the new function.*/function flatRest(func) {return setToString(overRest(func, undefined, flatten), func + '');}/*** Creates an array of own enumerable property names and symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names and symbols.*/function getAllKeys(object) {return baseGetAllKeys(object, keys, getSymbols);}/*** Creates an array of own and inherited enumerable property names and* symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names and symbols.*/function getAllKeysIn(object) {return baseGetAllKeys(object, keysIn, getSymbolsIn);}/*** Gets metadata for `func`.** @private* @param {Function} func The function to query.* @returns {*} Returns the metadata for `func`.*/var getData = !metaMap ? noop : function(func) {return metaMap.get(func);};/*** Gets the name of `func`.** @private* @param {Function} func The function to query.* @returns {string} Returns the function name.*/function getFuncName(func) {var result = (func.name + ''),array = realNames[result],length = hasOwnProperty.call(realNames, result) ? array.length : 0;while (length--) {var data = array[length],otherFunc = data.func;if (otherFunc == null || otherFunc == func) {return data.name;}}return result;}/*** Gets the argument placeholder value for `func`.** @private* @param {Function} func The function to inspect.* @returns {*} Returns the placeholder value.*/function getHolder(func) {var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;return object.placeholder;}/*** Gets the appropriate "iteratee" function. If `_.iteratee` is customized,* this function returns the custom method, otherwise it returns `baseIteratee`.* If arguments are provided, the chosen function is invoked with them and* its result is returned.** @private* @param {*} [value] The value to convert to an iteratee.* @param {number} [arity] The arity of the created iteratee.* @returns {Function} Returns the chosen function or its result.*/function getIteratee() {var result = lodash.iteratee || iteratee;result = result === iteratee ? baseIteratee : result;return arguments.length ? result(arguments[0], arguments[1]) : result;}/*** Gets the data for `map`.** @private* @param {Object} map The map to query.* @param {string} key The reference key.* @returns {*} Returns the map data.*/function getMapData(map, key) {var data = map.__data__;return isKeyable(key)? data[typeof key == 'string' ? 'string' : 'hash']: data.map;}/*** Gets the property names, values, and compare flags of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the match data of `object`.*/function getMatchData(object) {var result = keys(object),length = result.length;while (length--) {var key = result[length],value = object[key];result[length] = [key, value, isStrictComparable(value)];}return result;}/*** Gets the native function at `key` of `object`.** @private* @param {Object} object The object to query.* @param {string} key The key of the method to get.* @returns {*} Returns the function if it's native, else `undefined`.*/function getNative(object, key) {var value = getValue(object, key);return baseIsNative(value) ? value : undefined;}/*** A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.** @private* @param {*} value The value to query.* @returns {string} Returns the raw `toStringTag`.*/function getRawTag(value) {var isOwn = hasOwnProperty.call(value, symToStringTag),tag = value[symToStringTag];try {value[symToStringTag] = undefined;var unmasked = true;} catch (e) {}var result = nativeObjectToString.call(value);if (unmasked) {if (isOwn) {value[symToStringTag] = tag;} else {delete value[symToStringTag];}}return result;}/*** Creates an array of the own enumerable symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of symbols.*/var getSymbols = !nativeGetSymbols ? stubArray : function(object) {if (object == null) {return [];}object = Object(object);return arrayFilter(nativeGetSymbols(object), function(symbol) {return propertyIsEnumerable.call(object, symbol);});};/*** Creates an array of the own and inherited enumerable symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of symbols.*/var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {var result = [];while (object) {arrayPush(result, getSymbols(object));object = getPrototype(object);}return result;};/*** Gets the `toStringTag` of `value`.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/var getTag = baseGetTag;// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||(Map && getTag(new Map) != mapTag) ||(Promise && getTag(Promise.resolve()) != promiseTag) ||(Set && getTag(new Set) != setTag) ||(WeakMap && getTag(new WeakMap) != weakMapTag)) {getTag = function(value) {var result = baseGetTag(value),Ctor = result == objectTag ? value.constructor : undefined,ctorString = Ctor ? toSource(Ctor) : '';if (ctorString) {switch (ctorString) {case dataViewCtorString: return dataViewTag;case mapCtorString: return mapTag;case promiseCtorString: return promiseTag;case setCtorString: return setTag;case weakMapCtorString: return weakMapTag;}}return result;};}/*** Gets the view, applying any `transforms` to the `start` and `end` positions.** @private* @param {number} start The start of the view.* @param {number} end The end of the view.* @param {Array} transforms The transformations to apply to the view.* @returns {Object} Returns an object containing the `start` and `end`* positions of the view.*/function getView(start, end, transforms) {var index = -1,length = transforms.length;while (++index < length) {var data = transforms[index],size = data.size;switch (data.type) {case 'drop': start += size; break;case 'dropRight': end -= size; break;case 'take': end = nativeMin(end, start + size); break;case 'takeRight': start = nativeMax(start, end - size); break;}}return { 'start': start, 'end': end };}/*** Extracts wrapper details from the `source` body comment.** @private* @param {string} source The source to inspect.* @returns {Array} Returns the wrapper details.*/function getWrapDetails(source) {var match = source.match(reWrapDetails);return match ? match[1].split(reSplitDetails) : [];}/*** Checks if `path` exists on `object`.** @private* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @param {Function} hasFunc The function to check properties.* @returns {boolean} Returns `true` if `path` exists, else `false`.*/function hasPath(object, path, hasFunc) {path = castPath(path, object);var index = -1,length = path.length,result = false;while (++index < length) {var key = toKey(path[index]);if (!(result = object != null && hasFunc(object, key))) {break;}object = object[key];}if (result || ++index != length) {return result;}length = object == null ? 0 : object.length;return !!length && isLength(length) && isIndex(key, length) &&(isArray(object) || isArguments(object));}/*** Initializes an array clone.** @private* @param {Array} array The array to clone.* @returns {Array} Returns the initialized clone.*/function initCloneArray(array) {var length = array.length,result = new array.constructor(length);// Add properties assigned by `RegExp#exec`.if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {result.index = array.index;result.input = array.input;}return result;}/*** Initializes an object clone.** @private* @param {Object} object The object to clone.* @returns {Object} Returns the initialized clone.*/function initCloneObject(object) {return (typeof object.constructor == 'function' && !isPrototype(object))? baseCreate(getPrototype(object)): {};}/*** Initializes an object clone based on its `toStringTag`.** **Note:** This function only supports cloning values with tags of* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.** @private* @param {Object} object The object to clone.* @param {string} tag The `toStringTag` of the object to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the initialized clone.*/function initCloneByTag(object, tag, isDeep) {var Ctor = object.constructor;switch (tag) {case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object, isDeep);case float32Tag: case float64Tag:case int8Tag: case int16Tag: case int32Tag:case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:return cloneTypedArray(object, isDeep);case mapTag:return new Ctor;case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return new Ctor;case symbolTag:return cloneSymbol(object);}}/*** Inserts wrapper `details` in a comment at the top of the `source` body.** @private* @param {string} source The source to modify.* @returns {Array} details The details to insert.* @returns {string} Returns the modified source.*/function insertWrapDetails(source, details) {var length = details.length;if (!length) {return source;}var lastIndex = length - 1;details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];details = details.join(length > 2 ? ', ' : ' ');return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');}/*** Checks if `value` is a flattenable `arguments` object or array.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.*/function isFlattenable(value) {return isArray(value) || isArguments(value) ||!!(spreadableSymbol && value && value[spreadableSymbol]);}/*** Checks if `value` is a valid array-like index.** @private* @param {*} value The value to check.* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.*/function isIndex(value, length) {var type = typeof value;length = length == null ? MAX_SAFE_INTEGER : length;return !!length &&(type == 'number' ||(type != 'symbol' && reIsUint.test(value))) &&(value > -1 && value % 1 == 0 && value < length);}/*** Checks if the given arguments are from an iteratee call.** @private* @param {*} value The potential iteratee value argument.* @param {*} index The potential iteratee index or key argument.* @param {*} object The potential iteratee object argument.* @returns {boolean} Returns `true` if the arguments are from an iteratee call,* else `false`.*/function isIterateeCall(value, index, object) {if (!isObject(object)) {return false;}var type = typeof index;if (type == 'number'? (isArrayLike(object) && isIndex(index, object.length)): (type == 'string' && index in object)) {return eq(object[index], value);}return false;}/*** Checks if `value` is a property name and not a property path.** @private* @param {*} value The value to check.* @param {Object} [object] The object to query keys on.* @returns {boolean} Returns `true` if `value` is a property name, else `false`.*/function isKey(value, object) {if (isArray(value)) {return false;}var type = typeof value;if (type == 'number' || type == 'symbol' || type == 'boolean' ||value == null || isSymbol(value)) {return true;}return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||(object != null && value in Object(object));}/*** Checks if `value` is suitable for use as unique object key.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is suitable, else `false`.*/function isKeyable(value) {var type = typeof value;return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')? (value !== '__proto__'): (value === null);}/*** Checks if `func` has a lazy counterpart.** @private* @param {Function} func The function to check.* @returns {boolean} Returns `true` if `func` has a lazy counterpart,* else `false`.*/function isLaziable(func) {var funcName = getFuncName(func),other = lodash[funcName];if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {return false;}if (func === other) {return true;}var data = getData(other);return !!data && func === data[0];}/*** Checks if `func` has its source masked.** @private* @param {Function} func The function to check.* @returns {boolean} Returns `true` if `func` is masked, else `false`.*/function isMasked(func) {return !!maskSrcKey && (maskSrcKey in func);}/*** Checks if `func` is capable of being masked.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `func` is maskable, else `false`.*/var isMaskable = coreJsData ? isFunction : stubFalse;/*** Checks if `value` is likely a prototype object.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.*/function isPrototype(value) {var Ctor = value && value.constructor,proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;return value === proto;}/*** Checks if `value` is suitable for strict equality comparisons, i.e. `===`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` if suitable for strict* equality comparisons, else `false`.*/function isStrictComparable(value) {return value === value && !isObject(value);}/*** A specialized version of `matchesProperty` for source values suitable* for strict equality comparisons, i.e. `===`.** @private* @param {string} key The key of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.*/function matchesStrictComparable(key, srcValue) {return function(object) {if (object == null) {return false;}return object[key] === srcValue &&(srcValue !== undefined || (key in Object(object)));};}/*** A specialized version of `_.memoize` which clears the memoized function's* cache when it exceeds `MAX_MEMOIZE_SIZE`.** @private* @param {Function} func The function to have its output memoized.* @returns {Function} Returns the new memoized function.*/function memoizeCapped(func) {var result = memoize(func, function(key) {if (cache.size === MAX_MEMOIZE_SIZE) {cache.clear();}return key;});var cache = result.cache;return result;}/*** Merges the function metadata of `source` into `data`.** Merging metadata reduces the number of wrappers used to invoke a function.* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`* may be applied regardless of execution order. Methods like `_.ary` and* `_.rearg` modify function arguments, making the order in which they are* executed important, preventing the merging of metadata. However, we make* an exception for a safe combined case where curried functions have `_.ary`* and or `_.rearg` applied.** @private* @param {Array} data The destination metadata.* @param {Array} source The source metadata.* @returns {Array} Returns `data`.*/function mergeData(data, source) {var bitmask = data[1],srcBitmask = source[1],newBitmask = bitmask | srcBitmask,isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);var isCombo =((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));// Exit early if metadata can't be merged.if (!(isCommon || isCombo)) {return data;}// Use source `thisArg` if available.if (srcBitmask & WRAP_BIND_FLAG) {data[2] = source[2];// Set when currying a bound function.newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;}// Compose partial arguments.var value = source[3];if (value) {var partials = data[3];data[3] = partials ? composeArgs(partials, value, source[4]) : value;data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];}// Compose partial right arguments.value = source[5];if (value) {partials = data[5];data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];}// Use source `argPos` if available.value = source[7];if (value) {data[7] = value;}// Use source `ary` if it's smaller.if (srcBitmask & WRAP_ARY_FLAG) {data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);}// Use source `arity` if one is not provided.if (data[9] == null) {data[9] = source[9];}// Use source `func` and merge bitmasks.data[0] = source[0];data[1] = newBitmask;return data;}/*** This function is like* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* except that it includes inherited enumerable properties.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function nativeKeysIn(object) {var result = [];if (object != null) {for (var key in Object(object)) {result.push(key);}}return result;}/*** Converts `value` to a string using `Object.prototype.toString`.** @private* @param {*} value The value to convert.* @returns {string} Returns the converted string.*/function objectToString(value) {return nativeObjectToString.call(value);}/*** A specialized version of `baseRest` which transforms the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @param {Function} transform The rest array transform.* @returns {Function} Returns the new function.*/function overRest(func, start, transform) {start = nativeMax(start === undefined ? (func.length - 1) : start, 0);return function() {var args = arguments,index = -1,length = nativeMax(args.length - start, 0),array = Array(length);while (++index < length) {array[index] = args[start + index];}index = -1;var otherArgs = Array(start + 1);while (++index < start) {otherArgs[index] = args[index];}otherArgs[start] = transform(array);return apply(func, this, otherArgs);};}/*** Gets the parent value at `path` of `object`.** @private* @param {Object} object The object to query.* @param {Array} path The path to get the parent value of.* @returns {*} Returns the parent value.*/function parent(object, path) {return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));}/*** Reorder `array` according to the specified indexes where the element at* the first index is assigned as the first element, the element at* the second index is assigned as the second element, and so on.** @private* @param {Array} array The array to reorder.* @param {Array} indexes The arranged array indexes.* @returns {Array} Returns `array`.*/function reorder(array, indexes) {var arrLength = array.length,length = nativeMin(indexes.length, arrLength),oldArray = copyArray(array);while (length--) {var index = indexes[length];array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;}return array;}/*** Gets the value at `key`, unless `key` is "__proto__" or "constructor".** @private* @param {Object} object The object to query.* @param {string} key The key of the property to get.* @returns {*} Returns the property value.*/function safeGet(object, key) {if (key === 'constructor' && typeof object[key] === 'function') {return;}if (key == '__proto__') {return;}return object[key];}/*** Sets metadata for `func`.** **Note:** If this function becomes hot, i.e. is invoked a lot in a short* period of time, it will trip its breaker and transition to an identity* function to avoid garbage collection pauses in V8. See* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)* for more details.** @private* @param {Function} func The function to associate metadata with.* @param {*} data The metadata.* @returns {Function} Returns `func`.*/var setData = shortOut(baseSetData);/*** A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).** @private* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @returns {number|Object} Returns the timer id or timeout object.*/var setTimeout = ctxSetTimeout || function(func, wait) {return root.setTimeout(func, wait);};/*** Sets the `toString` method of `func` to return `string`.** @private* @param {Function} func The function to modify.* @param {Function} string The `toString` result.* @returns {Function} Returns `func`.*/var setToString = shortOut(baseSetToString);/*** Sets the `toString` method of `wrapper` to mimic the source of `reference`* with wrapper details in a comment at the top of the source body.** @private* @param {Function} wrapper The function to modify.* @param {Function} reference The reference function.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @returns {Function} Returns `wrapper`.*/function setWrapToString(wrapper, reference, bitmask) {var source = (reference + '');return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));}/*** Creates a function that'll short out and invoke `identity` instead* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`* milliseconds.** @private* @param {Function} func The function to restrict.* @returns {Function} Returns the new shortable function.*/function shortOut(func) {var count = 0,lastCalled = 0;return function() {var stamp = nativeNow(),remaining = HOT_SPAN - (stamp - lastCalled);lastCalled = stamp;if (remaining > 0) {if (++count >= HOT_COUNT) {return arguments[0];}} else {count = 0;}return func.apply(undefined, arguments);};}/*** A specialized version of `_.shuffle` which mutates and sets the size of `array`.** @private* @param {Array} array The array to shuffle.* @param {number} [size=array.length] The size of `array`.* @returns {Array} Returns `array`.*/function shuffleSelf(array, size) {var index = -1,length = array.length,lastIndex = length - 1;size = size === undefined ? length : size;while (++index < size) {var rand = baseRandom(index, lastIndex),value = array[rand];array[rand] = array[index];array[index] = value;}array.length = size;return array;}/*** Converts `string` to a property path array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the property path array.*/var stringToPath = memoizeCapped(function(string) {var result = [];if (string.charCodeAt(0) === 46 /* . */) {result.push('');}string.replace(rePropName, function(match, number, quote, subString) {result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));});return result;});/*** Converts `value` to a string key if it's not a string or symbol.** @private* @param {*} value The value to inspect.* @returns {string|symbol} Returns the key.*/function toKey(value) {if (typeof value == 'string' || isSymbol(value)) {return value;}var result = (value + '');return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;}/*** Converts `func` to its source code.** @private* @param {Function} func The function to convert.* @returns {string} Returns the source code.*/function toSource(func) {if (func != null) {try {return funcToString.call(func);} catch (e) {}try {return (func + '');} catch (e) {}}return '';}/*** Updates wrapper `details` based on `bitmask` flags.** @private* @returns {Array} details The details to modify.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @returns {Array} Returns `details`.*/function updateWrapDetails(details, bitmask) {arrayEach(wrapFlags, function(pair) {var value = '_.' + pair[0];if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {details.push(value);}});return details.sort();}/*** Creates a clone of `wrapper`.** @private* @param {Object} wrapper The wrapper to clone.* @returns {Object} Returns the cloned wrapper.*/function wrapperClone(wrapper) {if (wrapper instanceof LazyWrapper) {return wrapper.clone();}var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);result.__actions__ = copyArray(wrapper.__actions__);result.__index__ = wrapper.__index__;result.__values__ = wrapper.__values__;return result;}/*------------------------------------------------------------------------*//*** Creates an array of elements split into groups the length of `size`.* If `array` can't be split evenly, the final chunk will be the remaining* elements.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to process.* @param {number} [size=1] The length of each chunk* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the new array of chunks.* @example** _.chunk(['a', 'b', 'c', 'd'], 2);* // => [['a', 'b'], ['c', 'd']]** _.chunk(['a', 'b', 'c', 'd'], 3);* // => [['a', 'b', 'c'], ['d']]*/function chunk(array, size, guard) {if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {size = 1;} else {size = nativeMax(toInteger(size), 0);}var length = array == null ? 0 : array.length;if (!length || size < 1) {return [];}var index = 0,resIndex = 0,result = Array(nativeCeil(length / size));while (index < length) {result[resIndex++] = baseSlice(array, index, (index += size));}return result;}/*** Creates an array with all falsey values removed. The values `false`, `null`,* `0`, `""`, `undefined`, and `NaN` are falsey.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to compact.* @returns {Array} Returns the new array of filtered values.* @example** _.compact([0, 1, false, 2, '', 3]);* // => [1, 2, 3]*/function compact(array) {var index = -1,length = array == null ? 0 : array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (value) {result[resIndex++] = value;}}return result;}/*** Creates a new array concatenating `array` with any additional arrays* and/or values.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to concatenate.* @param {...*} [values] The values to concatenate.* @returns {Array} Returns the new concatenated array.* @example** var array = [1];* var other = _.concat(array, 2, [3], [[4]]);** console.log(other);* // => [1, 2, 3, [4]]** console.log(array);* // => [1]*/function concat() {var length = arguments.length;if (!length) {return [];}var args = Array(length - 1),array = arguments[0],index = length;while (index--) {args[index - 1] = arguments[index];}return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));}/*** Creates an array of `array` values not included in the other given arrays* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. The order and references of result values are* determined by the first array.** **Note:** Unlike `_.pullAll`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @returns {Array} Returns the new array of filtered values.* @see _.without, _.xor* @example** _.difference([2, 1], [2, 3]);* // => [1]*/var difference = baseRest(function(array, values) {return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)): [];});/*** This method is like `_.difference` except that it accepts `iteratee` which* is invoked for each element of `array` and `values` to generate the criterion* by which they're compared. The order and references of result values are* determined by the first array. The iteratee is invoked with one argument:* (value).** **Note:** Unlike `_.pullAllBy`, this method returns a new array.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [1.2]** // The `_.property` iteratee shorthand.* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');* // => [{ 'x': 2 }]*/var differenceBy = baseRest(function(array, values) {var iteratee = last(values);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)): [];});/*** This method is like `_.difference` except that it accepts `comparator`* which is invoked to compare elements of `array` to `values`. The order and* references of result values are determined by the first array. The comparator* is invoked with two arguments: (arrVal, othVal).** **Note:** Unlike `_.pullAllWith`, this method returns a new array.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];** _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);* // => [{ 'x': 2, 'y': 1 }]*/var differenceWith = baseRest(function(array, values) {var comparator = last(values);if (isArrayLikeObject(comparator)) {comparator = undefined;}return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator): [];});/*** Creates a slice of `array` with `n` elements dropped from the beginning.** @static* @memberOf _* @since 0.5.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to drop.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.drop([1, 2, 3]);* // => [2, 3]** _.drop([1, 2, 3], 2);* // => [3]** _.drop([1, 2, 3], 5);* // => []** _.drop([1, 2, 3], 0);* // => [1, 2, 3]*/function drop(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);return baseSlice(array, n < 0 ? 0 : n, length);}/*** Creates a slice of `array` with `n` elements dropped from the end.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to drop.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.dropRight([1, 2, 3]);* // => [1, 2]** _.dropRight([1, 2, 3], 2);* // => [1]** _.dropRight([1, 2, 3], 5);* // => []** _.dropRight([1, 2, 3], 0);* // => [1, 2, 3]*/function dropRight(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);n = length - n;return baseSlice(array, 0, n < 0 ? 0 : n);}/*** Creates a slice of `array` excluding elements dropped from the end.* Elements are dropped until `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.dropRightWhile(users, function(o) { return !o.active; });* // => objects for ['barney']** // The `_.matches` iteratee shorthand.* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });* // => objects for ['barney', 'fred']** // The `_.matchesProperty` iteratee shorthand.* _.dropRightWhile(users, ['active', false]);* // => objects for ['barney']** // The `_.property` iteratee shorthand.* _.dropRightWhile(users, 'active');* // => objects for ['barney', 'fred', 'pebbles']*/function dropRightWhile(array, predicate) {return (array && array.length)? baseWhile(array, getIteratee(predicate, 3), true, true): [];}/*** Creates a slice of `array` excluding elements dropped from the beginning.* Elements are dropped until `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.dropWhile(users, function(o) { return !o.active; });* // => objects for ['pebbles']** // The `_.matches` iteratee shorthand.* _.dropWhile(users, { 'user': 'barney', 'active': false });* // => objects for ['fred', 'pebbles']** // The `_.matchesProperty` iteratee shorthand.* _.dropWhile(users, ['active', false]);* // => objects for ['pebbles']** // The `_.property` iteratee shorthand.* _.dropWhile(users, 'active');* // => objects for ['barney', 'fred', 'pebbles']*/function dropWhile(array, predicate) {return (array && array.length)? baseWhile(array, getIteratee(predicate, 3), true): [];}/*** Fills elements of `array` with `value` from `start` up to, but not* including, `end`.** **Note:** This method mutates `array`.** @static* @memberOf _* @since 3.2.0* @category Array* @param {Array} array The array to fill.* @param {*} value The value to fill `array` with.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns `array`.* @example** var array = [1, 2, 3];** _.fill(array, 'a');* console.log(array);* // => ['a', 'a', 'a']** _.fill(Array(3), 2);* // => [2, 2, 2]** _.fill([4, 6, 8, 10], '*', 1, 3);* // => [4, '*', '*', 10]*/function fill(array, value, start, end) {var length = array == null ? 0 : array.length;if (!length) {return [];}if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {start = 0;end = length;}return baseFill(array, value, start, end);}/*** This method is like `_.find` except that it returns the index of the first* element `predicate` returns truthy for instead of the element itself.** @static* @memberOf _* @since 1.1.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the found element, else `-1`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.findIndex(users, function(o) { return o.user == 'barney'; });* // => 0** // The `_.matches` iteratee shorthand.* _.findIndex(users, { 'user': 'fred', 'active': false });* // => 1** // The `_.matchesProperty` iteratee shorthand.* _.findIndex(users, ['active', false]);* // => 0** // The `_.property` iteratee shorthand.* _.findIndex(users, 'active');* // => 2*/function findIndex(array, predicate, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = fromIndex == null ? 0 : toInteger(fromIndex);if (index < 0) {index = nativeMax(length + index, 0);}return baseFindIndex(array, getIteratee(predicate, 3), index);}/*** This method is like `_.findIndex` except that it iterates over elements* of `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=array.length-1] The index to search from.* @returns {number} Returns the index of the found element, else `-1`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });* // => 2** // The `_.matches` iteratee shorthand.* _.findLastIndex(users, { 'user': 'barney', 'active': true });* // => 0** // The `_.matchesProperty` iteratee shorthand.* _.findLastIndex(users, ['active', false]);* // => 2** // The `_.property` iteratee shorthand.* _.findLastIndex(users, 'active');* // => 0*/function findLastIndex(array, predicate, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = length - 1;if (fromIndex !== undefined) {index = toInteger(fromIndex);index = fromIndex < 0? nativeMax(length + index, 0): nativeMin(index, length - 1);}return baseFindIndex(array, getIteratee(predicate, 3), index, true);}/*** Flattens `array` a single level deep.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flatten([1, [2, [3, [4]], 5]]);* // => [1, 2, [3, [4]], 5]*/function flatten(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, 1) : [];}/*** Recursively flattens `array`.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flattenDeep([1, [2, [3, [4]], 5]]);* // => [1, 2, 3, 4, 5]*/function flattenDeep(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, INFINITY) : [];}/*** Recursively flatten `array` up to `depth` times.** @static* @memberOf _* @since 4.4.0* @category Array* @param {Array} array The array to flatten.* @param {number} [depth=1] The maximum recursion depth.* @returns {Array} Returns the new flattened array.* @example** var array = [1, [2, [3, [4]], 5]];** _.flattenDepth(array, 1);* // => [1, 2, [3, [4]], 5]** _.flattenDepth(array, 2);* // => [1, 2, 3, [4], 5]*/function flattenDepth(array, depth) {var length = array == null ? 0 : array.length;if (!length) {return [];}depth = depth === undefined ? 1 : toInteger(depth);return baseFlatten(array, depth);}/*** The inverse of `_.toPairs`; this method returns an object composed* from key-value `pairs`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} pairs The key-value pairs.* @returns {Object} Returns the new object.* @example** _.fromPairs([['a', 1], ['b', 2]]);* // => { 'a': 1, 'b': 2 }*/function fromPairs(pairs) {var index = -1,length = pairs == null ? 0 : pairs.length,result = {};while (++index < length) {var pair = pairs[index];result[pair[0]] = pair[1];}return result;}/*** Gets the first element of `array`.** @static* @memberOf _* @since 0.1.0* @alias first* @category Array* @param {Array} array The array to query.* @returns {*} Returns the first element of `array`.* @example** _.head([1, 2, 3]);* // => 1** _.head([]);* // => undefined*/function head(array) {return (array && array.length) ? array[0] : undefined;}/*** Gets the index at which the first occurrence of `value` is found in `array`* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. If `fromIndex` is negative, it's used as the* offset from the end of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.indexOf([1, 2, 1, 2], 2);* // => 1** // Search from the `fromIndex`.* _.indexOf([1, 2, 1, 2], 2, 2);* // => 3*/function indexOf(array, value, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = fromIndex == null ? 0 : toInteger(fromIndex);if (index < 0) {index = nativeMax(length + index, 0);}return baseIndexOf(array, value, index);}/*** Gets all but the last element of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @returns {Array} Returns the slice of `array`.* @example** _.initial([1, 2, 3]);* // => [1, 2]*/function initial(array) {var length = array == null ? 0 : array.length;return length ? baseSlice(array, 0, -1) : [];}/*** Creates an array of unique values that are included in all given arrays* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. The order and references of result values are* determined by the first array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of intersecting values.* @example** _.intersection([2, 1], [2, 3]);* // => [2]*/var intersection = baseRest(function(arrays) {var mapped = arrayMap(arrays, castArrayLikeObject);return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped): [];});/*** This method is like `_.intersection` except that it accepts `iteratee`* which is invoked for each element of each `arrays` to generate the criterion* by which they're compared. The order and references of result values are* determined by the first array. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of intersecting values.* @example** _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [2.1]** // The `_.property` iteratee shorthand.* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }]*/var intersectionBy = baseRest(function(arrays) {var iteratee = last(arrays),mapped = arrayMap(arrays, castArrayLikeObject);if (iteratee === last(mapped)) {iteratee = undefined;} else {mapped.pop();}return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped, getIteratee(iteratee, 2)): [];});/*** This method is like `_.intersection` except that it accepts `comparator`* which is invoked to compare elements of `arrays`. The order and references* of result values are determined by the first array. The comparator is* invoked with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of intersecting values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.intersectionWith(objects, others, _.isEqual);* // => [{ 'x': 1, 'y': 2 }]*/var intersectionWith = baseRest(function(arrays) {var comparator = last(arrays),mapped = arrayMap(arrays, castArrayLikeObject);comparator = typeof comparator == 'function' ? comparator : undefined;if (comparator) {mapped.pop();}return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped, undefined, comparator): [];});/*** Converts all elements in `array` into a string separated by `separator`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to convert.* @param {string} [separator=','] The element separator.* @returns {string} Returns the joined string.* @example** _.join(['a', 'b', 'c'], '~');* // => 'a~b~c'*/function join(array, separator) {return array == null ? '' : nativeJoin.call(array, separator);}/*** Gets the last element of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @returns {*} Returns the last element of `array`.* @example** _.last([1, 2, 3]);* // => 3*/function last(array) {var length = array == null ? 0 : array.length;return length ? array[length - 1] : undefined;}/*** This method is like `_.indexOf` except that it iterates over elements of* `array` from right to left.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=array.length-1] The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.lastIndexOf([1, 2, 1, 2], 2);* // => 3** // Search from the `fromIndex`.* _.lastIndexOf([1, 2, 1, 2], 2, 2);* // => 1*/function lastIndexOf(array, value, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = length;if (fromIndex !== undefined) {index = toInteger(fromIndex);index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);}return value === value? strictLastIndexOf(array, value, index): baseFindIndex(array, baseIsNaN, index, true);}/*** Gets the element at index `n` of `array`. If `n` is negative, the nth* element from the end is returned.** @static* @memberOf _* @since 4.11.0* @category Array* @param {Array} array The array to query.* @param {number} [n=0] The index of the element to return.* @returns {*} Returns the nth element of `array`.* @example** var array = ['a', 'b', 'c', 'd'];** _.nth(array, 1);* // => 'b'** _.nth(array, -2);* // => 'c';*/function nth(array, n) {return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;}/*** Removes all given values from `array` using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`* to remove elements from an array by predicate.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to modify.* @param {...*} [values] The values to remove.* @returns {Array} Returns `array`.* @example** var array = ['a', 'b', 'c', 'a', 'b', 'c'];** _.pull(array, 'a', 'c');* console.log(array);* // => ['b', 'b']*/var pull = baseRest(pullAll);/*** This method is like `_.pull` except that it accepts an array of values to remove.** **Note:** Unlike `_.difference`, this method mutates `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @returns {Array} Returns `array`.* @example** var array = ['a', 'b', 'c', 'a', 'b', 'c'];** _.pullAll(array, ['a', 'c']);* console.log(array);* // => ['b', 'b']*/function pullAll(array, values) {return (array && array.length && values && values.length)? basePullAll(array, values): array;}/*** This method is like `_.pullAll` except that it accepts `iteratee` which is* invoked for each element of `array` and `values` to generate the criterion* by which they're compared. The iteratee is invoked with one argument: (value).** **Note:** Unlike `_.differenceBy`, this method mutates `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns `array`.* @example** var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];** _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');* console.log(array);* // => [{ 'x': 2 }]*/function pullAllBy(array, values, iteratee) {return (array && array.length && values && values.length)? basePullAll(array, values, getIteratee(iteratee, 2)): array;}/*** This method is like `_.pullAll` except that it accepts `comparator` which* is invoked to compare elements of `array` to `values`. The comparator is* invoked with two arguments: (arrVal, othVal).** **Note:** Unlike `_.differenceWith`, this method mutates `array`.** @static* @memberOf _* @since 4.6.0* @category Array* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns `array`.* @example** var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];** _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);* console.log(array);* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]*/function pullAllWith(array, values, comparator) {return (array && array.length && values && values.length)? basePullAll(array, values, undefined, comparator): array;}/*** Removes elements from `array` corresponding to `indexes` and returns an* array of removed elements.** **Note:** Unlike `_.at`, this method mutates `array`.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to modify.* @param {...(number|number[])} [indexes] The indexes of elements to remove.* @returns {Array} Returns the new array of removed elements.* @example** var array = ['a', 'b', 'c', 'd'];* var pulled = _.pullAt(array, [1, 3]);** console.log(array);* // => ['a', 'c']** console.log(pulled);* // => ['b', 'd']*/var pullAt = flatRest(function(array, indexes) {var length = array == null ? 0 : array.length,result = baseAt(array, indexes);basePullAt(array, arrayMap(indexes, function(index) {return isIndex(index, length) ? +index : index;}).sort(compareAscending));return result;});/*** Removes all elements from `array` that `predicate` returns truthy for* and returns an array of the removed elements. The predicate is invoked* with three arguments: (value, index, array).** **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`* to pull elements from an array by value.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to modify.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new array of removed elements.* @example** var array = [1, 2, 3, 4];* var evens = _.remove(array, function(n) {* return n % 2 == 0;* });** console.log(array);* // => [1, 3]** console.log(evens);* // => [2, 4]*/function remove(array, predicate) {var result = [];if (!(array && array.length)) {return result;}var index = -1,indexes = [],length = array.length;predicate = getIteratee(predicate, 3);while (++index < length) {var value = array[index];if (predicate(value, index, array)) {result.push(value);indexes.push(index);}}basePullAt(array, indexes);return result;}/*** Reverses `array` so that the first element becomes the last, the second* element becomes the second to last, and so on.** **Note:** This method mutates `array` and is based on* [`Array#reverse`](https://mdn.io/Array/reverse).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to modify.* @returns {Array} Returns `array`.* @example** var array = [1, 2, 3];** _.reverse(array);* // => [3, 2, 1]** console.log(array);* // => [3, 2, 1]*/function reverse(array) {return array == null ? array : nativeReverse.call(array);}/*** Creates a slice of `array` from `start` up to, but not including, `end`.** **Note:** This method is used instead of* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are* returned.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function slice(array, start, end) {var length = array == null ? 0 : array.length;if (!length) {return [];}if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {start = 0;end = length;}else {start = start == null ? 0 : toInteger(start);end = end === undefined ? length : toInteger(end);}return baseSlice(array, start, end);}/*** Uses a binary search to determine the lowest index at which `value`* should be inserted into `array` in order to maintain its sort order.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** _.sortedIndex([30, 50], 40);* // => 1*/function sortedIndex(array, value) {return baseSortedIndex(array, value);}/*** This method is like `_.sortedIndex` except that it accepts `iteratee`* which is invoked for `value` and each element of `array` to compute their* sort ranking. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** var objects = [{ 'x': 4 }, { 'x': 5 }];** _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });* // => 0** // The `_.property` iteratee shorthand.* _.sortedIndexBy(objects, { 'x': 4 }, 'x');* // => 0*/function sortedIndexBy(array, value, iteratee) {return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));}/*** This method is like `_.indexOf` except that it performs a binary* search on a sorted `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.sortedIndexOf([4, 5, 5, 5, 6], 5);* // => 1*/function sortedIndexOf(array, value) {var length = array == null ? 0 : array.length;if (length) {var index = baseSortedIndex(array, value);if (index < length && eq(array[index], value)) {return index;}}return -1;}/*** This method is like `_.sortedIndex` except that it returns the highest* index at which `value` should be inserted into `array` in order to* maintain its sort order.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** _.sortedLastIndex([4, 5, 5, 5, 6], 5);* // => 4*/function sortedLastIndex(array, value) {return baseSortedIndex(array, value, true);}/*** This method is like `_.sortedLastIndex` except that it accepts `iteratee`* which is invoked for `value` and each element of `array` to compute their* sort ranking. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the index at which `value` should be inserted* into `array`.* @example** var objects = [{ 'x': 4 }, { 'x': 5 }];** _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });* // => 1** // The `_.property` iteratee shorthand.* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');* // => 1*/function sortedLastIndexBy(array, value, iteratee) {return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);}/*** This method is like `_.lastIndexOf` except that it performs a binary* search on a sorted `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);* // => 3*/function sortedLastIndexOf(array, value) {var length = array == null ? 0 : array.length;if (length) {var index = baseSortedIndex(array, value, true) - 1;if (eq(array[index], value)) {return index;}}return -1;}/*** This method is like `_.uniq` except that it's designed and optimized* for sorted arrays.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @returns {Array} Returns the new duplicate free array.* @example** _.sortedUniq([1, 1, 2]);* // => [1, 2]*/function sortedUniq(array) {return (array && array.length)? baseSortedUniq(array): [];}/*** This method is like `_.uniqBy` except that it's designed and optimized* for sorted arrays.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);* // => [1.1, 2.3]*/function sortedUniqBy(array, iteratee) {return (array && array.length)? baseSortedUniq(array, getIteratee(iteratee, 2)): [];}/*** Gets all but the first element of `array`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to query.* @returns {Array} Returns the slice of `array`.* @example** _.tail([1, 2, 3]);* // => [2, 3]*/function tail(array) {var length = array == null ? 0 : array.length;return length ? baseSlice(array, 1, length) : [];}/*** Creates a slice of `array` with `n` elements taken from the beginning.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to take.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.take([1, 2, 3]);* // => [1]** _.take([1, 2, 3], 2);* // => [1, 2]** _.take([1, 2, 3], 5);* // => [1, 2, 3]** _.take([1, 2, 3], 0);* // => []*/function take(array, n, guard) {if (!(array && array.length)) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);return baseSlice(array, 0, n < 0 ? 0 : n);}/*** Creates a slice of `array` with `n` elements taken from the end.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to take.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.takeRight([1, 2, 3]);* // => [3]** _.takeRight([1, 2, 3], 2);* // => [2, 3]** _.takeRight([1, 2, 3], 5);* // => [1, 2, 3]** _.takeRight([1, 2, 3], 0);* // => []*/function takeRight(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);n = length - n;return baseSlice(array, n < 0 ? 0 : n, length);}/*** Creates a slice of `array` with elements taken from the end. Elements are* taken until `predicate` returns falsey. The predicate is invoked with* three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.takeRightWhile(users, function(o) { return !o.active; });* // => objects for ['fred', 'pebbles']** // The `_.matches` iteratee shorthand.* _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });* // => objects for ['pebbles']** // The `_.matchesProperty` iteratee shorthand.* _.takeRightWhile(users, ['active', false]);* // => objects for ['fred', 'pebbles']** // The `_.property` iteratee shorthand.* _.takeRightWhile(users, 'active');* // => []*/function takeRightWhile(array, predicate) {return (array && array.length)? baseWhile(array, getIteratee(predicate, 3), false, true): [];}/*** Creates a slice of `array` with elements taken from the beginning. Elements* are taken until `predicate` returns falsey. The predicate is invoked with* three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.takeWhile(users, function(o) { return !o.active; });* // => objects for ['barney', 'fred']** // The `_.matches` iteratee shorthand.* _.takeWhile(users, { 'user': 'barney', 'active': false });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.takeWhile(users, ['active', false]);* // => objects for ['barney', 'fred']** // The `_.property` iteratee shorthand.* _.takeWhile(users, 'active');* // => []*/function takeWhile(array, predicate) {return (array && array.length)? baseWhile(array, getIteratee(predicate, 3)): [];}/*** Creates an array of unique values, in order, from all given arrays using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of combined values.* @example** _.union([2], [1, 2]);* // => [2, 1]*/var union = baseRest(function(arrays) {return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));});/*** This method is like `_.union` except that it accepts `iteratee` which is* invoked for each element of each `arrays` to generate the criterion by* which uniqueness is computed. Result values are chosen from the first* array in which the value occurs. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of combined values.* @example** _.unionBy([2.1], [1.2, 2.3], Math.floor);* // => [2.1, 1.2]** // The `_.property` iteratee shorthand.* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }, { 'x': 2 }]*/var unionBy = baseRest(function(arrays) {var iteratee = last(arrays);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));});/*** This method is like `_.union` except that it accepts `comparator` which* is invoked to compare elements of `arrays`. Result values are chosen from* the first array in which the value occurs. The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of combined values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.unionWith(objects, others, _.isEqual);* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]*/var unionWith = baseRest(function(arrays) {var comparator = last(arrays);comparator = typeof comparator == 'function' ? comparator : undefined;return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);});/*** Creates a duplicate-free version of an array, using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons, in which only the first occurrence of each element* is kept. The order of result values is determined by the order they occur* in the array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @returns {Array} Returns the new duplicate free array.* @example** _.uniq([2, 1, 2]);* // => [2, 1]*/function uniq(array) {return (array && array.length) ? baseUniq(array) : [];}/*** This method is like `_.uniq` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* uniqueness is computed. The order of result values is determined by the* order they occur in the array. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** _.uniqBy([2.1, 1.2, 2.3], Math.floor);* // => [2.1, 1.2]** // The `_.property` iteratee shorthand.* _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }, { 'x': 2 }]*/function uniqBy(array, iteratee) {return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];}/*** This method is like `_.uniq` except that it accepts `comparator` which* is invoked to compare elements of `array`. The order of result values is* determined by the order they occur in the array.The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new duplicate free array.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.uniqWith(objects, _.isEqual);* // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]*/function uniqWith(array, comparator) {comparator = typeof comparator == 'function' ? comparator : undefined;return (array && array.length) ? baseUniq(array, undefined, comparator) : [];}/*** This method is like `_.zip` except that it accepts an array of grouped* elements and creates an array regrouping the elements to their pre-zip* configuration.** @static* @memberOf _* @since 1.2.0* @category Array* @param {Array} array The array of grouped elements to process.* @returns {Array} Returns the new array of regrouped elements.* @example** var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);* // => [['a', 1, true], ['b', 2, false]]** _.unzip(zipped);* // => [['a', 'b'], [1, 2], [true, false]]*/function unzip(array) {if (!(array && array.length)) {return [];}var length = 0;array = arrayFilter(array, function(group) {if (isArrayLikeObject(group)) {length = nativeMax(group.length, length);return true;}});return baseTimes(length, function(index) {return arrayMap(array, baseProperty(index));});}/*** This method is like `_.unzip` except that it accepts `iteratee` to specify* how regrouped values should be combined. The iteratee is invoked with the* elements of each group: (...group).** @static* @memberOf _* @since 3.8.0* @category Array* @param {Array} array The array of grouped elements to process.* @param {Function} [iteratee=_.identity] The function to combine* regrouped values.* @returns {Array} Returns the new array of regrouped elements.* @example** var zipped = _.zip([1, 2], [10, 20], [100, 200]);* // => [[1, 10, 100], [2, 20, 200]]** _.unzipWith(zipped, _.add);* // => [3, 30, 300]*/function unzipWith(array, iteratee) {if (!(array && array.length)) {return [];}var result = unzip(array);if (iteratee == null) {return result;}return arrayMap(result, function(group) {return apply(iteratee, undefined, group);});}/*** Creates an array excluding all given values using* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** **Note:** Unlike `_.pull`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {...*} [values] The values to exclude.* @returns {Array} Returns the new array of filtered values.* @see _.difference, _.xor* @example** _.without([2, 1, 2, 3], 1, 2);* // => [3]*/var without = baseRest(function(array, values) {return isArrayLikeObject(array)? baseDifference(array, values): [];});/*** Creates an array of unique values that is the* [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)* of the given arrays. The order of result values is determined by the order* they occur in the arrays.** @static* @memberOf _* @since 2.4.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of filtered values.* @see _.difference, _.without* @example** _.xor([2, 1], [2, 3]);* // => [1, 3]*/var xor = baseRest(function(arrays) {return baseXor(arrayFilter(arrays, isArrayLikeObject));});/*** This method is like `_.xor` except that it accepts `iteratee` which is* invoked for each element of each `arrays` to generate the criterion by* which by which they're compared. The order of result values is determined* by the order they occur in the arrays. The iteratee is invoked with one* argument: (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [1.2, 3.4]** // The `_.property` iteratee shorthand.* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 2 }]*/var xorBy = baseRest(function(arrays) {var iteratee = last(arrays);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));});/*** This method is like `_.xor` except that it accepts `comparator` which is* invoked to compare elements of `arrays`. The order of result values is* determined by the order they occur in the arrays. The comparator is invoked* with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.xorWith(objects, others, _.isEqual);* // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]*/var xorWith = baseRest(function(arrays) {var comparator = last(arrays);comparator = typeof comparator == 'function' ? comparator : undefined;return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);});/*** Creates an array of grouped elements, the first of which contains the* first elements of the given arrays, the second of which contains the* second elements of the given arrays, and so on.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to process.* @returns {Array} Returns the new array of grouped elements.* @example** _.zip(['a', 'b'], [1, 2], [true, false]);* // => [['a', 1, true], ['b', 2, false]]*/var zip = baseRest(unzip);/*** This method is like `_.fromPairs` except that it accepts two arrays,* one of property identifiers and one of corresponding values.** @static* @memberOf _* @since 0.4.0* @category Array* @param {Array} [props=[]] The property identifiers.* @param {Array} [values=[]] The property values.* @returns {Object} Returns the new object.* @example** _.zipObject(['a', 'b'], [1, 2]);* // => { 'a': 1, 'b': 2 }*/function zipObject(props, values) {return baseZipObject(props || [], values || [], assignValue);}/*** This method is like `_.zipObject` except that it supports property paths.** @static* @memberOf _* @since 4.1.0* @category Array* @param {Array} [props=[]] The property identifiers.* @param {Array} [values=[]] The property values.* @returns {Object} Returns the new object.* @example** _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);* // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }*/function zipObjectDeep(props, values) {return baseZipObject(props || [], values || [], baseSet);}/*** This method is like `_.zip` except that it accepts `iteratee` to specify* how grouped values should be combined. The iteratee is invoked with the* elements of each group: (...group).** @static* @memberOf _* @since 3.8.0* @category Array* @param {...Array} [arrays] The arrays to process.* @param {Function} [iteratee=_.identity] The function to combine* grouped values.* @returns {Array} Returns the new array of grouped elements.* @example** _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {* return a + b + c;* });* // => [111, 222]*/var zipWith = baseRest(function(arrays) {var length = arrays.length,iteratee = length > 1 ? arrays[length - 1] : undefined;iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;return unzipWith(arrays, iteratee);});/*------------------------------------------------------------------------*//*** Creates a `lodash` wrapper instance that wraps `value` with explicit method* chain sequences enabled. The result of such sequences must be unwrapped* with `_#value`.** @static* @memberOf _* @since 1.3.0* @category Seq* @param {*} value The value to wrap.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 },* { 'user': 'pebbles', 'age': 1 }* ];** var youngest = _* .chain(users)* .sortBy('age')* .map(function(o) {* return o.user + ' is ' + o.age;* })* .head()* .value();* // => 'pebbles is 1'*/function chain(value) {var result = lodash(value);result.__chain__ = true;return result;}/*** This method invokes `interceptor` and returns `value`. The interceptor* is invoked with one argument; (value). The purpose of this method is to* "tap into" a method chain sequence in order to modify intermediate results.** @static* @memberOf _* @since 0.1.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns `value`.* @example** _([1, 2, 3])* .tap(function(array) {* // Mutate input array.* array.pop();* })* .reverse()* .value();* // => [2, 1]*/function tap(value, interceptor) {interceptor(value);return value;}/*** This method is like `_.tap` except that it returns the result of `interceptor`.* The purpose of this method is to "pass thru" values replacing intermediate* results in a method chain sequence.** @static* @memberOf _* @since 3.0.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns the result of `interceptor`.* @example** _(' abc ')* .chain()* .trim()* .thru(function(value) {* return [value];* })* .value();* // => ['abc']*/function thru(value, interceptor) {return interceptor(value);}/*** This method is the wrapper version of `_.at`.** @name at* @memberOf _* @since 1.0.0* @category Seq* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };** _(object).at(['a[0].b.c', 'a[1]']).value();* // => [3, 4]*/var wrapperAt = flatRest(function(paths) {var length = paths.length,start = length ? paths[0] : 0,value = this.__wrapped__,interceptor = function(object) { return baseAt(object, paths); };if (length > 1 || this.__actions__.length ||!(value instanceof LazyWrapper) || !isIndex(start)) {return this.thru(interceptor);}value = value.slice(start, +start + (length ? 1 : 0));value.__actions__.push({'func': thru,'args': [interceptor],'thisArg': undefined});return new LodashWrapper(value, this.__chain__).thru(function(array) {if (length && !array.length) {array.push(undefined);}return array;});});/*** Creates a `lodash` wrapper instance with explicit method chain sequences enabled.** @name chain* @memberOf _* @since 0.1.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 }* ];** // A sequence without explicit chaining.* _(users).head();* // => { 'user': 'barney', 'age': 36 }** // A sequence with explicit chaining.* _(users)* .chain()* .head()* .pick('user')* .value();* // => { 'user': 'barney' }*/function wrapperChain() {return chain(this);}/*** Executes the chain sequence and returns the wrapped result.** @name commit* @memberOf _* @since 3.2.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var array = [1, 2];* var wrapped = _(array).push(3);** console.log(array);* // => [1, 2]** wrapped = wrapped.commit();* console.log(array);* // => [1, 2, 3]** wrapped.last();* // => 3** console.log(array);* // => [1, 2, 3]*/function wrapperCommit() {return new LodashWrapper(this.value(), this.__chain__);}/*** Gets the next value on a wrapped object following the* [iterator protocol](https://mdn.io/iteration_protocols#iterator).** @name next* @memberOf _* @since 4.0.0* @category Seq* @returns {Object} Returns the next iterator value.* @example** var wrapped = _([1, 2]);** wrapped.next();* // => { 'done': false, 'value': 1 }** wrapped.next();* // => { 'done': false, 'value': 2 }** wrapped.next();* // => { 'done': true, 'value': undefined }*/function wrapperNext() {if (this.__values__ === undefined) {this.__values__ = toArray(this.value());}var done = this.__index__ >= this.__values__.length,value = done ? undefined : this.__values__[this.__index__++];return { 'done': done, 'value': value };}/*** Enables the wrapper to be iterable.** @name Symbol.iterator* @memberOf _* @since 4.0.0* @category Seq* @returns {Object} Returns the wrapper object.* @example** var wrapped = _([1, 2]);** wrapped[Symbol.iterator]() === wrapped;* // => true** Array.from(wrapped);* // => [1, 2]*/function wrapperToIterator() {return this;}/*** Creates a clone of the chain sequence planting `value` as the wrapped value.** @name plant* @memberOf _* @since 3.2.0* @category Seq* @param {*} value The value to plant.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** function square(n) {* return n * n;* }** var wrapped = _([1, 2]).map(square);* var other = wrapped.plant([3, 4]);** other.value();* // => [9, 16]** wrapped.value();* // => [1, 4]*/function wrapperPlant(value) {var result,parent = this;while (parent instanceof baseLodash) {var clone = wrapperClone(parent);clone.__index__ = 0;clone.__values__ = undefined;if (result) {previous.__wrapped__ = clone;} else {result = clone;}var previous = clone;parent = parent.__wrapped__;}previous.__wrapped__ = value;return result;}/*** This method is the wrapper version of `_.reverse`.** **Note:** This method mutates the wrapped array.** @name reverse* @memberOf _* @since 0.1.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var array = [1, 2, 3];** _(array).reverse().value()* // => [3, 2, 1]** console.log(array);* // => [3, 2, 1]*/function wrapperReverse() {var value = this.__wrapped__;if (value instanceof LazyWrapper) {var wrapped = value;if (this.__actions__.length) {wrapped = new LazyWrapper(this);}wrapped = wrapped.reverse();wrapped.__actions__.push({'func': thru,'args': [reverse],'thisArg': undefined});return new LodashWrapper(wrapped, this.__chain__);}return this.thru(reverse);}/*** Executes the chain sequence to resolve the unwrapped value.** @name value* @memberOf _* @since 0.1.0* @alias toJSON, valueOf* @category Seq* @returns {*} Returns the resolved unwrapped value.* @example** _([1, 2, 3]).value();* // => [1, 2, 3]*/function wrapperValue() {return baseWrapperValue(this.__wrapped__, this.__actions__);}/*------------------------------------------------------------------------*//*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The corresponding value of* each key is the number of times the key was returned by `iteratee`. The* iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 0.5.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** _.countBy([6.1, 4.2, 6.3], Math.floor);* // => { '4': 1, '6': 2 }** // The `_.property` iteratee shorthand.* _.countBy(['one', 'two', 'three'], 'length');* // => { '3': 2, '5': 1 }*/var countBy = createAggregator(function(result, value, key) {if (hasOwnProperty.call(result, key)) {++result[key];} else {baseAssignValue(result, key, 1);}});/*** Checks if `predicate` returns truthy for **all** elements of `collection`.* Iteration is stopped once `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index|key, collection).** **Note:** This method returns `true` for* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of* elements of empty collections.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`.* @example** _.every([true, 1, null, 'yes'], Boolean);* // => false** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.every(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.every(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.every(users, 'active');* // => false*/function every(collection, predicate, guard) {var func = isArray(collection) ? arrayEvery : baseEvery;if (guard && isIterateeCall(collection, predicate, guard)) {predicate = undefined;}return func(collection, getIteratee(predicate, 3));}/*** Iterates over elements of `collection`, returning an array of all elements* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** **Note:** Unlike `_.remove`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new filtered array.* @see _.reject* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** _.filter(users, function(o) { return !o.active; });* // => objects for ['fred']** // The `_.matches` iteratee shorthand.* _.filter(users, { 'age': 36, 'active': true });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, ['active', false]);* // => objects for ['fred']** // The `_.property` iteratee shorthand.* _.filter(users, 'active');* // => objects for ['barney']** // Combining several predicates using `_.overEvery` or `_.overSome`.* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));* // => objects for ['fred', 'barney']*/function filter(collection, predicate) {var func = isArray(collection) ? arrayFilter : baseFilter;return func(collection, getIteratee(predicate, 3));}/*** Iterates over elements of `collection`, returning the first element* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {*} Returns the matched element, else `undefined`.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false },* { 'user': 'pebbles', 'age': 1, 'active': true }* ];** _.find(users, function(o) { return o.age < 40; });* // => object for 'barney'** // The `_.matches` iteratee shorthand.* _.find(users, { 'age': 1, 'active': true });* // => object for 'pebbles'** // The `_.matchesProperty` iteratee shorthand.* _.find(users, ['active', false]);* // => object for 'fred'** // The `_.property` iteratee shorthand.* _.find(users, 'active');* // => object for 'barney'*/var find = createFind(findIndex);/*** This method is like `_.find` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @category Collection* @param {Array|Object} collection The collection to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=collection.length-1] The index to search from.* @returns {*} Returns the matched element, else `undefined`.* @example** _.findLast([1, 2, 3, 4], function(n) {* return n % 2 == 1;* });* // => 3*/var findLast = createFind(findLastIndex);/*** Creates a flattened array of values by running each element in `collection`* thru `iteratee` and flattening the mapped results. The iteratee is invoked* with three arguments: (value, index|key, collection).** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [n, n];* }** _.flatMap([1, 2], duplicate);* // => [1, 1, 2, 2]*/function flatMap(collection, iteratee) {return baseFlatten(map(collection, iteratee), 1);}/*** This method is like `_.flatMap` except that it recursively flattens the* mapped results.** @static* @memberOf _* @since 4.7.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [[[n, n]]];* }** _.flatMapDeep([1, 2], duplicate);* // => [1, 1, 2, 2]*/function flatMapDeep(collection, iteratee) {return baseFlatten(map(collection, iteratee), INFINITY);}/*** This method is like `_.flatMap` except that it recursively flattens the* mapped results up to `depth` times.** @static* @memberOf _* @since 4.7.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {number} [depth=1] The maximum recursion depth.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [[[n, n]]];* }** _.flatMapDepth([1, 2], duplicate, 2);* // => [[1, 1], [2, 2]]*/function flatMapDepth(collection, iteratee, depth) {depth = depth === undefined ? 1 : toInteger(depth);return baseFlatten(map(collection, iteratee), depth);}/*** Iterates over elements of `collection` and invokes `iteratee` for each element.* The iteratee is invoked with three arguments: (value, index|key, collection).* Iteratee functions may exit iteration early by explicitly returning `false`.** **Note:** As with other "Collections" methods, objects with a "length"* property are iterated like arrays. To avoid this behavior use `_.forIn`* or `_.forOwn` for object iteration.** @static* @memberOf _* @since 0.1.0* @alias each* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array|Object} Returns `collection`.* @see _.forEachRight* @example** _.forEach([1, 2], function(value) {* console.log(value);* });* // => Logs `1` then `2`.** _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {* console.log(key);* });* // => Logs 'a' then 'b' (iteration order is not guaranteed).*/function forEach(collection, iteratee) {var func = isArray(collection) ? arrayEach : baseEach;return func(collection, getIteratee(iteratee, 3));}/*** This method is like `_.forEach` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @alias eachRight* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array|Object} Returns `collection`.* @see _.forEach* @example** _.forEachRight([1, 2], function(value) {* console.log(value);* });* // => Logs `2` then `1`.*/function forEachRight(collection, iteratee) {var func = isArray(collection) ? arrayEachRight : baseEachRight;return func(collection, getIteratee(iteratee, 3));}/*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The order of grouped values* is determined by the order they occur in `collection`. The corresponding* value of each key is an array of elements responsible for generating the* key. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** _.groupBy([6.1, 4.2, 6.3], Math.floor);* // => { '4': [4.2], '6': [6.1, 6.3] }** // The `_.property` iteratee shorthand.* _.groupBy(['one', 'two', 'three'], 'length');* // => { '3': ['one', 'two'], '5': ['three'] }*/var groupBy = createAggregator(function(result, value, key) {if (hasOwnProperty.call(result, key)) {result[key].push(value);} else {baseAssignValue(result, key, [value]);}});/*** Checks if `value` is in `collection`. If `collection` is a string, it's* checked for a substring of `value`, otherwise* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* is used for equality comparisons. If `fromIndex` is negative, it's used as* the offset from the end of `collection`.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object|string} collection The collection to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=0] The index to search from.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.* @returns {boolean} Returns `true` if `value` is found, else `false`.* @example** _.includes([1, 2, 3], 1);* // => true** _.includes([1, 2, 3], 1, 2);* // => false** _.includes({ 'a': 1, 'b': 2 }, 1);* // => true** _.includes('abcd', 'bc');* // => true*/function includes(collection, value, fromIndex, guard) {collection = isArrayLike(collection) ? collection : values(collection);fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;var length = collection.length;if (fromIndex < 0) {fromIndex = nativeMax(length + fromIndex, 0);}return isString(collection)? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1): (!!length && baseIndexOf(collection, value, fromIndex) > -1);}/*** Invokes the method at `path` of each element in `collection`, returning* an array of the results of each invoked method. Any additional arguments* are provided to each invoked method. If `path` is a function, it's invoked* for, and `this` bound to, each element in `collection`.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Array|Function|string} path The path of the method to invoke or* the function invoked per iteration.* @param {...*} [args] The arguments to invoke each method with.* @returns {Array} Returns the array of results.* @example** _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');* // => [[1, 5, 7], [1, 2, 3]]** _.invokeMap([123, 456], String.prototype.split, '');* // => [['1', '2', '3'], ['4', '5', '6']]*/var invokeMap = baseRest(function(collection, path, args) {var index = -1,isFunc = typeof path == 'function',result = isArrayLike(collection) ? Array(collection.length) : [];baseEach(collection, function(value) {result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);});return result;});/*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The corresponding value of* each key is the last element responsible for generating the key. The* iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** var array = [* { 'dir': 'left', 'code': 97 },* { 'dir': 'right', 'code': 100 }* ];** _.keyBy(array, function(o) {* return String.fromCharCode(o.code);* });* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }** _.keyBy(array, 'dir');* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }*/var keyBy = createAggregator(function(result, value, key) {baseAssignValue(result, key, value);});/*** Creates an array of values by running each element in `collection` thru* `iteratee`. The iteratee is invoked with three arguments:* (value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.** The guarded methods are:* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,* `template`, `trim`, `trimEnd`, `trimStart`, and `words`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new mapped array.* @example** function square(n) {* return n * n;* }** _.map([4, 8], square);* // => [16, 64]** _.map({ 'a': 4, 'b': 8 }, square);* // => [16, 64] (iteration order is not guaranteed)** var users = [* { 'user': 'barney' },* { 'user': 'fred' }* ];** // The `_.property` iteratee shorthand.* _.map(users, 'user');* // => ['barney', 'fred']*/function map(collection, iteratee) {var func = isArray(collection) ? arrayMap : baseMap;return func(collection, getIteratee(iteratee, 3));}/*** This method is like `_.sortBy` except that it allows specifying the sort* orders of the iteratees to sort by. If `orders` is unspecified, all values* are sorted in ascending order. Otherwise, specify an order of "desc" for* descending or "asc" for ascending sort order of corresponding values.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]* The iteratees to sort by.* @param {string[]} [orders] The sort orders of `iteratees`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.* @returns {Array} Returns the new sorted array.* @example** var users = [* { 'user': 'fred', 'age': 48 },* { 'user': 'barney', 'age': 34 },* { 'user': 'fred', 'age': 40 },* { 'user': 'barney', 'age': 36 }* ];** // Sort by `user` in ascending order and by `age` in descending order.* _.orderBy(users, ['user', 'age'], ['asc', 'desc']);* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]*/function orderBy(collection, iteratees, orders, guard) {if (collection == null) {return [];}if (!isArray(iteratees)) {iteratees = iteratees == null ? [] : [iteratees];}orders = guard ? undefined : orders;if (!isArray(orders)) {orders = orders == null ? [] : [orders];}return baseOrderBy(collection, iteratees, orders);}/*** Creates an array of elements split into two groups, the first of which* contains elements `predicate` returns truthy for, the second of which* contains elements `predicate` returns falsey for. The predicate is* invoked with one argument: (value).** @static* @memberOf _* @since 3.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the array of grouped elements.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': true },* { 'user': 'pebbles', 'age': 1, 'active': false }* ];** _.partition(users, function(o) { return o.active; });* // => objects for [['fred'], ['barney', 'pebbles']]** // The `_.matches` iteratee shorthand.* _.partition(users, { 'age': 1, 'active': false });* // => objects for [['pebbles'], ['barney', 'fred']]** // The `_.matchesProperty` iteratee shorthand.* _.partition(users, ['active', false]);* // => objects for [['barney', 'pebbles'], ['fred']]** // The `_.property` iteratee shorthand.* _.partition(users, 'active');* // => objects for [['fred'], ['barney', 'pebbles']]*/var partition = createAggregator(function(result, value, key) {result[key ? 0 : 1].push(value);}, function() { return [[], []]; });/*** Reduces `collection` to a value which is the accumulated result of running* each element in `collection` thru `iteratee`, where each successive* invocation is supplied the return value of the previous. If `accumulator`* is not given, the first element of `collection` is used as the initial* value. The iteratee is invoked with four arguments:* (accumulator, value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.reduce`, `_.reduceRight`, and `_.transform`.** The guarded methods are:* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,* and `sortBy`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The initial value.* @returns {*} Returns the accumulated value.* @see _.reduceRight* @example** _.reduce([1, 2], function(sum, n) {* return sum + n;* }, 0);* // => 3** _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {* (result[value] || (result[value] = [])).push(key);* return result;* }, {});* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)*/function reduce(collection, iteratee, accumulator) {var func = isArray(collection) ? arrayReduce : baseReduce,initAccum = arguments.length < 3;return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);}/*** This method is like `_.reduce` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The initial value.* @returns {*} Returns the accumulated value.* @see _.reduce* @example** var array = [[0, 1], [2, 3], [4, 5]];** _.reduceRight(array, function(flattened, other) {* return flattened.concat(other);* }, []);* // => [4, 5, 2, 3, 0, 1]*/function reduceRight(collection, iteratee, accumulator) {var func = isArray(collection) ? arrayReduceRight : baseReduce,initAccum = arguments.length < 3;return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);}/*** The opposite of `_.filter`; this method returns the elements of `collection`* that `predicate` does **not** return truthy for.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new filtered array.* @see _.filter* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': true }* ];** _.reject(users, function(o) { return !o.active; });* // => objects for ['fred']** // The `_.matches` iteratee shorthand.* _.reject(users, { 'age': 40, 'active': true });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.reject(users, ['active', false]);* // => objects for ['fred']** // The `_.property` iteratee shorthand.* _.reject(users, 'active');* // => objects for ['barney']*/function reject(collection, predicate) {var func = isArray(collection) ? arrayFilter : baseFilter;return func(collection, negate(getIteratee(predicate, 3)));}/*** Gets a random element from `collection`.** @static* @memberOf _* @since 2.0.0* @category Collection* @param {Array|Object} collection The collection to sample.* @returns {*} Returns the random element.* @example** _.sample([1, 2, 3, 4]);* // => 2*/function sample(collection) {var func = isArray(collection) ? arraySample : baseSample;return func(collection);}/*** Gets `n` random elements at unique keys from `collection` up to the* size of `collection`.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to sample.* @param {number} [n=1] The number of elements to sample.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the random elements.* @example** _.sampleSize([1, 2, 3], 2);* // => [3, 1]** _.sampleSize([1, 2, 3], 4);* // => [2, 3, 1]*/function sampleSize(collection, n, guard) {if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {n = 1;} else {n = toInteger(n);}var func = isArray(collection) ? arraySampleSize : baseSampleSize;return func(collection, n);}/*** Creates an array of shuffled values, using a version of the* [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to shuffle.* @returns {Array} Returns the new shuffled array.* @example** _.shuffle([1, 2, 3, 4]);* // => [4, 1, 3, 2]*/function shuffle(collection) {var func = isArray(collection) ? arrayShuffle : baseShuffle;return func(collection);}/*** Gets the size of `collection` by returning its length for array-like* values or the number of own enumerable string keyed properties for objects.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object|string} collection The collection to inspect.* @returns {number} Returns the collection size.* @example** _.size([1, 2, 3]);* // => 3** _.size({ 'a': 1, 'b': 2 });* // => 2** _.size('pebbles');* // => 7*/function size(collection) {if (collection == null) {return 0;}if (isArrayLike(collection)) {return isString(collection) ? stringSize(collection) : collection.length;}var tag = getTag(collection);if (tag == mapTag || tag == setTag) {return collection.size;}return baseKeys(collection).length;}/*** Checks if `predicate` returns truthy for **any** element of `collection`.* Iteration is stopped once `predicate` returns truthy. The predicate is* invoked with three arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.* @example** _.some([null, 0, 'yes', false], Boolean);* // => true** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.some(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.some(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.some(users, 'active');* // => true*/function some(collection, predicate, guard) {var func = isArray(collection) ? arraySome : baseSome;if (guard && isIterateeCall(collection, predicate, guard)) {predicate = undefined;}return func(collection, getIteratee(predicate, 3));}/*** Creates an array of elements, sorted in ascending order by the results of* running each element in a collection thru each iteratee. This method* performs a stable sort, that is, it preserves the original sort order of* equal elements. The iteratees are invoked with one argument: (value).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {...(Function|Function[])} [iteratees=[_.identity]]* The iteratees to sort by.* @returns {Array} Returns the new sorted array.* @example** var users = [* { 'user': 'fred', 'age': 48 },* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 30 },* { 'user': 'barney', 'age': 34 }* ];** _.sortBy(users, [function(o) { return o.user; }]);* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]** _.sortBy(users, ['user', 'age']);* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]*/var sortBy = baseRest(function(collection, iteratees) {if (collection == null) {return [];}var length = iteratees.length;if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {iteratees = [];} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {iteratees = [iteratees[0]];}return baseOrderBy(collection, baseFlatten(iteratees, 1), []);});/*------------------------------------------------------------------------*//*** Gets the timestamp of the number of milliseconds that have elapsed since* the Unix epoch (1 January 1970 00:00:00 UTC).** @static* @memberOf _* @since 2.4.0* @category Date* @returns {number} Returns the timestamp.* @example** _.defer(function(stamp) {* console.log(_.now() - stamp);* }, _.now());* // => Logs the number of milliseconds it took for the deferred invocation.*/var now = ctxNow || function() {return root.Date.now();};/*------------------------------------------------------------------------*//*** The opposite of `_.before`; this method creates a function that invokes* `func` once it's called `n` or more times.** @static* @memberOf _* @since 0.1.0* @category Function* @param {number} n The number of calls before `func` is invoked.* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** var saves = ['profile', 'settings'];** var done = _.after(saves.length, function() {* console.log('done saving!');* });** _.forEach(saves, function(type) {* asyncSave({ 'type': type, 'complete': done });* });* // => Logs 'done saving!' after the two async saves have completed.*/function after(n, func) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}n = toInteger(n);return function() {if (--n < 1) {return func.apply(this, arguments);}};}/*** Creates a function that invokes `func`, with up to `n` arguments,* ignoring any additional arguments.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to cap arguments for.* @param {number} [n=func.length] The arity cap.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new capped function.* @example** _.map(['6', '8', '10'], _.ary(parseInt, 1));* // => [6, 8, 10]*/function ary(func, n, guard) {n = guard ? undefined : n;n = (func && n == null) ? func.length : n;return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);}/*** Creates a function that invokes `func`, with the `this` binding and arguments* of the created function, while it's called less than `n` times. Subsequent* calls to the created function return the result of the last `func` invocation.** @static* @memberOf _* @since 3.0.0* @category Function* @param {number} n The number of calls at which `func` is no longer invoked.* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** jQuery(element).on('click', _.before(5, addContactToList));* // => Allows adding up to 4 contacts to the list.*/function before(n, func) {var result;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}n = toInteger(n);return function() {if (--n > 0) {result = func.apply(this, arguments);}if (n <= 1) {func = undefined;}return result;};}/*** Creates a function that invokes `func` with the `this` binding of `thisArg`* and `partials` prepended to the arguments it receives.** The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,* may be used as a placeholder for partially applied arguments.** **Note:** Unlike native `Function#bind`, this method doesn't set the "length"* property of bound functions.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to bind.* @param {*} thisArg The `this` binding of `func`.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new bound function.* @example** function greet(greeting, punctuation) {* return greeting + ' ' + this.user + punctuation;* }** var object = { 'user': 'fred' };** var bound = _.bind(greet, object, 'hi');* bound('!');* // => 'hi fred!'** // Bound with placeholders.* var bound = _.bind(greet, object, _, '!');* bound('hi');* // => 'hi fred!'*/var bind = baseRest(function(func, thisArg, partials) {var bitmask = WRAP_BIND_FLAG;if (partials.length) {var holders = replaceHolders(partials, getHolder(bind));bitmask |= WRAP_PARTIAL_FLAG;}return createWrap(func, bitmask, thisArg, partials, holders);});/*** Creates a function that invokes the method at `object[key]` with `partials`* prepended to the arguments it receives.** This method differs from `_.bind` by allowing bound functions to reference* methods that may be redefined or don't yet exist. See* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)* for more details.** The `_.bindKey.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** @static* @memberOf _* @since 0.10.0* @category Function* @param {Object} object The object to invoke the method on.* @param {string} key The key of the method.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new bound function.* @example** var object = {* 'user': 'fred',* 'greet': function(greeting, punctuation) {* return greeting + ' ' + this.user + punctuation;* }* };** var bound = _.bindKey(object, 'greet', 'hi');* bound('!');* // => 'hi fred!'** object.greet = function(greeting, punctuation) {* return greeting + 'ya ' + this.user + punctuation;* };** bound('!');* // => 'hiya fred!'** // Bound with placeholders.* var bound = _.bindKey(object, 'greet', _, '!');* bound('hi');* // => 'hiya fred!'*/var bindKey = baseRest(function(object, key, partials) {var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;if (partials.length) {var holders = replaceHolders(partials, getHolder(bindKey));bitmask |= WRAP_PARTIAL_FLAG;}return createWrap(key, bitmask, object, partials, holders);});/*** Creates a function that accepts arguments of `func` and either invokes* `func` returning its result, if at least `arity` number of arguments have* been provided, or returns a function that accepts the remaining `func`* arguments, and so on. The arity of `func` may be specified if `func.length`* is not sufficient.** The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,* may be used as a placeholder for provided arguments.** **Note:** This method doesn't set the "length" property of curried functions.** @static* @memberOf _* @since 2.0.0* @category Function* @param {Function} func The function to curry.* @param {number} [arity=func.length] The arity of `func`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new curried function.* @example** var abc = function(a, b, c) {* return [a, b, c];* };** var curried = _.curry(abc);** curried(1)(2)(3);* // => [1, 2, 3]** curried(1, 2)(3);* // => [1, 2, 3]** curried(1, 2, 3);* // => [1, 2, 3]** // Curried with placeholders.* curried(1)(_, 3)(2);* // => [1, 2, 3]*/function curry(func, arity, guard) {arity = guard ? undefined : arity;var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);result.placeholder = curry.placeholder;return result;}/*** This method is like `_.curry` except that arguments are applied to `func`* in the manner of `_.partialRight` instead of `_.partial`.** The `_.curryRight.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for provided arguments.** **Note:** This method doesn't set the "length" property of curried functions.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to curry.* @param {number} [arity=func.length] The arity of `func`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new curried function.* @example** var abc = function(a, b, c) {* return [a, b, c];* };** var curried = _.curryRight(abc);** curried(3)(2)(1);* // => [1, 2, 3]** curried(2, 3)(1);* // => [1, 2, 3]** curried(1, 2, 3);* // => [1, 2, 3]** // Curried with placeholders.* curried(3)(1, _)(2);* // => [1, 2, 3]*/function curryRight(func, arity, guard) {arity = guard ? undefined : arity;var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);result.placeholder = curryRight.placeholder;return result;}/*** Creates a debounced function that delays invoking `func` until after `wait`* milliseconds have elapsed since the last time the debounced function was* invoked. The debounced function comes with a `cancel` method to cancel* delayed `func` invocations and a `flush` method to immediately invoke them.* Provide `options` to indicate whether `func` should be invoked on the* leading and/or trailing edge of the `wait` timeout. The `func` is invoked* with the last arguments provided to the debounced function. Subsequent* calls to the debounced function return the result of the last `func`* invocation.** **Note:** If `leading` and `trailing` options are `true`, `func` is* invoked on the trailing edge of the timeout only if the debounced function* is invoked more than once during the `wait` timeout.** If `wait` is `0` and `leading` is `false`, `func` invocation is deferred* until to the next tick, similar to `setTimeout` with a timeout of `0`.** See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)* for details over the differences between `_.debounce` and `_.throttle`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to debounce.* @param {number} [wait=0] The number of milliseconds to delay.* @param {Object} [options={}] The options object.* @param {boolean} [options.leading=false]* Specify invoking on the leading edge of the timeout.* @param {number} [options.maxWait]* The maximum time `func` is allowed to be delayed before it's invoked.* @param {boolean} [options.trailing=true]* Specify invoking on the trailing edge of the timeout.* @returns {Function} Returns the new debounced function.* @example** // Avoid costly calculations while the window size is in flux.* jQuery(window).on('resize', _.debounce(calculateLayout, 150));** // Invoke `sendMail` when clicked, debouncing subsequent calls.* jQuery(element).on('click', _.debounce(sendMail, 300, {* 'leading': true,* 'trailing': false* }));** // Ensure `batchLog` is invoked once after 1 second of debounced calls.* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });* var source = new EventSource('/stream');* jQuery(source).on('message', debounced);** // Cancel the trailing debounced invocation.* jQuery(window).on('popstate', debounced.cancel);*/function debounce(func, wait, options) {var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime = 0,leading = false,maxing = false,trailing = true;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}wait = toNumber(wait) || 0;if (isObject(options)) {leading = !!options.leading;maxing = 'maxWait' in options;maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;trailing = 'trailing' in options ? !!options.trailing : trailing;}function invokeFunc(time) {var args = lastArgs,thisArg = lastThis;lastArgs = lastThis = undefined;lastInvokeTime = time;result = func.apply(thisArg, args);return result;}function leadingEdge(time) {// Reset any `maxWait` timer.lastInvokeTime = time;// Start the timer for the trailing edge.timerId = setTimeout(timerExpired, wait);// Invoke the leading edge.return leading ? invokeFunc(time) : result;}function remainingWait(time) {var timeSinceLastCall = time - lastCallTime,timeSinceLastInvoke = time - lastInvokeTime,timeWaiting = wait - timeSinceLastCall;return maxing? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke): timeWaiting;}function shouldInvoke(time) {var timeSinceLastCall = time - lastCallTime,timeSinceLastInvoke = time - lastInvokeTime;// Either this is the first call, activity has stopped and we're at the// trailing edge, the system time has gone backwards and we're treating// it as the trailing edge, or we've hit the `maxWait` limit.return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));}function timerExpired() {var time = now();if (shouldInvoke(time)) {return trailingEdge(time);}// Restart the timer.timerId = setTimeout(timerExpired, remainingWait(time));}function trailingEdge(time) {timerId = undefined;// Only invoke if we have `lastArgs` which means `func` has been// debounced at least once.if (trailing && lastArgs) {return invokeFunc(time);}lastArgs = lastThis = undefined;return result;}function cancel() {if (timerId !== undefined) {clearTimeout(timerId);}lastInvokeTime = 0;lastArgs = lastCallTime = lastThis = timerId = undefined;}function flush() {return timerId === undefined ? result : trailingEdge(now());}function debounced() {var time = now(),isInvoking = shouldInvoke(time);lastArgs = arguments;lastThis = this;lastCallTime = time;if (isInvoking) {if (timerId === undefined) {return leadingEdge(lastCallTime);}if (maxing) {// Handle invocations in a tight loop.clearTimeout(timerId);timerId = setTimeout(timerExpired, wait);return invokeFunc(lastCallTime);}}if (timerId === undefined) {timerId = setTimeout(timerExpired, wait);}return result;}debounced.cancel = cancel;debounced.flush = flush;return debounced;}/*** Defers invoking the `func` until the current call stack has cleared. Any* additional arguments are provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to defer.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.defer(function(text) {* console.log(text);* }, 'deferred');* // => Logs 'deferred' after one millisecond.*/var defer = baseRest(function(func, args) {return baseDelay(func, 1, args);});/*** Invokes `func` after `wait` milliseconds. Any additional arguments are* provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.delay(function(text) {* console.log(text);* }, 1000, 'later');* // => Logs 'later' after one second.*/var delay = baseRest(function(func, wait, args) {return baseDelay(func, toNumber(wait) || 0, args);});/*** Creates a function that invokes `func` with arguments reversed.** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to flip arguments for.* @returns {Function} Returns the new flipped function.* @example** var flipped = _.flip(function() {* return _.toArray(arguments);* });** flipped('a', 'b', 'c', 'd');* // => ['d', 'c', 'b', 'a']*/function flip(func) {return createWrap(func, WRAP_FLIP_FLAG);}/*** Creates a function that memoizes the result of `func`. If `resolver` is* provided, it determines the cache key for storing the result based on the* arguments provided to the memoized function. By default, the first argument* provided to the memoized function is used as the map cache key. The `func`* is invoked with the `this` binding of the memoized function.** **Note:** The cache is exposed as the `cache` property on the memoized* function. Its creation may be customized by replacing the `_.memoize.Cache`* constructor with one whose instances implement the* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)* method interface of `clear`, `delete`, `get`, `has`, and `set`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to have its output memoized.* @param {Function} [resolver] The function to resolve the cache key.* @returns {Function} Returns the new memoized function.* @example** var object = { 'a': 1, 'b': 2 };* var other = { 'c': 3, 'd': 4 };** var values = _.memoize(_.values);* values(object);* // => [1, 2]** values(other);* // => [3, 4]** object.a = 2;* values(object);* // => [1, 2]** // Modify the result cache.* values.cache.set(object, ['a', 'b']);* values(object);* // => ['a', 'b']** // Replace `_.memoize.Cache`.* _.memoize.Cache = WeakMap;*/function memoize(func, resolver) {if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {throw new TypeError(FUNC_ERROR_TEXT);}var memoized = function() {var args = arguments,key = resolver ? resolver.apply(this, args) : args[0],cache = memoized.cache;if (cache.has(key)) {return cache.get(key);}var result = func.apply(this, args);memoized.cache = cache.set(key, result) || cache;return result;};memoized.cache = new (memoize.Cache || MapCache);return memoized;}// Expose `MapCache`.memoize.Cache = MapCache;/*** Creates a function that negates the result of the predicate `func`. The* `func` predicate is invoked with the `this` binding and arguments of the* created function.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} predicate The predicate to negate.* @returns {Function} Returns the new negated function.* @example** function isEven(n) {* return n % 2 == 0;* }** _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));* // => [1, 3, 5]*/function negate(predicate) {if (typeof predicate != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return function() {var args = arguments;switch (args.length) {case 0: return !predicate.call(this);case 1: return !predicate.call(this, args[0]);case 2: return !predicate.call(this, args[0], args[1]);case 3: return !predicate.call(this, args[0], args[1], args[2]);}return !predicate.apply(this, args);};}/*** Creates a function that is restricted to invoking `func` once. Repeat calls* to the function return the value of the first invocation. The `func` is* invoked with the `this` binding and arguments of the created function.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** var initialize = _.once(createApplication);* initialize();* initialize();* // => `createApplication` is invoked once*/function once(func) {return before(2, func);}/*** Creates a function that invokes `func` with its arguments transformed.** @static* @since 4.0.0* @memberOf _* @category Function* @param {Function} func The function to wrap.* @param {...(Function|Function[])} [transforms=[_.identity]]* The argument transforms.* @returns {Function} Returns the new function.* @example** function doubled(n) {* return n * 2;* }** function square(n) {* return n * n;* }** var func = _.overArgs(function(x, y) {* return [x, y];* }, [square, doubled]);** func(9, 3);* // => [81, 6]** func(10, 5);* // => [100, 10]*/var overArgs = castRest(function(func, transforms) {transforms = (transforms.length == 1 && isArray(transforms[0]))? arrayMap(transforms[0], baseUnary(getIteratee())): arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));var funcsLength = transforms.length;return baseRest(function(args) {var index = -1,length = nativeMin(args.length, funcsLength);while (++index < length) {args[index] = transforms[index].call(this, args[index]);}return apply(func, this, args);});});/*** Creates a function that invokes `func` with `partials` prepended to the* arguments it receives. This method is like `_.bind` except it does **not*** alter the `this` binding.** The `_.partial.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** **Note:** This method doesn't set the "length" property of partially* applied functions.** @static* @memberOf _* @since 0.2.0* @category Function* @param {Function} func The function to partially apply arguments to.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new partially applied function.* @example** function greet(greeting, name) {* return greeting + ' ' + name;* }** var sayHelloTo = _.partial(greet, 'hello');* sayHelloTo('fred');* // => 'hello fred'** // Partially applied with placeholders.* var greetFred = _.partial(greet, _, 'fred');* greetFred('hi');* // => 'hi fred'*/var partial = baseRest(function(func, partials) {var holders = replaceHolders(partials, getHolder(partial));return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);});/*** This method is like `_.partial` except that partially applied arguments* are appended to the arguments it receives.** The `_.partialRight.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** **Note:** This method doesn't set the "length" property of partially* applied functions.** @static* @memberOf _* @since 1.0.0* @category Function* @param {Function} func The function to partially apply arguments to.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new partially applied function.* @example** function greet(greeting, name) {* return greeting + ' ' + name;* }** var greetFred = _.partialRight(greet, 'fred');* greetFred('hi');* // => 'hi fred'** // Partially applied with placeholders.* var sayHelloTo = _.partialRight(greet, 'hello', _);* sayHelloTo('fred');* // => 'hello fred'*/var partialRight = baseRest(function(func, partials) {var holders = replaceHolders(partials, getHolder(partialRight));return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);});/*** Creates a function that invokes `func` with arguments arranged according* to the specified `indexes` where the argument value at the first index is* provided as the first argument, the argument value at the second index is* provided as the second argument, and so on.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to rearrange arguments for.* @param {...(number|number[])} indexes The arranged argument indexes.* @returns {Function} Returns the new function.* @example** var rearged = _.rearg(function(a, b, c) {* return [a, b, c];* }, [2, 0, 1]);** rearged('b', 'c', 'a')* // => ['a', 'b', 'c']*/var rearg = flatRest(function(func, indexes) {return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);});/*** Creates a function that invokes `func` with the `this` binding of the* created function and arguments from `start` and beyond provided as* an array.** **Note:** This method is based on the* [rest parameter](https://mdn.io/rest_parameters).** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @returns {Function} Returns the new function.* @example** var say = _.rest(function(what, names) {* return what + ' ' + _.initial(names).join(', ') +* (_.size(names) > 1 ? ', & ' : '') + _.last(names);* });** say('hello', 'fred', 'barney', 'pebbles');* // => 'hello fred, barney, & pebbles'*/function rest(func, start) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}start = start === undefined ? start : toInteger(start);return baseRest(func, start);}/*** Creates a function that invokes `func` with the `this` binding of the* create function and an array of arguments much like* [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).** **Note:** This method is based on the* [spread operator](https://mdn.io/spread_operator).** @static* @memberOf _* @since 3.2.0* @category Function* @param {Function} func The function to spread arguments over.* @param {number} [start=0] The start position of the spread.* @returns {Function} Returns the new function.* @example** var say = _.spread(function(who, what) {* return who + ' says ' + what;* });** say(['fred', 'hello']);* // => 'fred says hello'** var numbers = Promise.all([* Promise.resolve(40),* Promise.resolve(36)* ]);** numbers.then(_.spread(function(x, y) {* return x + y;* }));* // => a Promise of 76*/function spread(func, start) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}start = start == null ? 0 : nativeMax(toInteger(start), 0);return baseRest(function(args) {var array = args[start],otherArgs = castSlice(args, 0, start);if (array) {arrayPush(otherArgs, array);}return apply(func, this, otherArgs);});}/*** Creates a throttled function that only invokes `func` at most once per* every `wait` milliseconds. The throttled function comes with a `cancel`* method to cancel delayed `func` invocations and a `flush` method to* immediately invoke them. Provide `options` to indicate whether `func`* should be invoked on the leading and/or trailing edge of the `wait`* timeout. The `func` is invoked with the last arguments provided to the* throttled function. Subsequent calls to the throttled function return the* result of the last `func` invocation.** **Note:** If `leading` and `trailing` options are `true`, `func` is* invoked on the trailing edge of the timeout only if the throttled function* is invoked more than once during the `wait` timeout.** If `wait` is `0` and `leading` is `false`, `func` invocation is deferred* until to the next tick, similar to `setTimeout` with a timeout of `0`.** See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)* for details over the differences between `_.throttle` and `_.debounce`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to throttle.* @param {number} [wait=0] The number of milliseconds to throttle invocations to.* @param {Object} [options={}] The options object.* @param {boolean} [options.leading=true]* Specify invoking on the leading edge of the timeout.* @param {boolean} [options.trailing=true]* Specify invoking on the trailing edge of the timeout.* @returns {Function} Returns the new throttled function.* @example** // Avoid excessively updating the position while scrolling.* jQuery(window).on('scroll', _.throttle(updatePosition, 100));** // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });* jQuery(element).on('click', throttled);** // Cancel the trailing throttled invocation.* jQuery(window).on('popstate', throttled.cancel);*/function throttle(func, wait, options) {var leading = true,trailing = true;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}if (isObject(options)) {leading = 'leading' in options ? !!options.leading : leading;trailing = 'trailing' in options ? !!options.trailing : trailing;}return debounce(func, wait, {'leading': leading,'maxWait': wait,'trailing': trailing});}/*** Creates a function that accepts up to one argument, ignoring any* additional arguments.** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to cap arguments for.* @returns {Function} Returns the new capped function.* @example** _.map(['6', '8', '10'], _.unary(parseInt));* // => [6, 8, 10]*/function unary(func) {return ary(func, 1);}/*** Creates a function that provides `value` to `wrapper` as its first* argument. Any additional arguments provided to the function are appended* to those provided to the `wrapper`. The wrapper is invoked with the `this`* binding of the created function.** @static* @memberOf _* @since 0.1.0* @category Function* @param {*} value The value to wrap.* @param {Function} [wrapper=identity] The wrapper function.* @returns {Function} Returns the new function.* @example** var p = _.wrap(_.escape, function(func, text) {* return '<p>' + func(text) + '</p>';* });** p('fred, barney, & pebbles');* // => '<p>fred, barney, & pebbles</p>'*/function wrap(value, wrapper) {return partial(castFunction(wrapper), value);}/*------------------------------------------------------------------------*//*** Casts `value` as an array if it's not one.** @static* @memberOf _* @since 4.4.0* @category Lang* @param {*} value The value to inspect.* @returns {Array} Returns the cast array.* @example** _.castArray(1);* // => [1]** _.castArray({ 'a': 1 });* // => [{ 'a': 1 }]** _.castArray('abc');* // => ['abc']** _.castArray(null);* // => [null]** _.castArray(undefined);* // => [undefined]** _.castArray();* // => []** var array = [1, 2, 3];* console.log(_.castArray(array) === array);* // => true*/function castArray() {if (!arguments.length) {return [];}var value = arguments[0];return isArray(value) ? value : [value];}/*** Creates a shallow clone of `value`.** **Note:** This method is loosely based on the* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)* and supports cloning arrays, array buffers, booleans, date objects, maps,* numbers, `Object` objects, regexes, sets, strings, symbols, and typed* arrays. The own enumerable properties of `arguments` objects are cloned* as plain objects. An empty object is returned for uncloneable values such* as error objects, functions, DOM nodes, and WeakMaps.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to clone.* @returns {*} Returns the cloned value.* @see _.cloneDeep* @example** var objects = [{ 'a': 1 }, { 'b': 2 }];** var shallow = _.clone(objects);* console.log(shallow[0] === objects[0]);* // => true*/function clone(value) {return baseClone(value, CLONE_SYMBOLS_FLAG);}/*** This method is like `_.clone` except that it accepts `customizer` which* is invoked to produce the cloned value. If `customizer` returns `undefined`,* cloning is handled by the method instead. The `customizer` is invoked with* up to four arguments; (value [, index|key, object, stack]).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to clone.* @param {Function} [customizer] The function to customize cloning.* @returns {*} Returns the cloned value.* @see _.cloneDeepWith* @example** function customizer(value) {* if (_.isElement(value)) {* return value.cloneNode(false);* }* }** var el = _.cloneWith(document.body, customizer);** console.log(el === document.body);* // => false* console.log(el.nodeName);* // => 'BODY'* console.log(el.childNodes.length);* // => 0*/function cloneWith(value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);}/*** This method is like `_.clone` except that it recursively clones `value`.** @static* @memberOf _* @since 1.0.0* @category Lang* @param {*} value The value to recursively clone.* @returns {*} Returns the deep cloned value.* @see _.clone* @example** var objects = [{ 'a': 1 }, { 'b': 2 }];** var deep = _.cloneDeep(objects);* console.log(deep[0] === objects[0]);* // => false*/function cloneDeep(value) {return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);}/*** This method is like `_.cloneWith` except that it recursively clones `value`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to recursively clone.* @param {Function} [customizer] The function to customize cloning.* @returns {*} Returns the deep cloned value.* @see _.cloneWith* @example** function customizer(value) {* if (_.isElement(value)) {* return value.cloneNode(true);* }* }** var el = _.cloneDeepWith(document.body, customizer);** console.log(el === document.body);* // => false* console.log(el.nodeName);* // => 'BODY'* console.log(el.childNodes.length);* // => 20*/function cloneDeepWith(value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);}/*** Checks if `object` conforms to `source` by invoking the predicate* properties of `source` with the corresponding property values of `object`.** **Note:** This method is equivalent to `_.conforms` when `source` is* partially applied.** @static* @memberOf _* @since 4.14.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property predicates to conform to.* @returns {boolean} Returns `true` if `object` conforms, else `false`.* @example** var object = { 'a': 1, 'b': 2 };** _.conformsTo(object, { 'b': function(n) { return n > 1; } });* // => true** _.conformsTo(object, { 'b': function(n) { return n > 2; } });* // => false*/function conformsTo(object, source) {return source == null || baseConformsTo(object, source, keys(source));}/*** Performs a* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* comparison between two values to determine if they are equivalent.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.eq(object, object);* // => true** _.eq(object, other);* // => false** _.eq('a', 'a');* // => true** _.eq('a', Object('a'));* // => false** _.eq(NaN, NaN);* // => true*/function eq(value, other) {return value === other || (value !== value && other !== other);}/*** Checks if `value` is greater than `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than `other`,* else `false`.* @see _.lt* @example** _.gt(3, 1);* // => true** _.gt(3, 3);* // => false** _.gt(1, 3);* // => false*/var gt = createRelationalOperation(baseGt);/*** Checks if `value` is greater than or equal to `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than or equal to* `other`, else `false`.* @see _.lte* @example** _.gte(3, 1);* // => true** _.gte(3, 3);* // => true** _.gte(1, 3);* // => false*/var gte = createRelationalOperation(function(value, other) {return value >= other;});/*** Checks if `value` is likely an `arguments` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,* else `false`.* @example** _.isArguments(function() { return arguments; }());* // => true** _.isArguments([1, 2, 3]);* // => false*/var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&!propertyIsEnumerable.call(value, 'callee');};/*** Checks if `value` is classified as an `Array` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array, else `false`.* @example** _.isArray([1, 2, 3]);* // => true** _.isArray(document.body.children);* // => false** _.isArray('abc');* // => false** _.isArray(_.noop);* // => false*/var isArray = Array.isArray;/*** Checks if `value` is classified as an `ArrayBuffer` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.* @example** _.isArrayBuffer(new ArrayBuffer(2));* // => true** _.isArrayBuffer(new Array(2));* // => false*/var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;/*** Checks if `value` is array-like. A value is considered array-like if it's* not a function and has a `value.length` that's an integer greater than or* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is array-like, else `false`.* @example** _.isArrayLike([1, 2, 3]);* // => true** _.isArrayLike(document.body.children);* // => true** _.isArrayLike('abc');* // => true** _.isArrayLike(_.noop);* // => false*/function isArrayLike(value) {return value != null && isLength(value.length) && !isFunction(value);}/*** This method is like `_.isArrayLike` except that it also checks if `value`* is an object.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array-like object,* else `false`.* @example** _.isArrayLikeObject([1, 2, 3]);* // => true** _.isArrayLikeObject(document.body.children);* // => true** _.isArrayLikeObject('abc');* // => false** _.isArrayLikeObject(_.noop);* // => false*/function isArrayLikeObject(value) {return isObjectLike(value) && isArrayLike(value);}/*** Checks if `value` is classified as a boolean primitive or object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.* @example** _.isBoolean(false);* // => true** _.isBoolean(null);* // => false*/function isBoolean(value) {return value === true || value === false ||(isObjectLike(value) && baseGetTag(value) == boolTag);}/*** Checks if `value` is a buffer.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.* @example** _.isBuffer(new Buffer(2));* // => true** _.isBuffer(new Uint8Array(2));* // => false*/var isBuffer = nativeIsBuffer || stubFalse;/*** Checks if `value` is classified as a `Date` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.* @example** _.isDate(new Date);* // => true** _.isDate('Mon April 23 2012');* // => false*/var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;/*** Checks if `value` is likely a DOM element.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.* @example** _.isElement(document.body);* // => true** _.isElement('<body>');* // => false*/function isElement(value) {return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);}/*** Checks if `value` is an empty object, collection, map, or set.** Objects are considered empty if they have no own enumerable string keyed* properties.** Array-like values such as `arguments` objects, arrays, buffers, strings, or* jQuery-like collections are considered empty if they have a `length` of `0`.* Similarly, maps and sets are considered empty if they have a `size` of `0`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is empty, else `false`.* @example** _.isEmpty(null);* // => true** _.isEmpty(true);* // => true** _.isEmpty(1);* // => true** _.isEmpty([1, 2, 3]);* // => false** _.isEmpty({ 'a': 1 });* // => false*/function isEmpty(value) {if (value == null) {return true;}if (isArrayLike(value) &&(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||isBuffer(value) || isTypedArray(value) || isArguments(value))) {return !value.length;}var tag = getTag(value);if (tag == mapTag || tag == setTag) {return !value.size;}if (isPrototype(value)) {return !baseKeys(value).length;}for (var key in value) {if (hasOwnProperty.call(value, key)) {return false;}}return true;}/*** Performs a deep comparison between two values to determine if they are* equivalent.** **Note:** This method supports comparing arrays, array buffers, booleans,* date objects, error objects, maps, numbers, `Object` objects, regexes,* sets, strings, symbols, and typed arrays. `Object` objects are compared* by their own, not inherited, enumerable properties. Functions and DOM* nodes are compared by strict equality, i.e. `===`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.isEqual(object, other);* // => true** object === other;* // => false*/function isEqual(value, other) {return baseIsEqual(value, other);}/*** This method is like `_.isEqual` except that it accepts `customizer` which* is invoked to compare values. If `customizer` returns `undefined`, comparisons* are handled by the method instead. The `customizer` is invoked with up to* six arguments: (objValue, othValue [, index|key, object, other, stack]).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** function isGreeting(value) {* return /^h(?:i|ello)$/.test(value);* }** function customizer(objValue, othValue) {* if (isGreeting(objValue) && isGreeting(othValue)) {* return true;* }* }** var array = ['hello', 'goodbye'];* var other = ['hi', 'goodbye'];** _.isEqualWith(array, other, customizer);* // => true*/function isEqualWith(value, other, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;var result = customizer ? customizer(value, other) : undefined;return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;}/*** Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,* `SyntaxError`, `TypeError`, or `URIError` object.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an error object, else `false`.* @example** _.isError(new Error);* // => true** _.isError(Error);* // => false*/function isError(value) {if (!isObjectLike(value)) {return false;}var tag = baseGetTag(value);return tag == errorTag || tag == domExcTag ||(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));}/*** Checks if `value` is a finite primitive number.** **Note:** This method is based on* [`Number.isFinite`](https://mdn.io/Number/isFinite).** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.* @example** _.isFinite(3);* // => true** _.isFinite(Number.MIN_VALUE);* // => true** _.isFinite(Infinity);* // => false** _.isFinite('3');* // => false*/function isFinite(value) {return typeof value == 'number' && nativeIsFinite(value);}/*** Checks if `value` is classified as a `Function` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a function, else `false`.* @example** _.isFunction(_);* // => true** _.isFunction(/abc/);* // => false*/function isFunction(value) {if (!isObject(value)) {return false;}// The use of `Object#toString` avoids issues with the `typeof` operator// in Safari 9 which returns 'object' for typed arrays and other constructors.var tag = baseGetTag(value);return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;}/*** Checks if `value` is an integer.** **Note:** This method is based on* [`Number.isInteger`](https://mdn.io/Number/isInteger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an integer, else `false`.* @example** _.isInteger(3);* // => true** _.isInteger(Number.MIN_VALUE);* // => false** _.isInteger(Infinity);* // => false** _.isInteger('3');* // => false*/function isInteger(value) {return typeof value == 'number' && value == toInteger(value);}/*** Checks if `value` is a valid array-like length.** **Note:** This method is loosely based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.* @example** _.isLength(3);* // => true** _.isLength(Number.MIN_VALUE);* // => false** _.isLength(Infinity);* // => false** _.isLength('3');* // => false*/function isLength(value) {return typeof value == 'number' &&value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;}/*** Checks if `value` is the* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an object, else `false`.* @example** _.isObject({});* // => true** _.isObject([1, 2, 3]);* // => true** _.isObject(_.noop);* // => true** _.isObject(null);* // => false*/function isObject(value) {var type = typeof value;return value != null && (type == 'object' || type == 'function');}/*** Checks if `value` is object-like. A value is object-like if it's not `null`* and has a `typeof` result of "object".** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is object-like, else `false`.* @example** _.isObjectLike({});* // => true** _.isObjectLike([1, 2, 3]);* // => true** _.isObjectLike(_.noop);* // => false** _.isObjectLike(null);* // => false*/function isObjectLike(value) {return value != null && typeof value == 'object';}/*** Checks if `value` is classified as a `Map` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a map, else `false`.* @example** _.isMap(new Map);* // => true** _.isMap(new WeakMap);* // => false*/var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;/*** Performs a partial deep comparison between `object` and `source` to* determine if `object` contains equivalent property values.** **Note:** This method is equivalent to `_.matches` when `source` is* partially applied.** Partial comparisons will match empty array and empty object `source`* values against any array or object value, respectively. See `_.isEqual`* for a list of supported value comparisons.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @returns {boolean} Returns `true` if `object` is a match, else `false`.* @example** var object = { 'a': 1, 'b': 2 };** _.isMatch(object, { 'b': 2 });* // => true** _.isMatch(object, { 'b': 1 });* // => false*/function isMatch(object, source) {return object === source || baseIsMatch(object, source, getMatchData(source));}/*** This method is like `_.isMatch` except that it accepts `customizer` which* is invoked to compare values. If `customizer` returns `undefined`, comparisons* are handled by the method instead. The `customizer` is invoked with five* arguments: (objValue, srcValue, index|key, object, source).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if `object` is a match, else `false`.* @example** function isGreeting(value) {* return /^h(?:i|ello)$/.test(value);* }** function customizer(objValue, srcValue) {* if (isGreeting(objValue) && isGreeting(srcValue)) {* return true;* }* }** var object = { 'greeting': 'hello' };* var source = { 'greeting': 'hi' };** _.isMatchWith(object, source, customizer);* // => true*/function isMatchWith(object, source, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseIsMatch(object, source, getMatchData(source), customizer);}/*** Checks if `value` is `NaN`.** **Note:** This method is based on* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for* `undefined` and other non-number values.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.* @example** _.isNaN(NaN);* // => true** _.isNaN(new Number(NaN));* // => true** isNaN(undefined);* // => true** _.isNaN(undefined);* // => false*/function isNaN(value) {// An `NaN` primitive is the only value that is not equal to itself.// Perform the `toStringTag` check first to avoid errors with some// ActiveX objects in IE.return isNumber(value) && value != +value;}/*** Checks if `value` is a pristine native function.** **Note:** This method can't reliably detect native functions in the presence* of the core-js package because core-js circumvents this kind of detection.* Despite multiple requests, the core-js maintainer has made it clear: any* attempt to fix the detection will be obstructed. As a result, we're left* with little choice but to throw an error. Unfortunately, this also affects* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),* which rely on core-js.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a native function,* else `false`.* @example** _.isNative(Array.prototype.push);* // => true** _.isNative(_);* // => false*/function isNative(value) {if (isMaskable(value)) {throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}/*** Checks if `value` is `null`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `null`, else `false`.* @example** _.isNull(null);* // => true** _.isNull(void 0);* // => false*/function isNull(value) {return value === null;}/*** Checks if `value` is `null` or `undefined`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is nullish, else `false`.* @example** _.isNil(null);* // => true** _.isNil(void 0);* // => true** _.isNil(NaN);* // => false*/function isNil(value) {return value == null;}/*** Checks if `value` is classified as a `Number` primitive or object.** **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are* classified as numbers, use the `_.isFinite` method.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a number, else `false`.* @example** _.isNumber(3);* // => true** _.isNumber(Number.MIN_VALUE);* // => true** _.isNumber(Infinity);* // => true** _.isNumber('3');* // => false*/function isNumber(value) {return typeof value == 'number' ||(isObjectLike(value) && baseGetTag(value) == numberTag);}/*** Checks if `value` is a plain object, that is, an object created by the* `Object` constructor or one with a `[[Prototype]]` of `null`.** @static* @memberOf _* @since 0.8.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.* @example** function Foo() {* this.a = 1;* }** _.isPlainObject(new Foo);* // => false** _.isPlainObject([1, 2, 3]);* // => false** _.isPlainObject({ 'x': 0, 'y': 0 });* // => true** _.isPlainObject(Object.create(null));* // => true*/function isPlainObject(value) {if (!isObjectLike(value) || baseGetTag(value) != objectTag) {return false;}var proto = getPrototype(value);if (proto === null) {return true;}var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;return typeof Ctor == 'function' && Ctor instanceof Ctor &&funcToString.call(Ctor) == objectCtorString;}/*** Checks if `value` is classified as a `RegExp` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.* @example** _.isRegExp(/abc/);* // => true** _.isRegExp('/abc/');* // => false*/var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;/*** Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754* double precision number which isn't the result of a rounded unsafe integer.** **Note:** This method is based on* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.* @example** _.isSafeInteger(3);* // => true** _.isSafeInteger(Number.MIN_VALUE);* // => false** _.isSafeInteger(Infinity);* // => false** _.isSafeInteger('3');* // => false*/function isSafeInteger(value) {return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;}/*** Checks if `value` is classified as a `Set` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a set, else `false`.* @example** _.isSet(new Set);* // => true** _.isSet(new WeakSet);* // => false*/var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;/*** Checks if `value` is classified as a `String` primitive or object.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a string, else `false`.* @example** _.isString('abc');* // => true** _.isString(1);* // => false*/function isString(value) {return typeof value == 'string' ||(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);}/*** Checks if `value` is classified as a `Symbol` primitive or object.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.* @example** _.isSymbol(Symbol.iterator);* // => true** _.isSymbol('abc');* // => false*/function isSymbol(value) {return typeof value == 'symbol' ||(isObjectLike(value) && baseGetTag(value) == symbolTag);}/*** Checks if `value` is classified as a typed array.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.* @example** _.isTypedArray(new Uint8Array);* // => true** _.isTypedArray([]);* // => false*/var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;/*** Checks if `value` is `undefined`.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.* @example** _.isUndefined(void 0);* // => true** _.isUndefined(null);* // => false*/function isUndefined(value) {return value === undefined;}/*** Checks if `value` is classified as a `WeakMap` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.* @example** _.isWeakMap(new WeakMap);* // => true** _.isWeakMap(new Map);* // => false*/function isWeakMap(value) {return isObjectLike(value) && getTag(value) == weakMapTag;}/*** Checks if `value` is classified as a `WeakSet` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.* @example** _.isWeakSet(new WeakSet);* // => true** _.isWeakSet(new Set);* // => false*/function isWeakSet(value) {return isObjectLike(value) && baseGetTag(value) == weakSetTag;}/*** Checks if `value` is less than `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than `other`,* else `false`.* @see _.gt* @example** _.lt(1, 3);* // => true** _.lt(3, 3);* // => false** _.lt(3, 1);* // => false*/var lt = createRelationalOperation(baseLt);/*** Checks if `value` is less than or equal to `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than or equal to* `other`, else `false`.* @see _.gte* @example** _.lte(1, 3);* // => true** _.lte(3, 3);* // => true** _.lte(3, 1);* // => false*/var lte = createRelationalOperation(function(value, other) {return value <= other;});/*** Converts `value` to an array.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to convert.* @returns {Array} Returns the converted array.* @example** _.toArray({ 'a': 1, 'b': 2 });* // => [1, 2]** _.toArray('abc');* // => ['a', 'b', 'c']** _.toArray(1);* // => []** _.toArray(null);* // => []*/function toArray(value) {if (!value) {return [];}if (isArrayLike(value)) {return isString(value) ? stringToArray(value) : copyArray(value);}if (symIterator && value[symIterator]) {return iteratorToArray(value[symIterator]());}var tag = getTag(value),func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);return func(value);}/*** Converts `value` to a finite number.** @static* @memberOf _* @since 4.12.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted number.* @example** _.toFinite(3.2);* // => 3.2** _.toFinite(Number.MIN_VALUE);* // => 5e-324** _.toFinite(Infinity);* // => 1.7976931348623157e+308** _.toFinite('3.2');* // => 3.2*/function toFinite(value) {if (!value) {return value === 0 ? value : 0;}value = toNumber(value);if (value === INFINITY || value === -INFINITY) {var sign = (value < 0 ? -1 : 1);return sign * MAX_INTEGER;}return value === value ? value : 0;}/*** Converts `value` to an integer.** **Note:** This method is loosely based on* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toInteger(3.2);* // => 3** _.toInteger(Number.MIN_VALUE);* // => 0** _.toInteger(Infinity);* // => 1.7976931348623157e+308** _.toInteger('3.2');* // => 3*/function toInteger(value) {var result = toFinite(value),remainder = result % 1;return result === result ? (remainder ? result - remainder : result) : 0;}/*** Converts `value` to an integer suitable for use as the length of an* array-like object.** **Note:** This method is based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toLength(3.2);* // => 3** _.toLength(Number.MIN_VALUE);* // => 0** _.toLength(Infinity);* // => 4294967295** _.toLength('3.2');* // => 3*/function toLength(value) {return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;}/*** Converts `value` to a number.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to process.* @returns {number} Returns the number.* @example** _.toNumber(3.2);* // => 3.2** _.toNumber(Number.MIN_VALUE);* // => 5e-324** _.toNumber(Infinity);* // => Infinity** _.toNumber('3.2');* // => 3.2*/function toNumber(value) {if (typeof value == 'number') {return value;}if (isSymbol(value)) {return NAN;}if (isObject(value)) {var other = typeof value.valueOf == 'function' ? value.valueOf() : value;value = isObject(other) ? (other + '') : other;}if (typeof value != 'string') {return value === 0 ? value : +value;}value = value.replace(reTrim, '');var isBinary = reIsBinary.test(value);return (isBinary || reIsOctal.test(value))? freeParseInt(value.slice(2), isBinary ? 2 : 8): (reIsBadHex.test(value) ? NAN : +value);}/*** Converts `value` to a plain object flattening inherited enumerable string* keyed properties of `value` to own properties of the plain object.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to convert.* @returns {Object} Returns the converted plain object.* @example** function Foo() {* this.b = 2;* }** Foo.prototype.c = 3;** _.assign({ 'a': 1 }, new Foo);* // => { 'a': 1, 'b': 2 }** _.assign({ 'a': 1 }, _.toPlainObject(new Foo));* // => { 'a': 1, 'b': 2, 'c': 3 }*/function toPlainObject(value) {return copyObject(value, keysIn(value));}/*** Converts `value` to a safe integer. A safe integer can be compared and* represented correctly.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toSafeInteger(3.2);* // => 3** _.toSafeInteger(Number.MIN_VALUE);* // => 0** _.toSafeInteger(Infinity);* // => 9007199254740991** _.toSafeInteger('3.2');* // => 3*/function toSafeInteger(value) {return value? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER): (value === 0 ? value : 0);}/*** Converts `value` to a string. An empty string is returned for `null`* and `undefined` values. The sign of `-0` is preserved.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {string} Returns the converted string.* @example** _.toString(null);* // => ''** _.toString(-0);* // => '-0'** _.toString([1, 2, 3]);* // => '1,2,3'*/function toString(value) {return value == null ? '' : baseToString(value);}/*------------------------------------------------------------------------*//*** Assigns own enumerable string keyed properties of source objects to the* destination object. Source objects are applied from left to right.* Subsequent sources overwrite property assignments of previous sources.** **Note:** This method mutates `object` and is loosely based on* [`Object.assign`](https://mdn.io/Object/assign).** @static* @memberOf _* @since 0.10.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assignIn* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assign({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'c': 3 }*/var assign = createAssigner(function(object, source) {if (isPrototype(source) || isArrayLike(source)) {copyObject(source, keys(source), object);return;}for (var key in source) {if (hasOwnProperty.call(source, key)) {assignValue(object, key, source[key]);}}});/*** This method is like `_.assign` except that it iterates over own and* inherited source properties.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @alias extend* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assign* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assignIn({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }*/var assignIn = createAssigner(function(object, source) {copyObject(source, keysIn(source), object);});/*** This method is like `_.assignIn` except that it accepts `customizer`* which is invoked to produce the assigned values. If `customizer` returns* `undefined`, assignment is handled by the method instead. The `customizer`* is invoked with five arguments: (objValue, srcValue, key, object, source).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @alias extendWith* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @see _.assignWith* @example** function customizer(objValue, srcValue) {* return _.isUndefined(objValue) ? srcValue : objValue;* }** var defaults = _.partialRight(_.assignInWith, customizer);** defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {copyObject(source, keysIn(source), object, customizer);});/*** This method is like `_.assign` except that it accepts `customizer`* which is invoked to produce the assigned values. If `customizer` returns* `undefined`, assignment is handled by the method instead. The `customizer`* is invoked with five arguments: (objValue, srcValue, key, object, source).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @see _.assignInWith* @example** function customizer(objValue, srcValue) {* return _.isUndefined(objValue) ? srcValue : objValue;* }** var defaults = _.partialRight(_.assignWith, customizer);** defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var assignWith = createAssigner(function(object, source, srcIndex, customizer) {copyObject(source, keys(source), object, customizer);});/*** Creates an array of values corresponding to `paths` of `object`.** @static* @memberOf _* @since 1.0.0* @category Object* @param {Object} object The object to iterate over.* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Array} Returns the picked values.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };** _.at(object, ['a[0].b.c', 'a[1]']);* // => [3, 4]*/var at = flatRest(baseAt);/*** Creates an object that inherits from the `prototype` object. If a* `properties` object is given, its own enumerable string keyed properties* are assigned to the created object.** @static* @memberOf _* @since 2.3.0* @category Object* @param {Object} prototype The object to inherit from.* @param {Object} [properties] The properties to assign to the object.* @returns {Object} Returns the new object.* @example** function Shape() {* this.x = 0;* this.y = 0;* }** function Circle() {* Shape.call(this);* }** Circle.prototype = _.create(Shape.prototype, {* 'constructor': Circle* });** var circle = new Circle;* circle instanceof Circle;* // => true** circle instanceof Shape;* // => true*/function create(prototype, properties) {var result = baseCreate(prototype);return properties == null ? result : baseAssign(result, properties);}/*** Assigns own and inherited enumerable string keyed properties of source* objects to the destination object for all destination properties that* resolve to `undefined`. Source objects are applied from left to right.* Once a property is set, additional values of the same property are ignored.** **Note:** This method mutates `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.defaultsDeep* @example** _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var defaults = baseRest(function(object, sources) {object = Object(object);var index = -1;var length = sources.length;var guard = length > 2 ? sources[2] : undefined;if (guard && isIterateeCall(sources[0], sources[1], guard)) {length = 1;}while (++index < length) {var source = sources[index];var props = keysIn(source);var propsIndex = -1;var propsLength = props.length;while (++propsIndex < propsLength) {var key = props[propsIndex];var value = object[key];if (value === undefined ||(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {object[key] = source[key];}}}return object;});/*** This method is like `_.defaults` except that it recursively assigns* default properties.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 3.10.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.defaults* @example** _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });* // => { 'a': { 'b': 2, 'c': 3 } }*/var defaultsDeep = baseRest(function(args) {args.push(undefined, customDefaultsMerge);return apply(mergeWith, undefined, args);});/*** This method is like `_.find` except that it returns the key of the first* element `predicate` returns truthy for instead of the element itself.** @static* @memberOf _* @since 1.1.0* @category Object* @param {Object} object The object to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {string|undefined} Returns the key of the matched element,* else `undefined`.* @example** var users = {* 'barney': { 'age': 36, 'active': true },* 'fred': { 'age': 40, 'active': false },* 'pebbles': { 'age': 1, 'active': true }* };** _.findKey(users, function(o) { return o.age < 40; });* // => 'barney' (iteration order is not guaranteed)** // The `_.matches` iteratee shorthand.* _.findKey(users, { 'age': 1, 'active': true });* // => 'pebbles'** // The `_.matchesProperty` iteratee shorthand.* _.findKey(users, ['active', false]);* // => 'fred'** // The `_.property` iteratee shorthand.* _.findKey(users, 'active');* // => 'barney'*/function findKey(object, predicate) {return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);}/*** This method is like `_.findKey` except that it iterates over elements of* a collection in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {string|undefined} Returns the key of the matched element,* else `undefined`.* @example** var users = {* 'barney': { 'age': 36, 'active': true },* 'fred': { 'age': 40, 'active': false },* 'pebbles': { 'age': 1, 'active': true }* };** _.findLastKey(users, function(o) { return o.age < 40; });* // => returns 'pebbles' assuming `_.findKey` returns 'barney'** // The `_.matches` iteratee shorthand.* _.findLastKey(users, { 'age': 36, 'active': true });* // => 'barney'** // The `_.matchesProperty` iteratee shorthand.* _.findLastKey(users, ['active', false]);* // => 'fred'** // The `_.property` iteratee shorthand.* _.findLastKey(users, 'active');* // => 'pebbles'*/function findLastKey(object, predicate) {return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);}/*** Iterates over own and inherited enumerable string keyed properties of an* object and invokes `iteratee` for each property. The iteratee is invoked* with three arguments: (value, key, object). Iteratee functions may exit* iteration early by explicitly returning `false`.** @static* @memberOf _* @since 0.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forInRight* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forIn(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).*/function forIn(object, iteratee) {return object == null? object: baseFor(object, getIteratee(iteratee, 3), keysIn);}/*** This method is like `_.forIn` except that it iterates over properties of* `object` in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forIn* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forInRight(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.*/function forInRight(object, iteratee) {return object == null? object: baseForRight(object, getIteratee(iteratee, 3), keysIn);}/*** Iterates over own enumerable string keyed properties of an object and* invokes `iteratee` for each property. The iteratee is invoked with three* arguments: (value, key, object). Iteratee functions may exit iteration* early by explicitly returning `false`.** @static* @memberOf _* @since 0.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forOwnRight* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forOwn(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'a' then 'b' (iteration order is not guaranteed).*/function forOwn(object, iteratee) {return object && baseForOwn(object, getIteratee(iteratee, 3));}/*** This method is like `_.forOwn` except that it iterates over properties of* `object` in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forOwn* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forOwnRight(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.*/function forOwnRight(object, iteratee) {return object && baseForOwnRight(object, getIteratee(iteratee, 3));}/*** Creates an array of function property names from own enumerable properties* of `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to inspect.* @returns {Array} Returns the function names.* @see _.functionsIn* @example** function Foo() {* this.a = _.constant('a');* this.b = _.constant('b');* }** Foo.prototype.c = _.constant('c');** _.functions(new Foo);* // => ['a', 'b']*/function functions(object) {return object == null ? [] : baseFunctions(object, keys(object));}/*** Creates an array of function property names from own and inherited* enumerable properties of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to inspect.* @returns {Array} Returns the function names.* @see _.functions* @example** function Foo() {* this.a = _.constant('a');* this.b = _.constant('b');* }** Foo.prototype.c = _.constant('c');** _.functionsIn(new Foo);* // => ['a', 'b', 'c']*/function functionsIn(object) {return object == null ? [] : baseFunctions(object, keysIn(object));}/*** Gets the value at `path` of `object`. If the resolved value is* `undefined`, the `defaultValue` is returned in its place.** @static* @memberOf _* @since 3.7.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the property to get.* @param {*} [defaultValue] The value returned for `undefined` resolved values.* @returns {*} Returns the resolved value.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.get(object, 'a[0].b.c');* // => 3** _.get(object, ['a', '0', 'b', 'c']);* // => 3** _.get(object, 'a.b.c', 'default');* // => 'default'*/function get(object, path, defaultValue) {var result = object == null ? undefined : baseGet(object, path);return result === undefined ? defaultValue : result;}/*** Checks if `path` is a direct property of `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @returns {boolean} Returns `true` if `path` exists, else `false`.* @example** var object = { 'a': { 'b': 2 } };* var other = _.create({ 'a': _.create({ 'b': 2 }) });** _.has(object, 'a');* // => true** _.has(object, 'a.b');* // => true** _.has(object, ['a', 'b']);* // => true** _.has(other, 'a');* // => false*/function has(object, path) {return object != null && hasPath(object, path, baseHas);}/*** Checks if `path` is a direct or inherited property of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @returns {boolean} Returns `true` if `path` exists, else `false`.* @example** var object = _.create({ 'a': _.create({ 'b': 2 }) });** _.hasIn(object, 'a');* // => true** _.hasIn(object, 'a.b');* // => true** _.hasIn(object, ['a', 'b']);* // => true** _.hasIn(object, 'b');* // => false*/function hasIn(object, path) {return object != null && hasPath(object, path, baseHasIn);}/*** Creates an object composed of the inverted keys and values of `object`.* If `object` contains duplicate values, subsequent values overwrite* property assignments of previous values.** @static* @memberOf _* @since 0.7.0* @category Object* @param {Object} object The object to invert.* @returns {Object} Returns the new inverted object.* @example** var object = { 'a': 1, 'b': 2, 'c': 1 };** _.invert(object);* // => { '1': 'c', '2': 'b' }*/var invert = createInverter(function(result, value, key) {if (value != null &&typeof value.toString != 'function') {value = nativeObjectToString.call(value);}result[value] = key;}, constant(identity));/*** This method is like `_.invert` except that the inverted object is generated* from the results of running each element of `object` thru `iteratee`. The* corresponding inverted value of each inverted key is an array of keys* responsible for generating the inverted value. The iteratee is invoked* with one argument: (value).** @static* @memberOf _* @since 4.1.0* @category Object* @param {Object} object The object to invert.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Object} Returns the new inverted object.* @example** var object = { 'a': 1, 'b': 2, 'c': 1 };** _.invertBy(object);* // => { '1': ['a', 'c'], '2': ['b'] }** _.invertBy(object, function(value) {* return 'group' + value;* });* // => { 'group1': ['a', 'c'], 'group2': ['b'] }*/var invertBy = createInverter(function(result, value, key) {if (value != null &&typeof value.toString != 'function') {value = nativeObjectToString.call(value);}if (hasOwnProperty.call(result, value)) {result[value].push(key);} else {result[value] = [key];}}, getIteratee);/*** Invokes the method at `path` of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the method to invoke.* @param {...*} [args] The arguments to invoke the method with.* @returns {*} Returns the result of the invoked method.* @example** var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };** _.invoke(object, 'a[0].b.c.slice', 1, 3);* // => [2, 3]*/var invoke = baseRest(baseInvoke);/*** Creates an array of the own enumerable property names of `object`.** **Note:** Non-object values are coerced to objects. See the* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* for more details.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keys(new Foo);* // => ['a', 'b'] (iteration order is not guaranteed)** _.keys('hi');* // => ['0', '1']*/function keys(object) {return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);}/*** Creates an array of the own and inherited enumerable property names of `object`.** **Note:** Non-object values are coerced to objects.** @static* @memberOf _* @since 3.0.0* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keysIn(new Foo);* // => ['a', 'b', 'c'] (iteration order is not guaranteed)*/function keysIn(object) {return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);}/*** The opposite of `_.mapValues`; this method creates an object with the* same values as `object` and keys generated by running each own enumerable* string keyed property of `object` thru `iteratee`. The iteratee is invoked* with three arguments: (value, key, object).** @static* @memberOf _* @since 3.8.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns the new mapped object.* @see _.mapValues* @example** _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {* return key + value;* });* // => { 'a1': 1, 'b2': 2 }*/function mapKeys(object, iteratee) {var result = {};iteratee = getIteratee(iteratee, 3);baseForOwn(object, function(value, key, object) {baseAssignValue(result, iteratee(value, key, object), value);});return result;}/*** Creates an object with the same keys as `object` and values generated* by running each own enumerable string keyed property of `object` thru* `iteratee`. The iteratee is invoked with three arguments:* (value, key, object).** @static* @memberOf _* @since 2.4.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns the new mapped object.* @see _.mapKeys* @example** var users = {* 'fred': { 'user': 'fred', 'age': 40 },* 'pebbles': { 'user': 'pebbles', 'age': 1 }* };** _.mapValues(users, function(o) { return o.age; });* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)** // The `_.property` iteratee shorthand.* _.mapValues(users, 'age');* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)*/function mapValues(object, iteratee) {var result = {};iteratee = getIteratee(iteratee, 3);baseForOwn(object, function(value, key, object) {baseAssignValue(result, key, iteratee(value, key, object));});return result;}/*** This method is like `_.assign` except that it recursively merges own and* inherited enumerable string keyed properties of source objects into the* destination object. Source properties that resolve to `undefined` are* skipped if a destination value exists. Array and plain object properties* are merged recursively. Other objects and value types are overridden by* assignment. Source objects are applied from left to right. Subsequent* sources overwrite property assignments of previous sources.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 0.5.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @example** var object = {* 'a': [{ 'b': 2 }, { 'd': 4 }]* };** var other = {* 'a': [{ 'c': 3 }, { 'e': 5 }]* };** _.merge(object, other);* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }*/var merge = createAssigner(function(object, source, srcIndex) {baseMerge(object, source, srcIndex);});/*** This method is like `_.merge` except that it accepts `customizer` which* is invoked to produce the merged values of the destination and source* properties. If `customizer` returns `undefined`, merging is handled by the* method instead. The `customizer` is invoked with six arguments:* (objValue, srcValue, key, object, source, stack).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} customizer The function to customize assigned values.* @returns {Object} Returns `object`.* @example** function customizer(objValue, srcValue) {* if (_.isArray(objValue)) {* return objValue.concat(srcValue);* }* }** var object = { 'a': [1], 'b': [2] };* var other = { 'a': [3], 'b': [4] };** _.mergeWith(object, other, customizer);* // => { 'a': [1, 3], 'b': [2, 4] }*/var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {baseMerge(object, source, srcIndex, customizer);});/*** The opposite of `_.pick`; this method creates an object composed of the* own and inherited enumerable property paths of `object` that are not omitted.** **Note:** This method is considerably slower than `_.pick`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The source object.* @param {...(string|string[])} [paths] The property paths to omit.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.omit(object, ['a', 'c']);* // => { 'b': '2' }*/var omit = flatRest(function(object, paths) {var result = {};if (object == null) {return result;}var isDeep = false;paths = arrayMap(paths, function(path) {path = castPath(path, object);isDeep || (isDeep = path.length > 1);return path;});copyObject(object, getAllKeysIn(object), result);if (isDeep) {result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);}var length = paths.length;while (length--) {baseUnset(result, paths[length]);}return result;});/*** The opposite of `_.pickBy`; this method creates an object composed of* the own and inherited enumerable string keyed properties of `object` that* `predicate` doesn't return truthy for. The predicate is invoked with two* arguments: (value, key).** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The source object.* @param {Function} [predicate=_.identity] The function invoked per property.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.omitBy(object, _.isNumber);* // => { 'b': '2' }*/function omitBy(object, predicate) {return pickBy(object, negate(getIteratee(predicate)));}/*** Creates an object composed of the picked `object` properties.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The source object.* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.pick(object, ['a', 'c']);* // => { 'a': 1, 'c': 3 }*/var pick = flatRest(function(object, paths) {return object == null ? {} : basePick(object, paths);});/*** Creates an object composed of the `object` properties `predicate` returns* truthy for. The predicate is invoked with two arguments: (value, key).** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The source object.* @param {Function} [predicate=_.identity] The function invoked per property.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.pickBy(object, _.isNumber);* // => { 'a': 1, 'c': 3 }*/function pickBy(object, predicate) {if (object == null) {return {};}var props = arrayMap(getAllKeysIn(object), function(prop) {return [prop];});predicate = getIteratee(predicate);return basePickBy(object, props, function(value, path) {return predicate(value, path[0]);});}/*** This method is like `_.get` except that if the resolved value is a* function it's invoked with the `this` binding of its parent object and* its result is returned.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the property to resolve.* @param {*} [defaultValue] The value returned for `undefined` resolved values.* @returns {*} Returns the resolved value.* @example** var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };** _.result(object, 'a[0].b.c1');* // => 3** _.result(object, 'a[0].b.c2');* // => 4** _.result(object, 'a[0].b.c3', 'default');* // => 'default'** _.result(object, 'a[0].b.c3', _.constant('default'));* // => 'default'*/function result(object, path, defaultValue) {path = castPath(path, object);var index = -1,length = path.length;// Ensure the loop is entered when path is empty.if (!length) {length = 1;object = undefined;}while (++index < length) {var value = object == null ? undefined : object[toKey(path[index])];if (value === undefined) {index = length;value = defaultValue;}object = isFunction(value) ? value.call(object) : value;}return object;}/*** Sets the value at `path` of `object`. If a portion of `path` doesn't exist,* it's created. Arrays are created for missing index properties while objects* are created for all other missing properties. Use `_.setWith` to customize* `path` creation.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 3.7.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @returns {Object} Returns `object`.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.set(object, 'a[0].b.c', 4);* console.log(object.a[0].b.c);* // => 4** _.set(object, ['x', '0', 'y', 'z'], 5);* console.log(object.x[0].y.z);* // => 5*/function set(object, path, value) {return object == null ? object : baseSet(object, path, value);}/*** This method is like `_.set` except that it accepts `customizer` which is* invoked to produce the objects of `path`. If `customizer` returns `undefined`* path creation is handled by the method instead. The `customizer` is invoked* with three arguments: (nsValue, key, nsObject).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @example** var object = {};** _.setWith(object, '[0][1]', 'a', Object);* // => { '0': { '1': 'a' } }*/function setWith(object, path, value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return object == null ? object : baseSet(object, path, value, customizer);}/*** Creates an array of own enumerable string keyed-value pairs for `object`* which can be consumed by `_.fromPairs`. If `object` is a map or set, its* entries are returned.** @static* @memberOf _* @since 4.0.0* @alias entries* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the key-value pairs.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.toPairs(new Foo);* // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)*/var toPairs = createToPairs(keys);/*** Creates an array of own and inherited enumerable string keyed-value pairs* for `object` which can be consumed by `_.fromPairs`. If `object` is a map* or set, its entries are returned.** @static* @memberOf _* @since 4.0.0* @alias entriesIn* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the key-value pairs.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.toPairsIn(new Foo);* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)*/var toPairsIn = createToPairs(keysIn);/*** An alternative to `_.reduce`; this method transforms `object` to a new* `accumulator` object which is the result of running each of its own* enumerable string keyed properties thru `iteratee`, with each invocation* potentially mutating the `accumulator` object. If `accumulator` is not* provided, a new object with the same `[[Prototype]]` will be used. The* iteratee is invoked with four arguments: (accumulator, value, key, object).* Iteratee functions may exit iteration early by explicitly returning `false`.** @static* @memberOf _* @since 1.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The custom accumulator value.* @returns {*} Returns the accumulated value.* @example** _.transform([2, 3, 4], function(result, n) {* result.push(n *= n);* return n % 2 == 0;* }, []);* // => [4, 9]** _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {* (result[value] || (result[value] = [])).push(key);* }, {});* // => { '1': ['a', 'c'], '2': ['b'] }*/function transform(object, iteratee, accumulator) {var isArr = isArray(object),isArrLike = isArr || isBuffer(object) || isTypedArray(object);iteratee = getIteratee(iteratee, 4);if (accumulator == null) {var Ctor = object && object.constructor;if (isArrLike) {accumulator = isArr ? new Ctor : [];}else if (isObject(object)) {accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};}else {accumulator = {};}}(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {return iteratee(accumulator, value, index, object);});return accumulator;}/*** Removes the property at `path` of `object`.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to unset.* @returns {boolean} Returns `true` if the property is deleted, else `false`.* @example** var object = { 'a': [{ 'b': { 'c': 7 } }] };* _.unset(object, 'a[0].b.c');* // => true** console.log(object);* // => { 'a': [{ 'b': {} }] };** _.unset(object, ['a', '0', 'b', 'c']);* // => true** console.log(object);* // => { 'a': [{ 'b': {} }] };*/function unset(object, path) {return object == null ? true : baseUnset(object, path);}/*** This method is like `_.set` except that accepts `updater` to produce the* value to set. Use `_.updateWith` to customize `path` creation. The `updater`* is invoked with one argument: (value).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.6.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {Function} updater The function to produce the updated value.* @returns {Object} Returns `object`.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.update(object, 'a[0].b.c', function(n) { return n * n; });* console.log(object.a[0].b.c);* // => 9** _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });* console.log(object.x[0].y.z);* // => 0*/function update(object, path, updater) {return object == null ? object : baseUpdate(object, path, castFunction(updater));}/*** This method is like `_.update` except that it accepts `customizer` which is* invoked to produce the objects of `path`. If `customizer` returns `undefined`* path creation is handled by the method instead. The `customizer` is invoked* with three arguments: (nsValue, key, nsObject).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.6.0* @category Object* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {Function} updater The function to produce the updated value.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @example** var object = {};** _.updateWith(object, '[0][1]', _.constant('a'), Object);* // => { '0': { '1': 'a' } }*/function updateWith(object, path, updater, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);}/*** Creates an array of the own enumerable string keyed property values of `object`.** **Note:** Non-object values are coerced to objects.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property values.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.values(new Foo);* // => [1, 2] (iteration order is not guaranteed)** _.values('hi');* // => ['h', 'i']*/function values(object) {return object == null ? [] : baseValues(object, keys(object));}/*** Creates an array of the own and inherited enumerable string keyed property* values of `object`.** **Note:** Non-object values are coerced to objects.** @static* @memberOf _* @since 3.0.0* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property values.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.valuesIn(new Foo);* // => [1, 2, 3] (iteration order is not guaranteed)*/function valuesIn(object) {return object == null ? [] : baseValues(object, keysIn(object));}/*------------------------------------------------------------------------*//*** Clamps `number` within the inclusive `lower` and `upper` bounds.** @static* @memberOf _* @since 4.0.0* @category Number* @param {number} number The number to clamp.* @param {number} [lower] The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the clamped number.* @example** _.clamp(-10, -5, 5);* // => -5** _.clamp(10, -5, 5);* // => 5*/function clamp(number, lower, upper) {if (upper === undefined) {upper = lower;lower = undefined;}if (upper !== undefined) {upper = toNumber(upper);upper = upper === upper ? upper : 0;}if (lower !== undefined) {lower = toNumber(lower);lower = lower === lower ? lower : 0;}return baseClamp(toNumber(number), lower, upper);}/*** Checks if `n` is between `start` and up to, but not including, `end`. If* `end` is not specified, it's set to `start` with `start` then set to `0`.* If `start` is greater than `end` the params are swapped to support* negative ranges.** @static* @memberOf _* @since 3.3.0* @category Number* @param {number} number The number to check.* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @returns {boolean} Returns `true` if `number` is in the range, else `false`.* @see _.range, _.rangeRight* @example** _.inRange(3, 2, 4);* // => true** _.inRange(4, 8);* // => true** _.inRange(4, 2);* // => false** _.inRange(2, 2);* // => false** _.inRange(1.2, 2);* // => true** _.inRange(5.2, 4);* // => false** _.inRange(-3, -2, -6);* // => true*/function inRange(number, start, end) {start = toFinite(start);if (end === undefined) {end = start;start = 0;} else {end = toFinite(end);}number = toNumber(number);return baseInRange(number, start, end);}/*** Produces a random number between the inclusive `lower` and `upper` bounds.* If only one argument is provided a number between `0` and the given number* is returned. If `floating` is `true`, or either `lower` or `upper` are* floats, a floating-point number is returned instead of an integer.** **Note:** JavaScript follows the IEEE-754 standard for resolving* floating-point values which can produce unexpected results.** @static* @memberOf _* @since 0.7.0* @category Number* @param {number} [lower=0] The lower bound.* @param {number} [upper=1] The upper bound.* @param {boolean} [floating] Specify returning a floating-point number.* @returns {number} Returns the random number.* @example** _.random(0, 5);* // => an integer between 0 and 5** _.random(5);* // => also an integer between 0 and 5** _.random(5, true);* // => a floating-point number between 0 and 5** _.random(1.2, 5.2);* // => a floating-point number between 1.2 and 5.2*/function random(lower, upper, floating) {if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {upper = floating = undefined;}if (floating === undefined) {if (typeof upper == 'boolean') {floating = upper;upper = undefined;}else if (typeof lower == 'boolean') {floating = lower;lower = undefined;}}if (lower === undefined && upper === undefined) {lower = 0;upper = 1;}else {lower = toFinite(lower);if (upper === undefined) {upper = lower;lower = 0;} else {upper = toFinite(upper);}}if (lower > upper) {var temp = lower;lower = upper;upper = temp;}if (floating || lower % 1 || upper % 1) {var rand = nativeRandom();return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);}return baseRandom(lower, upper);}/*------------------------------------------------------------------------*//*** Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the camel cased string.* @example** _.camelCase('Foo Bar');* // => 'fooBar'** _.camelCase('--foo-bar--');* // => 'fooBar'** _.camelCase('__FOO_BAR__');* // => 'fooBar'*/var camelCase = createCompounder(function(result, word, index) {word = word.toLowerCase();return result + (index ? capitalize(word) : word);});/*** Converts the first character of `string` to upper case and the remaining* to lower case.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to capitalize.* @returns {string} Returns the capitalized string.* @example** _.capitalize('FRED');* // => 'Fred'*/function capitalize(string) {return upperFirst(toString(string).toLowerCase());}/*** Deburrs `string` by converting* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)* letters to basic Latin letters and removing* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to deburr.* @returns {string} Returns the deburred string.* @example** _.deburr('déjà vu');* // => 'deja vu'*/function deburr(string) {string = toString(string);return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');}/*** Checks if `string` ends with the given target string.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {string} [target] The string to search for.* @param {number} [position=string.length] The position to search up to.* @returns {boolean} Returns `true` if `string` ends with `target`,* else `false`.* @example** _.endsWith('abc', 'c');* // => true** _.endsWith('abc', 'b');* // => false** _.endsWith('abc', 'b', 2);* // => true*/function endsWith(string, target, position) {string = toString(string);target = baseToString(target);var length = string.length;position = position === undefined? length: baseClamp(toInteger(position), 0, length);var end = position;position -= target.length;return position >= 0 && string.slice(position, end) == target;}/*** Converts the characters "&", "<", ">", '"', and "'" in `string` to their* corresponding HTML entities.** **Note:** No other characters are escaped. To escape additional* characters use a third-party library like [_he_](https://mths.be/he).** Though the ">" character is escaped for symmetry, characters like* ">" and "/" don't need escaping in HTML and have no special meaning* unless they're part of a tag or unquoted attribute value. See* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)* (under "semi-related fun fact") for more details.** When working with HTML you should always* [quote attribute values](http://wonko.com/post/html-escaping) to reduce* XSS vectors.** @static* @since 0.1.0* @memberOf _* @category String* @param {string} [string=''] The string to escape.* @returns {string} Returns the escaped string.* @example** _.escape('fred, barney, & pebbles');* // => 'fred, barney, & pebbles'*/function escape(string) {string = toString(string);return (string && reHasUnescapedHtml.test(string))? string.replace(reUnescapedHtml, escapeHtmlChar): string;}/*** Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to escape.* @returns {string} Returns the escaped string.* @example** _.escapeRegExp('[lodash](https://lodash.com/)');* // => '\[lodash\]\(https://lodash\.com/\)'*/function escapeRegExp(string) {string = toString(string);return (string && reHasRegExpChar.test(string))? string.replace(reRegExpChar, '\\$&'): string;}/*** Converts `string` to* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the kebab cased string.* @example** _.kebabCase('Foo Bar');* // => 'foo-bar'** _.kebabCase('fooBar');* // => 'foo-bar'** _.kebabCase('__FOO_BAR__');* // => 'foo-bar'*/var kebabCase = createCompounder(function(result, word, index) {return result + (index ? '-' : '') + word.toLowerCase();});/*** Converts `string`, as space separated words, to lower case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the lower cased string.* @example** _.lowerCase('--Foo-Bar--');* // => 'foo bar'** _.lowerCase('fooBar');* // => 'foo bar'** _.lowerCase('__FOO_BAR__');* // => 'foo bar'*/var lowerCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + word.toLowerCase();});/*** Converts the first character of `string` to lower case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the converted string.* @example** _.lowerFirst('Fred');* // => 'fred'** _.lowerFirst('FRED');* // => 'fRED'*/var lowerFirst = createCaseFirst('toLowerCase');/*** Pads `string` on the left and right sides if it's shorter than `length`.* Padding characters are truncated if they can't be evenly divided by `length`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.pad('abc', 8);* // => ' abc '** _.pad('abc', 8, '_-');* // => '_-abc_-_'** _.pad('abc', 3);* // => 'abc'*/function pad(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;if (!length || strLength >= length) {return string;}var mid = (length - strLength) / 2;return (createPadding(nativeFloor(mid), chars) +string +createPadding(nativeCeil(mid), chars));}/*** Pads `string` on the right side if it's shorter than `length`. Padding* characters are truncated if they exceed `length`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.padEnd('abc', 6);* // => 'abc '** _.padEnd('abc', 6, '_-');* // => 'abc_-_'** _.padEnd('abc', 3);* // => 'abc'*/function padEnd(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;return (length && strLength < length)? (string + createPadding(length - strLength, chars)): string;}/*** Pads `string` on the left side if it's shorter than `length`. Padding* characters are truncated if they exceed `length`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to pad.* @param {number} [length=0] The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padded string.* @example** _.padStart('abc', 6);* // => ' abc'** _.padStart('abc', 6, '_-');* // => '_-_abc'** _.padStart('abc', 3);* // => 'abc'*/function padStart(string, length, chars) {string = toString(string);length = toInteger(length);var strLength = length ? stringSize(string) : 0;return (length && strLength < length)? (createPadding(length - strLength, chars) + string): string;}/*** Converts `string` to an integer of the specified radix. If `radix` is* `undefined` or `0`, a `radix` of `10` is used unless `value` is a* hexadecimal, in which case a `radix` of `16` is used.** **Note:** This method aligns with the* [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.** @static* @memberOf _* @since 1.1.0* @category String* @param {string} string The string to convert.* @param {number} [radix=10] The radix to interpret `value` by.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {number} Returns the converted integer.* @example** _.parseInt('08');* // => 8** _.map(['6', '08', '10'], _.parseInt);* // => [6, 8, 10]*/function parseInt(string, radix, guard) {if (guard || radix == null) {radix = 0;} else if (radix) {radix = +radix;}return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);}/*** Repeats the given string `n` times.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to repeat.* @param {number} [n=1] The number of times to repeat the string.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the repeated string.* @example** _.repeat('*', 3);* // => '***'** _.repeat('abc', 2);* // => 'abcabc'** _.repeat('abc', 0);* // => ''*/function repeat(string, n, guard) {if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {n = 1;} else {n = toInteger(n);}return baseRepeat(toString(string), n);}/*** Replaces matches for `pattern` in `string` with `replacement`.** **Note:** This method is based on* [`String#replace`](https://mdn.io/String/replace).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to modify.* @param {RegExp|string} pattern The pattern to replace.* @param {Function|string} replacement The match replacement.* @returns {string} Returns the modified string.* @example** _.replace('Hi Fred', 'Fred', 'Barney');* // => 'Hi Barney'*/function replace() {var args = arguments,string = toString(args[0]);return args.length < 3 ? string : string.replace(args[1], args[2]);}/*** Converts `string` to* [snake case](https://en.wikipedia.org/wiki/Snake_case).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the snake cased string.* @example** _.snakeCase('Foo Bar');* // => 'foo_bar'** _.snakeCase('fooBar');* // => 'foo_bar'** _.snakeCase('--FOO-BAR--');* // => 'foo_bar'*/var snakeCase = createCompounder(function(result, word, index) {return result + (index ? '_' : '') + word.toLowerCase();});/*** Splits `string` by `separator`.** **Note:** This method is based on* [`String#split`](https://mdn.io/String/split).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to split.* @param {RegExp|string} separator The separator pattern to split by.* @param {number} [limit] The length to truncate results to.* @returns {Array} Returns the string segments.* @example** _.split('a-b-c', '-', 2);* // => ['a', 'b']*/function split(string, separator, limit) {if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {separator = limit = undefined;}limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;if (!limit) {return [];}string = toString(string);if (string && (typeof separator == 'string' ||(separator != null && !isRegExp(separator)))) {separator = baseToString(separator);if (!separator && hasUnicode(string)) {return castSlice(stringToArray(string), 0, limit);}}return string.split(separator, limit);}/*** Converts `string` to* [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).** @static* @memberOf _* @since 3.1.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the start cased string.* @example** _.startCase('--foo-bar--');* // => 'Foo Bar'** _.startCase('fooBar');* // => 'Foo Bar'** _.startCase('__FOO_BAR__');* // => 'FOO BAR'*/var startCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + upperFirst(word);});/*** Checks if `string` starts with the given target string.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {string} [target] The string to search for.* @param {number} [position=0] The position to search from.* @returns {boolean} Returns `true` if `string` starts with `target`,* else `false`.* @example** _.startsWith('abc', 'a');* // => true** _.startsWith('abc', 'b');* // => false** _.startsWith('abc', 'b', 1);* // => true*/function startsWith(string, target, position) {string = toString(string);position = position == null? 0: baseClamp(toInteger(position), 0, string.length);target = baseToString(target);return string.slice(position, position + target.length) == target;}/*** Creates a compiled template function that can interpolate data properties* in "interpolate" delimiters, HTML-escape interpolated data properties in* "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data* properties may be accessed as free variables in the template. If a setting* object is given, it takes precedence over `_.templateSettings` values.** **Note:** In the development build `_.template` utilizes* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)* for easier debugging.** For more information on precompiling templates see* [lodash's custom builds documentation](https://lodash.com/custom-builds).** For more information on Chrome extension sandboxes see* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).** @static* @since 0.1.0* @memberOf _* @category String* @param {string} [string=''] The template string.* @param {Object} [options={}] The options object.* @param {RegExp} [options.escape=_.templateSettings.escape]* The HTML "escape" delimiter.* @param {RegExp} [options.evaluate=_.templateSettings.evaluate]* The "evaluate" delimiter.* @param {Object} [options.imports=_.templateSettings.imports]* An object to import into the template as free variables.* @param {RegExp} [options.interpolate=_.templateSettings.interpolate]* The "interpolate" delimiter.* @param {string} [options.sourceURL='lodash.templateSources[n]']* The sourceURL of the compiled template.* @param {string} [options.variable='obj']* The data object variable name.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the compiled template function.* @example** // Use the "interpolate" delimiter to create a compiled template.* var compiled = _.template('hello <%= user %>!');* compiled({ 'user': 'fred' });* // => 'hello fred!'** // Use the HTML "escape" delimiter to escape data property values.* var compiled = _.template('<b><%- value %></b>');* compiled({ 'value': '<script>' });* // => '<b><script></b>'** // Use the "evaluate" delimiter to execute JavaScript and generate HTML.* var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');* compiled({ 'users': ['fred', 'barney'] });* // => '<li>fred</li><li>barney</li>'** // Use the internal `print` function in "evaluate" delimiters.* var compiled = _.template('<% print("hello " + user); %>!');* compiled({ 'user': 'barney' });* // => 'hello barney!'** // Use the ES template literal delimiter as an "interpolate" delimiter.* // Disable support by replacing the "interpolate" delimiter.* var compiled = _.template('hello ${ user }!');* compiled({ 'user': 'pebbles' });* // => 'hello pebbles!'** // Use backslashes to treat delimiters as plain text.* var compiled = _.template('<%= "\\<%- value %\\>" %>');* compiled({ 'value': 'ignored' });* // => '<%- value %>'** // Use the `imports` option to import `jQuery` as `jq`.* var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';* var compiled = _.template(text, { 'imports': { 'jq': jQuery } });* compiled({ 'users': ['fred', 'barney'] });* // => '<li>fred</li><li>barney</li>'** // Use the `sourceURL` option to specify a custom sourceURL for the template.* var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });* compiled(data);* // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.** // Use the `variable` option to ensure a with-statement isn't used in the compiled template.* var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });* compiled.source;* // => function(data) {* // var __t, __p = '';* // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';* // return __p;* // }** // Use custom template delimiters.* _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;* var compiled = _.template('hello {{ user }}!');* compiled({ 'user': 'mustache' });* // => 'hello mustache!'** // Use the `source` property to inline compiled templates for meaningful* // line numbers in error messages and stack traces.* fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\* var JST = {\* "main": ' + _.template(mainText).source + '\* };\* ');*/function template(string, options, guard) {// Based on John Resig's `tmpl` implementation// (http://ejohn.org/blog/javascript-micro-templating/)// and Laura Doktorova's doT.js (https://github.com/olado/doT).var settings = lodash.templateSettings;if (guard && isIterateeCall(string, options, guard)) {options = undefined;}string = toString(string);options = assignInWith({}, options, settings, customDefaultsAssignIn);var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),importsKeys = keys(imports),importsValues = baseValues(imports, importsKeys);var isEscaping,isEvaluating,index = 0,interpolate = options.interpolate || reNoMatch,source = "__p += '";// Compile the regexp to match each delimiter.var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' +interpolate.source + '|' +(interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +(options.evaluate || reNoMatch).source + '|$', 'g');// Use a sourceURL for easier debugging.// The sourceURL gets injected into the source that's eval-ed, so be careful// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in// and escape the comment, thus injecting code that gets evaled.var sourceURL = '//# sourceURL=' +(hasOwnProperty.call(options, 'sourceURL')? (options.sourceURL + '').replace(/\s/g, ' '): ('lodash.templateSources[' + (++templateCounter) + ']')) + '\n';string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {interpolateValue || (interpolateValue = esTemplateValue);// Escape characters that can't be included in string literals.source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);// Replace delimiters with snippets.if (escapeValue) {isEscaping = true;source += "' +\n__e(" + escapeValue + ") +\n'";}if (evaluateValue) {isEvaluating = true;source += "';\n" + evaluateValue + ";\n__p += '";}if (interpolateValue) {source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";}index = offset + match.length;// The JS engine embedded in Adobe products needs `match` returned in// order to produce the correct `offset` value.return match;});source += "';\n";// If `variable` is not specified wrap a with-statement around the generated// code to add the data object to the top of the scope chain.var variable = hasOwnProperty.call(options, 'variable') && options.variable;if (!variable) {source = 'with (obj) {\n' + source + '\n}\n';}// Cleanup code by stripping empty strings.source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;');// Frame code as the function body.source = 'function(' + (variable || 'obj') + ') {\n' +(variable? '': 'obj || (obj = {});\n') +"var __t, __p = ''" +(isEscaping? ', __e = _.escape': '') +(isEvaluating? ', __j = Array.prototype.join;\n' +"function print() { __p += __j.call(arguments, '') }\n": ';\n') +source +'return __p\n}';var result = attempt(function() {return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);});// Provide the compiled function's source by its `toString` method or// the `source` property as a convenience for inlining compiled templates.result.source = source;if (isError(result)) {throw result;}return result;}/*** Converts `string`, as a whole, to lower case just like* [String#toLowerCase](https://mdn.io/toLowerCase).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the lower cased string.* @example** _.toLower('--Foo-Bar--');* // => '--foo-bar--'** _.toLower('fooBar');* // => 'foobar'** _.toLower('__FOO_BAR__');* // => '__foo_bar__'*/function toLower(value) {return toString(value).toLowerCase();}/*** Converts `string`, as a whole, to upper case just like* [String#toUpperCase](https://mdn.io/toUpperCase).** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the upper cased string.* @example** _.toUpper('--foo-bar--');* // => '--FOO-BAR--'** _.toUpper('fooBar');* // => 'FOOBAR'** _.toUpper('__foo_bar__');* // => '__FOO_BAR__'*/function toUpper(value) {return toString(value).toUpperCase();}/*** Removes leading and trailing whitespace or specified characters from `string`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trim(' abc ');* // => 'abc'** _.trim('-_-abc-_-', '_-');* // => 'abc'** _.map([' foo ', ' bar '], _.trim);* // => ['foo', 'bar']*/function trim(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrim, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),chrSymbols = stringToArray(chars),start = charsStartIndex(strSymbols, chrSymbols),end = charsEndIndex(strSymbols, chrSymbols) + 1;return castSlice(strSymbols, start, end).join('');}/*** Removes trailing whitespace or specified characters from `string`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trimEnd(' abc ');* // => ' abc'** _.trimEnd('-_-abc-_-', '_-');* // => '-_-abc'*/function trimEnd(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrimEnd, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;return castSlice(strSymbols, 0, end).join('');}/*** Removes leading whitespace or specified characters from `string`.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trimStart(' abc ');* // => 'abc '** _.trimStart('-_-abc-_-', '_-');* // => 'abc-_-'*/function trimStart(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrimStart, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),start = charsStartIndex(strSymbols, stringToArray(chars));return castSlice(strSymbols, start).join('');}/*** Truncates `string` if it's longer than the given maximum string length.* The last characters of the truncated string are replaced with the omission* string which defaults to "...".** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to truncate.* @param {Object} [options={}] The options object.* @param {number} [options.length=30] The maximum string length.* @param {string} [options.omission='...'] The string to indicate text is omitted.* @param {RegExp|string} [options.separator] The separator pattern to truncate to.* @returns {string} Returns the truncated string.* @example** _.truncate('hi-diddly-ho there, neighborino');* // => 'hi-diddly-ho there, neighbo...'** _.truncate('hi-diddly-ho there, neighborino', {* 'length': 24,* 'separator': ' '* });* // => 'hi-diddly-ho there,...'** _.truncate('hi-diddly-ho there, neighborino', {* 'length': 24,* 'separator': /,? +/* });* // => 'hi-diddly-ho there...'** _.truncate('hi-diddly-ho there, neighborino', {* 'omission': ' [...]'* });* // => 'hi-diddly-ho there, neig [...]'*/function truncate(string, options) {var length = DEFAULT_TRUNC_LENGTH,omission = DEFAULT_TRUNC_OMISSION;if (isObject(options)) {var separator = 'separator' in options ? options.separator : separator;length = 'length' in options ? toInteger(options.length) : length;omission = 'omission' in options ? baseToString(options.omission) : omission;}string = toString(string);var strLength = string.length;if (hasUnicode(string)) {var strSymbols = stringToArray(string);strLength = strSymbols.length;}if (length >= strLength) {return string;}var end = length - stringSize(omission);if (end < 1) {return omission;}var result = strSymbols? castSlice(strSymbols, 0, end).join(''): string.slice(0, end);if (separator === undefined) {return result + omission;}if (strSymbols) {end += (result.length - end);}if (isRegExp(separator)) {if (string.slice(end).search(separator)) {var match,substring = result;if (!separator.global) {separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');}separator.lastIndex = 0;while ((match = separator.exec(substring))) {var newEnd = match.index;}result = result.slice(0, newEnd === undefined ? end : newEnd);}} else if (string.indexOf(baseToString(separator), end) != end) {var index = result.lastIndexOf(separator);if (index > -1) {result = result.slice(0, index);}}return result + omission;}/*** The inverse of `_.escape`; this method converts the HTML entities* `&`, `<`, `>`, `"`, and `'` in `string` to* their corresponding characters.** **Note:** No other HTML entities are unescaped. To unescape additional* HTML entities use a third-party library like [_he_](https://mths.be/he).** @static* @memberOf _* @since 0.6.0* @category String* @param {string} [string=''] The string to unescape.* @returns {string} Returns the unescaped string.* @example** _.unescape('fred, barney, & pebbles');* // => 'fred, barney, & pebbles'*/function unescape(string) {string = toString(string);return (string && reHasEscapedHtml.test(string))? string.replace(reEscapedHtml, unescapeHtmlChar): string;}/*** Converts `string`, as space separated words, to upper case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the upper cased string.* @example** _.upperCase('--foo-bar');* // => 'FOO BAR'** _.upperCase('fooBar');* // => 'FOO BAR'** _.upperCase('__foo_bar__');* // => 'FOO BAR'*/var upperCase = createCompounder(function(result, word, index) {return result + (index ? ' ' : '') + word.toUpperCase();});/*** Converts the first character of `string` to upper case.** @static* @memberOf _* @since 4.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the converted string.* @example** _.upperFirst('fred');* // => 'Fred'** _.upperFirst('FRED');* // => 'FRED'*/var upperFirst = createCaseFirst('toUpperCase');/*** Splits `string` into an array of its words.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {RegExp|string} [pattern] The pattern to match words.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the words of `string`.* @example** _.words('fred, barney, & pebbles');* // => ['fred', 'barney', 'pebbles']** _.words('fred, barney, & pebbles', /[^, ]+/g);* // => ['fred', 'barney', '&', 'pebbles']*/function words(string, pattern, guard) {string = toString(string);pattern = guard ? undefined : pattern;if (pattern === undefined) {return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);}return string.match(pattern) || [];}/*------------------------------------------------------------------------*//*** Attempts to invoke `func`, returning either the result or the caught error* object. Any additional arguments are provided to `func` when it's invoked.** @static* @memberOf _* @since 3.0.0* @category Util* @param {Function} func The function to attempt.* @param {...*} [args] The arguments to invoke `func` with.* @returns {*} Returns the `func` result or error object.* @example** // Avoid throwing errors for invalid selectors.* var elements = _.attempt(function(selector) {* return document.querySelectorAll(selector);* }, '>_>');** if (_.isError(elements)) {* elements = [];* }*/var attempt = baseRest(function(func, args) {try {return apply(func, undefined, args);} catch (e) {return isError(e) ? e : new Error(e);}});/*** Binds methods of an object to the object itself, overwriting the existing* method.** **Note:** This method doesn't set the "length" property of bound functions.** @static* @since 0.1.0* @memberOf _* @category Util* @param {Object} object The object to bind and assign the bound methods to.* @param {...(string|string[])} methodNames The object method names to bind.* @returns {Object} Returns `object`.* @example** var view = {* 'label': 'docs',* 'click': function() {* console.log('clicked ' + this.label);* }* };** _.bindAll(view, ['click']);* jQuery(element).on('click', view.click);* // => Logs 'clicked docs' when clicked.*/var bindAll = flatRest(function(object, methodNames) {arrayEach(methodNames, function(key) {key = toKey(key);baseAssignValue(object, key, bind(object[key], object));});return object;});/*** Creates a function that iterates over `pairs` and invokes the corresponding* function of the first predicate to return truthy. The predicate-function* pairs are invoked with the `this` binding and arguments of the created* function.** @static* @memberOf _* @since 4.0.0* @category Util* @param {Array} pairs The predicate-function pairs.* @returns {Function} Returns the new composite function.* @example** var func = _.cond([* [_.matches({ 'a': 1 }), _.constant('matches A')],* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],* [_.stubTrue, _.constant('no match')]* ]);** func({ 'a': 1, 'b': 2 });* // => 'matches A'** func({ 'a': 0, 'b': 1 });* // => 'matches B'** func({ 'a': '1', 'b': '2' });* // => 'no match'*/function cond(pairs) {var length = pairs == null ? 0 : pairs.length,toIteratee = getIteratee();pairs = !length ? [] : arrayMap(pairs, function(pair) {if (typeof pair[1] != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return [toIteratee(pair[0]), pair[1]];});return baseRest(function(args) {var index = -1;while (++index < length) {var pair = pairs[index];if (apply(pair[0], this, args)) {return apply(pair[1], this, args);}}});}/*** Creates a function that invokes the predicate properties of `source` with* the corresponding property values of a given object, returning `true` if* all predicates return truthy, else `false`.** **Note:** The created function is equivalent to `_.conformsTo` with* `source` partially applied.** @static* @memberOf _* @since 4.0.0* @category Util* @param {Object} source The object of property predicates to conform to.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 2, 'b': 1 },* { 'a': 1, 'b': 2 }* ];** _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));* // => [{ 'a': 1, 'b': 2 }]*/function conforms(source) {return baseConforms(baseClone(source, CLONE_DEEP_FLAG));}/*** Creates a function that returns `value`.** @static* @memberOf _* @since 2.4.0* @category Util* @param {*} value The value to return from the new function.* @returns {Function} Returns the new constant function.* @example** var objects = _.times(2, _.constant({ 'a': 1 }));** console.log(objects);* // => [{ 'a': 1 }, { 'a': 1 }]** console.log(objects[0] === objects[1]);* // => true*/function constant(value) {return function() {return value;};}/*** Checks `value` to determine whether a default value should be returned in* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,* or `undefined`.** @static* @memberOf _* @since 4.14.0* @category Util* @param {*} value The value to check.* @param {*} defaultValue The default value.* @returns {*} Returns the resolved value.* @example** _.defaultTo(1, 10);* // => 1** _.defaultTo(undefined, 10);* // => 10*/function defaultTo(value, defaultValue) {return (value == null || value !== value) ? defaultValue : value;}/*** Creates a function that returns the result of invoking the given functions* with the `this` binding of the created function, where each successive* invocation is supplied the return value of the previous.** @static* @memberOf _* @since 3.0.0* @category Util* @param {...(Function|Function[])} [funcs] The functions to invoke.* @returns {Function} Returns the new composite function.* @see _.flowRight* @example** function square(n) {* return n * n;* }** var addSquare = _.flow([_.add, square]);* addSquare(1, 2);* // => 9*/var flow = createFlow();/*** This method is like `_.flow` except that it creates a function that* invokes the given functions from right to left.** @static* @since 3.0.0* @memberOf _* @category Util* @param {...(Function|Function[])} [funcs] The functions to invoke.* @returns {Function} Returns the new composite function.* @see _.flow* @example** function square(n) {* return n * n;* }** var addSquare = _.flowRight([square, _.add]);* addSquare(1, 2);* // => 9*/var flowRight = createFlow(true);/*** This method returns the first argument it receives.** @static* @since 0.1.0* @memberOf _* @category Util* @param {*} value Any value.* @returns {*} Returns `value`.* @example** var object = { 'a': 1 };** console.log(_.identity(object) === object);* // => true*/function identity(value) {return value;}/*** Creates a function that invokes `func` with the arguments of the created* function. If `func` is a property name, the created function returns the* property value for a given element. If `func` is an array or object, the* created function returns `true` for elements that contain the equivalent* source properties, otherwise it returns `false`.** @static* @since 4.0.0* @memberOf _* @category Util* @param {*} [func=_.identity] The value to convert to a callback.* @returns {Function} Returns the callback.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));* // => [{ 'user': 'barney', 'age': 36, 'active': true }]** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, _.iteratee(['user', 'fred']));* // => [{ 'user': 'fred', 'age': 40 }]** // The `_.property` iteratee shorthand.* _.map(users, _.iteratee('user'));* // => ['barney', 'fred']** // Create custom iteratee shorthands.* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {* return !_.isRegExp(func) ? iteratee(func) : function(string) {* return func.test(string);* };* });** _.filter(['abc', 'def'], /ef/);* // => ['def']*/function iteratee(func) {return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));}/*** Creates a function that performs a partial deep comparison between a given* object and `source`, returning `true` if the given object has equivalent* property values, else `false`.** **Note:** The created function is equivalent to `_.isMatch` with `source`* partially applied.** Partial comparisons will match empty array and empty object `source`* values against any array or object value, respectively. See `_.isEqual`* for a list of supported value comparisons.** **Note:** Multiple values can be checked by combining several matchers* using `_.overSome`** @static* @memberOf _* @since 3.0.0* @category Util* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 1, 'b': 2, 'c': 3 },* { 'a': 4, 'b': 5, 'c': 6 }* ];** _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));* // => [{ 'a': 4, 'b': 5, 'c': 6 }]** // Checking for several possible values* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]*/function matches(source) {return baseMatches(baseClone(source, CLONE_DEEP_FLAG));}/*** Creates a function that performs a partial deep comparison between the* value at `path` of a given object to `srcValue`, returning `true` if the* object value is equivalent, else `false`.** **Note:** Partial comparisons will match empty array and empty object* `srcValue` values against any array or object value, respectively. See* `_.isEqual` for a list of supported value comparisons.** **Note:** Multiple values can be checked by combining several matchers* using `_.overSome`** @static* @memberOf _* @since 3.2.0* @category Util* @param {Array|string} path The path of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 1, 'b': 2, 'c': 3 },* { 'a': 4, 'b': 5, 'c': 6 }* ];** _.find(objects, _.matchesProperty('a', 4));* // => { 'a': 4, 'b': 5, 'c': 6 }** // Checking for several possible values* _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]*/function matchesProperty(path, srcValue) {return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));}/*** Creates a function that invokes the method at `path` of a given object.* Any additional arguments are provided to the invoked method.** @static* @memberOf _* @since 3.7.0* @category Util* @param {Array|string} path The path of the method to invoke.* @param {...*} [args] The arguments to invoke the method with.* @returns {Function} Returns the new invoker function.* @example** var objects = [* { 'a': { 'b': _.constant(2) } },* { 'a': { 'b': _.constant(1) } }* ];** _.map(objects, _.method('a.b'));* // => [2, 1]** _.map(objects, _.method(['a', 'b']));* // => [2, 1]*/var method = baseRest(function(path, args) {return function(object) {return baseInvoke(object, path, args);};});/*** The opposite of `_.method`; this method creates a function that invokes* the method at a given path of `object`. Any additional arguments are* provided to the invoked method.** @static* @memberOf _* @since 3.7.0* @category Util* @param {Object} object The object to query.* @param {...*} [args] The arguments to invoke the method with.* @returns {Function} Returns the new invoker function.* @example** var array = _.times(3, _.constant),* object = { 'a': array, 'b': array, 'c': array };** _.map(['a[2]', 'c[0]'], _.methodOf(object));* // => [2, 0]** _.map([['a', '2'], ['c', '0']], _.methodOf(object));* // => [2, 0]*/var methodOf = baseRest(function(object, args) {return function(path) {return baseInvoke(object, path, args);};});/*** Adds all own enumerable string keyed function properties of a source* object to the destination object. If `object` is a function, then methods* are added to its prototype as well.** **Note:** Use `_.runInContext` to create a pristine `lodash` function to* avoid conflicts caused by modifying the original.** @static* @since 0.1.0* @memberOf _* @category Util* @param {Function|Object} [object=lodash] The destination object.* @param {Object} source The object of functions to add.* @param {Object} [options={}] The options object.* @param {boolean} [options.chain=true] Specify whether mixins are chainable.* @returns {Function|Object} Returns `object`.* @example** function vowels(string) {* return _.filter(string, function(v) {* return /[aeiou]/i.test(v);* });* }** _.mixin({ 'vowels': vowels });* _.vowels('fred');* // => ['e']** _('fred').vowels().value();* // => ['e']** _.mixin({ 'vowels': vowels }, { 'chain': false });* _('fred').vowels();* // => ['e']*/function mixin(object, source, options) {var props = keys(source),methodNames = baseFunctions(source, props);if (options == null &&!(isObject(source) && (methodNames.length || !props.length))) {options = source;source = object;object = this;methodNames = baseFunctions(source, keys(source));}var chain = !(isObject(options) && 'chain' in options) || !!options.chain,isFunc = isFunction(object);arrayEach(methodNames, function(methodName) {var func = source[methodName];object[methodName] = func;if (isFunc) {object.prototype[methodName] = function() {var chainAll = this.__chain__;if (chain || chainAll) {var result = object(this.__wrapped__),actions = result.__actions__ = copyArray(this.__actions__);actions.push({ 'func': func, 'args': arguments, 'thisArg': object });result.__chain__ = chainAll;return result;}return func.apply(object, arrayPush([this.value()], arguments));};}});return object;}/*** Reverts the `_` variable to its previous value and returns a reference to* the `lodash` function.** @static* @since 0.1.0* @memberOf _* @category Util* @returns {Function} Returns the `lodash` function.* @example** var lodash = _.noConflict();*/function noConflict() {if (root._ === this) {root._ = oldDash;}return this;}/*** This method returns `undefined`.** @static* @memberOf _* @since 2.3.0* @category Util* @example** _.times(2, _.noop);* // => [undefined, undefined]*/function noop() {// No operation performed.}/*** Creates a function that gets the argument at index `n`. If `n` is negative,* the nth argument from the end is returned.** @static* @memberOf _* @since 4.0.0* @category Util* @param {number} [n=0] The index of the argument to return.* @returns {Function} Returns the new pass-thru function.* @example** var func = _.nthArg(1);* func('a', 'b', 'c', 'd');* // => 'b'** var func = _.nthArg(-2);* func('a', 'b', 'c', 'd');* // => 'c'*/function nthArg(n) {n = toInteger(n);return baseRest(function(args) {return baseNth(args, n);});}/*** Creates a function that invokes `iteratees` with the arguments it receives* and returns their results.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [iteratees=[_.identity]]* The iteratees to invoke.* @returns {Function} Returns the new function.* @example** var func = _.over([Math.max, Math.min]);** func(1, 2, 3, 4);* // => [4, 1]*/var over = createOver(arrayMap);/*** Creates a function that checks if **all** of the `predicates` return* truthy when invoked with the arguments it receives.** Following shorthands are possible for providing predicates.* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [predicates=[_.identity]]* The predicates to check.* @returns {Function} Returns the new function.* @example** var func = _.overEvery([Boolean, isFinite]);** func('1');* // => true** func(null);* // => false** func(NaN);* // => false*/var overEvery = createOver(arrayEvery);/*** Creates a function that checks if **any** of the `predicates` return* truthy when invoked with the arguments it receives.** Following shorthands are possible for providing predicates.* Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.* Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.** @static* @memberOf _* @since 4.0.0* @category Util* @param {...(Function|Function[])} [predicates=[_.identity]]* The predicates to check.* @returns {Function} Returns the new function.* @example** var func = _.overSome([Boolean, isFinite]);** func('1');* // => true** func(null);* // => true** func(NaN);* // => false** var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])* var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])*/var overSome = createOver(arraySome);/*** Creates a function that returns the value at `path` of a given object.** @static* @memberOf _* @since 2.4.0* @category Util* @param {Array|string} path The path of the property to get.* @returns {Function} Returns the new accessor function.* @example** var objects = [* { 'a': { 'b': 2 } },* { 'a': { 'b': 1 } }* ];** _.map(objects, _.property('a.b'));* // => [2, 1]** _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');* // => [1, 2]*/function property(path) {return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);}/*** The opposite of `_.property`; this method creates a function that returns* the value at a given path of `object`.** @static* @memberOf _* @since 3.0.0* @category Util* @param {Object} object The object to query.* @returns {Function} Returns the new accessor function.* @example** var array = [0, 1, 2],* object = { 'a': array, 'b': array, 'c': array };** _.map(['a[2]', 'c[0]'], _.propertyOf(object));* // => [2, 0]** _.map([['a', '2'], ['c', '0']], _.propertyOf(object));* // => [2, 0]*/function propertyOf(object) {return function(path) {return object == null ? undefined : baseGet(object, path);};}/*** Creates an array of numbers (positive and/or negative) progressing from* `start` up to, but not including, `end`. A step of `-1` is used if a negative* `start` is specified without an `end` or `step`. If `end` is not specified,* it's set to `start` with `start` then set to `0`.** **Note:** JavaScript follows the IEEE-754 standard for resolving* floating-point values which can produce unexpected results.** @static* @since 0.1.0* @memberOf _* @category Util* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @param {number} [step=1] The value to increment or decrement by.* @returns {Array} Returns the range of numbers.* @see _.inRange, _.rangeRight* @example** _.range(4);* // => [0, 1, 2, 3]** _.range(-4);* // => [0, -1, -2, -3]** _.range(1, 5);* // => [1, 2, 3, 4]** _.range(0, 20, 5);* // => [0, 5, 10, 15]** _.range(0, -4, -1);* // => [0, -1, -2, -3]** _.range(1, 4, 0);* // => [1, 1, 1]** _.range(0);* // => []*/var range = createRange();/*** This method is like `_.range` except that it populates values in* descending order.** @static* @memberOf _* @since 4.0.0* @category Util* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @param {number} [step=1] The value to increment or decrement by.* @returns {Array} Returns the range of numbers.* @see _.inRange, _.range* @example** _.rangeRight(4);* // => [3, 2, 1, 0]** _.rangeRight(-4);* // => [-3, -2, -1, 0]** _.rangeRight(1, 5);* // => [4, 3, 2, 1]** _.rangeRight(0, 20, 5);* // => [15, 10, 5, 0]** _.rangeRight(0, -4, -1);* // => [-3, -2, -1, 0]** _.rangeRight(1, 4, 0);* // => [1, 1, 1]** _.rangeRight(0);* // => []*/var rangeRight = createRange(true);/*** This method returns a new empty array.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {Array} Returns the new empty array.* @example** var arrays = _.times(2, _.stubArray);** console.log(arrays);* // => [[], []]** console.log(arrays[0] === arrays[1]);* // => false*/function stubArray() {return [];}/*** This method returns `false`.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {boolean} Returns `false`.* @example** _.times(2, _.stubFalse);* // => [false, false]*/function stubFalse() {return false;}/*** This method returns a new empty object.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {Object} Returns the new empty object.* @example** var objects = _.times(2, _.stubObject);** console.log(objects);* // => [{}, {}]** console.log(objects[0] === objects[1]);* // => false*/function stubObject() {return {};}/*** This method returns an empty string.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {string} Returns the empty string.* @example** _.times(2, _.stubString);* // => ['', '']*/function stubString() {return '';}/*** This method returns `true`.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {boolean} Returns `true`.* @example** _.times(2, _.stubTrue);* // => [true, true]*/function stubTrue() {return true;}/*** Invokes the iteratee `n` times, returning an array of the results of* each invocation. The iteratee is invoked with one argument; (index).** @static* @since 0.1.0* @memberOf _* @category Util* @param {number} n The number of times to invoke `iteratee`.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the array of results.* @example** _.times(3, String);* // => ['0', '1', '2']** _.times(4, _.constant(0));* // => [0, 0, 0, 0]*/function times(n, iteratee) {n = toInteger(n);if (n < 1 || n > MAX_SAFE_INTEGER) {return [];}var index = MAX_ARRAY_LENGTH,length = nativeMin(n, MAX_ARRAY_LENGTH);iteratee = getIteratee(iteratee);n -= MAX_ARRAY_LENGTH;var result = baseTimes(length, iteratee);while (++index < n) {iteratee(index);}return result;}/*** Converts `value` to a property path array.** @static* @memberOf _* @since 4.0.0* @category Util* @param {*} value The value to convert.* @returns {Array} Returns the new property path array.* @example** _.toPath('a.b.c');* // => ['a', 'b', 'c']** _.toPath('a[0].b.c');* // => ['a', '0', 'b', 'c']*/function toPath(value) {if (isArray(value)) {return arrayMap(value, toKey);}return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));}/*** Generates a unique ID. If `prefix` is given, the ID is appended to it.** @static* @since 0.1.0* @memberOf _* @category Util* @param {string} [prefix=''] The value to prefix the ID with.* @returns {string} Returns the unique ID.* @example** _.uniqueId('contact_');* // => 'contact_104'** _.uniqueId();* // => '105'*/function uniqueId(prefix) {var id = ++idCounter;return toString(prefix) + id;}/*------------------------------------------------------------------------*//*** Adds two numbers.** @static* @memberOf _* @since 3.4.0* @category Math* @param {number} augend The first number in an addition.* @param {number} addend The second number in an addition.* @returns {number} Returns the total.* @example** _.add(6, 4);* // => 10*/var add = createMathOperation(function(augend, addend) {return augend + addend;}, 0);/*** Computes `number` rounded up to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round up.* @param {number} [precision=0] The precision to round up to.* @returns {number} Returns the rounded up number.* @example** _.ceil(4.006);* // => 5** _.ceil(6.004, 2);* // => 6.01** _.ceil(6040, -2);* // => 6100*/var ceil = createRound('ceil');/*** Divide two numbers.** @static* @memberOf _* @since 4.7.0* @category Math* @param {number} dividend The first number in a division.* @param {number} divisor The second number in a division.* @returns {number} Returns the quotient.* @example** _.divide(6, 4);* // => 1.5*/var divide = createMathOperation(function(dividend, divisor) {return dividend / divisor;}, 1);/*** Computes `number` rounded down to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round down.* @param {number} [precision=0] The precision to round down to.* @returns {number} Returns the rounded down number.* @example** _.floor(4.006);* // => 4** _.floor(0.046, 2);* // => 0.04** _.floor(4060, -2);* // => 4000*/var floor = createRound('floor');/*** Computes the maximum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the maximum value.* @example** _.max([4, 2, 8, 6]);* // => 8** _.max([]);* // => undefined*/function max(array) {return (array && array.length)? baseExtremum(array, identity, baseGt): undefined;}/*** This method is like `_.max` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* the value is ranked. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {*} Returns the maximum value.* @example** var objects = [{ 'n': 1 }, { 'n': 2 }];** _.maxBy(objects, function(o) { return o.n; });* // => { 'n': 2 }** // The `_.property` iteratee shorthand.* _.maxBy(objects, 'n');* // => { 'n': 2 }*/function maxBy(array, iteratee) {return (array && array.length)? baseExtremum(array, getIteratee(iteratee, 2), baseGt): undefined;}/*** Computes the mean of the values in `array`.** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @returns {number} Returns the mean.* @example** _.mean([4, 2, 8, 6]);* // => 5*/function mean(array) {return baseMean(array, identity);}/*** This method is like `_.mean` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the value to be averaged.* The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.7.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the mean.* @example** var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];** _.meanBy(objects, function(o) { return o.n; });* // => 5** // The `_.property` iteratee shorthand.* _.meanBy(objects, 'n');* // => 5*/function meanBy(array, iteratee) {return baseMean(array, getIteratee(iteratee, 2));}/*** Computes the minimum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the minimum value.* @example** _.min([4, 2, 8, 6]);* // => 2** _.min([]);* // => undefined*/function min(array) {return (array && array.length)? baseExtremum(array, identity, baseLt): undefined;}/*** This method is like `_.min` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the criterion by which* the value is ranked. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {*} Returns the minimum value.* @example** var objects = [{ 'n': 1 }, { 'n': 2 }];** _.minBy(objects, function(o) { return o.n; });* // => { 'n': 1 }** // The `_.property` iteratee shorthand.* _.minBy(objects, 'n');* // => { 'n': 1 }*/function minBy(array, iteratee) {return (array && array.length)? baseExtremum(array, getIteratee(iteratee, 2), baseLt): undefined;}/*** Multiply two numbers.** @static* @memberOf _* @since 4.7.0* @category Math* @param {number} multiplier The first number in a multiplication.* @param {number} multiplicand The second number in a multiplication.* @returns {number} Returns the product.* @example** _.multiply(6, 4);* // => 24*/var multiply = createMathOperation(function(multiplier, multiplicand) {return multiplier * multiplicand;}, 1);/*** Computes `number` rounded to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round.* @param {number} [precision=0] The precision to round to.* @returns {number} Returns the rounded number.* @example** _.round(4.006);* // => 4** _.round(4.006, 2);* // => 4.01** _.round(4060, -2);* // => 4100*/var round = createRound('round');/*** Subtract two numbers.** @static* @memberOf _* @since 4.0.0* @category Math* @param {number} minuend The first number in a subtraction.* @param {number} subtrahend The second number in a subtraction.* @returns {number} Returns the difference.* @example** _.subtract(6, 4);* // => 2*/var subtract = createMathOperation(function(minuend, subtrahend) {return minuend - subtrahend;}, 0);/*** Computes the sum of the values in `array`.** @static* @memberOf _* @since 3.4.0* @category Math* @param {Array} array The array to iterate over.* @returns {number} Returns the sum.* @example** _.sum([4, 2, 8, 6]);* // => 20*/function sum(array) {return (array && array.length)? baseSum(array, identity): 0;}/*** This method is like `_.sum` except that it accepts `iteratee` which is* invoked for each element in `array` to generate the value to be summed.* The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Math* @param {Array} array The array to iterate over.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {number} Returns the sum.* @example** var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];** _.sumBy(objects, function(o) { return o.n; });* // => 20** // The `_.property` iteratee shorthand.* _.sumBy(objects, 'n');* // => 20*/function sumBy(array, iteratee) {return (array && array.length)? baseSum(array, getIteratee(iteratee, 2)): 0;}/*------------------------------------------------------------------------*/// Add methods that return wrapped values in chain sequences.lodash.after = after;lodash.ary = ary;lodash.assign = assign;lodash.assignIn = assignIn;lodash.assignInWith = assignInWith;lodash.assignWith = assignWith;lodash.at = at;lodash.before = before;lodash.bind = bind;lodash.bindAll = bindAll;lodash.bindKey = bindKey;lodash.castArray = castArray;lodash.chain = chain;lodash.chunk = chunk;lodash.compact = compact;lodash.concat = concat;lodash.cond = cond;lodash.conforms = conforms;lodash.constant = constant;lodash.countBy = countBy;lodash.create = create;lodash.curry = curry;lodash.curryRight = curryRight;lodash.debounce = debounce;lodash.defaults = defaults;lodash.defaultsDeep = defaultsDeep;lodash.defer = defer;lodash.delay = delay;lodash.difference = difference;lodash.differenceBy = differenceBy;lodash.differenceWith = differenceWith;lodash.drop = drop;lodash.dropRight = dropRight;lodash.dropRightWhile = dropRightWhile;lodash.dropWhile = dropWhile;lodash.fill = fill;lodash.filter = filter;lodash.flatMap = flatMap;lodash.flatMapDeep = flatMapDeep;lodash.flatMapDepth = flatMapDepth;lodash.flatten = flatten;lodash.flattenDeep = flattenDeep;lodash.flattenDepth = flattenDepth;lodash.flip = flip;lodash.flow = flow;lodash.flowRight = flowRight;lodash.fromPairs = fromPairs;lodash.functions = functions;lodash.functionsIn = functionsIn;lodash.groupBy = groupBy;lodash.initial = initial;lodash.intersection = intersection;lodash.intersectionBy = intersectionBy;lodash.intersectionWith = intersectionWith;lodash.invert = invert;lodash.invertBy = invertBy;lodash.invokeMap = invokeMap;lodash.iteratee = iteratee;lodash.keyBy = keyBy;lodash.keys = keys;lodash.keysIn = keysIn;lodash.map = map;lodash.mapKeys = mapKeys;lodash.mapValues = mapValues;lodash.matches = matches;lodash.matchesProperty = matchesProperty;lodash.memoize = memoize;lodash.merge = merge;lodash.mergeWith = mergeWith;lodash.method = method;lodash.methodOf = methodOf;lodash.mixin = mixin;lodash.negate = negate;lodash.nthArg = nthArg;lodash.omit = omit;lodash.omitBy = omitBy;lodash.once = once;lodash.orderBy = orderBy;lodash.over = over;lodash.overArgs = overArgs;lodash.overEvery = overEvery;lodash.overSome = overSome;lodash.partial = partial;lodash.partialRight = partialRight;lodash.partition = partition;lodash.pick = pick;lodash.pickBy = pickBy;lodash.property = property;lodash.propertyOf = propertyOf;lodash.pull = pull;lodash.pullAll = pullAll;lodash.pullAllBy = pullAllBy;lodash.pullAllWith = pullAllWith;lodash.pullAt = pullAt;lodash.range = range;lodash.rangeRight = rangeRight;lodash.rearg = rearg;lodash.reject = reject;lodash.remove = remove;lodash.rest = rest;lodash.reverse = reverse;lodash.sampleSize = sampleSize;lodash.set = set;lodash.setWith = setWith;lodash.shuffle = shuffle;lodash.slice = slice;lodash.sortBy = sortBy;lodash.sortedUniq = sortedUniq;lodash.sortedUniqBy = sortedUniqBy;lodash.split = split;lodash.spread = spread;lodash.tail = tail;lodash.take = take;lodash.takeRight = takeRight;lodash.takeRightWhile = takeRightWhile;lodash.takeWhile = takeWhile;lodash.tap = tap;lodash.throttle = throttle;lodash.thru = thru;lodash.toArray = toArray;lodash.toPairs = toPairs;lodash.toPairsIn = toPairsIn;lodash.toPath = toPath;lodash.toPlainObject = toPlainObject;lodash.transform = transform;lodash.unary = unary;lodash.union = union;lodash.unionBy = unionBy;lodash.unionWith = unionWith;lodash.uniq = uniq;lodash.uniqBy = uniqBy;lodash.uniqWith = uniqWith;lodash.unset = unset;lodash.unzip = unzip;lodash.unzipWith = unzipWith;lodash.update = update;lodash.updateWith = updateWith;lodash.values = values;lodash.valuesIn = valuesIn;lodash.without = without;lodash.words = words;lodash.wrap = wrap;lodash.xor = xor;lodash.xorBy = xorBy;lodash.xorWith = xorWith;lodash.zip = zip;lodash.zipObject = zipObject;lodash.zipObjectDeep = zipObjectDeep;lodash.zipWith = zipWith;// Add aliases.lodash.entries = toPairs;lodash.entriesIn = toPairsIn;lodash.extend = assignIn;lodash.extendWith = assignInWith;// Add methods to `lodash.prototype`.mixin(lodash, lodash);/*------------------------------------------------------------------------*/// Add methods that return unwrapped values in chain sequences.lodash.add = add;lodash.attempt = attempt;lodash.camelCase = camelCase;lodash.capitalize = capitalize;lodash.ceil = ceil;lodash.clamp = clamp;lodash.clone = clone;lodash.cloneDeep = cloneDeep;lodash.cloneDeepWith = cloneDeepWith;lodash.cloneWith = cloneWith;lodash.conformsTo = conformsTo;lodash.deburr = deburr;lodash.defaultTo = defaultTo;lodash.divide = divide;lodash.endsWith = endsWith;lodash.eq = eq;lodash.escape = escape;lodash.escapeRegExp = escapeRegExp;lodash.every = every;lodash.find = find;lodash.findIndex = findIndex;lodash.findKey = findKey;lodash.findLast = findLast;lodash.findLastIndex = findLastIndex;lodash.findLastKey = findLastKey;lodash.floor = floor;lodash.forEach = forEach;lodash.forEachRight = forEachRight;lodash.forIn = forIn;lodash.forInRight = forInRight;lodash.forOwn = forOwn;lodash.forOwnRight = forOwnRight;lodash.get = get;lodash.gt = gt;lodash.gte = gte;lodash.has = has;lodash.hasIn = hasIn;lodash.head = head;lodash.identity = identity;lodash.includes = includes;lodash.indexOf = indexOf;lodash.inRange = inRange;lodash.invoke = invoke;lodash.isArguments = isArguments;lodash.isArray = isArray;lodash.isArrayBuffer = isArrayBuffer;lodash.isArrayLike = isArrayLike;lodash.isArrayLikeObject = isArrayLikeObject;lodash.isBoolean = isBoolean;lodash.isBuffer = isBuffer;lodash.isDate = isDate;lodash.isElement = isElement;lodash.isEmpty = isEmpty;lodash.isEqual = isEqual;lodash.isEqualWith = isEqualWith;lodash.isError = isError;lodash.isFinite = isFinite;lodash.isFunction = isFunction;lodash.isInteger = isInteger;lodash.isLength = isLength;lodash.isMap = isMap;lodash.isMatch = isMatch;lodash.isMatchWith = isMatchWith;lodash.isNaN = isNaN;lodash.isNative = isNative;lodash.isNil = isNil;lodash.isNull = isNull;lodash.isNumber = isNumber;lodash.isObject = isObject;lodash.isObjectLike = isObjectLike;lodash.isPlainObject = isPlainObject;lodash.isRegExp = isRegExp;lodash.isSafeInteger = isSafeInteger;lodash.isSet = isSet;lodash.isString = isString;lodash.isSymbol = isSymbol;lodash.isTypedArray = isTypedArray;lodash.isUndefined = isUndefined;lodash.isWeakMap = isWeakMap;lodash.isWeakSet = isWeakSet;lodash.join = join;lodash.kebabCase = kebabCase;lodash.last = last;lodash.lastIndexOf = lastIndexOf;lodash.lowerCase = lowerCase;lodash.lowerFirst = lowerFirst;lodash.lt = lt;lodash.lte = lte;lodash.max = max;lodash.maxBy = maxBy;lodash.mean = mean;lodash.meanBy = meanBy;lodash.min = min;lodash.minBy = minBy;lodash.stubArray = stubArray;lodash.stubFalse = stubFalse;lodash.stubObject = stubObject;lodash.stubString = stubString;lodash.stubTrue = stubTrue;lodash.multiply = multiply;lodash.nth = nth;lodash.noConflict = noConflict;lodash.noop = noop;lodash.now = now;lodash.pad = pad;lodash.padEnd = padEnd;lodash.padStart = padStart;lodash.parseInt = parseInt;lodash.random = random;lodash.reduce = reduce;lodash.reduceRight = reduceRight;lodash.repeat = repeat;lodash.replace = replace;lodash.result = result;lodash.round = round;lodash.runInContext = runInContext;lodash.sample = sample;lodash.size = size;lodash.snakeCase = snakeCase;lodash.some = some;lodash.sortedIndex = sortedIndex;lodash.sortedIndexBy = sortedIndexBy;lodash.sortedIndexOf = sortedIndexOf;lodash.sortedLastIndex = sortedLastIndex;lodash.sortedLastIndexBy = sortedLastIndexBy;lodash.sortedLastIndexOf = sortedLastIndexOf;lodash.startCase = startCase;lodash.startsWith = startsWith;lodash.subtract = subtract;lodash.sum = sum;lodash.sumBy = sumBy;lodash.template = template;lodash.times = times;lodash.toFinite = toFinite;lodash.toInteger = toInteger;lodash.toLength = toLength;lodash.toLower = toLower;lodash.toNumber = toNumber;lodash.toSafeInteger = toSafeInteger;lodash.toString = toString;lodash.toUpper = toUpper;lodash.trim = trim;lodash.trimEnd = trimEnd;lodash.trimStart = trimStart;lodash.truncate = truncate;lodash.unescape = unescape;lodash.uniqueId = uniqueId;lodash.upperCase = upperCase;lodash.upperFirst = upperFirst;// Add aliases.lodash.each = forEach;lodash.eachRight = forEachRight;lodash.first = head;mixin(lodash, (function() {var source = {};baseForOwn(lodash, function(func, methodName) {if (!hasOwnProperty.call(lodash.prototype, methodName)) {source[methodName] = func;}});return source;}()), { 'chain': false });/*------------------------------------------------------------------------*//*** The semantic version number.** @static* @memberOf _* @type {string}*/lodash.VERSION = VERSION;// Assign default placeholders.arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {lodash[methodName].placeholder = lodash;});// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.arrayEach(['drop', 'take'], function(methodName, index) {LazyWrapper.prototype[methodName] = function(n) {n = n === undefined ? 1 : nativeMax(toInteger(n), 0);var result = (this.__filtered__ && !index)? new LazyWrapper(this): this.clone();if (result.__filtered__) {result.__takeCount__ = nativeMin(n, result.__takeCount__);} else {result.__views__.push({'size': nativeMin(n, MAX_ARRAY_LENGTH),'type': methodName + (result.__dir__ < 0 ? 'Right' : '')});}return result;};LazyWrapper.prototype[methodName + 'Right'] = function(n) {return this.reverse()[methodName](n).reverse();};});// Add `LazyWrapper` methods that accept an `iteratee` value.arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {var type = index + 1,isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName] = function(iteratee) {var result = this.clone();result.__iteratees__.push({'iteratee': getIteratee(iteratee, 3),'type': type});result.__filtered__ = result.__filtered__ || isFilter;return result;};});// Add `LazyWrapper` methods for `_.head` and `_.last`.arrayEach(['head', 'last'], function(methodName, index) {var takeName = 'take' + (index ? 'Right' : '');LazyWrapper.prototype[methodName] = function() {return this[takeName](1).value()[0];};});// Add `LazyWrapper` methods for `_.initial` and `_.tail`.arrayEach(['initial', 'tail'], function(methodName, index) {var dropName = 'drop' + (index ? '' : 'Right');LazyWrapper.prototype[methodName] = function() {return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);};});LazyWrapper.prototype.compact = function() {return this.filter(identity);};LazyWrapper.prototype.find = function(predicate) {return this.filter(predicate).head();};LazyWrapper.prototype.findLast = function(predicate) {return this.reverse().find(predicate);};LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {if (typeof path == 'function') {return new LazyWrapper(this);}return this.map(function(value) {return baseInvoke(value, path, args);});});LazyWrapper.prototype.reject = function(predicate) {return this.filter(negate(getIteratee(predicate)));};LazyWrapper.prototype.slice = function(start, end) {start = toInteger(start);var result = this;if (result.__filtered__ && (start > 0 || end < 0)) {return new LazyWrapper(result);}if (start < 0) {result = result.takeRight(-start);} else if (start) {result = result.drop(start);}if (end !== undefined) {end = toInteger(end);result = end < 0 ? result.dropRight(-end) : result.take(end - start);}return result;};LazyWrapper.prototype.takeRightWhile = function(predicate) {return this.reverse().takeWhile(predicate).reverse();};LazyWrapper.prototype.toArray = function() {return this.take(MAX_ARRAY_LENGTH);};// Add `LazyWrapper` methods to `lodash.prototype`.baseForOwn(LazyWrapper.prototype, function(func, methodName) {var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),isTaker = /^(?:head|last)$/.test(methodName),lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],retUnwrapped = isTaker || /^find/.test(methodName);if (!lodashFunc) {return;}lodash.prototype[methodName] = function() {var value = this.__wrapped__,args = isTaker ? [1] : arguments,isLazy = value instanceof LazyWrapper,iteratee = args[0],useLazy = isLazy || isArray(value);var interceptor = function(value) {var result = lodashFunc.apply(lodash, arrayPush([value], args));return (isTaker && chainAll) ? result[0] : result;};if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {// Avoid lazy use if the iteratee has a "length" value other than `1`.isLazy = useLazy = false;}var chainAll = this.__chain__,isHybrid = !!this.__actions__.length,isUnwrapped = retUnwrapped && !chainAll,onlyLazy = isLazy && !isHybrid;if (!retUnwrapped && useLazy) {value = onlyLazy ? value : new LazyWrapper(this);var result = func.apply(value, args);result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });return new LodashWrapper(result, chainAll);}if (isUnwrapped && onlyLazy) {return func.apply(this, args);}result = this.thru(interceptor);return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;};});// Add `Array` methods to `lodash.prototype`.arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {var func = arrayProto[methodName],chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',retUnwrapped = /^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName] = function() {var args = arguments;if (retUnwrapped && !this.__chain__) {var value = this.value();return func.apply(isArray(value) ? value : [], args);}return this[chainName](function(value) {return func.apply(isArray(value) ? value : [], args);});};});// Map minified method names to their real names.baseForOwn(LazyWrapper.prototype, function(func, methodName) {var lodashFunc = lodash[methodName];if (lodashFunc) {var key = lodashFunc.name + '';if (!hasOwnProperty.call(realNames, key)) {realNames[key] = [];}realNames[key].push({ 'name': methodName, 'func': lodashFunc });}});realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{'name': 'wrapper','func': undefined}];// Add methods to `LazyWrapper`.LazyWrapper.prototype.clone = lazyClone;LazyWrapper.prototype.reverse = lazyReverse;LazyWrapper.prototype.value = lazyValue;// Add chain sequence methods to the `lodash` wrapper.lodash.prototype.at = wrapperAt;lodash.prototype.chain = wrapperChain;lodash.prototype.commit = wrapperCommit;lodash.prototype.next = wrapperNext;lodash.prototype.plant = wrapperPlant;lodash.prototype.reverse = wrapperReverse;lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;// Add lazy aliases.lodash.prototype.first = lodash.prototype.head;if (symIterator) {lodash.prototype[symIterator] = wrapperToIterator;}return lodash;});/*--------------------------------------------------------------------------*/// Export lodash.var _ = runInContext();// Some AMD build optimizers, like r.js, check for condition patterns like:if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {// Expose Lodash on the global object to prevent errors when Lodash is// loaded by a script tag in the presence of an AMD loader.// See http://requirejs.org/docs/errors.html#mismatch for more details.// Use `_.noConflict` to remove Lodash from the global object.root._ = _;// Define as an anonymous module so, through path mapping, it can be// referenced as the "underscore" module.define(function() {return _;});}// Check for `exports` after `define` in case a build optimizer adds it.else if (freeModule) {// Export for Node.js.(freeModule.exports = _)._ = _;// Export for CommonJS support.freeExports._ = _;}else {// Export to the global object.root._ = _;}}.call(this));
var baseFindIndex = require('./_baseFindIndex'),baseIsNaN = require('./_baseIsNaN'),strictLastIndexOf = require('./_strictLastIndexOf'),toInteger = require('./toInteger');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max,nativeMin = Math.min;/*** This method is like `_.indexOf` except that it iterates over elements of* `array` from right to left.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=array.length-1] The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.lastIndexOf([1, 2, 1, 2], 2);* // => 3** // Search from the `fromIndex`.* _.lastIndexOf([1, 2, 1, 2], 2, 2);* // => 1*/function lastIndexOf(array, value, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = length;if (fromIndex !== undefined) {index = toInteger(fromIndex);index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);}return value === value? strictLastIndexOf(array, value, index): baseFindIndex(array, baseIsNaN, index, true);}module.exports = lastIndexOf;
/*** Gets the last element of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @returns {*} Returns the last element of `array`.* @example** _.last([1, 2, 3]);* // => 3*/function last(array) {var length = array == null ? 0 : array.length;return length ? array[length - 1] : undefined;}module.exports = last;
module.exports = {'castArray': require('./castArray'),'clone': require('./clone'),'cloneDeep': require('./cloneDeep'),'cloneDeepWith': require('./cloneDeepWith'),'cloneWith': require('./cloneWith'),'conformsTo': require('./conformsTo'),'eq': require('./eq'),'gt': require('./gt'),'gte': require('./gte'),'isArguments': require('./isArguments'),'isArray': require('./isArray'),'isArrayBuffer': require('./isArrayBuffer'),'isArrayLike': require('./isArrayLike'),'isArrayLikeObject': require('./isArrayLikeObject'),'isBoolean': require('./isBoolean'),'isBuffer': require('./isBuffer'),'isDate': require('./isDate'),'isElement': require('./isElement'),'isEmpty': require('./isEmpty'),'isEqual': require('./isEqual'),'isEqualWith': require('./isEqualWith'),'isError': require('./isError'),'isFinite': require('./isFinite'),'isFunction': require('./isFunction'),'isInteger': require('./isInteger'),'isLength': require('./isLength'),'isMap': require('./isMap'),'isMatch': require('./isMatch'),'isMatchWith': require('./isMatchWith'),'isNaN': require('./isNaN'),'isNative': require('./isNative'),'isNil': require('./isNil'),'isNull': require('./isNull'),'isNumber': require('./isNumber'),'isObject': require('./isObject'),'isObjectLike': require('./isObjectLike'),'isPlainObject': require('./isPlainObject'),'isRegExp': require('./isRegExp'),'isSafeInteger': require('./isSafeInteger'),'isSet': require('./isSet'),'isString': require('./isString'),'isSymbol': require('./isSymbol'),'isTypedArray': require('./isTypedArray'),'isUndefined': require('./isUndefined'),'isWeakMap': require('./isWeakMap'),'isWeakSet': require('./isWeakSet'),'lt': require('./lt'),'lte': require('./lte'),'toArray': require('./toArray'),'toFinite': require('./toFinite'),'toInteger': require('./toInteger'),'toLength': require('./toLength'),'toNumber': require('./toNumber'),'toPlainObject': require('./toPlainObject'),'toSafeInteger': require('./toSafeInteger'),'toString': require('./toString')};
var arrayLikeKeys = require('./_arrayLikeKeys'),baseKeysIn = require('./_baseKeysIn'),isArrayLike = require('./isArrayLike');/*** Creates an array of the own and inherited enumerable property names of `object`.** **Note:** Non-object values are coerced to objects.** @static* @memberOf _* @since 3.0.0* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keysIn(new Foo);* // => ['a', 'b', 'c'] (iteration order is not guaranteed)*/function keysIn(object) {return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);}module.exports = keysIn;
var arrayLikeKeys = require('./_arrayLikeKeys'),baseKeys = require('./_baseKeys'),isArrayLike = require('./isArrayLike');/*** Creates an array of the own enumerable property names of `object`.** **Note:** Non-object values are coerced to objects. See the* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* for more details.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keys(new Foo);* // => ['a', 'b'] (iteration order is not guaranteed)** _.keys('hi');* // => ['0', '1']*/function keys(object) {return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);}module.exports = keys;
var baseAssignValue = require('./_baseAssignValue'),createAggregator = require('./_createAggregator');/*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The corresponding value of* each key is the last element responsible for generating the key. The* iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** var array = [* { 'dir': 'left', 'code': 97 },* { 'dir': 'right', 'code': 100 }* ];** _.keyBy(array, function(o) {* return String.fromCharCode(o.code);* });* // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }** _.keyBy(array, 'dir');* // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }*/var keyBy = createAggregator(function(result, value, key) {baseAssignValue(result, key, value);});module.exports = keyBy;
var createCompounder = require('./_createCompounder');/*** Converts `string` to* [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the kebab cased string.* @example** _.kebabCase('Foo Bar');* // => 'foo-bar'** _.kebabCase('fooBar');* // => 'foo-bar'** _.kebabCase('__FOO_BAR__');* // => 'foo-bar'*/var kebabCase = createCompounder(function(result, word, index) {return result + (index ? '-' : '') + word.toLowerCase();});module.exports = kebabCase;
/** Used for built-in method references. */var arrayProto = Array.prototype;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeJoin = arrayProto.join;/*** Converts all elements in `array` into a string separated by `separator`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to convert.* @param {string} [separator=','] The element separator.* @returns {string} Returns the joined string.* @example** _.join(['a', 'b', 'c'], '~');* // => 'a~b~c'*/function join(array, separator) {return array == null ? '' : nativeJoin.call(array, separator);}module.exports = join;
var baseClone = require('./_baseClone'),baseIteratee = require('./_baseIteratee');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1;/*** Creates a function that invokes `func` with the arguments of the created* function. If `func` is a property name, the created function returns the* property value for a given element. If `func` is an array or object, the* created function returns `true` for elements that contain the equivalent* source properties, otherwise it returns `false`.** @static* @since 4.0.0* @memberOf _* @category Util* @param {*} [func=_.identity] The value to convert to a callback.* @returns {Function} Returns the callback.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));* // => [{ 'user': 'barney', 'age': 36, 'active': true }]** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, _.iteratee(['user', 'fred']));* // => [{ 'user': 'fred', 'age': 40 }]** // The `_.property` iteratee shorthand.* _.map(users, _.iteratee('user'));* // => ['barney', 'fred']** // Create custom iteratee shorthands.* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {* return !_.isRegExp(func) ? iteratee(func) : function(string) {* return func.test(string);* };* });** _.filter(['abc', 'def'], /ef/);* // => ['def']*/function iteratee(func) {return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));}module.exports = iteratee;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var weakSetTag = '[object WeakSet]';/*** Checks if `value` is classified as a `WeakSet` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a weak set, else `false`.* @example** _.isWeakSet(new WeakSet);* // => true** _.isWeakSet(new Set);* // => false*/function isWeakSet(value) {return isObjectLike(value) && baseGetTag(value) == weakSetTag;}module.exports = isWeakSet;
var getTag = require('./_getTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var weakMapTag = '[object WeakMap]';/*** Checks if `value` is classified as a `WeakMap` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a weak map, else `false`.* @example** _.isWeakMap(new WeakMap);* // => true** _.isWeakMap(new Map);* // => false*/function isWeakMap(value) {return isObjectLike(value) && getTag(value) == weakMapTag;}module.exports = isWeakMap;
/*** Checks if `value` is `undefined`.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.* @example** _.isUndefined(void 0);* // => true** _.isUndefined(null);* // => false*/function isUndefined(value) {return value === undefined;}module.exports = isUndefined;
var baseIsTypedArray = require('./_baseIsTypedArray'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;/*** Checks if `value` is classified as a typed array.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.* @example** _.isTypedArray(new Uint8Array);* // => true** _.isTypedArray([]);* // => false*/var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;module.exports = isTypedArray;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var symbolTag = '[object Symbol]';/*** Checks if `value` is classified as a `Symbol` primitive or object.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.* @example** _.isSymbol(Symbol.iterator);* // => true** _.isSymbol('abc');* // => false*/function isSymbol(value) {return typeof value == 'symbol' ||(isObjectLike(value) && baseGetTag(value) == symbolTag);}module.exports = isSymbol;
var baseGetTag = require('./_baseGetTag'),isArray = require('./isArray'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var stringTag = '[object String]';/*** Checks if `value` is classified as a `String` primitive or object.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a string, else `false`.* @example** _.isString('abc');* // => true** _.isString(1);* // => false*/function isString(value) {return typeof value == 'string' ||(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);}module.exports = isString;
var baseIsSet = require('./_baseIsSet'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsSet = nodeUtil && nodeUtil.isSet;/*** Checks if `value` is classified as a `Set` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a set, else `false`.* @example** _.isSet(new Set);* // => true** _.isSet(new WeakSet);* // => false*/var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;module.exports = isSet;
var isInteger = require('./isInteger');/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/*** Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754* double precision number which isn't the result of a rounded unsafe integer.** **Note:** This method is based on* [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.* @example** _.isSafeInteger(3);* // => true** _.isSafeInteger(Number.MIN_VALUE);* // => false** _.isSafeInteger(Infinity);* // => false** _.isSafeInteger('3');* // => false*/function isSafeInteger(value) {return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;}module.exports = isSafeInteger;
var baseIsRegExp = require('./_baseIsRegExp'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;/*** Checks if `value` is classified as a `RegExp` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.* @example** _.isRegExp(/abc/);* // => true** _.isRegExp('/abc/');* // => false*/var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;module.exports = isRegExp;
var baseGetTag = require('./_baseGetTag'),getPrototype = require('./_getPrototype'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var objectTag = '[object Object]';/** Used for built-in method references. */var funcProto = Function.prototype,objectProto = Object.prototype;/** Used to resolve the decompiled source of functions. */var funcToString = funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/** Used to infer the `Object` constructor. */var objectCtorString = funcToString.call(Object);/*** Checks if `value` is a plain object, that is, an object created by the* `Object` constructor or one with a `[[Prototype]]` of `null`.** @static* @memberOf _* @since 0.8.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.* @example** function Foo() {* this.a = 1;* }** _.isPlainObject(new Foo);* // => false** _.isPlainObject([1, 2, 3]);* // => false** _.isPlainObject({ 'x': 0, 'y': 0 });* // => true** _.isPlainObject(Object.create(null));* // => true*/function isPlainObject(value) {if (!isObjectLike(value) || baseGetTag(value) != objectTag) {return false;}var proto = getPrototype(value);if (proto === null) {return true;}var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;return typeof Ctor == 'function' && Ctor instanceof Ctor &&funcToString.call(Ctor) == objectCtorString;}module.exports = isPlainObject;
/*** Checks if `value` is object-like. A value is object-like if it's not `null`* and has a `typeof` result of "object".** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is object-like, else `false`.* @example** _.isObjectLike({});* // => true** _.isObjectLike([1, 2, 3]);* // => true** _.isObjectLike(_.noop);* // => false** _.isObjectLike(null);* // => false*/function isObjectLike(value) {return value != null && typeof value == 'object';}module.exports = isObjectLike;
/*** Checks if `value` is the* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an object, else `false`.* @example** _.isObject({});* // => true** _.isObject([1, 2, 3]);* // => true** _.isObject(_.noop);* // => true** _.isObject(null);* // => false*/function isObject(value) {var type = typeof value;return value != null && (type == 'object' || type == 'function');}module.exports = isObject;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var numberTag = '[object Number]';/*** Checks if `value` is classified as a `Number` primitive or object.** **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are* classified as numbers, use the `_.isFinite` method.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a number, else `false`.* @example** _.isNumber(3);* // => true** _.isNumber(Number.MIN_VALUE);* // => true** _.isNumber(Infinity);* // => true** _.isNumber('3');* // => false*/function isNumber(value) {return typeof value == 'number' ||(isObjectLike(value) && baseGetTag(value) == numberTag);}module.exports = isNumber;
/*** Checks if `value` is `null`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `null`, else `false`.* @example** _.isNull(null);* // => true** _.isNull(void 0);* // => false*/function isNull(value) {return value === null;}module.exports = isNull;
/*** Checks if `value` is `null` or `undefined`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is nullish, else `false`.* @example** _.isNil(null);* // => true** _.isNil(void 0);* // => true** _.isNil(NaN);* // => false*/function isNil(value) {return value == null;}module.exports = isNil;
var baseIsNative = require('./_baseIsNative'),isMaskable = require('./_isMaskable');/** Error message constants. */var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.';/*** Checks if `value` is a pristine native function.** **Note:** This method can't reliably detect native functions in the presence* of the core-js package because core-js circumvents this kind of detection.* Despite multiple requests, the core-js maintainer has made it clear: any* attempt to fix the detection will be obstructed. As a result, we're left* with little choice but to throw an error. Unfortunately, this also affects* packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),* which rely on core-js.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a native function,* else `false`.* @example** _.isNative(Array.prototype.push);* // => true** _.isNative(_);* // => false*/function isNative(value) {if (isMaskable(value)) {throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}module.exports = isNative;
var isNumber = require('./isNumber');/*** Checks if `value` is `NaN`.** **Note:** This method is based on* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for* `undefined` and other non-number values.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.* @example** _.isNaN(NaN);* // => true** _.isNaN(new Number(NaN));* // => true** isNaN(undefined);* // => true** _.isNaN(undefined);* // => false*/function isNaN(value) {// An `NaN` primitive is the only value that is not equal to itself.// Perform the `toStringTag` check first to avoid errors with some// ActiveX objects in IE.return isNumber(value) && value != +value;}module.exports = isNaN;
var baseIsMatch = require('./_baseIsMatch'),getMatchData = require('./_getMatchData');/*** This method is like `_.isMatch` except that it accepts `customizer` which* is invoked to compare values. If `customizer` returns `undefined`, comparisons* are handled by the method instead. The `customizer` is invoked with five* arguments: (objValue, srcValue, index|key, object, source).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if `object` is a match, else `false`.* @example** function isGreeting(value) {* return /^h(?:i|ello)$/.test(value);* }** function customizer(objValue, srcValue) {* if (isGreeting(objValue) && isGreeting(srcValue)) {* return true;* }* }** var object = { 'greeting': 'hello' };* var source = { 'greeting': 'hi' };** _.isMatchWith(object, source, customizer);* // => true*/function isMatchWith(object, source, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseIsMatch(object, source, getMatchData(source), customizer);}module.exports = isMatchWith;
var baseIsMatch = require('./_baseIsMatch'),getMatchData = require('./_getMatchData');/*** Performs a partial deep comparison between `object` and `source` to* determine if `object` contains equivalent property values.** **Note:** This method is equivalent to `_.matches` when `source` is* partially applied.** Partial comparisons will match empty array and empty object `source`* values against any array or object value, respectively. See `_.isEqual`* for a list of supported value comparisons.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @returns {boolean} Returns `true` if `object` is a match, else `false`.* @example** var object = { 'a': 1, 'b': 2 };** _.isMatch(object, { 'b': 2 });* // => true** _.isMatch(object, { 'b': 1 });* // => false*/function isMatch(object, source) {return object === source || baseIsMatch(object, source, getMatchData(source));}module.exports = isMatch;
var baseIsMap = require('./_baseIsMap'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsMap = nodeUtil && nodeUtil.isMap;/*** Checks if `value` is classified as a `Map` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a map, else `false`.* @example** _.isMap(new Map);* // => true** _.isMap(new WeakMap);* // => false*/var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;module.exports = isMap;
/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/*** Checks if `value` is a valid array-like length.** **Note:** This method is loosely based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.* @example** _.isLength(3);* // => true** _.isLength(Number.MIN_VALUE);* // => false** _.isLength(Infinity);* // => false** _.isLength('3');* // => false*/function isLength(value) {return typeof value == 'number' &&value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;}module.exports = isLength;
var toInteger = require('./toInteger');/*** Checks if `value` is an integer.** **Note:** This method is based on* [`Number.isInteger`](https://mdn.io/Number/isInteger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an integer, else `false`.* @example** _.isInteger(3);* // => true** _.isInteger(Number.MIN_VALUE);* // => false** _.isInteger(Infinity);* // => false** _.isInteger('3');* // => false*/function isInteger(value) {return typeof value == 'number' && value == toInteger(value);}module.exports = isInteger;
var baseGetTag = require('./_baseGetTag'),isObject = require('./isObject');/** `Object#toString` result references. */var asyncTag = '[object AsyncFunction]',funcTag = '[object Function]',genTag = '[object GeneratorFunction]',proxyTag = '[object Proxy]';/*** Checks if `value` is classified as a `Function` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a function, else `false`.* @example** _.isFunction(_);* // => true** _.isFunction(/abc/);* // => false*/function isFunction(value) {if (!isObject(value)) {return false;}// The use of `Object#toString` avoids issues with the `typeof` operator// in Safari 9 which returns 'object' for typed arrays and other constructors.var tag = baseGetTag(value);return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;}module.exports = isFunction;
var root = require('./_root');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsFinite = root.isFinite;/*** Checks if `value` is a finite primitive number.** **Note:** This method is based on* [`Number.isFinite`](https://mdn.io/Number/isFinite).** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.* @example** _.isFinite(3);* // => true** _.isFinite(Number.MIN_VALUE);* // => true** _.isFinite(Infinity);* // => false** _.isFinite('3');* // => false*/function isFinite(value) {return typeof value == 'number' && nativeIsFinite(value);}module.exports = isFinite;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike'),isPlainObject = require('./isPlainObject');/** `Object#toString` result references. */var domExcTag = '[object DOMException]',errorTag = '[object Error]';/*** Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,* `SyntaxError`, `TypeError`, or `URIError` object.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an error object, else `false`.* @example** _.isError(new Error);* // => true** _.isError(Error);* // => false*/function isError(value) {if (!isObjectLike(value)) {return false;}var tag = baseGetTag(value);return tag == errorTag || tag == domExcTag ||(typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));}module.exports = isError;
var baseIsEqual = require('./_baseIsEqual');/*** This method is like `_.isEqual` except that it accepts `customizer` which* is invoked to compare values. If `customizer` returns `undefined`, comparisons* are handled by the method instead. The `customizer` is invoked with up to* six arguments: (objValue, othValue [, index|key, object, other, stack]).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** function isGreeting(value) {* return /^h(?:i|ello)$/.test(value);* }** function customizer(objValue, othValue) {* if (isGreeting(objValue) && isGreeting(othValue)) {* return true;* }* }** var array = ['hello', 'goodbye'];* var other = ['hi', 'goodbye'];** _.isEqualWith(array, other, customizer);* // => true*/function isEqualWith(value, other, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;var result = customizer ? customizer(value, other) : undefined;return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;}module.exports = isEqualWith;
var baseIsEqual = require('./_baseIsEqual');/*** Performs a deep comparison between two values to determine if they are* equivalent.** **Note:** This method supports comparing arrays, array buffers, booleans,* date objects, error objects, maps, numbers, `Object` objects, regexes,* sets, strings, symbols, and typed arrays. `Object` objects are compared* by their own, not inherited, enumerable properties. Functions and DOM* nodes are compared by strict equality, i.e. `===`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.isEqual(object, other);* // => true** object === other;* // => false*/function isEqual(value, other) {return baseIsEqual(value, other);}module.exports = isEqual;
var baseKeys = require('./_baseKeys'),getTag = require('./_getTag'),isArguments = require('./isArguments'),isArray = require('./isArray'),isArrayLike = require('./isArrayLike'),isBuffer = require('./isBuffer'),isPrototype = require('./_isPrototype'),isTypedArray = require('./isTypedArray');/** `Object#toString` result references. */var mapTag = '[object Map]',setTag = '[object Set]';/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Checks if `value` is an empty object, collection, map, or set.** Objects are considered empty if they have no own enumerable string keyed* properties.** Array-like values such as `arguments` objects, arrays, buffers, strings, or* jQuery-like collections are considered empty if they have a `length` of `0`.* Similarly, maps and sets are considered empty if they have a `size` of `0`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is empty, else `false`.* @example** _.isEmpty(null);* // => true** _.isEmpty(true);* // => true** _.isEmpty(1);* // => true** _.isEmpty([1, 2, 3]);* // => false** _.isEmpty({ 'a': 1 });* // => false*/function isEmpty(value) {if (value == null) {return true;}if (isArrayLike(value) &&(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||isBuffer(value) || isTypedArray(value) || isArguments(value))) {return !value.length;}var tag = getTag(value);if (tag == mapTag || tag == setTag) {return !value.size;}if (isPrototype(value)) {return !baseKeys(value).length;}for (var key in value) {if (hasOwnProperty.call(value, key)) {return false;}}return true;}module.exports = isEmpty;
var isObjectLike = require('./isObjectLike'),isPlainObject = require('./isPlainObject');/*** Checks if `value` is likely a DOM element.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.* @example** _.isElement(document.body);* // => true** _.isElement('<body>');* // => false*/function isElement(value) {return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);}module.exports = isElement;
var baseIsDate = require('./_baseIsDate'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsDate = nodeUtil && nodeUtil.isDate;/*** Checks if `value` is classified as a `Date` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.* @example** _.isDate(new Date);* // => true** _.isDate('Mon April 23 2012');* // => false*/var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;module.exports = isDate;
var root = require('./_root'),stubFalse = require('./stubFalse');/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports = freeModule && freeModule.exports === freeExports;/** Built-in value references. */var Buffer = moduleExports ? root.Buffer : undefined;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;/*** Checks if `value` is a buffer.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.* @example** _.isBuffer(new Buffer(2));* // => true** _.isBuffer(new Uint8Array(2));* // => false*/var isBuffer = nativeIsBuffer || stubFalse;module.exports = isBuffer;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var boolTag = '[object Boolean]';/*** Checks if `value` is classified as a boolean primitive or object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.* @example** _.isBoolean(false);* // => true** _.isBoolean(null);* // => false*/function isBoolean(value) {return value === true || value === false ||(isObjectLike(value) && baseGetTag(value) == boolTag);}module.exports = isBoolean;
var isArrayLike = require('./isArrayLike'),isObjectLike = require('./isObjectLike');/*** This method is like `_.isArrayLike` except that it also checks if `value`* is an object.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array-like object,* else `false`.* @example** _.isArrayLikeObject([1, 2, 3]);* // => true** _.isArrayLikeObject(document.body.children);* // => true** _.isArrayLikeObject('abc');* // => false** _.isArrayLikeObject(_.noop);* // => false*/function isArrayLikeObject(value) {return isObjectLike(value) && isArrayLike(value);}module.exports = isArrayLikeObject;
var isFunction = require('./isFunction'),isLength = require('./isLength');/*** Checks if `value` is array-like. A value is considered array-like if it's* not a function and has a `value.length` that's an integer greater than or* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is array-like, else `false`.* @example** _.isArrayLike([1, 2, 3]);* // => true** _.isArrayLike(document.body.children);* // => true** _.isArrayLike('abc');* // => true** _.isArrayLike(_.noop);* // => false*/function isArrayLike(value) {return value != null && isLength(value.length) && !isFunction(value);}module.exports = isArrayLike;
var baseIsArrayBuffer = require('./_baseIsArrayBuffer'),baseUnary = require('./_baseUnary'),nodeUtil = require('./_nodeUtil');/* Node.js helper references. */var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;/*** Checks if `value` is classified as an `ArrayBuffer` object.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.* @example** _.isArrayBuffer(new ArrayBuffer(2));* // => true** _.isArrayBuffer(new Array(2));* // => false*/var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;module.exports = isArrayBuffer;
/*** Checks if `value` is classified as an `Array` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array, else `false`.* @example** _.isArray([1, 2, 3]);* // => true** _.isArray(document.body.children);* // => false** _.isArray('abc');* // => false** _.isArray(_.noop);* // => false*/var isArray = Array.isArray;module.exports = isArray;
var baseIsArguments = require('./_baseIsArguments'),isObjectLike = require('./isObjectLike');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/** Built-in value references. */var propertyIsEnumerable = objectProto.propertyIsEnumerable;/*** Checks if `value` is likely an `arguments` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,* else `false`.* @example** _.isArguments(function() { return arguments; }());* // => true** _.isArguments([1, 2, 3]);* // => false*/var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&!propertyIsEnumerable.call(value, 'callee');};module.exports = isArguments;
var apply = require('./_apply'),baseEach = require('./_baseEach'),baseInvoke = require('./_baseInvoke'),baseRest = require('./_baseRest'),isArrayLike = require('./isArrayLike');/*** Invokes the method at `path` of each element in `collection`, returning* an array of the results of each invoked method. Any additional arguments* are provided to each invoked method. If `path` is a function, it's invoked* for, and `this` bound to, each element in `collection`.** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Array|Function|string} path The path of the method to invoke or* the function invoked per iteration.* @param {...*} [args] The arguments to invoke each method with.* @returns {Array} Returns the array of results.* @example** _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');* // => [[1, 5, 7], [1, 2, 3]]** _.invokeMap([123, 456], String.prototype.split, '');* // => [['1', '2', '3'], ['4', '5', '6']]*/var invokeMap = baseRest(function(collection, path, args) {var index = -1,isFunc = typeof path == 'function',result = isArrayLike(collection) ? Array(collection.length) : [];baseEach(collection, function(value) {result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);});return result;});module.exports = invokeMap;
var baseInvoke = require('./_baseInvoke'),baseRest = require('./_baseRest');/*** Invokes the method at `path` of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the method to invoke.* @param {...*} [args] The arguments to invoke the method with.* @returns {*} Returns the result of the invoked method.* @example** var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };** _.invoke(object, 'a[0].b.c.slice', 1, 3);* // => [2, 3]*/var invoke = baseRest(baseInvoke);module.exports = invoke;
var baseIteratee = require('./_baseIteratee'),createInverter = require('./_createInverter');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/*** This method is like `_.invert` except that the inverted object is generated* from the results of running each element of `object` thru `iteratee`. The* corresponding inverted value of each inverted key is an array of keys* responsible for generating the inverted value. The iteratee is invoked* with one argument: (value).** @static* @memberOf _* @since 4.1.0* @category Object* @param {Object} object The object to invert.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Object} Returns the new inverted object.* @example** var object = { 'a': 1, 'b': 2, 'c': 1 };** _.invertBy(object);* // => { '1': ['a', 'c'], '2': ['b'] }** _.invertBy(object, function(value) {* return 'group' + value;* });* // => { 'group1': ['a', 'c'], 'group2': ['b'] }*/var invertBy = createInverter(function(result, value, key) {if (value != null &&typeof value.toString != 'function') {value = nativeObjectToString.call(value);}if (hasOwnProperty.call(result, value)) {result[value].push(key);} else {result[value] = [key];}}, baseIteratee);module.exports = invertBy;
var constant = require('./constant'),createInverter = require('./_createInverter'),identity = require('./identity');/** Used for built-in method references. */var objectProto = Object.prototype;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/*** Creates an object composed of the inverted keys and values of `object`.* If `object` contains duplicate values, subsequent values overwrite* property assignments of previous values.** @static* @memberOf _* @since 0.7.0* @category Object* @param {Object} object The object to invert.* @returns {Object} Returns the new inverted object.* @example** var object = { 'a': 1, 'b': 2, 'c': 1 };** _.invert(object);* // => { '1': 'c', '2': 'b' }*/var invert = createInverter(function(result, value, key) {if (value != null &&typeof value.toString != 'function') {value = nativeObjectToString.call(value);}result[value] = key;}, constant(identity));module.exports = invert;
var arrayMap = require('./_arrayMap'),baseIntersection = require('./_baseIntersection'),baseRest = require('./_baseRest'),castArrayLikeObject = require('./_castArrayLikeObject'),last = require('./last');/*** This method is like `_.intersection` except that it accepts `comparator`* which is invoked to compare elements of `arrays`. The order and references* of result values are determined by the first array. The comparator is* invoked with two arguments: (arrVal, othVal).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of intersecting values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];* var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];** _.intersectionWith(objects, others, _.isEqual);* // => [{ 'x': 1, 'y': 2 }]*/var intersectionWith = baseRest(function(arrays) {var comparator = last(arrays),mapped = arrayMap(arrays, castArrayLikeObject);comparator = typeof comparator == 'function' ? comparator : undefined;if (comparator) {mapped.pop();}return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped, undefined, comparator): [];});module.exports = intersectionWith;
var arrayMap = require('./_arrayMap'),baseIntersection = require('./_baseIntersection'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),castArrayLikeObject = require('./_castArrayLikeObject'),last = require('./last');/*** This method is like `_.intersection` except that it accepts `iteratee`* which is invoked for each element of each `arrays` to generate the criterion* by which they're compared. The order and references of result values are* determined by the first array. The iteratee is invoked with one argument:* (value).** @static* @memberOf _* @since 4.0.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of intersecting values.* @example** _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [2.1]** // The `_.property` iteratee shorthand.* _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');* // => [{ 'x': 1 }]*/var intersectionBy = baseRest(function(arrays) {var iteratee = last(arrays),mapped = arrayMap(arrays, castArrayLikeObject);if (iteratee === last(mapped)) {iteratee = undefined;} else {mapped.pop();}return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped, baseIteratee(iteratee, 2)): [];});module.exports = intersectionBy;
var arrayMap = require('./_arrayMap'),baseIntersection = require('./_baseIntersection'),baseRest = require('./_baseRest'),castArrayLikeObject = require('./_castArrayLikeObject');/*** Creates an array of unique values that are included in all given arrays* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. The order and references of result values are* determined by the first array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {...Array} [arrays] The arrays to inspect.* @returns {Array} Returns the new array of intersecting values.* @example** _.intersection([2, 1], [2, 3]);* // => [2]*/var intersection = baseRest(function(arrays) {var mapped = arrayMap(arrays, castArrayLikeObject);return (mapped.length && mapped[0] === arrays[0])? baseIntersection(mapped): [];});module.exports = intersection;
var baseSlice = require('./_baseSlice');/*** Gets all but the last element of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @returns {Array} Returns the slice of `array`.* @example** _.initial([1, 2, 3]);* // => [1, 2]*/function initial(array) {var length = array == null ? 0 : array.length;return length ? baseSlice(array, 0, -1) : [];}module.exports = initial;
var baseIndexOf = require('./_baseIndexOf'),toInteger = require('./toInteger');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** Gets the index at which the first occurrence of `value` is found in `array`* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. If `fromIndex` is negative, it's used as the* offset from the end of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.indexOf([1, 2, 1, 2], 2);* // => 1** // Search from the `fromIndex`.* _.indexOf([1, 2, 1, 2], 2, 2);* // => 3*/function indexOf(array, value, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = fromIndex == null ? 0 : toInteger(fromIndex);if (index < 0) {index = nativeMax(length + index, 0);}return baseIndexOf(array, value, index);}module.exports = indexOf;
module.exports = require('./lodash');
var baseIndexOf = require('./_baseIndexOf'),isArrayLike = require('./isArrayLike'),isString = require('./isString'),toInteger = require('./toInteger'),values = require('./values');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** Checks if `value` is in `collection`. If `collection` is a string, it's* checked for a substring of `value`, otherwise* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* is used for equality comparisons. If `fromIndex` is negative, it's used as* the offset from the end of `collection`.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object|string} collection The collection to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=0] The index to search from.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.* @returns {boolean} Returns `true` if `value` is found, else `false`.* @example** _.includes([1, 2, 3], 1);* // => true** _.includes([1, 2, 3], 1, 2);* // => false** _.includes({ 'a': 1, 'b': 2 }, 1);* // => true** _.includes('abcd', 'bc');* // => true*/function includes(collection, value, fromIndex, guard) {collection = isArrayLike(collection) ? collection : values(collection);fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;var length = collection.length;if (fromIndex < 0) {fromIndex = nativeMax(length + fromIndex, 0);}return isString(collection)? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1): (!!length && baseIndexOf(collection, value, fromIndex) > -1);}module.exports = includes;
var baseInRange = require('./_baseInRange'),toFinite = require('./toFinite'),toNumber = require('./toNumber');/*** Checks if `n` is between `start` and up to, but not including, `end`. If* `end` is not specified, it's set to `start` with `start` then set to `0`.* If `start` is greater than `end` the params are swapped to support* negative ranges.** @static* @memberOf _* @since 3.3.0* @category Number* @param {number} number The number to check.* @param {number} [start=0] The start of the range.* @param {number} end The end of the range.* @returns {boolean} Returns `true` if `number` is in the range, else `false`.* @see _.range, _.rangeRight* @example** _.inRange(3, 2, 4);* // => true** _.inRange(4, 8);* // => true** _.inRange(4, 2);* // => false** _.inRange(2, 2);* // => false** _.inRange(1.2, 2);* // => true** _.inRange(5.2, 4);* // => false** _.inRange(-3, -2, -6);* // => true*/function inRange(number, start, end) {start = toFinite(start);if (end === undefined) {end = start;start = 0;} else {end = toFinite(end);}number = toNumber(number);return baseInRange(number, start, end);}module.exports = inRange;
/*** This method returns the first argument it receives.** @static* @since 0.1.0* @memberOf _* @category Util* @param {*} value Any value.* @returns {*} Returns `value`.* @example** var object = { 'a': 1 };** console.log(_.identity(object) === object);* // => true*/function identity(value) {return value;}module.exports = identity;
/*** Gets the first element of `array`.** @static* @memberOf _* @since 0.1.0* @alias first* @category Array* @param {Array} array The array to query.* @returns {*} Returns the first element of `array`.* @example** _.head([1, 2, 3]);* // => 1** _.head([]);* // => undefined*/function head(array) {return (array && array.length) ? array[0] : undefined;}module.exports = head;
var baseHasIn = require('./_baseHasIn'),hasPath = require('./_hasPath');/*** Checks if `path` is a direct or inherited property of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @returns {boolean} Returns `true` if `path` exists, else `false`.* @example** var object = _.create({ 'a': _.create({ 'b': 2 }) });** _.hasIn(object, 'a');* // => true** _.hasIn(object, 'a.b');* // => true** _.hasIn(object, ['a', 'b']);* // => true** _.hasIn(object, 'b');* // => false*/function hasIn(object, path) {return object != null && hasPath(object, path, baseHasIn);}module.exports = hasIn;
var baseHas = require('./_baseHas'),hasPath = require('./_hasPath');/*** Checks if `path` is a direct property of `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @returns {boolean} Returns `true` if `path` exists, else `false`.* @example** var object = { 'a': { 'b': 2 } };* var other = _.create({ 'a': _.create({ 'b': 2 }) });** _.has(object, 'a');* // => true** _.has(object, 'a.b');* // => true** _.has(object, ['a', 'b']);* // => true** _.has(other, 'a');* // => false*/function has(object, path) {return object != null && hasPath(object, path, baseHas);}module.exports = has;
var createRelationalOperation = require('./_createRelationalOperation');/*** Checks if `value` is greater than or equal to `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than or equal to* `other`, else `false`.* @see _.lte* @example** _.gte(3, 1);* // => true** _.gte(3, 3);* // => true** _.gte(1, 3);* // => false*/var gte = createRelationalOperation(function(value, other) {return value >= other;});module.exports = gte;
var baseGt = require('./_baseGt'),createRelationalOperation = require('./_createRelationalOperation');/*** Checks if `value` is greater than `other`.** @static* @memberOf _* @since 3.9.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than `other`,* else `false`.* @see _.lt* @example** _.gt(3, 1);* // => true** _.gt(3, 3);* // => false** _.gt(1, 3);* // => false*/var gt = createRelationalOperation(baseGt);module.exports = gt;
var baseAssignValue = require('./_baseAssignValue'),createAggregator = require('./_createAggregator');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The order of grouped values* is determined by the order they occur in `collection`. The corresponding* value of each key is an array of elements responsible for generating the* key. The iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** _.groupBy([6.1, 4.2, 6.3], Math.floor);* // => { '4': [4.2], '6': [6.1, 6.3] }** // The `_.property` iteratee shorthand.* _.groupBy(['one', 'two', 'three'], 'length');* // => { '3': ['one', 'two'], '5': ['three'] }*/var groupBy = createAggregator(function(result, value, key) {if (hasOwnProperty.call(result, key)) {result[key].push(value);} else {baseAssignValue(result, key, [value]);}});module.exports = groupBy;
var baseGet = require('./_baseGet');/*** Gets the value at `path` of `object`. If the resolved value is* `undefined`, the `defaultValue` is returned in its place.** @static* @memberOf _* @since 3.7.0* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the property to get.* @param {*} [defaultValue] The value returned for `undefined` resolved values.* @returns {*} Returns the resolved value.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }] };** _.get(object, 'a[0].b.c');* // => 3** _.get(object, ['a', '0', 'b', 'c']);* // => 3** _.get(object, 'a.b.c', 'default');* // => 'default'*/function get(object, path, defaultValue) {var result = object == null ? undefined : baseGet(object, path);return result === undefined ? defaultValue : result;}module.exports = get;
var baseFunctions = require('./_baseFunctions'),keysIn = require('./keysIn');/*** Creates an array of function property names from own and inherited* enumerable properties of `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The object to inspect.* @returns {Array} Returns the function names.* @see _.functions* @example** function Foo() {* this.a = _.constant('a');* this.b = _.constant('b');* }** Foo.prototype.c = _.constant('c');** _.functionsIn(new Foo);* // => ['a', 'b', 'c']*/function functionsIn(object) {return object == null ? [] : baseFunctions(object, keysIn(object));}module.exports = functionsIn;
var baseFunctions = require('./_baseFunctions'),keys = require('./keys');/*** Creates an array of function property names from own enumerable properties* of `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to inspect.* @returns {Array} Returns the function names.* @see _.functionsIn* @example** function Foo() {* this.a = _.constant('a');* this.b = _.constant('b');* }** Foo.prototype.c = _.constant('c');** _.functions(new Foo);* // => ['a', 'b']*/function functions(object) {return object == null ? [] : baseFunctions(object, keys(object));}module.exports = functions;
module.exports = {'after': require('./after'),'ary': require('./ary'),'before': require('./before'),'bind': require('./bind'),'bindKey': require('./bindKey'),'curry': require('./curry'),'curryRight': require('./curryRight'),'debounce': require('./debounce'),'defer': require('./defer'),'delay': require('./delay'),'flip': require('./flip'),'memoize': require('./memoize'),'negate': require('./negate'),'once': require('./once'),'overArgs': require('./overArgs'),'partial': require('./partial'),'partialRight': require('./partialRight'),'rearg': require('./rearg'),'rest': require('./rest'),'spread': require('./spread'),'throttle': require('./throttle'),'unary': require('./unary'),'wrap': require('./wrap')};
/*** The inverse of `_.toPairs`; this method returns an object composed* from key-value `pairs`.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} pairs The key-value pairs.* @returns {Object} Returns the new object.* @example** _.fromPairs([['a', 1], ['b', 2]]);* // => { 'a': 1, 'b': 2 }*/function fromPairs(pairs) {var index = -1,length = pairs == null ? 0 : pairs.length,result = {};while (++index < length) {var pair = pairs[index];result[pair[0]] = pair[1];}return result;}module.exports = fromPairs;
var _ = require('./lodash.min').runInContext();module.exports = require('./fp/_baseConvert')(_, _);
var convert = require('./convert'),func = convert('zipWith', require('../zipWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('zipObjectDeep', require('../zipObjectDeep'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('zipObject', require('../zipObject'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./zipObject');
var convert = require('./convert'),func = convert('zipAll', require('../zip'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('zip', require('../zip'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('xorWith', require('../xorWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('xorBy', require('../xorBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('xor', require('../xor'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('wrap', require('../wrap'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('words', require('../words'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('without', require('../without'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./isMatch');
module.exports = require('./conformsTo');
var convert = require('./convert'),func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('values', require('../values'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('valueOf', require('../valueOf'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('value', require('../value'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../util'));
module.exports = require('./overArgs');
var convert = require('./convert'),func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('upperCase', require('../upperCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('updateWith', require('../updateWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('update', require('../update'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unzipWith', require('../unzipWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unzip', require('../unzip'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unset', require('../unset'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./flatten');
var convert = require('./convert'),func = convert('uniqueId', require('../uniqueId'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('uniqWith', require('../uniqWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('uniqBy', require('../uniqBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('uniq', require('../uniq'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unionWith', require('../unionWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unionBy', require('../unionBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('union', require('../union'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unescape', require('../unescape'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('unary', require('../unary'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./rest');
var convert = require('./convert'),func = convert('truncate', require('../truncate'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trimStart', require('../trimStart'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trimEnd', require('../trimEnd'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trimCharsStart', require('../trimStart'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trimCharsEnd', require('../trimEnd'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trimChars', require('../trim'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('trim', require('../trim'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('transform', require('../transform'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toUpper', require('../toUpper'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toString', require('../toString'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toPath', require('../toPath'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toPairs', require('../toPairs'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toNumber', require('../toNumber'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toLower', require('../toLower'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toLength', require('../toLength'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toJSON', require('../toJSON'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toIterator', require('../toIterator'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toInteger', require('../toInteger'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toFinite', require('../toFinite'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('toArray', require('../toArray'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('times', require('../times'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('thru', require('../thru'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('throttle', require('../throttle'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('template', require('../template'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('tap', require('../tap'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('takeWhile', require('../takeWhile'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('takeRightWhile', require('../takeRightWhile'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('takeRight', require('../takeRight'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./takeRightWhile');
module.exports = require('./takeRight');
var convert = require('./convert'),func = convert('take', require('../take'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('tail', require('../tail'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./xorWith');
module.exports = require('./xorBy');
module.exports = require('./xor');
var convert = require('./convert'),func = convert('sumBy', require('../sumBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sum', require('../sum'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('subtract', require('../subtract'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('stubString', require('../stubString'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('stubObject', require('../stubObject'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('stubArray', require('../stubArray'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../string'));
var convert = require('./convert'),func = convert('startsWith', require('../startsWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('startCase', require('../startCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('spreadFrom', require('../spread'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('spread', require('../spread'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('split', require('../split'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedUniqBy', require('../sortedUniqBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedLastIndexOf', require('../sortedLastIndexOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedLastIndexBy', require('../sortedLastIndexBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedLastIndex', require('../sortedLastIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedIndexOf', require('../sortedIndexOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedIndexBy', require('../sortedIndexBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortedIndex', require('../sortedIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sortBy', require('../sortBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('some', require('../some'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('slice', require('../slice'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('size', require('../size'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('shuffle', require('../shuffle'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('setWith', require('../setWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('set', require('../set'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../seq'));
var convert = require('./convert'),func = convert('sampleSize', require('../sampleSize'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('sample', require('../sample'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('round', require('../round'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('reverse', require('../reverse'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('result', require('../result'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('restFrom', require('../rest'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('rest', require('../rest'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('replace', require('../replace'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('repeat', require('../repeat'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('remove', require('../remove'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('reject', require('../reject'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('reduceRight', require('../reduceRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('reduce', require('../reduce'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('rearg', require('../rearg'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('rangeStepRight', require('../rangeRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('rangeStep', require('../range'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('rangeRight', require('../rangeRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('range', require('../range'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('random', require('../random'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pullAt', require('../pullAt'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pullAllWith', require('../pullAllWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pullAllBy', require('../pullAllBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pullAll', require('../pullAll'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pull', require('../pull'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./at');
var convert = require('./convert'),func = convert('propertyOf', require('../get'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./get');
module.exports = require('./getOr');
module.exports = require('./matchesProperty');
module.exports = require('./get');
module.exports = require('./map');
var convert = require('./convert'),func = convert('plant', require('../plant'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
/*** The default argument placeholder value for methods.** @type {Object}*/module.exports = {};
module.exports = require('./flow');
var convert = require('./convert'),func = convert('pickBy', require('../pickBy'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./pick');
var convert = require('./convert'),func = convert('pick', require('../pick'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./at');
module.exports = require('./getOr');
module.exports = require('./matchesProperty');
module.exports = require('./get');
var convert = require('./convert'),func = convert('partition', require('../partition'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('partialRight', require('../partialRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('partial', require('../partial'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('parseInt', require('../parseInt'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('padStart', require('../padStart'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('padEnd', require('../padEnd'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('padCharsStart', require('../padStart'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('padCharsEnd', require('../padEnd'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('padChars', require('../pad'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('pad', require('../pad'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('overSome', require('../overSome'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('overEvery', require('../overEvery'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('overArgs', require('../overArgs'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('over', require('../over'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('orderBy', require('../orderBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('once', require('../once'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('omitBy', require('../omitBy'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./omit');
var convert = require('./convert'),func = convert('omit', require('../omit'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../object'));
var convert = require('./convert');module.exports = convert(require('../number'));
var convert = require('./convert'),func = convert('nthArg', require('../nthArg'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('nth', require('../nth'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('now', require('../now'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('noop', require('../noop'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('next', require('../next'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('negate', require('../negate'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./ary');
var convert = require('./convert'),func = convert('multiply', require('../multiply'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mixin', require('../mixin'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('minBy', require('../minBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('min', require('../min'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('methodOf', require('../methodOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('method', require('../method'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mergeWith', require('../mergeWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mergeAllWith', require('../mergeWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mergeAll', require('../merge'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('merge', require('../merge'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('memoize', require('../memoize'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('meanBy', require('../meanBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mean', require('../mean'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('maxBy', require('../maxBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('max', require('../max'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../math'));
var convert = require('./convert'),func = convert('matchesProperty', require('../matchesProperty'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./isMatch');
var convert = require('./convert'),func = convert('mapValues', require('../mapValues'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('mapKeys', require('../mapKeys'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('map', require('../map'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lte', require('../lte'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lt', require('../lt'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lastIndexOfFrom', require('../lastIndexOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('lastIndexOf', require('../lastIndexOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('last', require('../last'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../lang'));
var convert = require('./convert'),func = convert('keysIn', require('../keysIn'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('keys', require('../keys'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('keyBy', require('../keyBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./over');
var convert = require('./convert'),func = convert('join', require('../join'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('iteratee', require('../iteratee'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isString', require('../isString'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isSet', require('../isSet'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isObject', require('../isObject'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isNumber', require('../isNumber'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isNull', require('../isNull'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isNil', require('../isNil'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isNative', require('../isNative'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isNaN', require('../isNaN'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isMatchWith', require('../isMatchWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isMatch', require('../isMatch'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isMap', require('../isMap'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isLength', require('../isLength'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isInteger', require('../isInteger'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isFunction', require('../isFunction'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isFinite', require('../isFinite'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isError', require('../isError'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isEqualWith', require('../isEqualWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isEqual', require('../isEqual'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isElement', require('../isElement'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isDate', require('../isDate'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isArray', require('../isArray'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('isArguments', require('../isArguments'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('invokeMap', require('../invokeMap'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('invokeArgsMap', require('../invokeMap'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('invokeArgs', require('../invoke'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('invoke', require('../invoke'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./invert');
var convert = require('./convert'),func = convert('invertBy', require('../invertBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('invert', require('../invert'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('intersectionWith', require('../intersectionWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('intersectionBy', require('../intersectionBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('intersection', require('../intersection'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('initial', require('../initial'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./initial');
var convert = require('./convert'),func = convert('indexOfFrom', require('../indexOf'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('indexOf', require('../indexOf'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./keyBy');
var convert = require('./convert'),func = convert('includesFrom', require('../includes'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('includes', require('../includes'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('inRange', require('../inRange'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('identity', require('../identity'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./eq');
var convert = require('./convert'),func = convert('head', require('../head'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('hasIn', require('../hasIn'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('has', require('../has'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('gte', require('../gte'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('gt', require('../gt'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('groupBy', require('../groupBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('getOr', require('../get'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('get', require('../get'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('functions', require('../functions'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../function'));
var convert = require('./convert'),func = convert('fromPairs', require('../fromPairs'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forOwnRight', require('../forOwnRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forOwn', require('../forOwn'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forInRight', require('../forInRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forIn', require('../forIn'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forEachRight', require('../forEachRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('forEach', require('../forEach'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flowRight', require('../flowRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flow', require('../flow'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('floor', require('../floor'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flip', require('../flip'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flattenDepth', require('../flattenDepth'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flatten', require('../flatten'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flatMapDepth', require('../flatMapDepth'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flatMapDeep', require('../flatMapDeep'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('flatMap', require('../flatMap'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./head');
var convert = require('./convert'),func = convert('findLastKey', require('../findLastKey'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findLastIndexFrom', require('../findLastIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findLastIndex', require('../findLastIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findLastFrom', require('../findLast'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findLast', require('../findLast'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findKey', require('../findKey'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findIndexFrom', require('../findIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findIndex', require('../findIndex'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('findFrom', require('../find'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('find', require('../find'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('filter', require('../filter'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('fill', require('../fill'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./assignInWith');
module.exports = require('./assignInAllWith');
module.exports = require('./assignInAll');
module.exports = require('./assignIn');
var convert = require('./convert'),func = convert('every', require('../every'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('escape', require('../escape'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./isEqual');
var convert = require('./convert'),func = convert('eq', require('../eq'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./toPairsIn');
module.exports = require('./toPairs');
var convert = require('./convert'),func = convert('endsWith', require('../endsWith'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./forEachRight');
module.exports = require('./forEach');
var convert = require('./convert'),func = convert('dropWhile', require('../dropWhile'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('dropRightWhile', require('../dropRightWhile'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('dropRight', require('../dropRight'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./dropRightWhile');
module.exports = require('./dropRight');
var convert = require('./convert'),func = convert('drop', require('../drop'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('divide', require('../divide'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./unset');
module.exports = require('./unset');
var convert = require('./convert'),func = convert('differenceWith', require('../differenceWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('differenceBy', require('../differenceBy'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('difference', require('../difference'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('delay', require('../delay'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defer', require('../defer'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defaultsDeepAll', require('../defaultsDeep'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defaultsDeep', require('../defaultsDeep'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defaultsAll', require('../defaults'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defaults', require('../defaults'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('defaultTo', require('../defaultTo'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('deburr', require('../deburr'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('debounce', require('../debounce'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../date'));
var convert = require('./convert'),func = convert('curryRightN', require('../curryRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('curryRight', require('../curryRight'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('curryN', require('../curry'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('curry', require('../curry'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('create', require('../create'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('countBy', require('../countBy'));func.placeholder = require('./placeholder');module.exports = func;
var baseConvert = require('./_baseConvert'),util = require('./_util');/*** Converts `func` of `name` to an immutable auto-curried iteratee-first data-last* version with conversion `options` applied. If `name` is an object its methods* will be converted.** @param {string} name The name of the function to wrap.* @param {Function} [func] The function to wrap.* @param {Object} [options] The options object. See `baseConvert` for more details.* @returns {Function|Object} Returns the converted function or object.*/function convert(name, func, options) {return baseConvert(util, name, func, options);}module.exports = convert;
module.exports = require('./includes');
var convert = require('./convert'),func = convert('constant', require('../constant'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('conformsTo', require('../conformsTo'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./conformsTo');
var convert = require('./convert'),func = convert('cond', require('../cond'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('concat', require('../concat'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./flowRight');
module.exports = require('./negate');
var convert = require('./convert'),func = convert('compact', require('../compact'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('commit', require('../commit'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../collection'));
var convert = require('./convert'),func = convert('cloneWith', require('../cloneWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('cloneDeepWith', require('../cloneDeepWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('clone', require('../clone'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('clamp', require('../clamp'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('chunk', require('../chunk'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('chain', require('../chain'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('ceil', require('../ceil'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('castArray', require('../castArray'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('capitalize', require('../capitalize'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('camelCase', require('../camelCase'), require('./_falseOptions'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('bindKey', require('../bindKey'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('bindAll', require('../bindAll'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('bind', require('../bind'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('before', require('../before'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('attempt', require('../attempt'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('at', require('../at'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = require('./set');
module.exports = require('./set');
var convert = require('./convert'),func = convert('assignWith', require('../assignWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignInWith', require('../assignInWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignInAllWith', require('../assignInWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignInAll', require('../assignIn'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignIn', require('../assignIn'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignAllWith', require('../assignWith'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assignAll', require('../assign'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('assign', require('../assign'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('ary', require('../ary'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert');module.exports = convert(require('../array'));
module.exports = require('./spread');
module.exports = require('./overSome');
module.exports = require('./some');
module.exports = require('./constant');
module.exports = require('./overEvery');
module.exports = require('./every');
var convert = require('./convert'),func = convert('after', require('../after'));func.placeholder = require('./placeholder');module.exports = func;
var convert = require('./convert'),func = convert('add', require('../add'));func.placeholder = require('./placeholder');module.exports = func;
module.exports = {'ary': require('../ary'),'assign': require('../_baseAssign'),'clone': require('../clone'),'curry': require('../curry'),'forEach': require('../_arrayEach'),'isArray': require('../isArray'),'isError': require('../isError'),'isFunction': require('../isFunction'),'isWeakMap': require('../isWeakMap'),'iteratee': require('../iteratee'),'keys': require('../_baseKeys'),'rearg': require('../rearg'),'toInteger': require('../toInteger'),'toPath': require('../toPath')};
/** Used to map aliases to their real names. */exports.aliasToReal = {// Lodash aliases.'each': 'forEach','eachRight': 'forEachRight','entries': 'toPairs','entriesIn': 'toPairsIn','extend': 'assignIn','extendAll': 'assignInAll','extendAllWith': 'assignInAllWith','extendWith': 'assignInWith','first': 'head',// Methods that are curried variants of others.'conforms': 'conformsTo','matches': 'isMatch','property': 'get',// Ramda aliases.'__': 'placeholder','F': 'stubFalse','T': 'stubTrue','all': 'every','allPass': 'overEvery','always': 'constant','any': 'some','anyPass': 'overSome','apply': 'spread','assoc': 'set','assocPath': 'set','complement': 'negate','compose': 'flowRight','contains': 'includes','dissoc': 'unset','dissocPath': 'unset','dropLast': 'dropRight','dropLastWhile': 'dropRightWhile','equals': 'isEqual','identical': 'eq','indexBy': 'keyBy','init': 'initial','invertObj': 'invert','juxt': 'over','omitAll': 'omit','nAry': 'ary','path': 'get','pathEq': 'matchesProperty','pathOr': 'getOr','paths': 'at','pickAll': 'pick','pipe': 'flow','pluck': 'map','prop': 'get','propEq': 'matchesProperty','propOr': 'getOr','props': 'at','symmetricDifference': 'xor','symmetricDifferenceBy': 'xorBy','symmetricDifferenceWith': 'xorWith','takeLast': 'takeRight','takeLastWhile': 'takeRightWhile','unapply': 'rest','unnest': 'flatten','useWith': 'overArgs','where': 'conformsTo','whereEq': 'isMatch','zipObj': 'zipObject'};/** Used to map ary to method names. */exports.aryMethod = {'1': ['assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create','curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow','flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll','methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse','round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart','uniqueId', 'words', 'zipAll'],'2': ['add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith','at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith','cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN','debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference','divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq','every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex','findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach','forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get','groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection','invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy','lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty','maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit','omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial','partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll','pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove','repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex','sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy','split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight','takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars','trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith','unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject','zipObjectDeep'],'3': ['assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith','findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr','includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith','invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth','lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd','padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight','reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy','sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy','xorWith', 'zipWith'],'4': ['fill', 'setWith', 'updateWith']};/** Used to map ary to rearg configs. */exports.aryRearg = {'2': [1, 0],'3': [2, 0, 1],'4': [3, 2, 0, 1]};/** Used to map method names to their iteratee ary. */exports.iterateeAry = {'dropRightWhile': 1,'dropWhile': 1,'every': 1,'filter': 1,'find': 1,'findFrom': 1,'findIndex': 1,'findIndexFrom': 1,'findKey': 1,'findLast': 1,'findLastFrom': 1,'findLastIndex': 1,'findLastIndexFrom': 1,'findLastKey': 1,'flatMap': 1,'flatMapDeep': 1,'flatMapDepth': 1,'forEach': 1,'forEachRight': 1,'forIn': 1,'forInRight': 1,'forOwn': 1,'forOwnRight': 1,'map': 1,'mapKeys': 1,'mapValues': 1,'partition': 1,'reduce': 2,'reduceRight': 2,'reject': 1,'remove': 1,'some': 1,'takeRightWhile': 1,'takeWhile': 1,'times': 1,'transform': 2};/** Used to map method names to iteratee rearg configs. */exports.iterateeRearg = {'mapKeys': [1],'reduceRight': [1, 0]};/** Used to map method names to rearg configs. */exports.methodRearg = {'assignInAllWith': [1, 0],'assignInWith': [1, 2, 0],'assignAllWith': [1, 0],'assignWith': [1, 2, 0],'differenceBy': [1, 2, 0],'differenceWith': [1, 2, 0],'getOr': [2, 1, 0],'intersectionBy': [1, 2, 0],'intersectionWith': [1, 2, 0],'isEqualWith': [1, 2, 0],'isMatchWith': [2, 1, 0],'mergeAllWith': [1, 0],'mergeWith': [1, 2, 0],'padChars': [2, 1, 0],'padCharsEnd': [2, 1, 0],'padCharsStart': [2, 1, 0],'pullAllBy': [2, 1, 0],'pullAllWith': [2, 1, 0],'rangeStep': [1, 2, 0],'rangeStepRight': [1, 2, 0],'setWith': [3, 1, 2, 0],'sortedIndexBy': [2, 1, 0],'sortedLastIndexBy': [2, 1, 0],'unionBy': [1, 2, 0],'unionWith': [1, 2, 0],'updateWith': [3, 1, 2, 0],'xorBy': [1, 2, 0],'xorWith': [1, 2, 0],'zipWith': [1, 2, 0]};/** Used to map method names to spread configs. */exports.methodSpread = {'assignAll': { 'start': 0 },'assignAllWith': { 'start': 0 },'assignInAll': { 'start': 0 },'assignInAllWith': { 'start': 0 },'defaultsAll': { 'start': 0 },'defaultsDeepAll': { 'start': 0 },'invokeArgs': { 'start': 2 },'invokeArgsMap': { 'start': 2 },'mergeAll': { 'start': 0 },'mergeAllWith': { 'start': 0 },'partial': { 'start': 1 },'partialRight': { 'start': 1 },'without': { 'start': 1 },'zipAll': { 'start': 0 }};/** Used to identify methods which mutate arrays or objects. */exports.mutate = {'array': {'fill': true,'pull': true,'pullAll': true,'pullAllBy': true,'pullAllWith': true,'pullAt': true,'remove': true,'reverse': true},'object': {'assign': true,'assignAll': true,'assignAllWith': true,'assignIn': true,'assignInAll': true,'assignInAllWith': true,'assignInWith': true,'assignWith': true,'defaults': true,'defaultsAll': true,'defaultsDeep': true,'defaultsDeepAll': true,'merge': true,'mergeAll': true,'mergeAllWith': true,'mergeWith': true,},'set': {'set': true,'setWith': true,'unset': true,'update': true,'updateWith': true}};/** Used to map real names to their aliases. */exports.realToAlias = (function() {var hasOwnProperty = Object.prototype.hasOwnProperty,object = exports.aliasToReal,result = {};for (var key in object) {var value = object[key];if (hasOwnProperty.call(result, value)) {result[value].push(key);} else {result[value] = [key];}}return result;}());/** Used to map method names to other names. */exports.remap = {'assignAll': 'assign','assignAllWith': 'assignWith','assignInAll': 'assignIn','assignInAllWith': 'assignInWith','curryN': 'curry','curryRightN': 'curryRight','defaultsAll': 'defaults','defaultsDeepAll': 'defaultsDeep','findFrom': 'find','findIndexFrom': 'findIndex','findLastFrom': 'findLast','findLastIndexFrom': 'findLastIndex','getOr': 'get','includesFrom': 'includes','indexOfFrom': 'indexOf','invokeArgs': 'invoke','invokeArgsMap': 'invokeMap','lastIndexOfFrom': 'lastIndexOf','mergeAll': 'merge','mergeAllWith': 'mergeWith','padChars': 'pad','padCharsEnd': 'padEnd','padCharsStart': 'padStart','propertyOf': 'get','rangeStep': 'range','rangeStepRight': 'rangeRight','restFrom': 'rest','spreadFrom': 'spread','trimChars': 'trim','trimCharsEnd': 'trimEnd','trimCharsStart': 'trimStart','zipAll': 'zip'};/** Used to track methods that skip fixing their arity. */exports.skipFixed = {'castArray': true,'flow': true,'flowRight': true,'iteratee': true,'mixin': true,'rearg': true,'runInContext': true};/** Used to track methods that skip rearranging arguments. */exports.skipRearg = {'add': true,'assign': true,'assignIn': true,'bind': true,'bindKey': true,'concat': true,'difference': true,'divide': true,'eq': true,'gt': true,'gte': true,'isEqual': true,'lt': true,'lte': true,'matchesProperty': true,'merge': true,'multiply': true,'overArgs': true,'partial': true,'partialRight': true,'propertyOf': true,'random': true,'range': true,'rangeRight': true,'subtract': true,'zip': true,'zipObject': true,'zipObjectDeep': true};
module.exports = {'cap': false,'curry': false,'fixed': false,'immutable': false,'rearg': false};
var baseConvert = require('./_baseConvert');/*** Converts `lodash` to an immutable auto-curried iteratee-first data-last* version with conversion `options` applied.** @param {Function} lodash The lodash function to convert.* @param {Object} [options] The options object. See `baseConvert` for more details.* @returns {Function} Returns the converted `lodash`.*/function browserConvert(lodash, options) {return baseConvert(lodash, lodash, options);}if (typeof _ == 'function' && typeof _.runInContext == 'function') {_ = browserConvert(_.runInContext());}module.exports = browserConvert;
var mapping = require('./_mapping'),fallbackHolder = require('./placeholder');/** Built-in value reference. */var push = Array.prototype.push;/*** Creates a function, with an arity of `n`, that invokes `func` with the* arguments it receives.** @private* @param {Function} func The function to wrap.* @param {number} n The arity of the new function.* @returns {Function} Returns the new function.*/function baseArity(func, n) {return n == 2? function(a, b) { return func.apply(undefined, arguments); }: function(a) { return func.apply(undefined, arguments); };}/*** Creates a function that invokes `func`, with up to `n` arguments, ignoring* any additional arguments.** @private* @param {Function} func The function to cap arguments for.* @param {number} n The arity cap.* @returns {Function} Returns the new function.*/function baseAry(func, n) {return n == 2? function(a, b) { return func(a, b); }: function(a) { return func(a); };}/*** Creates a clone of `array`.** @private* @param {Array} array The array to clone.* @returns {Array} Returns the cloned array.*/function cloneArray(array) {var length = array ? array.length : 0,result = Array(length);while (length--) {result[length] = array[length];}return result;}/*** Creates a function that clones a given object using the assignment `func`.** @private* @param {Function} func The assignment function.* @returns {Function} Returns the new cloner function.*/function createCloner(func) {return function(object) {return func({}, object);};}/*** A specialized version of `_.spread` which flattens the spread array into* the arguments of the invoked `func`.** @private* @param {Function} func The function to spread arguments over.* @param {number} start The start position of the spread.* @returns {Function} Returns the new function.*/function flatSpread(func, start) {return function() {var length = arguments.length,lastIndex = length - 1,args = Array(length);while (length--) {args[length] = arguments[length];}var array = args[start],otherArgs = args.slice(0, start);if (array) {push.apply(otherArgs, array);}if (start != lastIndex) {push.apply(otherArgs, args.slice(start + 1));}return func.apply(this, otherArgs);};}/*** Creates a function that wraps `func` and uses `cloner` to clone the first* argument it receives.** @private* @param {Function} func The function to wrap.* @param {Function} cloner The function to clone arguments.* @returns {Function} Returns the new immutable function.*/function wrapImmutable(func, cloner) {return function() {var length = arguments.length;if (!length) {return;}var args = Array(length);while (length--) {args[length] = arguments[length];}var result = args[0] = cloner.apply(undefined, args);func.apply(undefined, args);return result;};}/*** The base implementation of `convert` which accepts a `util` object of methods* required to perform conversions.** @param {Object} util The util object.* @param {string} name The name of the function to convert.* @param {Function} func The function to convert.* @param {Object} [options] The options object.* @param {boolean} [options.cap=true] Specify capping iteratee arguments.* @param {boolean} [options.curry=true] Specify currying.* @param {boolean} [options.fixed=true] Specify fixed arity.* @param {boolean} [options.immutable=true] Specify immutable operations.* @param {boolean} [options.rearg=true] Specify rearranging arguments.* @returns {Function|Object} Returns the converted function or object.*/function baseConvert(util, name, func, options) {var isLib = typeof name == 'function',isObj = name === Object(name);if (isObj) {options = func;func = name;name = undefined;}if (func == null) {throw new TypeError;}options || (options = {});var config = {'cap': 'cap' in options ? options.cap : true,'curry': 'curry' in options ? options.curry : true,'fixed': 'fixed' in options ? options.fixed : true,'immutable': 'immutable' in options ? options.immutable : true,'rearg': 'rearg' in options ? options.rearg : true};var defaultHolder = isLib ? func : fallbackHolder,forceCurry = ('curry' in options) && options.curry,forceFixed = ('fixed' in options) && options.fixed,forceRearg = ('rearg' in options) && options.rearg,pristine = isLib ? func.runInContext() : undefined;var helpers = isLib ? func : {'ary': util.ary,'assign': util.assign,'clone': util.clone,'curry': util.curry,'forEach': util.forEach,'isArray': util.isArray,'isError': util.isError,'isFunction': util.isFunction,'isWeakMap': util.isWeakMap,'iteratee': util.iteratee,'keys': util.keys,'rearg': util.rearg,'toInteger': util.toInteger,'toPath': util.toPath};var ary = helpers.ary,assign = helpers.assign,clone = helpers.clone,curry = helpers.curry,each = helpers.forEach,isArray = helpers.isArray,isError = helpers.isError,isFunction = helpers.isFunction,isWeakMap = helpers.isWeakMap,keys = helpers.keys,rearg = helpers.rearg,toInteger = helpers.toInteger,toPath = helpers.toPath;var aryMethodKeys = keys(mapping.aryMethod);var wrappers = {'castArray': function(castArray) {return function() {var value = arguments[0];return isArray(value)? castArray(cloneArray(value)): castArray.apply(undefined, arguments);};},'iteratee': function(iteratee) {return function() {var func = arguments[0],arity = arguments[1],result = iteratee(func, arity),length = result.length;if (config.cap && typeof arity == 'number') {arity = arity > 2 ? (arity - 2) : 1;return (length && length <= arity) ? result : baseAry(result, arity);}return result;};},'mixin': function(mixin) {return function(source) {var func = this;if (!isFunction(func)) {return mixin(func, Object(source));}var pairs = [];each(keys(source), function(key) {if (isFunction(source[key])) {pairs.push([key, func.prototype[key]]);}});mixin(func, Object(source));each(pairs, function(pair) {var value = pair[1];if (isFunction(value)) {func.prototype[pair[0]] = value;} else {delete func.prototype[pair[0]];}});return func;};},'nthArg': function(nthArg) {return function(n) {var arity = n < 0 ? 1 : (toInteger(n) + 1);return curry(nthArg(n), arity);};},'rearg': function(rearg) {return function(func, indexes) {var arity = indexes ? indexes.length : 0;return curry(rearg(func, indexes), arity);};},'runInContext': function(runInContext) {return function(context) {return baseConvert(util, runInContext(context), options);};}};/*--------------------------------------------------------------------------*//*** Casts `func` to a function with an arity capped iteratee if needed.** @private* @param {string} name The name of the function to inspect.* @param {Function} func The function to inspect.* @returns {Function} Returns the cast function.*/function castCap(name, func) {if (config.cap) {var indexes = mapping.iterateeRearg[name];if (indexes) {return iterateeRearg(func, indexes);}var n = !isLib && mapping.iterateeAry[name];if (n) {return iterateeAry(func, n);}}return func;}/*** Casts `func` to a curried function if needed.** @private* @param {string} name The name of the function to inspect.* @param {Function} func The function to inspect.* @param {number} n The arity of `func`.* @returns {Function} Returns the cast function.*/function castCurry(name, func, n) {return (forceCurry || (config.curry && n > 1))? curry(func, n): func;}/*** Casts `func` to a fixed arity function if needed.** @private* @param {string} name The name of the function to inspect.* @param {Function} func The function to inspect.* @param {number} n The arity cap.* @returns {Function} Returns the cast function.*/function castFixed(name, func, n) {if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {var data = mapping.methodSpread[name],start = data && data.start;return start === undefined ? ary(func, n) : flatSpread(func, start);}return func;}/*** Casts `func` to an rearged function if needed.** @private* @param {string} name The name of the function to inspect.* @param {Function} func The function to inspect.* @param {number} n The arity of `func`.* @returns {Function} Returns the cast function.*/function castRearg(name, func, n) {return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]): func;}/*** Creates a clone of `object` by `path`.** @private* @param {Object} object The object to clone.* @param {Array|string} path The path to clone by.* @returns {Object} Returns the cloned object.*/function cloneByPath(object, path) {path = toPath(path);var index = -1,length = path.length,lastIndex = length - 1,result = clone(Object(object)),nested = result;while (nested != null && ++index < length) {var key = path[index],value = nested[key];if (value != null &&!(isFunction(value) || isError(value) || isWeakMap(value))) {nested[key] = clone(index == lastIndex ? value : Object(value));}nested = nested[key];}return result;}/*** Converts `lodash` to an immutable auto-curried iteratee-first data-last* version with conversion `options` applied.** @param {Object} [options] The options object. See `baseConvert` for more details.* @returns {Function} Returns the converted `lodash`.*/function convertLib(options) {return _.runInContext.convert(options)(undefined);}/*** Create a converter function for `func` of `name`.** @param {string} name The name of the function to convert.* @param {Function} func The function to convert.* @returns {Function} Returns the new converter function.*/function createConverter(name, func) {var realName = mapping.aliasToReal[name] || name,methodName = mapping.remap[realName] || realName,oldOptions = options;return function(options) {var newUtil = isLib ? pristine : helpers,newFunc = isLib ? pristine[methodName] : func,newOptions = assign(assign({}, oldOptions), options);return baseConvert(newUtil, realName, newFunc, newOptions);};}/*** Creates a function that wraps `func` to invoke its iteratee, with up to `n`* arguments, ignoring any additional arguments.** @private* @param {Function} func The function to cap iteratee arguments for.* @param {number} n The arity cap.* @returns {Function} Returns the new function.*/function iterateeAry(func, n) {return overArg(func, function(func) {return typeof func == 'function' ? baseAry(func, n) : func;});}/*** Creates a function that wraps `func` to invoke its iteratee with arguments* arranged according to the specified `indexes` where the argument value at* the first index is provided as the first argument, the argument value at* the second index is provided as the second argument, and so on.** @private* @param {Function} func The function to rearrange iteratee arguments for.* @param {number[]} indexes The arranged argument indexes.* @returns {Function} Returns the new function.*/function iterateeRearg(func, indexes) {return overArg(func, function(func) {var n = indexes.length;return baseArity(rearg(baseAry(func, n), indexes), n);});}/*** Creates a function that invokes `func` with its first argument transformed.** @private* @param {Function} func The function to wrap.* @param {Function} transform The argument transform.* @returns {Function} Returns the new function.*/function overArg(func, transform) {return function() {var length = arguments.length;if (!length) {return func();}var args = Array(length);while (length--) {args[length] = arguments[length];}var index = config.rearg ? 0 : (length - 1);args[index] = transform(args[index]);return func.apply(undefined, args);};}/*** Creates a function that wraps `func` and applys the conversions* rules by `name`.** @private* @param {string} name The name of the function to wrap.* @param {Function} func The function to wrap.* @returns {Function} Returns the converted function.*/function wrap(name, func, placeholder) {var result,realName = mapping.aliasToReal[name] || name,wrapped = func,wrapper = wrappers[realName];if (wrapper) {wrapped = wrapper(func);}else if (config.immutable) {if (mapping.mutate.array[realName]) {wrapped = wrapImmutable(func, cloneArray);}else if (mapping.mutate.object[realName]) {wrapped = wrapImmutable(func, createCloner(func));}else if (mapping.mutate.set[realName]) {wrapped = wrapImmutable(func, cloneByPath);}}each(aryMethodKeys, function(aryKey) {each(mapping.aryMethod[aryKey], function(otherName) {if (realName == otherName) {var data = mapping.methodSpread[realName],afterRearg = data && data.afterRearg;result = afterRearg? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey): castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);result = castCap(realName, result);result = castCurry(realName, result, aryKey);return false;}});return !result;});result || (result = wrapped);if (result == func) {result = forceCurry ? curry(result, 1) : function() {return func.apply(this, arguments);};}result.convert = createConverter(realName, func);result.placeholder = func.placeholder = placeholder;return result;}/*--------------------------------------------------------------------------*/if (!isObj) {return wrap(name, func, defaultHolder);}var _ = func;// Convert methods by ary cap.var pairs = [];each(aryMethodKeys, function(aryKey) {each(mapping.aryMethod[aryKey], function(key) {var func = _[mapping.remap[key] || key];if (func) {pairs.push([key, wrap(key, func, _)]);}});});// Convert remaining methods.each(keys(_), function(key) {var func = _[key];if (typeof func == 'function') {var length = pairs.length;while (length--) {if (pairs[length][0] == key) {return;}}func.convert = createConverter(key, func);pairs.push([key, func]);}});// Assign to `_` leaving `_.prototype` unchanged to allow chaining.each(pairs, function(pair) {_[pair[0]] = pair[1];});_.convert = convertLib;_.placeholder = _;// Assign aliases.each(keys(_), function(key) {each(mapping.realToAlias[key] || [], function(alias) {_[alias] = _[key];});});return _;}module.exports = baseConvert;
module.exports = require('./placeholder');
module.exports = require('./stubTrue');
module.exports = require('./stubFalse');
var baseForOwnRight = require('./_baseForOwnRight'),castFunction = require('./_castFunction');/*** This method is like `_.forOwn` except that it iterates over properties of* `object` in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forOwn* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forOwnRight(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.*/function forOwnRight(object, iteratee) {return object && baseForOwnRight(object, castFunction(iteratee));}module.exports = forOwnRight;
var baseForOwn = require('./_baseForOwn'),castFunction = require('./_castFunction');/*** Iterates over own enumerable string keyed properties of an object and* invokes `iteratee` for each property. The iteratee is invoked with three* arguments: (value, key, object). Iteratee functions may exit iteration* early by explicitly returning `false`.** @static* @memberOf _* @since 0.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forOwnRight* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forOwn(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'a' then 'b' (iteration order is not guaranteed).*/function forOwn(object, iteratee) {return object && baseForOwn(object, castFunction(iteratee));}module.exports = forOwn;
var baseForRight = require('./_baseForRight'),castFunction = require('./_castFunction'),keysIn = require('./keysIn');/*** This method is like `_.forIn` except that it iterates over properties of* `object` in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forIn* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forInRight(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.*/function forInRight(object, iteratee) {return object == null? object: baseForRight(object, castFunction(iteratee), keysIn);}module.exports = forInRight;
var baseFor = require('./_baseFor'),castFunction = require('./_castFunction'),keysIn = require('./keysIn');/*** Iterates over own and inherited enumerable string keyed properties of an* object and invokes `iteratee` for each property. The iteratee is invoked* with three arguments: (value, key, object). Iteratee functions may exit* iteration early by explicitly returning `false`.** @static* @memberOf _* @since 0.3.0* @category Object* @param {Object} object The object to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Object} Returns `object`.* @see _.forInRight* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.forIn(new Foo, function(value, key) {* console.log(key);* });* // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).*/function forIn(object, iteratee) {return object == null? object: baseFor(object, castFunction(iteratee), keysIn);}module.exports = forIn;
var arrayEachRight = require('./_arrayEachRight'),baseEachRight = require('./_baseEachRight'),castFunction = require('./_castFunction'),isArray = require('./isArray');/*** This method is like `_.forEach` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @alias eachRight* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array|Object} Returns `collection`.* @see _.forEach* @example** _.forEachRight([1, 2], function(value) {* console.log(value);* });* // => Logs `2` then `1`.*/function forEachRight(collection, iteratee) {var func = isArray(collection) ? arrayEachRight : baseEachRight;return func(collection, castFunction(iteratee));}module.exports = forEachRight;
var arrayEach = require('./_arrayEach'),baseEach = require('./_baseEach'),castFunction = require('./_castFunction'),isArray = require('./isArray');/*** Iterates over elements of `collection` and invokes `iteratee` for each element.* The iteratee is invoked with three arguments: (value, index|key, collection).* Iteratee functions may exit iteration early by explicitly returning `false`.** **Note:** As with other "Collections" methods, objects with a "length"* property are iterated like arrays. To avoid this behavior use `_.forIn`* or `_.forOwn` for object iteration.** @static* @memberOf _* @since 0.1.0* @alias each* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array|Object} Returns `collection`.* @see _.forEachRight* @example** _.forEach([1, 2], function(value) {* console.log(value);* });* // => Logs `1` then `2`.** _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {* console.log(key);* });* // => Logs 'a' then 'b' (iteration order is not guaranteed).*/function forEach(collection, iteratee) {var func = isArray(collection) ? arrayEach : baseEach;return func(collection, castFunction(iteratee));}module.exports = forEach;
var createFlow = require('./_createFlow');/*** This method is like `_.flow` except that it creates a function that* invokes the given functions from right to left.** @static* @since 3.0.0* @memberOf _* @category Util* @param {...(Function|Function[])} [funcs] The functions to invoke.* @returns {Function} Returns the new composite function.* @see _.flow* @example** function square(n) {* return n * n;* }** var addSquare = _.flowRight([square, _.add]);* addSquare(1, 2);* // => 9*/var flowRight = createFlow(true);module.exports = flowRight;
var createFlow = require('./_createFlow');/*** Creates a function that returns the result of invoking the given functions* with the `this` binding of the created function, where each successive* invocation is supplied the return value of the previous.** @static* @memberOf _* @since 3.0.0* @category Util* @param {...(Function|Function[])} [funcs] The functions to invoke.* @returns {Function} Returns the new composite function.* @see _.flowRight* @example** function square(n) {* return n * n;* }** var addSquare = _.flow([_.add, square]);* addSquare(1, 2);* // => 9*/var flow = createFlow();module.exports = flow;
var createRound = require('./_createRound');/*** Computes `number` rounded down to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round down.* @param {number} [precision=0] The precision to round down to.* @returns {number} Returns the rounded down number.* @example** _.floor(4.006);* // => 4** _.floor(0.046, 2);* // => 0.04** _.floor(4060, -2);* // => 4000*/var floor = createRound('floor');module.exports = floor;
var createWrap = require('./_createWrap');/** Used to compose bitmasks for function metadata. */var WRAP_FLIP_FLAG = 512;/*** Creates a function that invokes `func` with arguments reversed.** @static* @memberOf _* @since 4.0.0* @category Function* @param {Function} func The function to flip arguments for.* @returns {Function} Returns the new flipped function.* @example** var flipped = _.flip(function() {* return _.toArray(arguments);* });** flipped('a', 'b', 'c', 'd');* // => ['d', 'c', 'b', 'a']*/function flip(func) {return createWrap(func, WRAP_FLIP_FLAG);}module.exports = flip;
var baseFlatten = require('./_baseFlatten'),toInteger = require('./toInteger');/*** Recursively flatten `array` up to `depth` times.** @static* @memberOf _* @since 4.4.0* @category Array* @param {Array} array The array to flatten.* @param {number} [depth=1] The maximum recursion depth.* @returns {Array} Returns the new flattened array.* @example** var array = [1, [2, [3, [4]], 5]];** _.flattenDepth(array, 1);* // => [1, 2, [3, [4]], 5]** _.flattenDepth(array, 2);* // => [1, 2, 3, [4], 5]*/function flattenDepth(array, depth) {var length = array == null ? 0 : array.length;if (!length) {return [];}depth = depth === undefined ? 1 : toInteger(depth);return baseFlatten(array, depth);}module.exports = flattenDepth;
var baseFlatten = require('./_baseFlatten');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/*** Recursively flattens `array`.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flattenDeep([1, [2, [3, [4]], 5]]);* // => [1, 2, 3, 4, 5]*/function flattenDeep(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, INFINITY) : [];}module.exports = flattenDeep;
var baseFlatten = require('./_baseFlatten');/*** Flattens `array` a single level deep.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flatten([1, [2, [3, [4]], 5]]);* // => [1, 2, [3, [4]], 5]*/function flatten(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, 1) : [];}module.exports = flatten;
var baseFlatten = require('./_baseFlatten'),map = require('./map'),toInteger = require('./toInteger');/*** This method is like `_.flatMap` except that it recursively flattens the* mapped results up to `depth` times.** @static* @memberOf _* @since 4.7.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {number} [depth=1] The maximum recursion depth.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [[[n, n]]];* }** _.flatMapDepth([1, 2], duplicate, 2);* // => [[1, 1], [2, 2]]*/function flatMapDepth(collection, iteratee, depth) {depth = depth === undefined ? 1 : toInteger(depth);return baseFlatten(map(collection, iteratee), depth);}module.exports = flatMapDepth;
var baseFlatten = require('./_baseFlatten'),map = require('./map');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/*** This method is like `_.flatMap` except that it recursively flattens the* mapped results.** @static* @memberOf _* @since 4.7.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [[[n, n]]];* }** _.flatMapDeep([1, 2], duplicate);* // => [1, 1, 2, 2]*/function flatMapDeep(collection, iteratee) {return baseFlatten(map(collection, iteratee), INFINITY);}module.exports = flatMapDeep;
var baseFlatten = require('./_baseFlatten'),map = require('./map');/*** Creates a flattened array of values by running each element in `collection`* thru `iteratee` and flattening the mapped results. The iteratee is invoked* with three arguments: (value, index|key, collection).** @static* @memberOf _* @since 4.0.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new flattened array.* @example** function duplicate(n) {* return [n, n];* }** _.flatMap([1, 2], duplicate);* // => [1, 1, 2, 2]*/function flatMap(collection, iteratee) {return baseFlatten(map(collection, iteratee), 1);}module.exports = flatMap;
module.exports = require('./head');
var baseFindKey = require('./_baseFindKey'),baseForOwnRight = require('./_baseForOwnRight'),baseIteratee = require('./_baseIteratee');/*** This method is like `_.findKey` except that it iterates over elements of* a collection in the opposite order.** @static* @memberOf _* @since 2.0.0* @category Object* @param {Object} object The object to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {string|undefined} Returns the key of the matched element,* else `undefined`.* @example** var users = {* 'barney': { 'age': 36, 'active': true },* 'fred': { 'age': 40, 'active': false },* 'pebbles': { 'age': 1, 'active': true }* };** _.findLastKey(users, function(o) { return o.age < 40; });* // => returns 'pebbles' assuming `_.findKey` returns 'barney'** // The `_.matches` iteratee shorthand.* _.findLastKey(users, { 'age': 36, 'active': true });* // => 'barney'** // The `_.matchesProperty` iteratee shorthand.* _.findLastKey(users, ['active', false]);* // => 'fred'** // The `_.property` iteratee shorthand.* _.findLastKey(users, 'active');* // => 'pebbles'*/function findLastKey(object, predicate) {return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight);}module.exports = findLastKey;
var baseFindIndex = require('./_baseFindIndex'),baseIteratee = require('./_baseIteratee'),toInteger = require('./toInteger');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max,nativeMin = Math.min;/*** This method is like `_.findIndex` except that it iterates over elements* of `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=array.length-1] The index to search from.* @returns {number} Returns the index of the found element, else `-1`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });* // => 2** // The `_.matches` iteratee shorthand.* _.findLastIndex(users, { 'user': 'barney', 'active': true });* // => 0** // The `_.matchesProperty` iteratee shorthand.* _.findLastIndex(users, ['active', false]);* // => 2** // The `_.property` iteratee shorthand.* _.findLastIndex(users, 'active');* // => 0*/function findLastIndex(array, predicate, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = length - 1;if (fromIndex !== undefined) {index = toInteger(fromIndex);index = fromIndex < 0? nativeMax(length + index, 0): nativeMin(index, length - 1);}return baseFindIndex(array, baseIteratee(predicate, 3), index, true);}module.exports = findLastIndex;
var createFind = require('./_createFind'),findLastIndex = require('./findLastIndex');/*** This method is like `_.find` except that it iterates over elements of* `collection` from right to left.** @static* @memberOf _* @since 2.0.0* @category Collection* @param {Array|Object} collection The collection to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=collection.length-1] The index to search from.* @returns {*} Returns the matched element, else `undefined`.* @example** _.findLast([1, 2, 3, 4], function(n) {* return n % 2 == 1;* });* // => 3*/var findLast = createFind(findLastIndex);module.exports = findLast;
var baseFindKey = require('./_baseFindKey'),baseForOwn = require('./_baseForOwn'),baseIteratee = require('./_baseIteratee');/*** This method is like `_.find` except that it returns the key of the first* element `predicate` returns truthy for instead of the element itself.** @static* @memberOf _* @since 1.1.0* @category Object* @param {Object} object The object to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {string|undefined} Returns the key of the matched element,* else `undefined`.* @example** var users = {* 'barney': { 'age': 36, 'active': true },* 'fred': { 'age': 40, 'active': false },* 'pebbles': { 'age': 1, 'active': true }* };** _.findKey(users, function(o) { return o.age < 40; });* // => 'barney' (iteration order is not guaranteed)** // The `_.matches` iteratee shorthand.* _.findKey(users, { 'age': 1, 'active': true });* // => 'pebbles'** // The `_.matchesProperty` iteratee shorthand.* _.findKey(users, ['active', false]);* // => 'fred'** // The `_.property` iteratee shorthand.* _.findKey(users, 'active');* // => 'barney'*/function findKey(object, predicate) {return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn);}module.exports = findKey;
var baseFindIndex = require('./_baseFindIndex'),baseIteratee = require('./_baseIteratee'),toInteger = require('./toInteger');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** This method is like `_.find` except that it returns the index of the first* element `predicate` returns truthy for instead of the element itself.** @static* @memberOf _* @since 1.1.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the found element, else `-1`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.findIndex(users, function(o) { return o.user == 'barney'; });* // => 0** // The `_.matches` iteratee shorthand.* _.findIndex(users, { 'user': 'fred', 'active': false });* // => 1** // The `_.matchesProperty` iteratee shorthand.* _.findIndex(users, ['active', false]);* // => 0** // The `_.property` iteratee shorthand.* _.findIndex(users, 'active');* // => 2*/function findIndex(array, predicate, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = fromIndex == null ? 0 : toInteger(fromIndex);if (index < 0) {index = nativeMax(length + index, 0);}return baseFindIndex(array, baseIteratee(predicate, 3), index);}module.exports = findIndex;
var createFind = require('./_createFind'),findIndex = require('./findIndex');/*** Iterates over elements of `collection`, returning the first element* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {*} Returns the matched element, else `undefined`.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false },* { 'user': 'pebbles', 'age': 1, 'active': true }* ];** _.find(users, function(o) { return o.age < 40; });* // => object for 'barney'** // The `_.matches` iteratee shorthand.* _.find(users, { 'age': 1, 'active': true });* // => object for 'pebbles'** // The `_.matchesProperty` iteratee shorthand.* _.find(users, ['active', false]);* // => object for 'fred'** // The `_.property` iteratee shorthand.* _.find(users, 'active');* // => object for 'barney'*/var find = createFind(findIndex);module.exports = find;
var arrayFilter = require('./_arrayFilter'),baseFilter = require('./_baseFilter'),baseIteratee = require('./_baseIteratee'),isArray = require('./isArray');/*** Iterates over elements of `collection`, returning an array of all elements* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** **Note:** Unlike `_.remove`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new filtered array.* @see _.reject* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** _.filter(users, function(o) { return !o.active; });* // => objects for ['fred']** // The `_.matches` iteratee shorthand.* _.filter(users, { 'age': 36, 'active': true });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, ['active', false]);* // => objects for ['fred']** // The `_.property` iteratee shorthand.* _.filter(users, 'active');* // => objects for ['barney']** // Combining several predicates using `_.overEvery` or `_.overSome`.* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));* // => objects for ['fred', 'barney']*/function filter(collection, predicate) {var func = isArray(collection) ? arrayFilter : baseFilter;return func(collection, baseIteratee(predicate, 3));}module.exports = filter;
var baseFill = require('./_baseFill'),isIterateeCall = require('./_isIterateeCall');/*** Fills elements of `array` with `value` from `start` up to, but not* including, `end`.** **Note:** This method mutates `array`.** @static* @memberOf _* @since 3.2.0* @category Array* @param {Array} array The array to fill.* @param {*} value The value to fill `array` with.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns `array`.* @example** var array = [1, 2, 3];** _.fill(array, 'a');* console.log(array);* // => ['a', 'a', 'a']** _.fill(Array(3), 2);* // => [2, 2, 2]** _.fill([4, 6, 8, 10], '*', 1, 3);* // => [4, '*', '*', 10]*/function fill(array, value, start, end) {var length = array == null ? 0 : array.length;if (!length) {return [];}if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {start = 0;end = length;}return baseFill(array, value, start, end);}module.exports = fill;
module.exports = require('./assignInWith');
module.exports = require('./assignIn');
var arrayEvery = require('./_arrayEvery'),baseEvery = require('./_baseEvery'),baseIteratee = require('./_baseIteratee'),isArray = require('./isArray'),isIterateeCall = require('./_isIterateeCall');/*** Checks if `predicate` returns truthy for **all** elements of `collection`.* Iteration is stopped once `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index|key, collection).** **Note:** This method returns `true` for* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of* elements of empty collections.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`.* @example** _.every([true, 1, null, 'yes'], Boolean);* // => false** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.every(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.every(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.every(users, 'active');* // => false*/function every(collection, predicate, guard) {var func = isArray(collection) ? arrayEvery : baseEvery;if (guard && isIterateeCall(collection, predicate, guard)) {predicate = undefined;}return func(collection, baseIteratee(predicate, 3));}module.exports = every;
var toString = require('./toString');/*** Used to match `RegExp`* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).*/var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,reHasRegExpChar = RegExp(reRegExpChar.source);/*** Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to escape.* @returns {string} Returns the escaped string.* @example** _.escapeRegExp('[lodash](https://lodash.com/)');* // => '\[lodash\]\(https://lodash\.com/\)'*/function escapeRegExp(string) {string = toString(string);return (string && reHasRegExpChar.test(string))? string.replace(reRegExpChar, '\\$&'): string;}module.exports = escapeRegExp;
var escapeHtmlChar = require('./_escapeHtmlChar'),toString = require('./toString');/** Used to match HTML entities and HTML characters. */var reUnescapedHtml = /[&<>"']/g,reHasUnescapedHtml = RegExp(reUnescapedHtml.source);/*** Converts the characters "&", "<", ">", '"', and "'" in `string` to their* corresponding HTML entities.** **Note:** No other characters are escaped. To escape additional* characters use a third-party library like [_he_](https://mths.be/he).** Though the ">" character is escaped for symmetry, characters like* ">" and "/" don't need escaping in HTML and have no special meaning* unless they're part of a tag or unquoted attribute value. See* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)* (under "semi-related fun fact") for more details.** When working with HTML you should always* [quote attribute values](http://wonko.com/post/html-escaping) to reduce* XSS vectors.** @static* @since 0.1.0* @memberOf _* @category String* @param {string} [string=''] The string to escape.* @returns {string} Returns the escaped string.* @example** _.escape('fred, barney, & pebbles');* // => 'fred, barney, & pebbles'*/function escape(string) {string = toString(string);return (string && reHasUnescapedHtml.test(string))? string.replace(reUnescapedHtml, escapeHtmlChar): string;}module.exports = escape;
/*** Performs a* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* comparison between two values to determine if they are equivalent.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.eq(object, object);* // => true** _.eq(object, other);* // => false** _.eq('a', 'a');* // => true** _.eq('a', Object('a'));* // => false** _.eq(NaN, NaN);* // => true*/function eq(value, other) {return value === other || (value !== value && other !== other);}module.exports = eq;
module.exports = require('./toPairsIn');
module.exports = require('./toPairs');
var baseClamp = require('./_baseClamp'),baseToString = require('./_baseToString'),toInteger = require('./toInteger'),toString = require('./toString');/*** Checks if `string` ends with the given target string.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to inspect.* @param {string} [target] The string to search for.* @param {number} [position=string.length] The position to search up to.* @returns {boolean} Returns `true` if `string` ends with `target`,* else `false`.* @example** _.endsWith('abc', 'c');* // => true** _.endsWith('abc', 'b');* // => false** _.endsWith('abc', 'b', 2);* // => true*/function endsWith(string, target, position) {string = toString(string);target = baseToString(target);var length = string.length;position = position === undefined? length: baseClamp(toInteger(position), 0, length);var end = position;position -= target.length;return position >= 0 && string.slice(position, end) == target;}module.exports = endsWith;
module.exports = require('./forEachRight');
module.exports = require('./forEach');
var baseIteratee = require('./_baseIteratee'),baseWhile = require('./_baseWhile');/*** Creates a slice of `array` excluding elements dropped from the beginning.* Elements are dropped until `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.dropWhile(users, function(o) { return !o.active; });* // => objects for ['pebbles']** // The `_.matches` iteratee shorthand.* _.dropWhile(users, { 'user': 'barney', 'active': false });* // => objects for ['fred', 'pebbles']** // The `_.matchesProperty` iteratee shorthand.* _.dropWhile(users, ['active', false]);* // => objects for ['pebbles']** // The `_.property` iteratee shorthand.* _.dropWhile(users, 'active');* // => objects for ['barney', 'fred', 'pebbles']*/function dropWhile(array, predicate) {return (array && array.length)? baseWhile(array, baseIteratee(predicate, 3), true): [];}module.exports = dropWhile;
var baseIteratee = require('./_baseIteratee'),baseWhile = require('./_baseWhile');/*** Creates a slice of `array` excluding elements dropped from the end.* Elements are dropped until `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index, array).** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the slice of `array`.* @example** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': false }* ];** _.dropRightWhile(users, function(o) { return !o.active; });* // => objects for ['barney']** // The `_.matches` iteratee shorthand.* _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });* // => objects for ['barney', 'fred']** // The `_.matchesProperty` iteratee shorthand.* _.dropRightWhile(users, ['active', false]);* // => objects for ['barney']** // The `_.property` iteratee shorthand.* _.dropRightWhile(users, 'active');* // => objects for ['barney', 'fred', 'pebbles']*/function dropRightWhile(array, predicate) {return (array && array.length)? baseWhile(array, baseIteratee(predicate, 3), true, true): [];}module.exports = dropRightWhile;
var baseSlice = require('./_baseSlice'),toInteger = require('./toInteger');/*** Creates a slice of `array` with `n` elements dropped from the end.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to drop.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.dropRight([1, 2, 3]);* // => [1, 2]** _.dropRight([1, 2, 3], 2);* // => [1]** _.dropRight([1, 2, 3], 5);* // => []** _.dropRight([1, 2, 3], 0);* // => [1, 2, 3]*/function dropRight(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);n = length - n;return baseSlice(array, 0, n < 0 ? 0 : n);}module.exports = dropRight;
var baseSlice = require('./_baseSlice'),toInteger = require('./toInteger');/*** Creates a slice of `array` with `n` elements dropped from the beginning.** @static* @memberOf _* @since 0.5.0* @category Array* @param {Array} array The array to query.* @param {number} [n=1] The number of elements to drop.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the slice of `array`.* @example** _.drop([1, 2, 3]);* // => [2, 3]** _.drop([1, 2, 3], 2);* // => [3]** _.drop([1, 2, 3], 5);* // => []** _.drop([1, 2, 3], 0);* // => [1, 2, 3]*/function drop(array, n, guard) {var length = array == null ? 0 : array.length;if (!length) {return [];}n = (guard || n === undefined) ? 1 : toInteger(n);return baseSlice(array, n < 0 ? 0 : n, length);}module.exports = drop;
var createMathOperation = require('./_createMathOperation');/*** Divide two numbers.** @static* @memberOf _* @since 4.7.0* @category Math* @param {number} dividend The first number in a division.* @param {number} divisor The second number in a division.* @returns {number} Returns the quotient.* @example** _.divide(6, 4);* // => 1.5*/var divide = createMathOperation(function(dividend, divisor) {return dividend / divisor;}, 1);module.exports = divide;
var baseDifference = require('./_baseDifference'),baseFlatten = require('./_baseFlatten'),baseRest = require('./_baseRest'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.difference` except that it accepts `comparator`* which is invoked to compare elements of `array` to `values`. The order and* references of result values are determined by the first array. The comparator* is invoked with two arguments: (arrVal, othVal).** **Note:** Unlike `_.pullAllWith`, this method returns a new array.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];** _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);* // => [{ 'x': 2, 'y': 1 }]*/var differenceWith = baseRest(function(array, values) {var comparator = last(values);if (isArrayLikeObject(comparator)) {comparator = undefined;}return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator): [];});module.exports = differenceWith;
var baseDifference = require('./_baseDifference'),baseFlatten = require('./_baseFlatten'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),isArrayLikeObject = require('./isArrayLikeObject'),last = require('./last');/*** This method is like `_.difference` except that it accepts `iteratee` which* is invoked for each element of `array` and `values` to generate the criterion* by which they're compared. The order and references of result values are* determined by the first array. The iteratee is invoked with one argument:* (value).** **Note:** Unlike `_.pullAllBy`, this method returns a new array.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @param {Function} [iteratee=_.identity] The iteratee invoked per element.* @returns {Array} Returns the new array of filtered values.* @example** _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);* // => [1.2]** // The `_.property` iteratee shorthand.* _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');* // => [{ 'x': 2 }]*/var differenceBy = baseRest(function(array, values) {var iteratee = last(values);if (isArrayLikeObject(iteratee)) {iteratee = undefined;}return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)): [];});module.exports = differenceBy;
var baseDifference = require('./_baseDifference'),baseFlatten = require('./_baseFlatten'),baseRest = require('./_baseRest'),isArrayLikeObject = require('./isArrayLikeObject');/*** Creates an array of `array` values not included in the other given arrays* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. The order and references of result values are* determined by the first array.** **Note:** Unlike `_.pullAll`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {...Array} [values] The values to exclude.* @returns {Array} Returns the new array of filtered values.* @see _.without, _.xor* @example** _.difference([2, 1], [2, 3]);* // => [1]*/var difference = baseRest(function(array, values) {return isArrayLikeObject(array)? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)): [];});module.exports = difference;
var baseDelay = require('./_baseDelay'),baseRest = require('./_baseRest'),toNumber = require('./toNumber');/*** Invokes `func` after `wait` milliseconds. Any additional arguments are* provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.delay(function(text) {* console.log(text);* }, 1000, 'later');* // => Logs 'later' after one second.*/var delay = baseRest(function(func, wait, args) {return baseDelay(func, toNumber(wait) || 0, args);});module.exports = delay;
var baseDelay = require('./_baseDelay'),baseRest = require('./_baseRest');/*** Defers invoking the `func` until the current call stack has cleared. Any* additional arguments are provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to defer.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.defer(function(text) {* console.log(text);* }, 'deferred');* // => Logs 'deferred' after one millisecond.*/var defer = baseRest(function(func, args) {return baseDelay(func, 1, args);});module.exports = defer;
var apply = require('./_apply'),baseRest = require('./_baseRest'),customDefaultsMerge = require('./_customDefaultsMerge'),mergeWith = require('./mergeWith');/*** This method is like `_.defaults` except that it recursively assigns* default properties.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 3.10.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.defaults* @example** _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });* // => { 'a': { 'b': 2, 'c': 3 } }*/var defaultsDeep = baseRest(function(args) {args.push(undefined, customDefaultsMerge);return apply(mergeWith, undefined, args);});module.exports = defaultsDeep;
var baseRest = require('./_baseRest'),eq = require('./eq'),isIterateeCall = require('./_isIterateeCall'),keysIn = require('./keysIn');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Assigns own and inherited enumerable string keyed properties of source* objects to the destination object for all destination properties that* resolve to `undefined`. Source objects are applied from left to right.* Once a property is set, additional values of the same property are ignored.** **Note:** This method mutates `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.defaultsDeep* @example** _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var defaults = baseRest(function(object, sources) {object = Object(object);var index = -1;var length = sources.length;var guard = length > 2 ? sources[2] : undefined;if (guard && isIterateeCall(sources[0], sources[1], guard)) {length = 1;}while (++index < length) {var source = sources[index];var props = keysIn(source);var propsIndex = -1;var propsLength = props.length;while (++propsIndex < propsLength) {var key = props[propsIndex];var value = object[key];if (value === undefined ||(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {object[key] = source[key];}}}return object;});module.exports = defaults;
/*** Checks `value` to determine whether a default value should be returned in* its place. The `defaultValue` is returned if `value` is `NaN`, `null`,* or `undefined`.** @static* @memberOf _* @since 4.14.0* @category Util* @param {*} value The value to check.* @param {*} defaultValue The default value.* @returns {*} Returns the resolved value.* @example** _.defaultTo(1, 10);* // => 1** _.defaultTo(undefined, 10);* // => 10*/function defaultTo(value, defaultValue) {return (value == null || value !== value) ? defaultValue : value;}module.exports = defaultTo;
var deburrLetter = require('./_deburrLetter'),toString = require('./toString');/** Used to match Latin Unicode letters (excluding mathematical operators). */var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;/** Used to compose unicode character classes. */var rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;/** Used to compose unicode capture groups. */var rsCombo = '[' + rsComboRange + ']';/*** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).*/var reComboMark = RegExp(rsCombo, 'g');/*** Deburrs `string` by converting* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)* letters to basic Latin letters and removing* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to deburr.* @returns {string} Returns the deburred string.* @example** _.deburr('déjà vu');* // => 'deja vu'*/function deburr(string) {string = toString(string);return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');}module.exports = deburr;
var isObject = require('./isObject'),now = require('./now'),toNumber = require('./toNumber');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max,nativeMin = Math.min;/*** Creates a debounced function that delays invoking `func` until after `wait`* milliseconds have elapsed since the last time the debounced function was* invoked. The debounced function comes with a `cancel` method to cancel* delayed `func` invocations and a `flush` method to immediately invoke them.* Provide `options` to indicate whether `func` should be invoked on the* leading and/or trailing edge of the `wait` timeout. The `func` is invoked* with the last arguments provided to the debounced function. Subsequent* calls to the debounced function return the result of the last `func`* invocation.** **Note:** If `leading` and `trailing` options are `true`, `func` is* invoked on the trailing edge of the timeout only if the debounced function* is invoked more than once during the `wait` timeout.** If `wait` is `0` and `leading` is `false`, `func` invocation is deferred* until to the next tick, similar to `setTimeout` with a timeout of `0`.** See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)* for details over the differences between `_.debounce` and `_.throttle`.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to debounce.* @param {number} [wait=0] The number of milliseconds to delay.* @param {Object} [options={}] The options object.* @param {boolean} [options.leading=false]* Specify invoking on the leading edge of the timeout.* @param {number} [options.maxWait]* The maximum time `func` is allowed to be delayed before it's invoked.* @param {boolean} [options.trailing=true]* Specify invoking on the trailing edge of the timeout.* @returns {Function} Returns the new debounced function.* @example** // Avoid costly calculations while the window size is in flux.* jQuery(window).on('resize', _.debounce(calculateLayout, 150));** // Invoke `sendMail` when clicked, debouncing subsequent calls.* jQuery(element).on('click', _.debounce(sendMail, 300, {* 'leading': true,* 'trailing': false* }));** // Ensure `batchLog` is invoked once after 1 second of debounced calls.* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });* var source = new EventSource('/stream');* jQuery(source).on('message', debounced);** // Cancel the trailing debounced invocation.* jQuery(window).on('popstate', debounced.cancel);*/function debounce(func, wait, options) {var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime = 0,leading = false,maxing = false,trailing = true;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}wait = toNumber(wait) || 0;if (isObject(options)) {leading = !!options.leading;maxing = 'maxWait' in options;maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;trailing = 'trailing' in options ? !!options.trailing : trailing;}function invokeFunc(time) {var args = lastArgs,thisArg = lastThis;lastArgs = lastThis = undefined;lastInvokeTime = time;result = func.apply(thisArg, args);return result;}function leadingEdge(time) {// Reset any `maxWait` timer.lastInvokeTime = time;// Start the timer for the trailing edge.timerId = setTimeout(timerExpired, wait);// Invoke the leading edge.return leading ? invokeFunc(time) : result;}function remainingWait(time) {var timeSinceLastCall = time - lastCallTime,timeSinceLastInvoke = time - lastInvokeTime,timeWaiting = wait - timeSinceLastCall;return maxing? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke): timeWaiting;}function shouldInvoke(time) {var timeSinceLastCall = time - lastCallTime,timeSinceLastInvoke = time - lastInvokeTime;// Either this is the first call, activity has stopped and we're at the// trailing edge, the system time has gone backwards and we're treating// it as the trailing edge, or we've hit the `maxWait` limit.return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));}function timerExpired() {var time = now();if (shouldInvoke(time)) {return trailingEdge(time);}// Restart the timer.timerId = setTimeout(timerExpired, remainingWait(time));}function trailingEdge(time) {timerId = undefined;// Only invoke if we have `lastArgs` which means `func` has been// debounced at least once.if (trailing && lastArgs) {return invokeFunc(time);}lastArgs = lastThis = undefined;return result;}function cancel() {if (timerId !== undefined) {clearTimeout(timerId);}lastInvokeTime = 0;lastArgs = lastCallTime = lastThis = timerId = undefined;}function flush() {return timerId === undefined ? result : trailingEdge(now());}function debounced() {var time = now(),isInvoking = shouldInvoke(time);lastArgs = arguments;lastThis = this;lastCallTime = time;if (isInvoking) {if (timerId === undefined) {return leadingEdge(lastCallTime);}if (maxing) {// Handle invocations in a tight loop.clearTimeout(timerId);timerId = setTimeout(timerExpired, wait);return invokeFunc(lastCallTime);}}if (timerId === undefined) {timerId = setTimeout(timerExpired, wait);}return result;}debounced.cancel = cancel;debounced.flush = flush;return debounced;}module.exports = debounce;
module.exports = {'now': require('./now')};
var createWrap = require('./_createWrap');/** Used to compose bitmasks for function metadata. */var WRAP_CURRY_RIGHT_FLAG = 16;/*** This method is like `_.curry` except that arguments are applied to `func`* in the manner of `_.partialRight` instead of `_.partial`.** The `_.curryRight.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for provided arguments.** **Note:** This method doesn't set the "length" property of curried functions.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to curry.* @param {number} [arity=func.length] The arity of `func`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new curried function.* @example** var abc = function(a, b, c) {* return [a, b, c];* };** var curried = _.curryRight(abc);** curried(3)(2)(1);* // => [1, 2, 3]** curried(2, 3)(1);* // => [1, 2, 3]** curried(1, 2, 3);* // => [1, 2, 3]** // Curried with placeholders.* curried(3)(1, _)(2);* // => [1, 2, 3]*/function curryRight(func, arity, guard) {arity = guard ? undefined : arity;var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);result.placeholder = curryRight.placeholder;return result;}// Assign default placeholders.curryRight.placeholder = {};module.exports = curryRight;
var createWrap = require('./_createWrap');/** Used to compose bitmasks for function metadata. */var WRAP_CURRY_FLAG = 8;/*** Creates a function that accepts arguments of `func` and either invokes* `func` returning its result, if at least `arity` number of arguments have* been provided, or returns a function that accepts the remaining `func`* arguments, and so on. The arity of `func` may be specified if `func.length`* is not sufficient.** The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,* may be used as a placeholder for provided arguments.** **Note:** This method doesn't set the "length" property of curried functions.** @static* @memberOf _* @since 2.0.0* @category Function* @param {Function} func The function to curry.* @param {number} [arity=func.length] The arity of `func`.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new curried function.* @example** var abc = function(a, b, c) {* return [a, b, c];* };** var curried = _.curry(abc);** curried(1)(2)(3);* // => [1, 2, 3]** curried(1, 2)(3);* // => [1, 2, 3]** curried(1, 2, 3);* // => [1, 2, 3]** // Curried with placeholders.* curried(1)(_, 3)(2);* // => [1, 2, 3]*/function curry(func, arity, guard) {arity = guard ? undefined : arity;var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);result.placeholder = curry.placeholder;return result;}// Assign default placeholders.curry.placeholder = {};module.exports = curry;
var baseAssign = require('./_baseAssign'),baseCreate = require('./_baseCreate');/*** Creates an object that inherits from the `prototype` object. If a* `properties` object is given, its own enumerable string keyed properties* are assigned to the created object.** @static* @memberOf _* @since 2.3.0* @category Object* @param {Object} prototype The object to inherit from.* @param {Object} [properties] The properties to assign to the object.* @returns {Object} Returns the new object.* @example** function Shape() {* this.x = 0;* this.y = 0;* }** function Circle() {* Shape.call(this);* }** Circle.prototype = _.create(Shape.prototype, {* 'constructor': Circle* });** var circle = new Circle;* circle instanceof Circle;* // => true** circle instanceof Shape;* // => true*/function create(prototype, properties) {var result = baseCreate(prototype);return properties == null ? result : baseAssign(result, properties);}module.exports = create;
var baseAssignValue = require('./_baseAssignValue'),createAggregator = require('./_createAggregator');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Creates an object composed of keys generated from the results of running* each element of `collection` thru `iteratee`. The corresponding value of* each key is the number of times the key was returned by `iteratee`. The* iteratee is invoked with one argument: (value).** @static* @memberOf _* @since 0.5.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The iteratee to transform keys.* @returns {Object} Returns the composed aggregate object.* @example** _.countBy([6.1, 4.2, 6.3], Math.floor);* // => { '4': 1, '6': 2 }** // The `_.property` iteratee shorthand.* _.countBy(['one', 'two', 'three'], 'length');* // => { '3': 2, '5': 1 }*/var countBy = createAggregator(function(result, value, key) {if (hasOwnProperty.call(result, key)) {++result[key];} else {baseAssignValue(result, key, 1);}});module.exports = countBy;
/*** @license* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE* Build: `lodash core -o ./dist/lodash.core.js`*/;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r,e){for(var u=n.length,o=r+(e?1:-1);e?o--:++o<u;)if(t(n[o],o,n))return o;return-1}function r(n){return function(t){return null==t?nt:t[n]}}function e(n){return function(t){return null==n?nt:n[t]}}function u(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function o(n,t){return E(t,function(t){return n[t]})}function i(n,t){return function(r){return n(t(r))}}function c(n){return n instanceof f?n:new f(n)}function f(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function a(n,t,r){var e=n[t];Rt.call(n,t)&&wn(e,r)&&(r!==nt||t in n)||l(n,t,r)}function l(n,t,r){n[t]=r}function p(n,t,r){if(typeof n!="function")throw new TypeError(rt);return setTimeout(function(){n.apply(nt,r)},t)}function s(n,t){var r=true;return Ut(n,function(n,e,u){return r=!!t(n,e,u)}),r}function h(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===nt?i===i&&true:r(i,c)))var c=i,f=o}return f}function v(n,t){var r=[];return Ut(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function y(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=H),o||(o=[]);++i<c;){var f=t[i];r>0&&e(f)?r>1?y(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function g(n,t){return n&&Vt(n,t,cr)}function _(n,t){return v(t,function(t){return Tn(n[t])})}function b(n){return W(n)}function j(n,t){return n>t}function d(n){return In(n)&&b(n)==ht}function m(n,t,r,e,u){return n===t||(null==n||null==t||!In(n)&&!In(t)?n!==n&&t!==t:O(n,t,r,e,m,u))}function O(n,t,r,e,u,o){var i=Zt(n),c=Zt(t),f=i?lt:b(n),a=c?lt:b(t);f=f==at?bt:f,a=a==at?bt:a;var l=f==bt,p=a==bt,s=f==a;o||(o=[]);var h=Lt(o,function(t){return t[0]==n}),v=Lt(o,function(n){return n[0]==t});if(h&&v)return h[1]==t;if(o.push([n,t]),o.push([t,n]),s&&!l){var y=i?J(n,t,r,e,u,o):M(n,t,f,r,e,u,o);return o.pop(),y}if(!(r&et)){var g=l&&Rt.call(n,"__wrapped__"),_=p&&Rt.call(t,"__wrapped__");if(g||_){var j=g?n.value():n,d=_?t.value():t,y=u(j,d,r,e,o);return o.pop(),y}}if(!s)return false;var y=U(n,t,r,e,u,o);return o.pop(),y}function x(n){return In(n)&&b(n)==dt}function w(n){return typeof n=="function"?n:null==n?Hn:(typeof n=="object"?N:r)(n)}function A(n,t){return n<t}function E(n,t){var r=-1,e=An(n)?Array(n.length):[];return Ut(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function N(n){var t=Gt(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&m(n[u],r[u],et|ut)))return false}return true}}function k(n,t){return n=Object(n),gn(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function F(n,t){return Kt(X(n,t,Hn),n+"")}function T(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(u);++e<u;)o[e]=n[e+t];return o}function S(n){return T(n,0,n.length)}function B(n,t){var r;return Ut(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function I(t,r){var e=t;return gn(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},e)}function R(n,t){if(n!==t){var r=n!==nt,e=null===n,u=n===n,o=false,i=t!==nt,c=null===t,f=t===t,a=false;if(!c&&!a&&!o&&n>t||o&&i&&f&&!c&&!a||e&&i&&f||!r&&f||!u)return 1;if(!e&&!o&&!a&&n<t||a&&r&&u&&!e&&!o||c&&r&&u||!i&&u||!f)return-1}return 0}function $(n,t,r,e){var u=!r;r||(r={});for(var o=-1,i=t.length;++o<i;){var c=t[o],f=e?e(r[c],n[c],c,r,n):nt;f===nt&&(f=n[c]),u?l(r,c,f):a(r,c,f)}return r}function q(n){return F(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:nt;for(o=n.length>3&&typeof o=="function"?(u--,o):nt,t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function D(n,t){return function(r,e){if(null==r)return r;if(!An(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&e(i[o],o,i)!==false;);return r}}function P(n){return function(t,r,e){for(var u=-1,o=Object(t),i=e(t),c=i.length;c--;){var f=i[n?c:++u];if(r(o[f],f,o)===false)break}return t}}function z(n){return function(){var t=arguments,r=Mt(n.prototype),e=n.apply(r,t);return Bn(e)?e:r}}function C(n){return function(t,r,e){var u=Object(t);if(!An(t)){var o=w(r,3);t=cr(t),r=function(n){return o(u[n],n,u)}}var i=n(t,r,e);return i>-1?u[o?t[i]:i]:nt}}function G(n,t,r,e){function u(){for(var t=-1,c=arguments.length,f=-1,a=e.length,l=Array(a+c),p=this&&this!==kt&&this instanceof u?i:n;++f<a;)l[f]=e[f];for(;c--;)l[f++]=arguments[++t];return p.apply(o?r:this,l)}if(typeof n!="function")throw new TypeError(rt);var o=t&ot,i=z(n);return u}function J(n,t,r,e,u,o){var i=r&et,c=n.length,f=t.length;if(c!=f&&!(i&&f>c))return false;var a=o.get(n),l=o.get(t);if(a&&l)return a==t&&l==n;for(var p=-1,s=true,h=r&ut?[]:nt;++p<c;){var v,y=n[p],g=t[p];if(v!==nt){if(v)continue;s=false;break}if(h){if(!B(t,function(n,t){if(!un(h,t)&&(y===n||u(y,n,r,e,o)))return h.push(t)})){s=false;break}}else if(y!==g&&!u(y,g,r,e,o)){s=false;break;}}return s}function M(n,t,r,e,u,o,i){switch(r){case st:case ht:case _t:return wn(+n,+t);case vt:return n.name==t.name&&n.message==t.message;case dt:case mt:return n==t+""}return false}function U(n,t,r,e,u,o){var i=r&et,c=cr(n),f=c.length;if(f!=cr(t).length&&!i)return false;for(var a=f;a--;){var l=c[a];if(!(i?l in t:Rt.call(t,l)))return false}var p=o.get(n),s=o.get(t);if(p&&s)return p==t&&s==n;for(var h=true,v=i;++a<f;){l=c[a];var y,g=n[l],_=t[l];if(!(y===nt?g===_||u(g,_,r,e,o):y)){h=false;break}v||(v="constructor"==l);}if(h&&!v){var b=n.constructor,j=t.constructor;b!=j&&"constructor"in n&&"constructor"in t&&!(typeof b=="function"&&b instanceof b&&typeof j=="function"&&j instanceof j)&&(h=false)}return h}function V(n){return Kt(X(n,nt,tn),n+"")}function H(n){return Zt(n)||Yt(n)}function K(n,t){var r=typeof n;return t=null==t?ft:t,!!t&&("number"==r||"symbol"!=r&&wt.test(n))&&n>-1&&n%1==0&&n<t}function L(n,t,r){if(!Bn(r))return false;var e=typeof t;return!!("number"==e?An(r)&&K(t,r.length):"string"==e&&t in r)&&wn(r[t],n);}function Q(n){var t=[];if(null!=n)for(var r in Object(n))t.push(r);return t}function W(n){return qt.call(n)}function X(n,t,r){return t=Jt(t===nt?n.length-1:t,0),function(){for(var e=arguments,u=-1,o=Jt(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];u=-1;for(var c=Array(t+1);++u<t;)c[u]=e[u];return c[t]=r(i),n.apply(this,c)}}function Y(n){return v(n,Boolean)}function Z(){var t=arguments.length;if(!t)return[];for(var r=Array(t-1),e=arguments[0],u=t;u--;)r[u-1]=arguments[u];return n(Zt(e)?S(e):[e],y(r,1));}function nn(n,r,e){var u=null==n?0:n.length;if(!u)return-1;var o=null==e?0:rr(e);return o<0&&(o=Jt(u+o,0)),t(n,w(r,3),o)}function tn(n){return(null==n?0:n.length)?y(n,1):[]}function rn(n){return(null==n?0:n.length)?y(n,ct):[]}function en(n){return n&&n.length?n[0]:nt}function un(n,t,r){var e=null==n?0:n.length;r=typeof r=="number"?r<0?Jt(e+r,0):r:0;for(var u=(r||0)-1,o=t===t;++u<e;){var i=n[u];if(o?i===t:i!==i)return u}return-1}function on(n){var t=null==n?0:n.length;return t?n[t-1]:nt}function cn(n,t,r){var e=null==n?0:n.length;return t=null==t?0:+t,r=r===nt?e:+r,e?T(n,t,r):[]}function fn(n){var t=c(n);return t.__chain__=true,t}function an(n,t){return t(n),n}function ln(n,t){return t(n)}function pn(){return I(this.__wrapped__,this.__actions__)}function sn(n,t,r){return t=r?nt:t,s(n,w(t))}function hn(n,t){return v(n,w(t))}function vn(n,t){return Ut(n,w(t))}function yn(n,t){return E(n,w(t))}function gn(n,t,r){return u(n,w(t),r,arguments.length<3,Ut)}function _n(n){return null==n?0:(n=An(n)?n:Gt(n),n.length);}function bn(n,t,r){return t=r?nt:t,B(n,w(t))}function jn(n,t){var e=0;return t=w(t),E(E(n,function(n,r,u){return{value:n,index:e++,criteria:t(n,r,u)}}).sort(function(n,t){return R(n.criteria,t.criteria)||n.index-t.index}),r("value"))}function dn(n,t){var r;if(typeof t!="function")throw new TypeError(rt);return n=rr(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=nt),r}}function mn(n){if(typeof n!="function")throw new TypeError(rt);return function(){return!n.apply(this,arguments)};}function On(n){return dn(2,n)}function xn(n){return Bn(n)?Zt(n)?S(n):$(n,Gt(n)):n}function wn(n,t){return n===t||n!==n&&t!==t}function An(n){return null!=n&&Sn(n.length)&&!Tn(n)}function En(n){return n===true||n===false||In(n)&&b(n)==st}function Nn(n){return An(n)&&(Zt(n)||Dn(n)||Tn(n.splice)||Yt(n))?!n.length:!Gt(n).length}function kn(n,t){return m(n,t)}function Fn(n){return typeof n=="number"&&Ct(n)}function Tn(n){if(!Bn(n))return false;var t=b(n);return t==yt||t==gt||t==pt||t==jt}function Sn(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ft;}function Bn(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function In(n){return null!=n&&typeof n=="object"}function Rn(n){return qn(n)&&n!=+n}function $n(n){return null===n}function qn(n){return typeof n=="number"||In(n)&&b(n)==_t}function Dn(n){return typeof n=="string"||!Zt(n)&&In(n)&&b(n)==mt}function Pn(n){return n===nt}function zn(n){return An(n)?n.length?S(n):[]:Un(n)}function Cn(n){return typeof n=="string"?n:null==n?"":n+""}function Gn(n,t){var r=Mt(n);return null==t?r:ur(r,t);}function Jn(n,t){return null!=n&&Rt.call(n,t)}function Mn(n,t,r){var e=null==n?nt:n[t];return e===nt&&(e=r),Tn(e)?e.call(n):e}function Un(n){return null==n?[]:o(n,cr(n))}function Vn(n){return n=Cn(n),n&&xt.test(n)?n.replace(Ot,St):n}function Hn(n){return n}function Kn(n){return N(ur({},n))}function Ln(t,r,e){var u=cr(r),o=_(r,u);null!=e||Bn(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=_(r,cr(r)));var i=!(Bn(e)&&"chain"in e&&!e.chain),c=Tn(t);return Ut(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=S(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}function Qn(){return kt._===this&&(kt._=Dt),this}function Wn(){}function Xn(n){var t=++$t;return Cn(n)+t}function Yn(n){return n&&n.length?h(n,Hn,j):nt}function Zn(n){return n&&n.length?h(n,Hn,A):nt}var nt,tt="4.17.20",rt="Expected a function",et=1,ut=2,ot=1,it=32,ct=1/0,ft=9007199254740991,at="[object Arguments]",lt="[object Array]",pt="[object AsyncFunction]",st="[object Boolean]",ht="[object Date]",vt="[object Error]",yt="[object Function]",gt="[object GeneratorFunction]",_t="[object Number]",bt="[object Object]",jt="[object Proxy]",dt="[object RegExp]",mt="[object String]",Ot=/[&<>"']/g,xt=RegExp(Ot.source),wt=/^(?:0|[1-9]\d*)$/,At={"&":"&","<":"<",">":">",'"':""","'":"'"},Et=typeof global=="object"&&global&&global.Object===Object&&global,Nt=typeof self=="object"&&self&&self.Object===Object&&self,kt=Et||Nt||Function("return this")(),Ft=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tt=Ft&&typeof module=="object"&&module&&!module.nodeType&&module,St=e(At),Bt=Array.prototype,It=Object.prototype,Rt=It.hasOwnProperty,$t=0,qt=It.toString,Dt=kt._,Pt=Object.create,zt=It.propertyIsEnumerable,Ct=kt.isFinite,Gt=i(Object.keys,Object),Jt=Math.max,Mt=function(){function n(){}return function(t){if(!Bn(t))return{};if(Pt)return Pt(t);n.prototype=t;var r=new n;return n.prototype=nt,r}}();f.prototype=Mt(c.prototype),f.prototype.constructor=f;var Ut=D(g),Vt=P(),Ht=Wn,Kt=Hn,Lt=C(nn),Qt=F(function(n,t,r){return G(n,ot|it,t,r)}),Wt=F(function(n,t){return p(n,1,t)}),Xt=F(function(n,t,r){return p(n,er(t)||0,r)}),Yt=Ht(function(){return arguments}())?Ht:function(n){return In(n)&&Rt.call(n,"callee")&&!zt.call(n,"callee")},Zt=Array.isArray,nr=d,tr=x,rr=Number,er=Number,ur=q(function(n,t){$(t,Gt(t),n)}),or=q(function(n,t){$(t,Q(t),n)}),ir=F(function(n,t){n=Object(n);var r=-1,e=t.length,u=e>2?t[2]:nt;for(u&&L(t[0],t[1],u)&&(e=1);++r<e;)for(var o=t[r],i=fr(o),c=-1,f=i.length;++c<f;){var a=i[c],l=n[a];(l===nt||wn(l,It[a])&&!Rt.call(n,a))&&(n[a]=o[a])}return n}),cr=Gt,fr=Q,ar=V(function(n,t){return null==n?{}:k(n,t)}),lr=w;c.assignIn=or,c.before=dn,c.bind=Qt,c.chain=fn,c.compact=Y,c.concat=Z,c.create=Gn,c.defaults=ir,c.defer=Wt,c.delay=Xt,c.filter=hn,c.flatten=tn,c.flattenDeep=rn,c.iteratee=lr,c.keys=cr,c.map=yn,c.matches=Kn,c.mixin=Ln,c.negate=mn,c.once=On,c.pick=ar,c.slice=cn,c.sortBy=jn,c.tap=an,c.thru=ln,c.toArray=zn,c.values=Un,c.extend=or,Ln(c,c),c.clone=xn,c.escape=Vn,c.every=sn,c.find=Lt,c.forEach=vn,c.has=Jn,c.head=en,c.identity=Hn,c.indexOf=un,c.isArguments=Yt,c.isArray=Zt,c.isBoolean=En,c.isDate=nr,c.isEmpty=Nn,c.isEqual=kn,c.isFinite=Fn,c.isFunction=Tn,c.isNaN=Rn,c.isNull=$n,c.isNumber=qn,c.isObject=Bn,c.isRegExp=tr,c.isString=Dn,c.isUndefined=Pn,c.last=on,c.max=Yn,c.min=Zn,c.noConflict=Qn,c.noop=Wn,c.reduce=gn,c.result=Mn,c.size=_n,c.some=bn,c.uniqueId=Xn,c.each=vn,c.first=en,Ln(c,function(){var n={};return g(c,function(t,r){Rt.call(c.prototype,r)||(n[r]=t)}),n}(),{chain:false}),c.VERSION=tt,Ut(["pop","join","replace","reverse","split","push","shift","sort","splice","unshift"],function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:Bt)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);c.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Zt(u)?u:[],n)}return this[r](function(r){return t.apply(Zt(r)?r:[],n)})}}),c.prototype.toJSON=c.prototype.valueOf=c.prototype.value=pn,typeof define=="function"&&typeof define.amd=="object"&&define.amd?(kt._=c, define(function(){return c})):Tt?((Tt.exports=c)._=c,Ft._=c):kt._=c}).call(this);
/*** @license* Lodash (Custom Build) <https://lodash.com/>* Build: `lodash core -o ./dist/lodash.core.js`* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>* Released under MIT license <https://lodash.com/license>* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors*/;(function() {/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined;/** Used as the semantic version number. */var VERSION = '4.17.20';/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_PARTIAL_FLAG = 32;/** Used as references for various `Number` constants. */var INFINITY = 1 / 0,MAX_SAFE_INTEGER = 9007199254740991;/** `Object#toString` result references. */var argsTag = '[object Arguments]',arrayTag = '[object Array]',asyncTag = '[object AsyncFunction]',boolTag = '[object Boolean]',dateTag = '[object Date]',errorTag = '[object Error]',funcTag = '[object Function]',genTag = '[object GeneratorFunction]',numberTag = '[object Number]',objectTag = '[object Object]',proxyTag = '[object Proxy]',regexpTag = '[object RegExp]',stringTag = '[object String]';/** Used to match HTML entities and HTML characters. */var reUnescapedHtml = /[&<>"']/g,reHasUnescapedHtml = RegExp(reUnescapedHtml.source);/** Used to detect unsigned integer values. */var reIsUint = /^(?:0|[1-9]\d*)$/;/** Used to map characters to HTML entities. */var htmlEscapes = {'&': '&','<': '<','>': '>','"': '"',"'": '''};/** Detect free variable `global` from Node.js. */var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;/** Detect free variable `self`. */var freeSelf = typeof self == 'object' && self && self.Object === Object && self;/** Used as a reference to the global object. */var root = freeGlobal || freeSelf || Function('return this')();/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/*--------------------------------------------------------------------------*//*** Appends the elements of `values` to `array`.** @private* @param {Array} array The array to modify.* @param {Array} values The values to append.* @returns {Array} Returns `array`.*/function arrayPush(array, values) {array.push.apply(array, values);return array;}/*** The base implementation of `_.findIndex` and `_.findLastIndex` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} predicate The function invoked per iteration.* @param {number} fromIndex The index to search from.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseFindIndex(array, predicate, fromIndex, fromRight) {var length = array.length,index = fromIndex + (fromRight ? 1 : -1);while ((fromRight ? index-- : ++index < length)) {if (predicate(array[index], index, array)) {return index;}}return -1;}/*** The base implementation of `_.property` without support for deep paths.** @private* @param {string} key The key of the property to get.* @returns {Function} Returns the new accessor function.*/function baseProperty(key) {return function(object) {return object == null ? undefined : object[key];};}/*** The base implementation of `_.propertyOf` without support for deep paths.** @private* @param {Object} object The object to query.* @returns {Function} Returns the new accessor function.*/function basePropertyOf(object) {return function(key) {return object == null ? undefined : object[key];};}/*** The base implementation of `_.reduce` and `_.reduceRight`, without support* for iteratee shorthands, which iterates over `collection` using `eachFunc`.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} accumulator The initial value.* @param {boolean} initAccum Specify using the first or last element of* `collection` as the initial value.* @param {Function} eachFunc The function to iterate over `collection`.* @returns {*} Returns the accumulated value.*/function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {eachFunc(collection, function(value, index, collection) {accumulator = initAccum? (initAccum = false, value): iteratee(accumulator, value, index, collection);});return accumulator;}/*** The base implementation of `_.values` and `_.valuesIn` which creates an* array of `object` property values corresponding to the property names* of `props`.** @private* @param {Object} object The object to query.* @param {Array} props The property names to get values for.* @returns {Object} Returns the array of property values.*/function baseValues(object, props) {return baseMap(props, function(key) {return object[key];});}/*** Used by `_.escape` to convert characters to HTML entities.** @private* @param {string} chr The matched character to escape.* @returns {string} Returns the escaped character.*/var escapeHtmlChar = basePropertyOf(htmlEscapes);/*** Creates a unary function that invokes `func` with its argument transformed.** @private* @param {Function} func The function to wrap.* @param {Function} transform The argument transform.* @returns {Function} Returns the new function.*/function overArg(func, transform) {return function(arg) {return func(transform(arg));};}/*--------------------------------------------------------------------------*//** Used for built-in method references. */var arrayProto = Array.prototype,objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/** Used to generate unique IDs. */var idCounter = 0;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/** Used to restore the original `_` reference in `_.noConflict`. */var oldDash = root._;/** Built-in value references. */var objectCreate = Object.create,propertyIsEnumerable = objectProto.propertyIsEnumerable;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsFinite = root.isFinite,nativeKeys = overArg(Object.keys, Object),nativeMax = Math.max;/*------------------------------------------------------------------------*//*** Creates a `lodash` object which wraps `value` to enable implicit method* chain sequences. Methods that operate on and return arrays, collections,* and functions can be chained together. Methods that retrieve a single value* or may return a primitive value will automatically end the chain sequence* and return the unwrapped value. Otherwise, the value must be unwrapped* with `_#value`.** Explicit chain sequences, which must be unwrapped with `_#value`, may be* enabled using `_.chain`.** The execution of chained methods is lazy, that is, it's deferred until* `_#value` is implicitly or explicitly called.** Lazy evaluation allows several methods to support shortcut fusion.* Shortcut fusion is an optimization to merge iteratee calls; this avoids* the creation of intermediate arrays and can greatly reduce the number of* iteratee executions. Sections of a chain sequence qualify for shortcut* fusion if the section is applied to an array and iteratees accept only* one argument. The heuristic for whether a section qualifies for shortcut* fusion is subject to change.** Chaining is supported in custom builds as long as the `_#value` method is* directly or indirectly included in the build.** In addition to lodash methods, wrappers have `Array` and `String` methods.** The wrapper `Array` methods are:* `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`** The wrapper `String` methods are:* `replace` and `split`** The wrapper methods that support shortcut fusion are:* `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,* `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,* `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`** The chainable wrapper methods are:* `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,* `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,* `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,* `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,* `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,* `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,* `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,* `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,* `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,* `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,* `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,* `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,* `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,* `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,* `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,* `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,* `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,* `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,* `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,* `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,* `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,* `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,* `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,* `zipObject`, `zipObjectDeep`, and `zipWith`** The wrapper methods that are **not** chainable by default are:* `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,* `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,* `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,* `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,* `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,* `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,* `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,* `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,* `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,* `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,* `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,* `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,* `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,* `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,* `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,* `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,* `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,* `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,* `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,* `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,* `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,* `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,* `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,* `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,* `upperFirst`, `value`, and `words`** @name _* @constructor* @category Seq* @param {*} value The value to wrap in a `lodash` instance.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** function square(n) {* return n * n;* }** var wrapped = _([1, 2, 3]);** // Returns an unwrapped value.* wrapped.reduce(_.add);* // => 6** // Returns a wrapped value.* var squares = wrapped.map(square);** _.isArray(squares);* // => false** _.isArray(squares.value());* // => true*/function lodash(value) {return value instanceof LodashWrapper? value: new LodashWrapper(value);}/*** The base implementation of `_.create` without support for assigning* properties to the created object.** @private* @param {Object} proto The object to inherit from.* @returns {Object} Returns the new object.*/var baseCreate = (function() {function object() {}return function(proto) {if (!isObject(proto)) {return {};}if (objectCreate) {return objectCreate(proto);}object.prototype = proto;var result = new object;object.prototype = undefined;return result;};}());/*** The base constructor for creating `lodash` wrapper objects.** @private* @param {*} value The value to wrap.* @param {boolean} [chainAll] Enable explicit method chain sequences.*/function LodashWrapper(value, chainAll) {this.__wrapped__ = value;this.__actions__ = [];this.__chain__ = !!chainAll;}LodashWrapper.prototype = baseCreate(lodash.prototype);LodashWrapper.prototype.constructor = LodashWrapper;/*------------------------------------------------------------------------*//*** Assigns `value` to `key` of `object` if the existing value is not equivalent* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function assignValue(object, key, value) {var objValue = object[key];if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||(value === undefined && !(key in object))) {baseAssignValue(object, key, value);}}/*** The base implementation of `assignValue` and `assignMergeValue` without* value checks.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function baseAssignValue(object, key, value) {object[key] = value;}/*** The base implementation of `_.delay` and `_.defer` which accepts `args`* to provide to `func`.** @private* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {Array} args The arguments to provide to `func`.* @returns {number|Object} Returns the timer id or timeout object.*/function baseDelay(func, wait, args) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function() { func.apply(undefined, args); }, wait);}/*** The base implementation of `_.forEach` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array|Object} Returns `collection`.*/var baseEach = createBaseEach(baseForOwn);/*** The base implementation of `_.every` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`*/function baseEvery(collection, predicate) {var result = true;baseEach(collection, function(value, index, collection) {result = !!predicate(value, index, collection);return result;});return result;}/*** The base implementation of methods like `_.max` and `_.min` which accepts a* `comparator` to determine the extremum value.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The iteratee invoked per iteration.* @param {Function} comparator The comparator used to compare values.* @returns {*} Returns the extremum value.*/function baseExtremum(array, iteratee, comparator) {var index = -1,length = array.length;while (++index < length) {var value = array[index],current = iteratee(value);if (current != null && (computed === undefined? (current === current && !false): comparator(current, computed))) {var computed = current,result = value;}}return result;}/*** The base implementation of `_.filter` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {Array} Returns the new filtered array.*/function baseFilter(collection, predicate) {var result = [];baseEach(collection, function(value, index, collection) {if (predicate(value, index, collection)) {result.push(value);}});return result;}/*** The base implementation of `_.flatten` with support for restricting flattening.** @private* @param {Array} array The array to flatten.* @param {number} depth The maximum recursion depth.* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.* @param {Array} [result=[]] The initial result value.* @returns {Array} Returns the new flattened array.*/function baseFlatten(array, depth, predicate, isStrict, result) {var index = -1,length = array.length;predicate || (predicate = isFlattenable);result || (result = []);while (++index < length) {var value = array[index];if (depth > 0 && predicate(value)) {if (depth > 1) {// Recursively flatten arrays (susceptible to call stack limits).baseFlatten(value, depth - 1, predicate, isStrict, result);} else {arrayPush(result, value);}} else if (!isStrict) {result[result.length] = value;}}return result;}/*** The base implementation of `baseForOwn` which iterates over `object`* properties returned by `keysFunc` and invokes `iteratee` for each property.* Iteratee functions may exit iteration early by explicitly returning `false`.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseFor = createBaseFor();/*** The base implementation of `_.forOwn` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwn(object, iteratee) {return object && baseFor(object, iteratee, keys);}/*** The base implementation of `_.functions` which creates an array of* `object` function property names filtered from `props`.** @private* @param {Object} object The object to inspect.* @param {Array} props The property names to filter.* @returns {Array} Returns the function names.*/function baseFunctions(object, props) {return baseFilter(props, function(key) {return isFunction(object[key]);});}/*** The base implementation of `getTag` without fallbacks for buggy environments.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/function baseGetTag(value) {return objectToString(value);}/*** The base implementation of `_.gt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than `other`,* else `false`.*/function baseGt(value, other) {return value > other;}/*** The base implementation of `_.isArguments`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,*/var baseIsArguments = noop;/*** The base implementation of `_.isDate` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.*/function baseIsDate(value) {return isObjectLike(value) && baseGetTag(value) == dateTag;}/*** The base implementation of `_.isEqual` which supports partial comparisons* and tracks traversed objects.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @param {boolean} bitmask The bitmask flags.* 1 - Unordered comparison* 2 - Partial comparison* @param {Function} [customizer] The function to customize comparisons.* @param {Object} [stack] Tracks traversed `value` and `other` objects.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.*/function baseIsEqual(value, other, bitmask, customizer, stack) {if (value === other) {return true;}if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {return value !== value && other !== other;}return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);}/*** A specialized version of `baseIsEqual` for arrays and objects which performs* deep comparisons and tracks traversed objects enabling objects with circular* references to be compared.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} [stack] Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {var objIsArr = isArray(object),othIsArr = isArray(other),objTag = objIsArr ? arrayTag : baseGetTag(object),othTag = othIsArr ? arrayTag : baseGetTag(other);objTag = objTag == argsTag ? objectTag : objTag;othTag = othTag == argsTag ? objectTag : othTag;var objIsObj = objTag == objectTag,othIsObj = othTag == objectTag,isSameTag = objTag == othTag;stack || (stack = []);var objStack = find(stack, function(entry) {return entry[0] == object;});var othStack = find(stack, function(entry) {return entry[0] == other;});if (objStack && othStack) {return objStack[1] == other;}stack.push([object, other]);stack.push([other, object]);if (isSameTag && !objIsObj) {var result = (objIsArr)? equalArrays(object, other, bitmask, customizer, equalFunc, stack): equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);stack.pop();return result;}if (!(bitmask & COMPARE_PARTIAL_FLAG)) {var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');if (objIsWrapped || othIsWrapped) {var objUnwrapped = objIsWrapped ? object.value() : object,othUnwrapped = othIsWrapped ? other.value() : other;var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);stack.pop();return result;}}if (!isSameTag) {return false;}var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack);stack.pop();return result;}/*** The base implementation of `_.isRegExp` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.*/function baseIsRegExp(value) {return isObjectLike(value) && baseGetTag(value) == regexpTag;}/*** The base implementation of `_.iteratee`.** @private* @param {*} [value=_.identity] The value to convert to an iteratee.* @returns {Function} Returns the iteratee.*/function baseIteratee(func) {if (typeof func == 'function') {return func;}if (func == null) {return identity;}return (typeof func == 'object' ? baseMatches : baseProperty)(func);}/*** The base implementation of `_.lt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than `other`,* else `false`.*/function baseLt(value, other) {return value < other;}/*** The base implementation of `_.map` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function baseMap(collection, iteratee) {var index = -1,result = isArrayLike(collection) ? Array(collection.length) : [];baseEach(collection, function(value, key, collection) {result[++index] = iteratee(value, key, collection);});return result;}/*** The base implementation of `_.matches` which doesn't clone `source`.** @private* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.*/function baseMatches(source) {var props = nativeKeys(source);return function(object) {var length = props.length;if (object == null) {return !length;}object = Object(object);while (length--) {var key = props[length];if (!(key in object &&baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG))) {return false;}}return true;};}/*** The base implementation of `_.pick` without support for individual* property identifiers.** @private* @param {Object} object The source object.* @param {string[]} paths The property paths to pick.* @returns {Object} Returns the new object.*/function basePick(object, props) {object = Object(object);return reduce(props, function(result, key) {if (key in object) {result[key] = object[key];}return result;}, {});}/*** The base implementation of `_.rest` which doesn't validate or coerce arguments.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @returns {Function} Returns the new function.*/function baseRest(func, start) {return setToString(overRest(func, start, identity), func + '');}/*** The base implementation of `_.slice` without an iteratee call guard.** @private* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function baseSlice(array, start, end) {var index = -1,length = array.length;if (start < 0) {start = -start > length ? 0 : (length + start);}end = end > length ? length : end;if (end < 0) {end += length;}length = start > end ? 0 : ((end - start) >>> 0);start >>>= 0;var result = Array(length);while (++index < length) {result[index] = array[index + start];}return result;}/*** Copies the values of `source` to `array`.** @private* @param {Array} source The array to copy values from.* @param {Array} [array=[]] The array to copy values to.* @returns {Array} Returns `array`.*/function copyArray(source) {return baseSlice(source, 0, source.length);}/*** The base implementation of `_.some` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.*/function baseSome(collection, predicate) {var result;baseEach(collection, function(value, index, collection) {result = predicate(value, index, collection);return !result;});return !!result;}/*** The base implementation of `wrapperValue` which returns the result of* performing a sequence of actions on the unwrapped `value`, where each* successive action is supplied the return value of the previous.** @private* @param {*} value The unwrapped value.* @param {Array} actions Actions to perform to resolve the unwrapped value.* @returns {*} Returns the resolved value.*/function baseWrapperValue(value, actions) {var result = value;return reduce(actions, function(result, action) {return action.func.apply(action.thisArg, arrayPush([result], action.args));}, result);}/*** Compares values to sort them in ascending order.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {number} Returns the sort order indicator for `value`.*/function compareAscending(value, other) {if (value !== other) {var valIsDefined = value !== undefined,valIsNull = value === null,valIsReflexive = value === value,valIsSymbol = false;var othIsDefined = other !== undefined,othIsNull = other === null,othIsReflexive = other === other,othIsSymbol = false;if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||(valIsNull && othIsDefined && othIsReflexive) ||(!valIsDefined && othIsReflexive) ||!valIsReflexive) {return 1;}if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||(othIsNull && valIsDefined && valIsReflexive) ||(!othIsDefined && valIsReflexive) ||!othIsReflexive) {return -1;}}return 0;}/*** Copies properties of `source` to `object`.** @private* @param {Object} source The object to copy properties from.* @param {Array} props The property identifiers to copy.* @param {Object} [object={}] The object to copy properties to.* @param {Function} [customizer] The function to customize copied values.* @returns {Object} Returns `object`.*/function copyObject(source, props, object, customizer) {var isNew = !object;object || (object = {});var index = -1,length = props.length;while (++index < length) {var key = props[index];var newValue = customizer? customizer(object[key], source[key], key, object, source): undefined;if (newValue === undefined) {newValue = source[key];}if (isNew) {baseAssignValue(object, key, newValue);} else {assignValue(object, key, newValue);}}return object;}/*** Creates a function like `_.assign`.** @private* @param {Function} assigner The function to assign values.* @returns {Function} Returns the new assigner function.*/function createAssigner(assigner) {return baseRest(function(object, sources) {var index = -1,length = sources.length,customizer = length > 1 ? sources[length - 1] : undefined;customizer = (assigner.length > 3 && typeof customizer == 'function')? (length--, customizer): undefined;object = Object(object);while (++index < length) {var source = sources[index];if (source) {assigner(object, source, index, customizer);}}return object;});}/*** Creates a `baseEach` or `baseEachRight` function.** @private* @param {Function} eachFunc The function to iterate over a collection.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseEach(eachFunc, fromRight) {return function(collection, iteratee) {if (collection == null) {return collection;}if (!isArrayLike(collection)) {return eachFunc(collection, iteratee);}var length = collection.length,index = fromRight ? length : -1,iterable = Object(collection);while ((fromRight ? index-- : ++index < length)) {if (iteratee(iterable[index], index, iterable) === false) {break;}}return collection;};}/*** Creates a base function for methods like `_.forIn` and `_.forOwn`.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseFor(fromRight) {return function(object, iteratee, keysFunc) {var index = -1,iterable = Object(object),props = keysFunc(object),length = props.length;while (length--) {var key = props[fromRight ? length : ++index];if (iteratee(iterable[key], key, iterable) === false) {break;}}return object;};}/*** Creates a function that produces an instance of `Ctor` regardless of* whether it was invoked as part of a `new` expression or by `call` or `apply`.** @private* @param {Function} Ctor The constructor to wrap.* @returns {Function} Returns the new wrapped function.*/function createCtor(Ctor) {return function() {// Use a `switch` statement to work with class constructors. See// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist// for more details.var args = arguments;var thisBinding = baseCreate(Ctor.prototype),result = Ctor.apply(thisBinding, args);// Mimic the constructor's `return` behavior.// See https://es5.github.io/#x13.2.2 for more details.return isObject(result) ? result : thisBinding;};}/*** Creates a `_.find` or `_.findLast` function.** @private* @param {Function} findIndexFunc The function to find the collection index.* @returns {Function} Returns the new find function.*/function createFind(findIndexFunc) {return function(collection, predicate, fromIndex) {var iterable = Object(collection);if (!isArrayLike(collection)) {var iteratee = baseIteratee(predicate, 3);collection = keys(collection);predicate = function(key) { return iteratee(iterable[key], key, iterable); };}var index = findIndexFunc(collection, predicate, fromIndex);return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;};}/*** Creates a function that wraps `func` to invoke it with the `this` binding* of `thisArg` and `partials` prepended to the arguments it receives.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} thisArg The `this` binding of `func`.* @param {Array} partials The arguments to prepend to those provided to* the new function.* @returns {Function} Returns the new wrapped function.*/function createPartial(func, bitmask, thisArg, partials) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}var isBind = bitmask & WRAP_BIND_FLAG,Ctor = createCtor(func);function wrapper() {var argsIndex = -1,argsLength = arguments.length,leftIndex = -1,leftLength = partials.length,args = Array(leftLength + argsLength),fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;while (++leftIndex < leftLength) {args[leftIndex] = partials[leftIndex];}while (argsLength--) {args[leftIndex++] = arguments[++argsIndex];}return fn.apply(isBind ? thisArg : this, args);}return wrapper;}/*** A specialized version of `baseIsEqualDeep` for arrays with support for* partial deep comparisons.** @private* @param {Array} array The array to compare.* @param {Array} other The other array to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `array` and `other` objects.* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.*/function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,arrLength = array.length,othLength = other.length;if (arrLength != othLength && !(isPartial && othLength > arrLength)) {return false;}// Check that cyclic values are equal.var arrStacked = stack.get(array);var othStacked = stack.get(other);if (arrStacked && othStacked) {return arrStacked == other && othStacked == array;}var index = -1,result = true,seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined;// Ignore non-index properties.while (++index < arrLength) {var arrValue = array[index],othValue = other[index];var compared;if (compared !== undefined) {if (compared) {continue;}result = false;break;}// Recursively compare arrays (susceptible to call stack limits).if (seen) {if (!baseSome(other, function(othValue, othIndex) {if (!indexOf(seen, othIndex) &&(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {return seen.push(othIndex);}})) {result = false;break;}} else if (!(arrValue === othValue ||equalFunc(arrValue, othValue, bitmask, customizer, stack))) {result = false;break;}}return result;}/*** A specialized version of `baseIsEqualDeep` for comparing objects of* the same `toStringTag`.** **Note:** This function only supports comparing values with tags of* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {string} tag The `toStringTag` of the objects to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {switch (tag) {case boolTag:case dateTag:case numberTag:// Coerce booleans to `1` or `0` and dates to milliseconds.// Invalid dates are coerced to `NaN`.return eq(+object, +other);case errorTag:return object.name == other.name && object.message == other.message;case regexpTag:case stringTag:// Coerce regexes to strings and treat strings, primitives and objects,// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring// for more details.return object == (other + '');}return false;}/*** A specialized version of `baseIsEqualDeep` for objects with support for* partial deep comparisons.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,objProps = keys(object),objLength = objProps.length,othProps = keys(other),othLength = othProps.length;if (objLength != othLength && !isPartial) {return false;}var index = objLength;while (index--) {var key = objProps[index];if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {return false;}}// Check that cyclic values are equal.var objStacked = stack.get(object);var othStacked = stack.get(other);if (objStacked && othStacked) {return objStacked == other && othStacked == object;}var result = true;var skipCtor = isPartial;while (++index < objLength) {key = objProps[index];var objValue = object[key],othValue = other[key];var compared;// Recursively compare objects (susceptible to call stack limits).if (!(compared === undefined? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)): compared)) {result = false;break;}skipCtor || (skipCtor = key == 'constructor');}if (result && !skipCtor) {var objCtor = object.constructor,othCtor = other.constructor;// Non `Object` object instances with different constructors are not equal.if (objCtor != othCtor &&('constructor' in object && 'constructor' in other) &&!(typeof objCtor == 'function' && objCtor instanceof objCtor &&typeof othCtor == 'function' && othCtor instanceof othCtor)) {result = false;}}return result;}/*** A specialized version of `baseRest` which flattens the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @returns {Function} Returns the new function.*/function flatRest(func) {return setToString(overRest(func, undefined, flatten), func + '');}/*** Checks if `value` is a flattenable `arguments` object or array.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.*/function isFlattenable(value) {return isArray(value) || isArguments(value);}/*** Checks if `value` is a valid array-like index.** @private* @param {*} value The value to check.* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.*/function isIndex(value, length) {var type = typeof value;length = length == null ? MAX_SAFE_INTEGER : length;return !!length &&(type == 'number' ||(type != 'symbol' && reIsUint.test(value))) &&(value > -1 && value % 1 == 0 && value < length);}/*** Checks if the given arguments are from an iteratee call.** @private* @param {*} value The potential iteratee value argument.* @param {*} index The potential iteratee index or key argument.* @param {*} object The potential iteratee object argument.* @returns {boolean} Returns `true` if the arguments are from an iteratee call,* else `false`.*/function isIterateeCall(value, index, object) {if (!isObject(object)) {return false;}var type = typeof index;if (type == 'number'? (isArrayLike(object) && isIndex(index, object.length)): (type == 'string' && index in object)) {return eq(object[index], value);}return false;}/*** This function is like* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* except that it includes inherited enumerable properties.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function nativeKeysIn(object) {var result = [];if (object != null) {for (var key in Object(object)) {result.push(key);}}return result;}/*** Converts `value` to a string using `Object.prototype.toString`.** @private* @param {*} value The value to convert.* @returns {string} Returns the converted string.*/function objectToString(value) {return nativeObjectToString.call(value);}/*** A specialized version of `baseRest` which transforms the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @param {Function} transform The rest array transform.* @returns {Function} Returns the new function.*/function overRest(func, start, transform) {start = nativeMax(start === undefined ? (func.length - 1) : start, 0);return function() {var args = arguments,index = -1,length = nativeMax(args.length - start, 0),array = Array(length);while (++index < length) {array[index] = args[start + index];}index = -1;var otherArgs = Array(start + 1);while (++index < start) {otherArgs[index] = args[index];}otherArgs[start] = transform(array);return func.apply(this, otherArgs);};}/*** Sets the `toString` method of `func` to return `string`.** @private* @param {Function} func The function to modify.* @param {Function} string The `toString` result.* @returns {Function} Returns `func`.*/var setToString = identity;/*------------------------------------------------------------------------*//*** Creates an array with all falsey values removed. The values `false`, `null`,* `0`, `""`, `undefined`, and `NaN` are falsey.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to compact.* @returns {Array} Returns the new array of filtered values.* @example** _.compact([0, 1, false, 2, '', 3]);* // => [1, 2, 3]*/function compact(array) {return baseFilter(array, Boolean);}/*** Creates a new array concatenating `array` with any additional arrays* and/or values.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to concatenate.* @param {...*} [values] The values to concatenate.* @returns {Array} Returns the new concatenated array.* @example** var array = [1];* var other = _.concat(array, 2, [3], [[4]]);** console.log(other);* // => [1, 2, 3, [4]]** console.log(array);* // => [1]*/function concat() {var length = arguments.length;if (!length) {return [];}var args = Array(length - 1),array = arguments[0],index = length;while (index--) {args[index - 1] = arguments[index];}return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));}/*** This method is like `_.find` except that it returns the index of the first* element `predicate` returns truthy for instead of the element itself.** @static* @memberOf _* @since 1.1.0* @category Array* @param {Array} array The array to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the found element, else `-1`.* @example** var users = [* { 'user': 'barney', 'active': false },* { 'user': 'fred', 'active': false },* { 'user': 'pebbles', 'active': true }* ];** _.findIndex(users, function(o) { return o.user == 'barney'; });* // => 0** // The `_.matches` iteratee shorthand.* _.findIndex(users, { 'user': 'fred', 'active': false });* // => 1** // The `_.matchesProperty` iteratee shorthand.* _.findIndex(users, ['active', false]);* // => 0** // The `_.property` iteratee shorthand.* _.findIndex(users, 'active');* // => 2*/function findIndex(array, predicate, fromIndex) {var length = array == null ? 0 : array.length;if (!length) {return -1;}var index = fromIndex == null ? 0 : toInteger(fromIndex);if (index < 0) {index = nativeMax(length + index, 0);}return baseFindIndex(array, baseIteratee(predicate, 3), index);}/*** Flattens `array` a single level deep.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flatten([1, [2, [3, [4]], 5]]);* // => [1, 2, [3, [4]], 5]*/function flatten(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, 1) : [];}/*** Recursively flattens `array`.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to flatten.* @returns {Array} Returns the new flattened array.* @example** _.flattenDeep([1, [2, [3, [4]], 5]]);* // => [1, 2, 3, 4, 5]*/function flattenDeep(array) {var length = array == null ? 0 : array.length;return length ? baseFlatten(array, INFINITY) : [];}/*** Gets the first element of `array`.** @static* @memberOf _* @since 0.1.0* @alias first* @category Array* @param {Array} array The array to query.* @returns {*} Returns the first element of `array`.* @example** _.head([1, 2, 3]);* // => 1** _.head([]);* // => undefined*/function head(array) {return (array && array.length) ? array[0] : undefined;}/*** Gets the index at which the first occurrence of `value` is found in `array`* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons. If `fromIndex` is negative, it's used as the* offset from the end of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} [fromIndex=0] The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.* @example** _.indexOf([1, 2, 1, 2], 2);* // => 1** // Search from the `fromIndex`.* _.indexOf([1, 2, 1, 2], 2, 2);* // => 3*/function indexOf(array, value, fromIndex) {var length = array == null ? 0 : array.length;if (typeof fromIndex == 'number') {fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;} else {fromIndex = 0;}var index = (fromIndex || 0) - 1,isReflexive = value === value;while (++index < length) {var other = array[index];if ((isReflexive ? other === value : other !== other)) {return index;}}return -1;}/*** Gets the last element of `array`.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to query.* @returns {*} Returns the last element of `array`.* @example** _.last([1, 2, 3]);* // => 3*/function last(array) {var length = array == null ? 0 : array.length;return length ? array[length - 1] : undefined;}/*** Creates a slice of `array` from `start` up to, but not including, `end`.** **Note:** This method is used instead of* [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are* returned.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function slice(array, start, end) {var length = array == null ? 0 : array.length;start = start == null ? 0 : +start;end = end === undefined ? length : +end;return length ? baseSlice(array, start, end) : [];}/*------------------------------------------------------------------------*//*** Creates a `lodash` wrapper instance that wraps `value` with explicit method* chain sequences enabled. The result of such sequences must be unwrapped* with `_#value`.** @static* @memberOf _* @since 1.3.0* @category Seq* @param {*} value The value to wrap.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 },* { 'user': 'pebbles', 'age': 1 }* ];** var youngest = _* .chain(users)* .sortBy('age')* .map(function(o) {* return o.user + ' is ' + o.age;* })* .head()* .value();* // => 'pebbles is 1'*/function chain(value) {var result = lodash(value);result.__chain__ = true;return result;}/*** This method invokes `interceptor` and returns `value`. The interceptor* is invoked with one argument; (value). The purpose of this method is to* "tap into" a method chain sequence in order to modify intermediate results.** @static* @memberOf _* @since 0.1.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns `value`.* @example** _([1, 2, 3])* .tap(function(array) {* // Mutate input array.* array.pop();* })* .reverse()* .value();* // => [2, 1]*/function tap(value, interceptor) {interceptor(value);return value;}/*** This method is like `_.tap` except that it returns the result of `interceptor`.* The purpose of this method is to "pass thru" values replacing intermediate* results in a method chain sequence.** @static* @memberOf _* @since 3.0.0* @category Seq* @param {*} value The value to provide to `interceptor`.* @param {Function} interceptor The function to invoke.* @returns {*} Returns the result of `interceptor`.* @example** _(' abc ')* .chain()* .trim()* .thru(function(value) {* return [value];* })* .value();* // => ['abc']*/function thru(value, interceptor) {return interceptor(value);}/*** Creates a `lodash` wrapper instance with explicit method chain sequences enabled.** @name chain* @memberOf _* @since 0.1.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 }* ];** // A sequence without explicit chaining.* _(users).head();* // => { 'user': 'barney', 'age': 36 }** // A sequence with explicit chaining.* _(users)* .chain()* .head()* .pick('user')* .value();* // => { 'user': 'barney' }*/function wrapperChain() {return chain(this);}/*** Executes the chain sequence to resolve the unwrapped value.** @name value* @memberOf _* @since 0.1.0* @alias toJSON, valueOf* @category Seq* @returns {*} Returns the resolved unwrapped value.* @example** _([1, 2, 3]).value();* // => [1, 2, 3]*/function wrapperValue() {return baseWrapperValue(this.__wrapped__, this.__actions__);}/*------------------------------------------------------------------------*//*** Checks if `predicate` returns truthy for **all** elements of `collection`.* Iteration is stopped once `predicate` returns falsey. The predicate is* invoked with three arguments: (value, index|key, collection).** **Note:** This method returns `true` for* [empty collections](https://en.wikipedia.org/wiki/Empty_set) because* [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of* elements of empty collections.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`.* @example** _.every([true, 1, null, 'yes'], Boolean);* // => false** var users = [* { 'user': 'barney', 'age': 36, 'active': false },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.every(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.every(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.every(users, 'active');* // => false*/function every(collection, predicate, guard) {predicate = guard ? undefined : predicate;return baseEvery(collection, baseIteratee(predicate));}/*** Iterates over elements of `collection`, returning an array of all elements* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** **Note:** Unlike `_.remove`, this method returns a new array.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @returns {Array} Returns the new filtered array.* @see _.reject* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** _.filter(users, function(o) { return !o.active; });* // => objects for ['fred']** // The `_.matches` iteratee shorthand.* _.filter(users, { 'age': 36, 'active': true });* // => objects for ['barney']** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, ['active', false]);* // => objects for ['fred']** // The `_.property` iteratee shorthand.* _.filter(users, 'active');* // => objects for ['barney']** // Combining several predicates using `_.overEvery` or `_.overSome`.* _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));* // => objects for ['fred', 'barney']*/function filter(collection, predicate) {return baseFilter(collection, baseIteratee(predicate));}/*** Iterates over elements of `collection`, returning the first element* `predicate` returns truthy for. The predicate is invoked with three* arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to inspect.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param {number} [fromIndex=0] The index to search from.* @returns {*} Returns the matched element, else `undefined`.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false },* { 'user': 'pebbles', 'age': 1, 'active': true }* ];** _.find(users, function(o) { return o.age < 40; });* // => object for 'barney'** // The `_.matches` iteratee shorthand.* _.find(users, { 'age': 1, 'active': true });* // => object for 'pebbles'** // The `_.matchesProperty` iteratee shorthand.* _.find(users, ['active', false]);* // => object for 'fred'** // The `_.property` iteratee shorthand.* _.find(users, 'active');* // => object for 'barney'*/var find = createFind(findIndex);/*** Iterates over elements of `collection` and invokes `iteratee` for each element.* The iteratee is invoked with three arguments: (value, index|key, collection).* Iteratee functions may exit iteration early by explicitly returning `false`.** **Note:** As with other "Collections" methods, objects with a "length"* property are iterated like arrays. To avoid this behavior use `_.forIn`* or `_.forOwn` for object iteration.** @static* @memberOf _* @since 0.1.0* @alias each* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array|Object} Returns `collection`.* @see _.forEachRight* @example** _.forEach([1, 2], function(value) {* console.log(value);* });* // => Logs `1` then `2`.** _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {* console.log(key);* });* // => Logs 'a' then 'b' (iteration order is not guaranteed).*/function forEach(collection, iteratee) {return baseEach(collection, baseIteratee(iteratee));}/*** Creates an array of values by running each element in `collection` thru* `iteratee`. The iteratee is invoked with three arguments:* (value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.** The guarded methods are:* `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,* `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,* `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,* `template`, `trim`, `trimEnd`, `trimStart`, and `words`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @returns {Array} Returns the new mapped array.* @example** function square(n) {* return n * n;* }** _.map([4, 8], square);* // => [16, 64]** _.map({ 'a': 4, 'b': 8 }, square);* // => [16, 64] (iteration order is not guaranteed)** var users = [* { 'user': 'barney' },* { 'user': 'fred' }* ];** // The `_.property` iteratee shorthand.* _.map(users, 'user');* // => ['barney', 'fred']*/function map(collection, iteratee) {return baseMap(collection, baseIteratee(iteratee));}/*** Reduces `collection` to a value which is the accumulated result of running* each element in `collection` thru `iteratee`, where each successive* invocation is supplied the return value of the previous. If `accumulator`* is not given, the first element of `collection` is used as the initial* value. The iteratee is invoked with four arguments:* (accumulator, value, index|key, collection).** Many lodash methods are guarded to work as iteratees for methods like* `_.reduce`, `_.reduceRight`, and `_.transform`.** The guarded methods are:* `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,* and `sortBy`** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [iteratee=_.identity] The function invoked per iteration.* @param {*} [accumulator] The initial value.* @returns {*} Returns the accumulated value.* @see _.reduceRight* @example** _.reduce([1, 2], function(sum, n) {* return sum + n;* }, 0);* // => 3** _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {* (result[value] || (result[value] = [])).push(key);* return result;* }, {});* // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)*/function reduce(collection, iteratee, accumulator) {return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach);}/*** Gets the size of `collection` by returning its length for array-like* values or the number of own enumerable string keyed properties for objects.** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object|string} collection The collection to inspect.* @returns {number} Returns the collection size.* @example** _.size([1, 2, 3]);* // => 3** _.size({ 'a': 1, 'b': 2 });* // => 2** _.size('pebbles');* // => 7*/function size(collection) {if (collection == null) {return 0;}collection = isArrayLike(collection) ? collection : nativeKeys(collection);return collection.length;}/*** Checks if `predicate` returns truthy for **any** element of `collection`.* Iteration is stopped once `predicate` returns truthy. The predicate is* invoked with three arguments: (value, index|key, collection).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {Function} [predicate=_.identity] The function invoked per iteration.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.* @example** _.some([null, 0, 'yes', false], Boolean);* // => true** var users = [* { 'user': 'barney', 'active': true },* { 'user': 'fred', 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.some(users, { 'user': 'barney', 'active': false });* // => false** // The `_.matchesProperty` iteratee shorthand.* _.some(users, ['active', false]);* // => true** // The `_.property` iteratee shorthand.* _.some(users, 'active');* // => true*/function some(collection, predicate, guard) {predicate = guard ? undefined : predicate;return baseSome(collection, baseIteratee(predicate));}/*** Creates an array of elements, sorted in ascending order by the results of* running each element in a collection thru each iteratee. This method* performs a stable sort, that is, it preserves the original sort order of* equal elements. The iteratees are invoked with one argument: (value).** @static* @memberOf _* @since 0.1.0* @category Collection* @param {Array|Object} collection The collection to iterate over.* @param {...(Function|Function[])} [iteratees=[_.identity]]* The iteratees to sort by.* @returns {Array} Returns the new sorted array.* @example** var users = [* { 'user': 'fred', 'age': 48 },* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 30 },* { 'user': 'barney', 'age': 34 }* ];** _.sortBy(users, [function(o) { return o.user; }]);* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]** _.sortBy(users, ['user', 'age']);* // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]*/function sortBy(collection, iteratee) {var index = 0;iteratee = baseIteratee(iteratee);return baseMap(baseMap(collection, function(value, key, collection) {return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) };}).sort(function(object, other) {return compareAscending(object.criteria, other.criteria) || (object.index - other.index);}), baseProperty('value'));}/*------------------------------------------------------------------------*//*** Creates a function that invokes `func`, with the `this` binding and arguments* of the created function, while it's called less than `n` times. Subsequent* calls to the created function return the result of the last `func` invocation.** @static* @memberOf _* @since 3.0.0* @category Function* @param {number} n The number of calls at which `func` is no longer invoked.* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** jQuery(element).on('click', _.before(5, addContactToList));* // => Allows adding up to 4 contacts to the list.*/function before(n, func) {var result;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}n = toInteger(n);return function() {if (--n > 0) {result = func.apply(this, arguments);}if (n <= 1) {func = undefined;}return result;};}/*** Creates a function that invokes `func` with the `this` binding of `thisArg`* and `partials` prepended to the arguments it receives.** The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,* may be used as a placeholder for partially applied arguments.** **Note:** Unlike native `Function#bind`, this method doesn't set the "length"* property of bound functions.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to bind.* @param {*} thisArg The `this` binding of `func`.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new bound function.* @example** function greet(greeting, punctuation) {* return greeting + ' ' + this.user + punctuation;* }** var object = { 'user': 'fred' };** var bound = _.bind(greet, object, 'hi');* bound('!');* // => 'hi fred!'** // Bound with placeholders.* var bound = _.bind(greet, object, _, '!');* bound('hi');* // => 'hi fred!'*/var bind = baseRest(function(func, thisArg, partials) {return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials);});/*** Defers invoking the `func` until the current call stack has cleared. Any* additional arguments are provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to defer.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.defer(function(text) {* console.log(text);* }, 'deferred');* // => Logs 'deferred' after one millisecond.*/var defer = baseRest(function(func, args) {return baseDelay(func, 1, args);});/*** Invokes `func` after `wait` milliseconds. Any additional arguments are* provided to `func` when it's invoked.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {...*} [args] The arguments to invoke `func` with.* @returns {number} Returns the timer id.* @example** _.delay(function(text) {* console.log(text);* }, 1000, 'later');* // => Logs 'later' after one second.*/var delay = baseRest(function(func, wait, args) {return baseDelay(func, toNumber(wait) || 0, args);});/*** Creates a function that negates the result of the predicate `func`. The* `func` predicate is invoked with the `this` binding and arguments of the* created function.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} predicate The predicate to negate.* @returns {Function} Returns the new negated function.* @example** function isEven(n) {* return n % 2 == 0;* }** _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));* // => [1, 3, 5]*/function negate(predicate) {if (typeof predicate != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return function() {var args = arguments;return !predicate.apply(this, args);};}/*** Creates a function that is restricted to invoking `func` once. Repeat calls* to the function return the value of the first invocation. The `func` is* invoked with the `this` binding and arguments of the created function.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** var initialize = _.once(createApplication);* initialize();* initialize();* // => `createApplication` is invoked once*/function once(func) {return before(2, func);}/*------------------------------------------------------------------------*//*** Creates a shallow clone of `value`.** **Note:** This method is loosely based on the* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)* and supports cloning arrays, array buffers, booleans, date objects, maps,* numbers, `Object` objects, regexes, sets, strings, symbols, and typed* arrays. The own enumerable properties of `arguments` objects are cloned* as plain objects. An empty object is returned for uncloneable values such* as error objects, functions, DOM nodes, and WeakMaps.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to clone.* @returns {*} Returns the cloned value.* @see _.cloneDeep* @example** var objects = [{ 'a': 1 }, { 'b': 2 }];** var shallow = _.clone(objects);* console.log(shallow[0] === objects[0]);* // => true*/function clone(value) {if (!isObject(value)) {return value;}return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value));}/*** Performs a* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* comparison between two values to determine if they are equivalent.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.eq(object, object);* // => true** _.eq(object, other);* // => false** _.eq('a', 'a');* // => true** _.eq('a', Object('a'));* // => false** _.eq(NaN, NaN);* // => true*/function eq(value, other) {return value === other || (value !== value && other !== other);}/*** Checks if `value` is likely an `arguments` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,* else `false`.* @example** _.isArguments(function() { return arguments; }());* // => true** _.isArguments([1, 2, 3]);* // => false*/var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&!propertyIsEnumerable.call(value, 'callee');};/*** Checks if `value` is classified as an `Array` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array, else `false`.* @example** _.isArray([1, 2, 3]);* // => true** _.isArray(document.body.children);* // => false** _.isArray('abc');* // => false** _.isArray(_.noop);* // => false*/var isArray = Array.isArray;/*** Checks if `value` is array-like. A value is considered array-like if it's* not a function and has a `value.length` that's an integer greater than or* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is array-like, else `false`.* @example** _.isArrayLike([1, 2, 3]);* // => true** _.isArrayLike(document.body.children);* // => true** _.isArrayLike('abc');* // => true** _.isArrayLike(_.noop);* // => false*/function isArrayLike(value) {return value != null && isLength(value.length) && !isFunction(value);}/*** Checks if `value` is classified as a boolean primitive or object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a boolean, else `false`.* @example** _.isBoolean(false);* // => true** _.isBoolean(null);* // => false*/function isBoolean(value) {return value === true || value === false ||(isObjectLike(value) && baseGetTag(value) == boolTag);}/*** Checks if `value` is classified as a `Date` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.* @example** _.isDate(new Date);* // => true** _.isDate('Mon April 23 2012');* // => false*/var isDate = baseIsDate;/*** Checks if `value` is an empty object, collection, map, or set.** Objects are considered empty if they have no own enumerable string keyed* properties.** Array-like values such as `arguments` objects, arrays, buffers, strings, or* jQuery-like collections are considered empty if they have a `length` of `0`.* Similarly, maps and sets are considered empty if they have a `size` of `0`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is empty, else `false`.* @example** _.isEmpty(null);* // => true** _.isEmpty(true);* // => true** _.isEmpty(1);* // => true** _.isEmpty([1, 2, 3]);* // => false** _.isEmpty({ 'a': 1 });* // => false*/function isEmpty(value) {if (isArrayLike(value) &&(isArray(value) || isString(value) ||isFunction(value.splice) || isArguments(value))) {return !value.length;}return !nativeKeys(value).length;}/*** Performs a deep comparison between two values to determine if they are* equivalent.** **Note:** This method supports comparing arrays, array buffers, booleans,* date objects, error objects, maps, numbers, `Object` objects, regexes,* sets, strings, symbols, and typed arrays. `Object` objects are compared* by their own, not inherited, enumerable properties. Functions and DOM* nodes are compared by strict equality, i.e. `===`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.* @example** var object = { 'a': 1 };* var other = { 'a': 1 };** _.isEqual(object, other);* // => true** object === other;* // => false*/function isEqual(value, other) {return baseIsEqual(value, other);}/*** Checks if `value` is a finite primitive number.** **Note:** This method is based on* [`Number.isFinite`](https://mdn.io/Number/isFinite).** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a finite number, else `false`.* @example** _.isFinite(3);* // => true** _.isFinite(Number.MIN_VALUE);* // => true** _.isFinite(Infinity);* // => false** _.isFinite('3');* // => false*/function isFinite(value) {return typeof value == 'number' && nativeIsFinite(value);}/*** Checks if `value` is classified as a `Function` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a function, else `false`.* @example** _.isFunction(_);* // => true** _.isFunction(/abc/);* // => false*/function isFunction(value) {if (!isObject(value)) {return false;}// The use of `Object#toString` avoids issues with the `typeof` operator// in Safari 9 which returns 'object' for typed arrays and other constructors.var tag = baseGetTag(value);return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;}/*** Checks if `value` is a valid array-like length.** **Note:** This method is loosely based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.* @example** _.isLength(3);* // => true** _.isLength(Number.MIN_VALUE);* // => false** _.isLength(Infinity);* // => false** _.isLength('3');* // => false*/function isLength(value) {return typeof value == 'number' &&value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;}/*** Checks if `value` is the* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an object, else `false`.* @example** _.isObject({});* // => true** _.isObject([1, 2, 3]);* // => true** _.isObject(_.noop);* // => true** _.isObject(null);* // => false*/function isObject(value) {var type = typeof value;return value != null && (type == 'object' || type == 'function');}/*** Checks if `value` is object-like. A value is object-like if it's not `null`* and has a `typeof` result of "object".** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is object-like, else `false`.* @example** _.isObjectLike({});* // => true** _.isObjectLike([1, 2, 3]);* // => true** _.isObjectLike(_.noop);* // => false** _.isObjectLike(null);* // => false*/function isObjectLike(value) {return value != null && typeof value == 'object';}/*** Checks if `value` is `NaN`.** **Note:** This method is based on* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for* `undefined` and other non-number values.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.* @example** _.isNaN(NaN);* // => true** _.isNaN(new Number(NaN));* // => true** isNaN(undefined);* // => true** _.isNaN(undefined);* // => false*/function isNaN(value) {// An `NaN` primitive is the only value that is not equal to itself.// Perform the `toStringTag` check first to avoid errors with some// ActiveX objects in IE.return isNumber(value) && value != +value;}/*** Checks if `value` is `null`.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `null`, else `false`.* @example** _.isNull(null);* // => true** _.isNull(void 0);* // => false*/function isNull(value) {return value === null;}/*** Checks if `value` is classified as a `Number` primitive or object.** **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are* classified as numbers, use the `_.isFinite` method.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a number, else `false`.* @example** _.isNumber(3);* // => true** _.isNumber(Number.MIN_VALUE);* // => true** _.isNumber(Infinity);* // => true** _.isNumber('3');* // => false*/function isNumber(value) {return typeof value == 'number' ||(isObjectLike(value) && baseGetTag(value) == numberTag);}/*** Checks if `value` is classified as a `RegExp` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.* @example** _.isRegExp(/abc/);* // => true** _.isRegExp('/abc/');* // => false*/var isRegExp = baseIsRegExp;/*** Checks if `value` is classified as a `String` primitive or object.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a string, else `false`.* @example** _.isString('abc');* // => true** _.isString(1);* // => false*/function isString(value) {return typeof value == 'string' ||(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);}/*** Checks if `value` is `undefined`.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.* @example** _.isUndefined(void 0);* // => true** _.isUndefined(null);* // => false*/function isUndefined(value) {return value === undefined;}/*** Converts `value` to an array.** @static* @since 0.1.0* @memberOf _* @category Lang* @param {*} value The value to convert.* @returns {Array} Returns the converted array.* @example** _.toArray({ 'a': 1, 'b': 2 });* // => [1, 2]** _.toArray('abc');* // => ['a', 'b', 'c']** _.toArray(1);* // => []** _.toArray(null);* // => []*/function toArray(value) {if (!isArrayLike(value)) {return values(value);}return value.length ? copyArray(value) : [];}/*** Converts `value` to an integer.** **Note:** This method is loosely based on* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {number} Returns the converted integer.* @example** _.toInteger(3.2);* // => 3** _.toInteger(Number.MIN_VALUE);* // => 0** _.toInteger(Infinity);* // => 1.7976931348623157e+308** _.toInteger('3.2');* // => 3*/var toInteger = Number;/*** Converts `value` to a number.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to process.* @returns {number} Returns the number.* @example** _.toNumber(3.2);* // => 3.2** _.toNumber(Number.MIN_VALUE);* // => 5e-324** _.toNumber(Infinity);* // => Infinity** _.toNumber('3.2');* // => 3.2*/var toNumber = Number;/*** Converts `value` to a string. An empty string is returned for `null`* and `undefined` values. The sign of `-0` is preserved.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {string} Returns the converted string.* @example** _.toString(null);* // => ''** _.toString(-0);* // => '-0'** _.toString([1, 2, 3]);* // => '1,2,3'*/function toString(value) {if (typeof value == 'string') {return value;}return value == null ? '' : (value + '');}/*------------------------------------------------------------------------*//*** Assigns own enumerable string keyed properties of source objects to the* destination object. Source objects are applied from left to right.* Subsequent sources overwrite property assignments of previous sources.** **Note:** This method mutates `object` and is loosely based on* [`Object.assign`](https://mdn.io/Object/assign).** @static* @memberOf _* @since 0.10.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assignIn* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assign({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'c': 3 }*/var assign = createAssigner(function(object, source) {copyObject(source, nativeKeys(source), object);});/*** This method is like `_.assign` except that it iterates over own and* inherited source properties.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @alias extend* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assign* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assignIn({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }*/var assignIn = createAssigner(function(object, source) {copyObject(source, nativeKeysIn(source), object);});/*** Creates an object that inherits from the `prototype` object. If a* `properties` object is given, its own enumerable string keyed properties* are assigned to the created object.** @static* @memberOf _* @since 2.3.0* @category Object* @param {Object} prototype The object to inherit from.* @param {Object} [properties] The properties to assign to the object.* @returns {Object} Returns the new object.* @example** function Shape() {* this.x = 0;* this.y = 0;* }** function Circle() {* Shape.call(this);* }** Circle.prototype = _.create(Shape.prototype, {* 'constructor': Circle* });** var circle = new Circle;* circle instanceof Circle;* // => true** circle instanceof Shape;* // => true*/function create(prototype, properties) {var result = baseCreate(prototype);return properties == null ? result : assign(result, properties);}/*** Assigns own and inherited enumerable string keyed properties of source* objects to the destination object for all destination properties that* resolve to `undefined`. Source objects are applied from left to right.* Once a property is set, additional values of the same property are ignored.** **Note:** This method mutates `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.defaultsDeep* @example** _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var defaults = baseRest(function(object, sources) {object = Object(object);var index = -1;var length = sources.length;var guard = length > 2 ? sources[2] : undefined;if (guard && isIterateeCall(sources[0], sources[1], guard)) {length = 1;}while (++index < length) {var source = sources[index];var props = keysIn(source);var propsIndex = -1;var propsLength = props.length;while (++propsIndex < propsLength) {var key = props[propsIndex];var value = object[key];if (value === undefined ||(eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {object[key] = source[key];}}}return object;});/*** Checks if `path` is a direct property of `object`.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @returns {boolean} Returns `true` if `path` exists, else `false`.* @example** var object = { 'a': { 'b': 2 } };* var other = _.create({ 'a': _.create({ 'b': 2 }) });** _.has(object, 'a');* // => true** _.has(object, 'a.b');* // => true** _.has(object, ['a', 'b']);* // => true** _.has(other, 'a');* // => false*/function has(object, path) {return object != null && hasOwnProperty.call(object, path);}/*** Creates an array of the own enumerable property names of `object`.** **Note:** Non-object values are coerced to objects. See the* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* for more details.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keys(new Foo);* // => ['a', 'b'] (iteration order is not guaranteed)** _.keys('hi');* // => ['0', '1']*/var keys = nativeKeys;/*** Creates an array of the own and inherited enumerable property names of `object`.** **Note:** Non-object values are coerced to objects.** @static* @memberOf _* @since 3.0.0* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keysIn(new Foo);* // => ['a', 'b', 'c'] (iteration order is not guaranteed)*/var keysIn = nativeKeysIn;/*** Creates an object composed of the picked `object` properties.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The source object.* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Object} Returns the new object.* @example** var object = { 'a': 1, 'b': '2', 'c': 3 };** _.pick(object, ['a', 'c']);* // => { 'a': 1, 'c': 3 }*/var pick = flatRest(function(object, paths) {return object == null ? {} : basePick(object, paths);});/*** This method is like `_.get` except that if the resolved value is a* function it's invoked with the `this` binding of its parent object and* its result is returned.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @param {Array|string} path The path of the property to resolve.* @param {*} [defaultValue] The value returned for `undefined` resolved values.* @returns {*} Returns the resolved value.* @example** var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };** _.result(object, 'a[0].b.c1');* // => 3** _.result(object, 'a[0].b.c2');* // => 4** _.result(object, 'a[0].b.c3', 'default');* // => 'default'** _.result(object, 'a[0].b.c3', _.constant('default'));* // => 'default'*/function result(object, path, defaultValue) {var value = object == null ? undefined : object[path];if (value === undefined) {value = defaultValue;}return isFunction(value) ? value.call(object) : value;}/*** Creates an array of the own enumerable string keyed property values of `object`.** **Note:** Non-object values are coerced to objects.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property values.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.values(new Foo);* // => [1, 2] (iteration order is not guaranteed)** _.values('hi');* // => ['h', 'i']*/function values(object) {return object == null ? [] : baseValues(object, keys(object));}/*------------------------------------------------------------------------*//*** Converts the characters "&", "<", ">", '"', and "'" in `string` to their* corresponding HTML entities.** **Note:** No other characters are escaped. To escape additional* characters use a third-party library like [_he_](https://mths.be/he).** Though the ">" character is escaped for symmetry, characters like* ">" and "/" don't need escaping in HTML and have no special meaning* unless they're part of a tag or unquoted attribute value. See* [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)* (under "semi-related fun fact") for more details.** When working with HTML you should always* [quote attribute values](http://wonko.com/post/html-escaping) to reduce* XSS vectors.** @static* @since 0.1.0* @memberOf _* @category String* @param {string} [string=''] The string to escape.* @returns {string} Returns the escaped string.* @example** _.escape('fred, barney, & pebbles');* // => 'fred, barney, & pebbles'*/function escape(string) {string = toString(string);return (string && reHasUnescapedHtml.test(string))? string.replace(reUnescapedHtml, escapeHtmlChar): string;}/*------------------------------------------------------------------------*//*** This method returns the first argument it receives.** @static* @since 0.1.0* @memberOf _* @category Util* @param {*} value Any value.* @returns {*} Returns `value`.* @example** var object = { 'a': 1 };** console.log(_.identity(object) === object);* // => true*/function identity(value) {return value;}/*** Creates a function that invokes `func` with the arguments of the created* function. If `func` is a property name, the created function returns the* property value for a given element. If `func` is an array or object, the* created function returns `true` for elements that contain the equivalent* source properties, otherwise it returns `false`.** @static* @since 4.0.0* @memberOf _* @category Util* @param {*} [func=_.identity] The value to convert to a callback.* @returns {Function} Returns the callback.* @example** var users = [* { 'user': 'barney', 'age': 36, 'active': true },* { 'user': 'fred', 'age': 40, 'active': false }* ];** // The `_.matches` iteratee shorthand.* _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));* // => [{ 'user': 'barney', 'age': 36, 'active': true }]** // The `_.matchesProperty` iteratee shorthand.* _.filter(users, _.iteratee(['user', 'fred']));* // => [{ 'user': 'fred', 'age': 40 }]** // The `_.property` iteratee shorthand.* _.map(users, _.iteratee('user'));* // => ['barney', 'fred']** // Create custom iteratee shorthands.* _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {* return !_.isRegExp(func) ? iteratee(func) : function(string) {* return func.test(string);* };* });** _.filter(['abc', 'def'], /ef/);* // => ['def']*/var iteratee = baseIteratee;/*** Creates a function that performs a partial deep comparison between a given* object and `source`, returning `true` if the given object has equivalent* property values, else `false`.** **Note:** The created function is equivalent to `_.isMatch` with `source`* partially applied.** Partial comparisons will match empty array and empty object `source`* values against any array or object value, respectively. See `_.isEqual`* for a list of supported value comparisons.** **Note:** Multiple values can be checked by combining several matchers* using `_.overSome`** @static* @memberOf _* @since 3.0.0* @category Util* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 1, 'b': 2, 'c': 3 },* { 'a': 4, 'b': 5, 'c': 6 }* ];** _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));* // => [{ 'a': 4, 'b': 5, 'c': 6 }]** // Checking for several possible values* _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));* // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]*/function matches(source) {return baseMatches(assign({}, source));}/*** Adds all own enumerable string keyed function properties of a source* object to the destination object. If `object` is a function, then methods* are added to its prototype as well.** **Note:** Use `_.runInContext` to create a pristine `lodash` function to* avoid conflicts caused by modifying the original.** @static* @since 0.1.0* @memberOf _* @category Util* @param {Function|Object} [object=lodash] The destination object.* @param {Object} source The object of functions to add.* @param {Object} [options={}] The options object.* @param {boolean} [options.chain=true] Specify whether mixins are chainable.* @returns {Function|Object} Returns `object`.* @example** function vowels(string) {* return _.filter(string, function(v) {* return /[aeiou]/i.test(v);* });* }** _.mixin({ 'vowels': vowels });* _.vowels('fred');* // => ['e']** _('fred').vowels().value();* // => ['e']** _.mixin({ 'vowels': vowels }, { 'chain': false });* _('fred').vowels();* // => ['e']*/function mixin(object, source, options) {var props = keys(source),methodNames = baseFunctions(source, props);if (options == null &&!(isObject(source) && (methodNames.length || !props.length))) {options = source;source = object;object = this;methodNames = baseFunctions(source, keys(source));}var chain = !(isObject(options) && 'chain' in options) || !!options.chain,isFunc = isFunction(object);baseEach(methodNames, function(methodName) {var func = source[methodName];object[methodName] = func;if (isFunc) {object.prototype[methodName] = function() {var chainAll = this.__chain__;if (chain || chainAll) {var result = object(this.__wrapped__),actions = result.__actions__ = copyArray(this.__actions__);actions.push({ 'func': func, 'args': arguments, 'thisArg': object });result.__chain__ = chainAll;return result;}return func.apply(object, arrayPush([this.value()], arguments));};}});return object;}/*** Reverts the `_` variable to its previous value and returns a reference to* the `lodash` function.** @static* @since 0.1.0* @memberOf _* @category Util* @returns {Function} Returns the `lodash` function.* @example** var lodash = _.noConflict();*/function noConflict() {if (root._ === this) {root._ = oldDash;}return this;}/*** This method returns `undefined`.** @static* @memberOf _* @since 2.3.0* @category Util* @example** _.times(2, _.noop);* // => [undefined, undefined]*/function noop() {// No operation performed.}/*** Generates a unique ID. If `prefix` is given, the ID is appended to it.** @static* @since 0.1.0* @memberOf _* @category Util* @param {string} [prefix=''] The value to prefix the ID with.* @returns {string} Returns the unique ID.* @example** _.uniqueId('contact_');* // => 'contact_104'** _.uniqueId();* // => '105'*/function uniqueId(prefix) {var id = ++idCounter;return toString(prefix) + id;}/*------------------------------------------------------------------------*//*** Computes the maximum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the maximum value.* @example** _.max([4, 2, 8, 6]);* // => 8** _.max([]);* // => undefined*/function max(array) {return (array && array.length)? baseExtremum(array, identity, baseGt): undefined;}/*** Computes the minimum value of `array`. If `array` is empty or falsey,* `undefined` is returned.** @static* @since 0.1.0* @memberOf _* @category Math* @param {Array} array The array to iterate over.* @returns {*} Returns the minimum value.* @example** _.min([4, 2, 8, 6]);* // => 2** _.min([]);* // => undefined*/function min(array) {return (array && array.length)? baseExtremum(array, identity, baseLt): undefined;}/*------------------------------------------------------------------------*/// Add methods that return wrapped values in chain sequences.lodash.assignIn = assignIn;lodash.before = before;lodash.bind = bind;lodash.chain = chain;lodash.compact = compact;lodash.concat = concat;lodash.create = create;lodash.defaults = defaults;lodash.defer = defer;lodash.delay = delay;lodash.filter = filter;lodash.flatten = flatten;lodash.flattenDeep = flattenDeep;lodash.iteratee = iteratee;lodash.keys = keys;lodash.map = map;lodash.matches = matches;lodash.mixin = mixin;lodash.negate = negate;lodash.once = once;lodash.pick = pick;lodash.slice = slice;lodash.sortBy = sortBy;lodash.tap = tap;lodash.thru = thru;lodash.toArray = toArray;lodash.values = values;// Add aliases.lodash.extend = assignIn;// Add methods to `lodash.prototype`.mixin(lodash, lodash);/*------------------------------------------------------------------------*/// Add methods that return unwrapped values in chain sequences.lodash.clone = clone;lodash.escape = escape;lodash.every = every;lodash.find = find;lodash.forEach = forEach;lodash.has = has;lodash.head = head;lodash.identity = identity;lodash.indexOf = indexOf;lodash.isArguments = isArguments;lodash.isArray = isArray;lodash.isBoolean = isBoolean;lodash.isDate = isDate;lodash.isEmpty = isEmpty;lodash.isEqual = isEqual;lodash.isFinite = isFinite;lodash.isFunction = isFunction;lodash.isNaN = isNaN;lodash.isNull = isNull;lodash.isNumber = isNumber;lodash.isObject = isObject;lodash.isRegExp = isRegExp;lodash.isString = isString;lodash.isUndefined = isUndefined;lodash.last = last;lodash.max = max;lodash.min = min;lodash.noConflict = noConflict;lodash.noop = noop;lodash.reduce = reduce;lodash.result = result;lodash.size = size;lodash.some = some;lodash.uniqueId = uniqueId;// Add aliases.lodash.each = forEach;lodash.first = head;mixin(lodash, (function() {var source = {};baseForOwn(lodash, function(func, methodName) {if (!hasOwnProperty.call(lodash.prototype, methodName)) {source[methodName] = func;}});return source;}()), { 'chain': false });/*------------------------------------------------------------------------*//*** The semantic version number.** @static* @memberOf _* @type {string}*/lodash.VERSION = VERSION;// Add `Array` methods to `lodash.prototype`.baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName],chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName);lodash.prototype[methodName] = function() {var args = arguments;if (retUnwrapped && !this.__chain__) {var value = this.value();return func.apply(isArray(value) ? value : [], args);}return this[chainName](function(value) {return func.apply(isArray(value) ? value : [], args);});};});// Add chain sequence methods to the `lodash` wrapper.lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;/*--------------------------------------------------------------------------*/// Some AMD build optimizers, like r.js, check for condition patterns like:if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {// Expose Lodash on the global object to prevent errors when Lodash is// loaded by a script tag in the presence of an AMD loader.// See http://requirejs.org/docs/errors.html#mismatch for more details.// Use `_.noConflict` to remove Lodash from the global object.root._ = lodash;// Define as an anonymous module so, through path mapping, it can be// referenced as the "underscore" module.define(function() {return lodash;});}// Check for `exports` after `define` in case a build optimizer adds it.else if (freeModule) {// Export for Node.js.(freeModule.exports = lodash)._ = lodash;// Export for CommonJS support.freeExports._ = lodash;}else {// Export to the global object.root._ = lodash;}}.call(this));
/*** Creates a function that returns `value`.** @static* @memberOf _* @since 2.4.0* @category Util* @param {*} value The value to return from the new function.* @returns {Function} Returns the new constant function.* @example** var objects = _.times(2, _.constant({ 'a': 1 }));** console.log(objects);* // => [{ 'a': 1 }, { 'a': 1 }]** console.log(objects[0] === objects[1]);* // => true*/function constant(value) {return function() {return value;};}module.exports = constant;
var baseConformsTo = require('./_baseConformsTo'),keys = require('./keys');/*** Checks if `object` conforms to `source` by invoking the predicate* properties of `source` with the corresponding property values of `object`.** **Note:** This method is equivalent to `_.conforms` when `source` is* partially applied.** @static* @memberOf _* @since 4.14.0* @category Lang* @param {Object} object The object to inspect.* @param {Object} source The object of property predicates to conform to.* @returns {boolean} Returns `true` if `object` conforms, else `false`.* @example** var object = { 'a': 1, 'b': 2 };** _.conformsTo(object, { 'b': function(n) { return n > 1; } });* // => true** _.conformsTo(object, { 'b': function(n) { return n > 2; } });* // => false*/function conformsTo(object, source) {return source == null || baseConformsTo(object, source, keys(source));}module.exports = conformsTo;
var baseClone = require('./_baseClone'),baseConforms = require('./_baseConforms');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1;/*** Creates a function that invokes the predicate properties of `source` with* the corresponding property values of a given object, returning `true` if* all predicates return truthy, else `false`.** **Note:** The created function is equivalent to `_.conformsTo` with* `source` partially applied.** @static* @memberOf _* @since 4.0.0* @category Util* @param {Object} source The object of property predicates to conform to.* @returns {Function} Returns the new spec function.* @example** var objects = [* { 'a': 2, 'b': 1 },* { 'a': 1, 'b': 2 }* ];** _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));* // => [{ 'a': 1, 'b': 2 }]*/function conforms(source) {return baseConforms(baseClone(source, CLONE_DEEP_FLAG));}module.exports = conforms;
var apply = require('./_apply'),arrayMap = require('./_arrayMap'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a function that iterates over `pairs` and invokes the corresponding* function of the first predicate to return truthy. The predicate-function* pairs are invoked with the `this` binding and arguments of the created* function.** @static* @memberOf _* @since 4.0.0* @category Util* @param {Array} pairs The predicate-function pairs.* @returns {Function} Returns the new composite function.* @example** var func = _.cond([* [_.matches({ 'a': 1 }), _.constant('matches A')],* [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],* [_.stubTrue, _.constant('no match')]* ]);** func({ 'a': 1, 'b': 2 });* // => 'matches A'** func({ 'a': 0, 'b': 1 });* // => 'matches B'** func({ 'a': '1', 'b': '2' });* // => 'no match'*/function cond(pairs) {var length = pairs == null ? 0 : pairs.length,toIteratee = baseIteratee;pairs = !length ? [] : arrayMap(pairs, function(pair) {if (typeof pair[1] != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return [toIteratee(pair[0]), pair[1]];});return baseRest(function(args) {var index = -1;while (++index < length) {var pair = pairs[index];if (apply(pair[0], this, args)) {return apply(pair[1], this, args);}}});}module.exports = cond;
var arrayPush = require('./_arrayPush'),baseFlatten = require('./_baseFlatten'),copyArray = require('./_copyArray'),isArray = require('./isArray');/*** Creates a new array concatenating `array` with any additional arrays* and/or values.** @static* @memberOf _* @since 4.0.0* @category Array* @param {Array} array The array to concatenate.* @param {...*} [values] The values to concatenate.* @returns {Array} Returns the new concatenated array.* @example** var array = [1];* var other = _.concat(array, 2, [3], [[4]]);** console.log(other);* // => [1, 2, 3, [4]]** console.log(array);* // => [1]*/function concat() {var length = arguments.length;if (!length) {return [];}var args = Array(length - 1),array = arguments[0],index = length;while (index--) {args[index - 1] = arguments[index];}return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));}module.exports = concat;
/*** Creates an array with all falsey values removed. The values `false`, `null`,* `0`, `""`, `undefined`, and `NaN` are falsey.** @static* @memberOf _* @since 0.1.0* @category Array* @param {Array} array The array to compact.* @returns {Array} Returns the new array of filtered values.* @example** _.compact([0, 1, false, 2, '', 3]);* // => [1, 2, 3]*/function compact(array) {var index = -1,length = array == null ? 0 : array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (value) {result[resIndex++] = value;}}return result;}module.exports = compact;
var LodashWrapper = require('./_LodashWrapper');/*** Executes the chain sequence and returns the wrapped result.** @name commit* @memberOf _* @since 3.2.0* @category Seq* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var array = [1, 2];* var wrapped = _(array).push(3);** console.log(array);* // => [1, 2]** wrapped = wrapped.commit();* console.log(array);* // => [1, 2, 3]** wrapped.last();* // => 3** console.log(array);* // => [1, 2, 3]*/function wrapperCommit() {return new LodashWrapper(this.value(), this.__chain__);}module.exports = wrapperCommit;
module.exports = {'countBy': require('./countBy'),'each': require('./each'),'eachRight': require('./eachRight'),'every': require('./every'),'filter': require('./filter'),'find': require('./find'),'findLast': require('./findLast'),'flatMap': require('./flatMap'),'flatMapDeep': require('./flatMapDeep'),'flatMapDepth': require('./flatMapDepth'),'forEach': require('./forEach'),'forEachRight': require('./forEachRight'),'groupBy': require('./groupBy'),'includes': require('./includes'),'invokeMap': require('./invokeMap'),'keyBy': require('./keyBy'),'map': require('./map'),'orderBy': require('./orderBy'),'partition': require('./partition'),'reduce': require('./reduce'),'reduceRight': require('./reduceRight'),'reject': require('./reject'),'sample': require('./sample'),'sampleSize': require('./sampleSize'),'shuffle': require('./shuffle'),'size': require('./size'),'some': require('./some'),'sortBy': require('./sortBy')};
var baseClone = require('./_baseClone');/** Used to compose bitmasks for cloning. */var CLONE_SYMBOLS_FLAG = 4;/*** This method is like `_.clone` except that it accepts `customizer` which* is invoked to produce the cloned value. If `customizer` returns `undefined`,* cloning is handled by the method instead. The `customizer` is invoked with* up to four arguments; (value [, index|key, object, stack]).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to clone.* @param {Function} [customizer] The function to customize cloning.* @returns {*} Returns the cloned value.* @see _.cloneDeepWith* @example** function customizer(value) {* if (_.isElement(value)) {* return value.cloneNode(false);* }* }** var el = _.cloneWith(document.body, customizer);** console.log(el === document.body);* // => false* console.log(el.nodeName);* // => 'BODY'* console.log(el.childNodes.length);* // => 0*/function cloneWith(value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);}module.exports = cloneWith;
var baseClone = require('./_baseClone');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1,CLONE_SYMBOLS_FLAG = 4;/*** This method is like `_.cloneWith` except that it recursively clones `value`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to recursively clone.* @param {Function} [customizer] The function to customize cloning.* @returns {*} Returns the deep cloned value.* @see _.cloneWith* @example** function customizer(value) {* if (_.isElement(value)) {* return value.cloneNode(true);* }* }** var el = _.cloneDeepWith(document.body, customizer);** console.log(el === document.body);* // => false* console.log(el.nodeName);* // => 'BODY'* console.log(el.childNodes.length);* // => 20*/function cloneDeepWith(value, customizer) {customizer = typeof customizer == 'function' ? customizer : undefined;return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);}module.exports = cloneDeepWith;
var baseClone = require('./_baseClone');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1,CLONE_SYMBOLS_FLAG = 4;/*** This method is like `_.clone` except that it recursively clones `value`.** @static* @memberOf _* @since 1.0.0* @category Lang* @param {*} value The value to recursively clone.* @returns {*} Returns the deep cloned value.* @see _.clone* @example** var objects = [{ 'a': 1 }, { 'b': 2 }];** var deep = _.cloneDeep(objects);* console.log(deep[0] === objects[0]);* // => false*/function cloneDeep(value) {return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);}module.exports = cloneDeep;
var baseClone = require('./_baseClone');/** Used to compose bitmasks for cloning. */var CLONE_SYMBOLS_FLAG = 4;/*** Creates a shallow clone of `value`.** **Note:** This method is loosely based on the* [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)* and supports cloning arrays, array buffers, booleans, date objects, maps,* numbers, `Object` objects, regexes, sets, strings, symbols, and typed* arrays. The own enumerable properties of `arguments` objects are cloned* as plain objects. An empty object is returned for uncloneable values such* as error objects, functions, DOM nodes, and WeakMaps.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to clone.* @returns {*} Returns the cloned value.* @see _.cloneDeep* @example** var objects = [{ 'a': 1 }, { 'b': 2 }];** var shallow = _.clone(objects);* console.log(shallow[0] === objects[0]);* // => true*/function clone(value) {return baseClone(value, CLONE_SYMBOLS_FLAG);}module.exports = clone;
var baseClamp = require('./_baseClamp'),toNumber = require('./toNumber');/*** Clamps `number` within the inclusive `lower` and `upper` bounds.** @static* @memberOf _* @since 4.0.0* @category Number* @param {number} number The number to clamp.* @param {number} [lower] The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the clamped number.* @example** _.clamp(-10, -5, 5);* // => -5** _.clamp(10, -5, 5);* // => 5*/function clamp(number, lower, upper) {if (upper === undefined) {upper = lower;lower = undefined;}if (upper !== undefined) {upper = toNumber(upper);upper = upper === upper ? upper : 0;}if (lower !== undefined) {lower = toNumber(lower);lower = lower === lower ? lower : 0;}return baseClamp(toNumber(number), lower, upper);}module.exports = clamp;
var baseSlice = require('./_baseSlice'),isIterateeCall = require('./_isIterateeCall'),toInteger = require('./toInteger');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil,nativeMax = Math.max;/*** Creates an array of elements split into groups the length of `size`.* If `array` can't be split evenly, the final chunk will be the remaining* elements.** @static* @memberOf _* @since 3.0.0* @category Array* @param {Array} array The array to process.* @param {number} [size=1] The length of each chunk* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Array} Returns the new array of chunks.* @example** _.chunk(['a', 'b', 'c', 'd'], 2);* // => [['a', 'b'], ['c', 'd']]** _.chunk(['a', 'b', 'c', 'd'], 3);* // => [['a', 'b', 'c'], ['d']]*/function chunk(array, size, guard) {if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {size = 1;} else {size = nativeMax(toInteger(size), 0);}var length = array == null ? 0 : array.length;if (!length || size < 1) {return [];}var index = 0,resIndex = 0,result = Array(nativeCeil(length / size));while (index < length) {result[resIndex++] = baseSlice(array, index, (index += size));}return result;}module.exports = chunk;
var lodash = require('./wrapperLodash');/*** Creates a `lodash` wrapper instance that wraps `value` with explicit method* chain sequences enabled. The result of such sequences must be unwrapped* with `_#value`.** @static* @memberOf _* @since 1.3.0* @category Seq* @param {*} value The value to wrap.* @returns {Object} Returns the new `lodash` wrapper instance.* @example** var users = [* { 'user': 'barney', 'age': 36 },* { 'user': 'fred', 'age': 40 },* { 'user': 'pebbles', 'age': 1 }* ];** var youngest = _* .chain(users)* .sortBy('age')* .map(function(o) {* return o.user + ' is ' + o.age;* })* .head()* .value();* // => 'pebbles is 1'*/function chain(value) {var result = lodash(value);result.__chain__ = true;return result;}module.exports = chain;
var createRound = require('./_createRound');/*** Computes `number` rounded up to `precision`.** @static* @memberOf _* @since 3.10.0* @category Math* @param {number} number The number to round up.* @param {number} [precision=0] The precision to round up to.* @returns {number} Returns the rounded up number.* @example** _.ceil(4.006);* // => 5** _.ceil(6.004, 2);* // => 6.01** _.ceil(6040, -2);* // => 6100*/var ceil = createRound('ceil');module.exports = ceil;
var isArray = require('./isArray');/*** Casts `value` as an array if it's not one.** @static* @memberOf _* @since 4.4.0* @category Lang* @param {*} value The value to inspect.* @returns {Array} Returns the cast array.* @example** _.castArray(1);* // => [1]** _.castArray({ 'a': 1 });* // => [{ 'a': 1 }]** _.castArray('abc');* // => ['abc']** _.castArray(null);* // => [null]** _.castArray(undefined);* // => [undefined]** _.castArray();* // => []** var array = [1, 2, 3];* console.log(_.castArray(array) === array);* // => true*/function castArray() {if (!arguments.length) {return [];}var value = arguments[0];return isArray(value) ? value : [value];}module.exports = castArray;
var toString = require('./toString'),upperFirst = require('./upperFirst');/*** Converts the first character of `string` to upper case and the remaining* to lower case.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to capitalize.* @returns {string} Returns the capitalized string.* @example** _.capitalize('FRED');* // => 'Fred'*/function capitalize(string) {return upperFirst(toString(string).toLowerCase());}module.exports = capitalize;
var capitalize = require('./capitalize'),createCompounder = require('./_createCompounder');/*** Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to convert.* @returns {string} Returns the camel cased string.* @example** _.camelCase('Foo Bar');* // => 'fooBar'** _.camelCase('--foo-bar--');* // => 'fooBar'** _.camelCase('__FOO_BAR__');* // => 'fooBar'*/var camelCase = createCompounder(function(result, word, index) {word = word.toLowerCase();return result + (index ? capitalize(word) : word);});module.exports = camelCase;
var baseRest = require('./_baseRest'),createWrap = require('./_createWrap'),getHolder = require('./_getHolder'),replaceHolders = require('./_replaceHolders');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_PARTIAL_FLAG = 32;/*** Creates a function that invokes the method at `object[key]` with `partials`* prepended to the arguments it receives.** This method differs from `_.bind` by allowing bound functions to reference* methods that may be redefined or don't yet exist. See* [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)* for more details.** The `_.bindKey.placeholder` value, which defaults to `_` in monolithic* builds, may be used as a placeholder for partially applied arguments.** @static* @memberOf _* @since 0.10.0* @category Function* @param {Object} object The object to invoke the method on.* @param {string} key The key of the method.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new bound function.* @example** var object = {* 'user': 'fred',* 'greet': function(greeting, punctuation) {* return greeting + ' ' + this.user + punctuation;* }* };** var bound = _.bindKey(object, 'greet', 'hi');* bound('!');* // => 'hi fred!'** object.greet = function(greeting, punctuation) {* return greeting + 'ya ' + this.user + punctuation;* };** bound('!');* // => 'hiya fred!'** // Bound with placeholders.* var bound = _.bindKey(object, 'greet', _, '!');* bound('hi');* // => 'hiya fred!'*/var bindKey = baseRest(function(object, key, partials) {var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;if (partials.length) {var holders = replaceHolders(partials, getHolder(bindKey));bitmask |= WRAP_PARTIAL_FLAG;}return createWrap(key, bitmask, object, partials, holders);});// Assign default placeholders.bindKey.placeholder = {};module.exports = bindKey;
var arrayEach = require('./_arrayEach'),baseAssignValue = require('./_baseAssignValue'),bind = require('./bind'),flatRest = require('./_flatRest'),toKey = require('./_toKey');/*** Binds methods of an object to the object itself, overwriting the existing* method.** **Note:** This method doesn't set the "length" property of bound functions.** @static* @since 0.1.0* @memberOf _* @category Util* @param {Object} object The object to bind and assign the bound methods to.* @param {...(string|string[])} methodNames The object method names to bind.* @returns {Object} Returns `object`.* @example** var view = {* 'label': 'docs',* 'click': function() {* console.log('clicked ' + this.label);* }* };** _.bindAll(view, ['click']);* jQuery(element).on('click', view.click);* // => Logs 'clicked docs' when clicked.*/var bindAll = flatRest(function(object, methodNames) {arrayEach(methodNames, function(key) {key = toKey(key);baseAssignValue(object, key, bind(object[key], object));});return object;});module.exports = bindAll;
var baseRest = require('./_baseRest'),createWrap = require('./_createWrap'),getHolder = require('./_getHolder'),replaceHolders = require('./_replaceHolders');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_PARTIAL_FLAG = 32;/*** Creates a function that invokes `func` with the `this` binding of `thisArg`* and `partials` prepended to the arguments it receives.** The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,* may be used as a placeholder for partially applied arguments.** **Note:** Unlike native `Function#bind`, this method doesn't set the "length"* property of bound functions.** @static* @memberOf _* @since 0.1.0* @category Function* @param {Function} func The function to bind.* @param {*} thisArg The `this` binding of `func`.* @param {...*} [partials] The arguments to be partially applied.* @returns {Function} Returns the new bound function.* @example** function greet(greeting, punctuation) {* return greeting + ' ' + this.user + punctuation;* }** var object = { 'user': 'fred' };** var bound = _.bind(greet, object, 'hi');* bound('!');* // => 'hi fred!'** // Bound with placeholders.* var bound = _.bind(greet, object, _, '!');* bound('hi');* // => 'hi fred!'*/var bind = baseRest(function(func, thisArg, partials) {var bitmask = WRAP_BIND_FLAG;if (partials.length) {var holders = replaceHolders(partials, getHolder(bind));bitmask |= WRAP_PARTIAL_FLAG;}return createWrap(func, bitmask, thisArg, partials, holders);});// Assign default placeholders.bind.placeholder = {};module.exports = bind;
var toInteger = require('./toInteger');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** Creates a function that invokes `func`, with the `this` binding and arguments* of the created function, while it's called less than `n` times. Subsequent* calls to the created function return the result of the last `func` invocation.** @static* @memberOf _* @since 3.0.0* @category Function* @param {number} n The number of calls at which `func` is no longer invoked.* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** jQuery(element).on('click', _.before(5, addContactToList));* // => Allows adding up to 4 contacts to the list.*/function before(n, func) {var result;if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}n = toInteger(n);return function() {if (--n > 0) {result = func.apply(this, arguments);}if (n <= 1) {func = undefined;}return result;};}module.exports = before;
var apply = require('./_apply'),baseRest = require('./_baseRest'),isError = require('./isError');/*** Attempts to invoke `func`, returning either the result or the caught error* object. Any additional arguments are provided to `func` when it's invoked.** @static* @memberOf _* @since 3.0.0* @category Util* @param {Function} func The function to attempt.* @param {...*} [args] The arguments to invoke `func` with.* @returns {*} Returns the `func` result or error object.* @example** // Avoid throwing errors for invalid selectors.* var elements = _.attempt(function(selector) {* return document.querySelectorAll(selector);* }, '>_>');** if (_.isError(elements)) {* elements = [];* }*/var attempt = baseRest(function(func, args) {try {return apply(func, undefined, args);} catch (e) {return isError(e) ? e : new Error(e);}});module.exports = attempt;
var baseAt = require('./_baseAt'),flatRest = require('./_flatRest');/*** Creates an array of values corresponding to `paths` of `object`.** @static* @memberOf _* @since 1.0.0* @category Object* @param {Object} object The object to iterate over.* @param {...(string|string[])} [paths] The property paths to pick.* @returns {Array} Returns the picked values.* @example** var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };** _.at(object, ['a[0].b.c', 'a[1]']);* // => [3, 4]*/var at = flatRest(baseAt);module.exports = at;
var copyObject = require('./_copyObject'),createAssigner = require('./_createAssigner'),keys = require('./keys');/*** This method is like `_.assign` except that it accepts `customizer`* which is invoked to produce the assigned values. If `customizer` returns* `undefined`, assignment is handled by the method instead. The `customizer`* is invoked with five arguments: (objValue, srcValue, key, object, source).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @see _.assignInWith* @example** function customizer(objValue, srcValue) {* return _.isUndefined(objValue) ? srcValue : objValue;* }** var defaults = _.partialRight(_.assignWith, customizer);** defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var assignWith = createAssigner(function(object, source, srcIndex, customizer) {copyObject(source, keys(source), object, customizer);});module.exports = assignWith;
var copyObject = require('./_copyObject'),createAssigner = require('./_createAssigner'),keysIn = require('./keysIn');/*** This method is like `_.assignIn` except that it accepts `customizer`* which is invoked to produce the assigned values. If `customizer` returns* `undefined`, assignment is handled by the method instead. The `customizer`* is invoked with five arguments: (objValue, srcValue, key, object, source).** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @alias extendWith* @category Object* @param {Object} object The destination object.* @param {...Object} sources The source objects.* @param {Function} [customizer] The function to customize assigned values.* @returns {Object} Returns `object`.* @see _.assignWith* @example** function customizer(objValue, srcValue) {* return _.isUndefined(objValue) ? srcValue : objValue;* }** var defaults = _.partialRight(_.assignInWith, customizer);** defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });* // => { 'a': 1, 'b': 2 }*/var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {copyObject(source, keysIn(source), object, customizer);});module.exports = assignInWith;
var copyObject = require('./_copyObject'),createAssigner = require('./_createAssigner'),keysIn = require('./keysIn');/*** This method is like `_.assign` except that it iterates over own and* inherited source properties.** **Note:** This method mutates `object`.** @static* @memberOf _* @since 4.0.0* @alias extend* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assign* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assignIn({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }*/var assignIn = createAssigner(function(object, source) {copyObject(source, keysIn(source), object);});module.exports = assignIn;
var assignValue = require('./_assignValue'),copyObject = require('./_copyObject'),createAssigner = require('./_createAssigner'),isArrayLike = require('./isArrayLike'),isPrototype = require('./_isPrototype'),keys = require('./keys');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Assigns own enumerable string keyed properties of source objects to the* destination object. Source objects are applied from left to right.* Subsequent sources overwrite property assignments of previous sources.** **Note:** This method mutates `object` and is loosely based on* [`Object.assign`](https://mdn.io/Object/assign).** @static* @memberOf _* @since 0.10.0* @category Object* @param {Object} object The destination object.* @param {...Object} [sources] The source objects.* @returns {Object} Returns `object`.* @see _.assignIn* @example** function Foo() {* this.a = 1;* }** function Bar() {* this.c = 3;* }** Foo.prototype.b = 2;* Bar.prototype.d = 4;** _.assign({ 'a': 0 }, new Foo, new Bar);* // => { 'a': 1, 'c': 3 }*/var assign = createAssigner(function(object, source) {if (isPrototype(source) || isArrayLike(source)) {copyObject(source, keys(source), object);return;}for (var key in source) {if (hasOwnProperty.call(source, key)) {assignValue(object, key, source[key]);}}});module.exports = assign;
var createWrap = require('./_createWrap');/** Used to compose bitmasks for function metadata. */var WRAP_ARY_FLAG = 128;/*** Creates a function that invokes `func`, with up to `n` arguments,* ignoring any additional arguments.** @static* @memberOf _* @since 3.0.0* @category Function* @param {Function} func The function to cap arguments for.* @param {number} [n=func.length] The arity cap.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {Function} Returns the new capped function.* @example** _.map(['6', '8', '10'], _.ary(parseInt, 1));* // => [6, 8, 10]*/function ary(func, n, guard) {n = guard ? undefined : n;n = (func && n == null) ? func.length : n;return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);}module.exports = ary;
module.exports = {'chunk': require('./chunk'),'compact': require('./compact'),'concat': require('./concat'),'difference': require('./difference'),'differenceBy': require('./differenceBy'),'differenceWith': require('./differenceWith'),'drop': require('./drop'),'dropRight': require('./dropRight'),'dropRightWhile': require('./dropRightWhile'),'dropWhile': require('./dropWhile'),'fill': require('./fill'),'findIndex': require('./findIndex'),'findLastIndex': require('./findLastIndex'),'first': require('./first'),'flatten': require('./flatten'),'flattenDeep': require('./flattenDeep'),'flattenDepth': require('./flattenDepth'),'fromPairs': require('./fromPairs'),'head': require('./head'),'indexOf': require('./indexOf'),'initial': require('./initial'),'intersection': require('./intersection'),'intersectionBy': require('./intersectionBy'),'intersectionWith': require('./intersectionWith'),'join': require('./join'),'last': require('./last'),'lastIndexOf': require('./lastIndexOf'),'nth': require('./nth'),'pull': require('./pull'),'pullAll': require('./pullAll'),'pullAllBy': require('./pullAllBy'),'pullAllWith': require('./pullAllWith'),'pullAt': require('./pullAt'),'remove': require('./remove'),'reverse': require('./reverse'),'slice': require('./slice'),'sortedIndex': require('./sortedIndex'),'sortedIndexBy': require('./sortedIndexBy'),'sortedIndexOf': require('./sortedIndexOf'),'sortedLastIndex': require('./sortedLastIndex'),'sortedLastIndexBy': require('./sortedLastIndexBy'),'sortedLastIndexOf': require('./sortedLastIndexOf'),'sortedUniq': require('./sortedUniq'),'sortedUniqBy': require('./sortedUniqBy'),'tail': require('./tail'),'take': require('./take'),'takeRight': require('./takeRight'),'takeRightWhile': require('./takeRightWhile'),'takeWhile': require('./takeWhile'),'union': require('./union'),'unionBy': require('./unionBy'),'unionWith': require('./unionWith'),'uniq': require('./uniq'),'uniqBy': require('./uniqBy'),'uniqWith': require('./uniqWith'),'unzip': require('./unzip'),'unzipWith': require('./unzipWith'),'without': require('./without'),'xor': require('./xor'),'xorBy': require('./xorBy'),'xorWith': require('./xorWith'),'zip': require('./zip'),'zipObject': require('./zipObject'),'zipObjectDeep': require('./zipObjectDeep'),'zipWith': require('./zipWith')};
var toInteger = require('./toInteger');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** The opposite of `_.before`; this method creates a function that invokes* `func` once it's called `n` or more times.** @static* @memberOf _* @since 0.1.0* @category Function* @param {number} n The number of calls before `func` is invoked.* @param {Function} func The function to restrict.* @returns {Function} Returns the new restricted function.* @example** var saves = ['profile', 'settings'];** var done = _.after(saves.length, function() {* console.log('done saving!');* });** _.forEach(saves, function(type) {* asyncSave({ 'type': type, 'complete': done });* });* // => Logs 'done saving!' after the two async saves have completed.*/function after(n, func) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}n = toInteger(n);return function() {if (--n < 1) {return func.apply(this, arguments);}};}module.exports = after;
var createMathOperation = require('./_createMathOperation');/*** Adds two numbers.** @static* @memberOf _* @since 3.4.0* @category Math* @param {number} augend The first number in an addition.* @param {number} addend The second number in an addition.* @returns {number} Returns the total.* @example** _.add(6, 4);* // => 10*/var add = createMathOperation(function(augend, addend) {return augend + addend;}, 0);module.exports = add;
var LazyWrapper = require('./_LazyWrapper'),LodashWrapper = require('./_LodashWrapper'),copyArray = require('./_copyArray');/*** Creates a clone of `wrapper`.** @private* @param {Object} wrapper The wrapper to clone.* @returns {Object} Returns the cloned wrapper.*/function wrapperClone(wrapper) {if (wrapper instanceof LazyWrapper) {return wrapper.clone();}var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);result.__actions__ = copyArray(wrapper.__actions__);result.__index__ = wrapper.__index__;result.__values__ = wrapper.__values__;return result;}module.exports = wrapperClone;
var arrayEach = require('./_arrayEach'),arrayIncludes = require('./_arrayIncludes');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_FLAG = 8,WRAP_CURRY_RIGHT_FLAG = 16,WRAP_PARTIAL_FLAG = 32,WRAP_PARTIAL_RIGHT_FLAG = 64,WRAP_ARY_FLAG = 128,WRAP_REARG_FLAG = 256,WRAP_FLIP_FLAG = 512;/** Used to associate wrap methods with their bit flags. */var wrapFlags = [['ary', WRAP_ARY_FLAG],['bind', WRAP_BIND_FLAG],['bindKey', WRAP_BIND_KEY_FLAG],['curry', WRAP_CURRY_FLAG],['curryRight', WRAP_CURRY_RIGHT_FLAG],['flip', WRAP_FLIP_FLAG],['partial', WRAP_PARTIAL_FLAG],['partialRight', WRAP_PARTIAL_RIGHT_FLAG],['rearg', WRAP_REARG_FLAG]];/*** Updates wrapper `details` based on `bitmask` flags.** @private* @returns {Array} details The details to modify.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @returns {Array} Returns `details`.*/function updateWrapDetails(details, bitmask) {arrayEach(wrapFlags, function(pair) {var value = '_.' + pair[0];if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {details.push(value);}});return details.sort();}module.exports = updateWrapDetails;
/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff',rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,rsDingbatRange = '\\u2700-\\u27bf',rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',rsPunctuationRange = '\\u2000-\\u206f',rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',rsVarRange = '\\ufe0e\\ufe0f',rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;/** Used to compose unicode capture groups. */var rsApos = "['\u2019]",rsBreak = '[' + rsBreakRange + ']',rsCombo = '[' + rsComboRange + ']',rsDigits = '\\d+',rsDingbat = '[' + rsDingbatRange + ']',rsLower = '[' + rsLowerRange + ']',rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',rsFitz = '\\ud83c[\\udffb-\\udfff]',rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',rsNonAstral = '[^' + rsAstralRange + ']',rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',rsUpper = '[' + rsUpperRange + ']',rsZWJ = '\\u200d';/** Used to compose unicode regexes. */var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',reOptMod = rsModifier + '?',rsOptVar = '[' + rsVarRange + ']?',rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',rsSeq = rsOptVar + reOptMod + rsOptJoin,rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;/** Used to match complex or compound words. */var reUnicodeWord = RegExp([rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,rsUpper + '+' + rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'), 'g');/*** Splits a Unicode `string` into an array of its words.** @private* @param {string} The string to inspect.* @returns {Array} Returns the words of `string`.*/function unicodeWords(string) {return string.match(reUnicodeWord) || [];}module.exports = unicodeWords;
/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff',rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,rsVarRange = '\\ufe0e\\ufe0f';/** Used to compose unicode capture groups. */var rsAstral = '[' + rsAstralRange + ']',rsCombo = '[' + rsComboRange + ']',rsFitz = '\\ud83c[\\udffb-\\udfff]',rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',rsNonAstral = '[^' + rsAstralRange + ']',rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',rsZWJ = '\\u200d';/** Used to compose unicode regexes. */var reOptMod = rsModifier + '?',rsOptVar = '[' + rsVarRange + ']?',rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',rsSeq = rsOptVar + reOptMod + rsOptJoin,rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');/*** Converts a Unicode `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function unicodeToArray(string) {return string.match(reUnicode) || [];}module.exports = unicodeToArray;
/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff',rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,rsVarRange = '\\ufe0e\\ufe0f';/** Used to compose unicode capture groups. */var rsAstral = '[' + rsAstralRange + ']',rsCombo = '[' + rsComboRange + ']',rsFitz = '\\ud83c[\\udffb-\\udfff]',rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',rsNonAstral = '[^' + rsAstralRange + ']',rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',rsZWJ = '\\u200d';/** Used to compose unicode regexes. */var reOptMod = rsModifier + '?',rsOptVar = '[' + rsVarRange + ']?',rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',rsSeq = rsOptVar + reOptMod + rsOptJoin,rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');/*** Gets the size of a Unicode `string`.** @private* @param {string} string The string inspect.* @returns {number} Returns the string size.*/function unicodeSize(string) {var result = reUnicode.lastIndex = 0;while (reUnicode.test(string)) {++result;}return result;}module.exports = unicodeSize;
var basePropertyOf = require('./_basePropertyOf');/** Used to map HTML entities to characters. */var htmlUnescapes = {'&': '&','<': '<','>': '>','"': '"',''': "'"};/*** Used by `_.unescape` to convert HTML entities to characters.** @private* @param {string} chr The matched character to unescape.* @returns {string} Returns the unescaped character.*/var unescapeHtmlChar = basePropertyOf(htmlUnescapes);module.exports = unescapeHtmlChar;
/** Used for built-in method references. */var funcProto = Function.prototype;/** Used to resolve the decompiled source of functions. */var funcToString = funcProto.toString;/*** Converts `func` to its source code.** @private* @param {Function} func The function to convert.* @returns {string} Returns the source code.*/function toSource(func) {if (func != null) {try {return funcToString.call(func);} catch (e) {}try {return (func + '');} catch (e) {}}return '';}module.exports = toSource;
var isSymbol = require('./isSymbol');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/*** Converts `value` to a string key if it's not a string or symbol.** @private* @param {*} value The value to inspect.* @returns {string|symbol} Returns the key.*/function toKey(value) {if (typeof value == 'string' || isSymbol(value)) {return value;}var result = (value + '');return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;}module.exports = toKey;
var memoizeCapped = require('./_memoizeCapped');/** Used to match property names within property paths. */var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/** Used to match backslashes in property paths. */var reEscapeChar = /\\(\\)?/g;/*** Converts `string` to a property path array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the property path array.*/var stringToPath = memoizeCapped(function(string) {var result = [];if (string.charCodeAt(0) === 46 /* . */) {result.push('');}string.replace(rePropName, function(match, number, quote, subString) {result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));});return result;});module.exports = stringToPath;
var asciiToArray = require('./_asciiToArray'),hasUnicode = require('./_hasUnicode'),unicodeToArray = require('./_unicodeToArray');/*** Converts `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function stringToArray(string) {return hasUnicode(string)? unicodeToArray(string): asciiToArray(string);}module.exports = stringToArray;
var asciiSize = require('./_asciiSize'),hasUnicode = require('./_hasUnicode'),unicodeSize = require('./_unicodeSize');/*** Gets the number of symbols in `string`.** @private* @param {string} string The string to inspect.* @returns {number} Returns the string size.*/function stringSize(string) {return hasUnicode(string)? unicodeSize(string): asciiSize(string);}module.exports = stringSize;
/*** A specialized version of `_.lastIndexOf` which performs strict equality* comparisons of values, i.e. `===`.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function strictLastIndexOf(array, value, fromIndex) {var index = fromIndex + 1;while (index--) {if (array[index] === value) {return index;}}return index;}module.exports = strictLastIndexOf;
/*** A specialized version of `_.indexOf` which performs strict equality* comparisons of values, i.e. `===`.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function strictIndexOf(array, value, fromIndex) {var index = fromIndex - 1,length = array.length;while (++index < length) {if (array[index] === value) {return index;}}return -1;}module.exports = strictIndexOf;
var ListCache = require('./_ListCache'),Map = require('./_Map'),MapCache = require('./_MapCache');/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE = 200;/*** Sets the stack `key` to `value`.** @private* @name set* @memberOf Stack* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the stack cache instance.*/function stackSet(key, value) {var data = this.__data__;if (data instanceof ListCache) {var pairs = data.__data__;if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {pairs.push([key, value]);this.size = ++data.size;return this;}data = this.__data__ = new MapCache(pairs);}data.set(key, value);this.size = data.size;return this;}module.exports = stackSet;
/*** Checks if a stack value for `key` exists.** @private* @name has* @memberOf Stack* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function stackHas(key) {return this.__data__.has(key);}module.exports = stackHas;
/*** Gets the stack value for `key`.** @private* @name get* @memberOf Stack* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function stackGet(key) {return this.__data__.get(key);}module.exports = stackGet;
/*** Removes `key` and its value from the stack.** @private* @name delete* @memberOf Stack* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function stackDelete(key) {var data = this.__data__,result = data['delete'](key);this.size = data.size;return result;}module.exports = stackDelete;
var ListCache = require('./_ListCache');/*** Removes all key-value entries from the stack.** @private* @name clear* @memberOf Stack*/function stackClear() {this.__data__ = new ListCache;this.size = 0;}module.exports = stackClear;
var baseRandom = require('./_baseRandom');/*** A specialized version of `_.shuffle` which mutates and sets the size of `array`.** @private* @param {Array} array The array to shuffle.* @param {number} [size=array.length] The size of `array`.* @returns {Array} Returns `array`.*/function shuffleSelf(array, size) {var index = -1,length = array.length,lastIndex = length - 1;size = size === undefined ? length : size;while (++index < size) {var rand = baseRandom(index, lastIndex),value = array[rand];array[rand] = array[index];array[index] = value;}array.length = size;return array;}module.exports = shuffleSelf;
/** Used to detect hot functions by number of calls within a span of milliseconds. */var HOT_COUNT = 800,HOT_SPAN = 16;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeNow = Date.now;/*** Creates a function that'll short out and invoke `identity` instead* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`* milliseconds.** @private* @param {Function} func The function to restrict.* @returns {Function} Returns the new shortable function.*/function shortOut(func) {var count = 0,lastCalled = 0;return function() {var stamp = nativeNow(),remaining = HOT_SPAN - (stamp - lastCalled);lastCalled = stamp;if (remaining > 0) {if (++count >= HOT_COUNT) {return arguments[0];}} else {count = 0;}return func.apply(undefined, arguments);};}module.exports = shortOut;
var getWrapDetails = require('./_getWrapDetails'),insertWrapDetails = require('./_insertWrapDetails'),setToString = require('./_setToString'),updateWrapDetails = require('./_updateWrapDetails');/*** Sets the `toString` method of `wrapper` to mimic the source of `reference`* with wrapper details in a comment at the top of the source body.** @private* @param {Function} wrapper The function to modify.* @param {Function} reference The reference function.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @returns {Function} Returns `wrapper`.*/function setWrapToString(wrapper, reference, bitmask) {var source = (reference + '');return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));}module.exports = setWrapToString;
var baseSetToString = require('./_baseSetToString'),shortOut = require('./_shortOut');/*** Sets the `toString` method of `func` to return `string`.** @private* @param {Function} func The function to modify.* @param {Function} string The `toString` result.* @returns {Function} Returns `func`.*/var setToString = shortOut(baseSetToString);module.exports = setToString;
/*** Converts `set` to its value-value pairs.** @private* @param {Object} set The set to convert.* @returns {Array} Returns the value-value pairs.*/function setToPairs(set) {var index = -1,result = Array(set.size);set.forEach(function(value) {result[++index] = [value, value];});return result;}module.exports = setToPairs;
/*** Converts `set` to an array of its values.** @private* @param {Object} set The set to convert.* @returns {Array} Returns the values.*/function setToArray(set) {var index = -1,result = Array(set.size);set.forEach(function(value) {result[++index] = value;});return result;}module.exports = setToArray;
var baseSetData = require('./_baseSetData'),shortOut = require('./_shortOut');/*** Sets metadata for `func`.** **Note:** If this function becomes hot, i.e. is invoked a lot in a short* period of time, it will trip its breaker and transition to an identity* function to avoid garbage collection pauses in V8. See* [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)* for more details.** @private* @param {Function} func The function to associate metadata with.* @param {*} data The metadata.* @returns {Function} Returns `func`.*/var setData = shortOut(baseSetData);module.exports = setData;
/*** Checks if `value` is in the array cache.** @private* @name has* @memberOf SetCache* @param {*} value The value to search for.* @returns {number} Returns `true` if `value` is found, else `false`.*/function setCacheHas(value) {return this.__data__.has(value);}module.exports = setCacheHas;
/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED = '__lodash_hash_undefined__';/*** Adds `value` to the array cache.** @private* @name add* @memberOf SetCache* @alias push* @param {*} value The value to cache.* @returns {Object} Returns the cache instance.*/function setCacheAdd(value) {this.__data__.set(value, HASH_UNDEFINED);return this;}module.exports = setCacheAdd;
/*** Gets the value at `key`, unless `key` is "__proto__" or "constructor".** @private* @param {Object} object The object to query.* @param {string} key The key of the property to get.* @returns {*} Returns the property value.*/function safeGet(object, key) {if (key === 'constructor' && typeof object[key] === 'function') {return;}if (key == '__proto__') {return;}return object[key];}module.exports = safeGet;
var freeGlobal = require('./_freeGlobal');/** Detect free variable `self`. */var freeSelf = typeof self == 'object' && self && self.Object === Object && self;/** Used as a reference to the global object. */var root = freeGlobal || freeSelf || Function('return this')();module.exports = root;
/** Used as the internal argument placeholder. */var PLACEHOLDER = '__lodash_placeholder__';/*** Replaces all `placeholder` elements in `array` with an internal placeholder* and returns an array of their indexes.** @private* @param {Array} array The array to modify.* @param {*} placeholder The placeholder to replace.* @returns {Array} Returns the new array of placeholder indexes.*/function replaceHolders(array, placeholder) {var index = -1,length = array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (value === placeholder || value === PLACEHOLDER) {array[index] = PLACEHOLDER;result[resIndex++] = index;}}return result;}module.exports = replaceHolders;
var copyArray = require('./_copyArray'),isIndex = require('./_isIndex');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** Reorder `array` according to the specified indexes where the element at* the first index is assigned as the first element, the element at* the second index is assigned as the second element, and so on.** @private* @param {Array} array The array to reorder.* @param {Array} indexes The arranged array indexes.* @returns {Array} Returns `array`.*/function reorder(array, indexes) {var arrLength = array.length,length = nativeMin(indexes.length, arrLength),oldArray = copyArray(array);while (length--) {var index = indexes[length];array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;}return array;}module.exports = reorder;
/** Used to lookup unminified function names. */var realNames = {};module.exports = realNames;
/** Used to match template delimiters. */var reInterpolate = /<%=([\s\S]+?)%>/g;module.exports = reInterpolate;
/** Used to match template delimiters. */var reEvaluate = /<%([\s\S]+?)%>/g;module.exports = reEvaluate;
/** Used to match template delimiters. */var reEscape = /<%-([\s\S]+?)%>/g;module.exports = reEscape;
var baseGet = require('./_baseGet'),baseSlice = require('./_baseSlice');/*** Gets the parent value at `path` of `object`.** @private* @param {Object} object The object to query.* @param {Array} path The path to get the parent value of.* @returns {*} Returns the parent value.*/function parent(object, path) {return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));}module.exports = parent;
var apply = require('./_apply');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** A specialized version of `baseRest` which transforms the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @param {Function} transform The rest array transform.* @returns {Function} Returns the new function.*/function overRest(func, start, transform) {start = nativeMax(start === undefined ? (func.length - 1) : start, 0);return function() {var args = arguments,index = -1,length = nativeMax(args.length - start, 0),array = Array(length);while (++index < length) {array[index] = args[start + index];}index = -1;var otherArgs = Array(start + 1);while (++index < start) {otherArgs[index] = args[index];}otherArgs[start] = transform(array);return apply(func, this, otherArgs);};}module.exports = overRest;
/*** Creates a unary function that invokes `func` with its argument transformed.** @private* @param {Function} func The function to wrap.* @param {Function} transform The argument transform.* @returns {Function} Returns the new function.*/function overArg(func, transform) {return function(arg) {return func(transform(arg));};}module.exports = overArg;
/** Used for built-in method references. */var objectProto = Object.prototype;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/*** Converts `value` to a string using `Object.prototype.toString`.** @private* @param {*} value The value to convert.* @returns {string} Returns the converted string.*/function objectToString(value) {return nativeObjectToString.call(value);}module.exports = objectToString;
var freeGlobal = require('./_freeGlobal');/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports = freeModule && freeModule.exports === freeExports;/** Detect free variable `process` from Node.js. */var freeProcess = moduleExports && freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil = (function() {try {// Use `util.types` for Node.js 10+.var types = freeModule && freeModule.require && freeModule.require('util').types;if (types) {return types;}// Legacy `process.binding('util')` for Node.js < 10.return freeProcess && freeProcess.binding && freeProcess.binding('util');} catch (e) {}}());module.exports = nodeUtil;
/*** This function is like* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* except that it includes inherited enumerable properties.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function nativeKeysIn(object) {var result = [];if (object != null) {for (var key in Object(object)) {result.push(key);}}return result;}module.exports = nativeKeysIn;
var overArg = require('./_overArg');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeKeys = overArg(Object.keys, Object);module.exports = nativeKeys;
var getNative = require('./_getNative');/* Built-in method references that are verified to be native. */var nativeCreate = getNative(Object, 'create');module.exports = nativeCreate;
var WeakMap = require('./_WeakMap');/** Used to store function metadata. */var metaMap = WeakMap && new WeakMap;module.exports = metaMap;
var composeArgs = require('./_composeArgs'),composeArgsRight = require('./_composeArgsRight'),replaceHolders = require('./_replaceHolders');/** Used as the internal argument placeholder. */var PLACEHOLDER = '__lodash_placeholder__';/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_BOUND_FLAG = 4,WRAP_CURRY_FLAG = 8,WRAP_ARY_FLAG = 128,WRAP_REARG_FLAG = 256;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** Merges the function metadata of `source` into `data`.** Merging metadata reduces the number of wrappers used to invoke a function.* This is possible because methods like `_.bind`, `_.curry`, and `_.partial`* may be applied regardless of execution order. Methods like `_.ary` and* `_.rearg` modify function arguments, making the order in which they are* executed important, preventing the merging of metadata. However, we make* an exception for a safe combined case where curried functions have `_.ary`* and or `_.rearg` applied.** @private* @param {Array} data The destination metadata.* @param {Array} source The source metadata.* @returns {Array} Returns `data`.*/function mergeData(data, source) {var bitmask = data[1],srcBitmask = source[1],newBitmask = bitmask | srcBitmask,isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);var isCombo =((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));// Exit early if metadata can't be merged.if (!(isCommon || isCombo)) {return data;}// Use source `thisArg` if available.if (srcBitmask & WRAP_BIND_FLAG) {data[2] = source[2];// Set when currying a bound function.newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;}// Compose partial arguments.var value = source[3];if (value) {var partials = data[3];data[3] = partials ? composeArgs(partials, value, source[4]) : value;data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];}// Compose partial right arguments.value = source[5];if (value) {partials = data[5];data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];}// Use source `argPos` if available.value = source[7];if (value) {data[7] = value;}// Use source `ary` if it's smaller.if (srcBitmask & WRAP_ARY_FLAG) {data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);}// Use source `arity` if one is not provided.if (data[9] == null) {data[9] = source[9];}// Use source `func` and merge bitmasks.data[0] = source[0];data[1] = newBitmask;return data;}module.exports = mergeData;
var memoize = require('./memoize');/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE = 500;/*** A specialized version of `_.memoize` which clears the memoized function's* cache when it exceeds `MAX_MEMOIZE_SIZE`.** @private* @param {Function} func The function to have its output memoized.* @returns {Function} Returns the new memoized function.*/function memoizeCapped(func) {var result = memoize(func, function(key) {if (cache.size === MAX_MEMOIZE_SIZE) {cache.clear();}return key;});var cache = result.cache;return result;}module.exports = memoizeCapped;
/*** A specialized version of `matchesProperty` for source values suitable* for strict equality comparisons, i.e. `===`.** @private* @param {string} key The key of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.*/function matchesStrictComparable(key, srcValue) {return function(object) {if (object == null) {return false;}return object[key] === srcValue &&(srcValue !== undefined || (key in Object(object)));};}module.exports = matchesStrictComparable;
/*** Converts `map` to its key-value pairs.** @private* @param {Object} map The map to convert.* @returns {Array} Returns the key-value pairs.*/function mapToArray(map) {var index = -1,result = Array(map.size);map.forEach(function(value, key) {result[++index] = [key, value];});return result;}module.exports = mapToArray;
var getMapData = require('./_getMapData');/*** Sets the map `key` to `value`.** @private* @name set* @memberOf MapCache* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the map cache instance.*/function mapCacheSet(key, value) {var data = getMapData(this, key),size = data.size;data.set(key, value);this.size += data.size == size ? 0 : 1;return this;}module.exports = mapCacheSet;
var getMapData = require('./_getMapData');/*** Checks if a map value for `key` exists.** @private* @name has* @memberOf MapCache* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function mapCacheHas(key) {return getMapData(this, key).has(key);}module.exports = mapCacheHas;
var getMapData = require('./_getMapData');/*** Gets the map value for `key`.** @private* @name get* @memberOf MapCache* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function mapCacheGet(key) {return getMapData(this, key).get(key);}module.exports = mapCacheGet;
var getMapData = require('./_getMapData');/*** Removes `key` and its value from the map.** @private* @name delete* @memberOf MapCache* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function mapCacheDelete(key) {var result = getMapData(this, key)['delete'](key);this.size -= result ? 1 : 0;return result;}module.exports = mapCacheDelete;
var Hash = require('./_Hash'),ListCache = require('./_ListCache'),Map = require('./_Map');/*** Removes all key-value entries from the map.** @private* @name clear* @memberOf MapCache*/function mapCacheClear() {this.size = 0;this.__data__ = {'hash': new Hash,'map': new (Map || ListCache),'string': new Hash};}module.exports = mapCacheClear;
var assocIndexOf = require('./_assocIndexOf');/*** Sets the list cache `key` to `value`.** @private* @name set* @memberOf ListCache* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the list cache instance.*/function listCacheSet(key, value) {var data = this.__data__,index = assocIndexOf(data, key);if (index < 0) {++this.size;data.push([key, value]);} else {data[index][1] = value;}return this;}module.exports = listCacheSet;
var assocIndexOf = require('./_assocIndexOf');/*** Checks if a list cache value for `key` exists.** @private* @name has* @memberOf ListCache* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function listCacheHas(key) {return assocIndexOf(this.__data__, key) > -1;}module.exports = listCacheHas;
var assocIndexOf = require('./_assocIndexOf');/*** Gets the list cache value for `key`.** @private* @name get* @memberOf ListCache* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function listCacheGet(key) {var data = this.__data__,index = assocIndexOf(data, key);return index < 0 ? undefined : data[index][1];}module.exports = listCacheGet;
var assocIndexOf = require('./_assocIndexOf');/** Used for built-in method references. */var arrayProto = Array.prototype;/** Built-in value references. */var splice = arrayProto.splice;/*** Removes `key` and its value from the list cache.** @private* @name delete* @memberOf ListCache* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function listCacheDelete(key) {var data = this.__data__,index = assocIndexOf(data, key);if (index < 0) {return false;}var lastIndex = data.length - 1;if (index == lastIndex) {data.pop();} else {splice.call(data, index, 1);}--this.size;return true;}module.exports = listCacheDelete;
/*** Removes all key-value entries from the list cache.** @private* @name clear* @memberOf ListCache*/function listCacheClear() {this.__data__ = [];this.size = 0;}module.exports = listCacheClear;
var baseWrapperValue = require('./_baseWrapperValue'),getView = require('./_getView'),isArray = require('./isArray');/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG = 1,LAZY_MAP_FLAG = 2;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** Extracts the unwrapped value from its lazy wrapper.** @private* @name value* @memberOf LazyWrapper* @returns {*} Returns the unwrapped value.*/function lazyValue() {var array = this.__wrapped__.value(),dir = this.__dir__,isArr = isArray(array),isRight = dir < 0,arrLength = isArr ? array.length : 0,view = getView(0, arrLength, this.__views__),start = view.start,end = view.end,length = end - start,index = isRight ? end : (start - 1),iteratees = this.__iteratees__,iterLength = iteratees.length,resIndex = 0,takeCount = nativeMin(length, this.__takeCount__);if (!isArr || (!isRight && arrLength == length && takeCount == length)) {return baseWrapperValue(array, this.__actions__);}var result = [];outer:while (length-- && resIndex < takeCount) {index += dir;var iterIndex = -1,value = array[index];while (++iterIndex < iterLength) {var data = iteratees[iterIndex],iteratee = data.iteratee,type = data.type,computed = iteratee(value);if (type == LAZY_MAP_FLAG) {value = computed;} else if (!computed) {if (type == LAZY_FILTER_FLAG) {continue outer;} else {break outer;}}}result[resIndex++] = value;}return result;}module.exports = lazyValue;
var LazyWrapper = require('./_LazyWrapper');/*** Reverses the direction of lazy iteration.** @private* @name reverse* @memberOf LazyWrapper* @returns {Object} Returns the new reversed `LazyWrapper` object.*/function lazyReverse() {if (this.__filtered__) {var result = new LazyWrapper(this);result.__dir__ = -1;result.__filtered__ = true;} else {result = this.clone();result.__dir__ *= -1;}return result;}module.exports = lazyReverse;
var LazyWrapper = require('./_LazyWrapper'),copyArray = require('./_copyArray');/*** Creates a clone of the lazy wrapper object.** @private* @name clone* @memberOf LazyWrapper* @returns {Object} Returns the cloned `LazyWrapper` object.*/function lazyClone() {var result = new LazyWrapper(this.__wrapped__);result.__actions__ = copyArray(this.__actions__);result.__dir__ = this.__dir__;result.__filtered__ = this.__filtered__;result.__iteratees__ = copyArray(this.__iteratees__);result.__takeCount__ = this.__takeCount__;result.__views__ = copyArray(this.__views__);return result;}module.exports = lazyClone;
/*** Converts `iterator` to an array.** @private* @param {Object} iterator The iterator to convert.* @returns {Array} Returns the converted array.*/function iteratorToArray(iterator) {var data,result = [];while (!(data = iterator.next()).done) {result.push(data.value);}return result;}module.exports = iteratorToArray;
var isObject = require('./isObject');/*** Checks if `value` is suitable for strict equality comparisons, i.e. `===`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` if suitable for strict* equality comparisons, else `false`.*/function isStrictComparable(value) {return value === value && !isObject(value);}module.exports = isStrictComparable;
/** Used for built-in method references. */var objectProto = Object.prototype;/*** Checks if `value` is likely a prototype object.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.*/function isPrototype(value) {var Ctor = value && value.constructor,proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;return value === proto;}module.exports = isPrototype;
var coreJsData = require('./_coreJsData');/** Used to detect methods masquerading as native. */var maskSrcKey = (function() {var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');return uid ? ('Symbol(src)_1.' + uid) : '';}());/*** Checks if `func` has its source masked.** @private* @param {Function} func The function to check.* @returns {boolean} Returns `true` if `func` is masked, else `false`.*/function isMasked(func) {return !!maskSrcKey && (maskSrcKey in func);}module.exports = isMasked;
var coreJsData = require('./_coreJsData'),isFunction = require('./isFunction'),stubFalse = require('./stubFalse');/*** Checks if `func` is capable of being masked.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `func` is maskable, else `false`.*/var isMaskable = coreJsData ? isFunction : stubFalse;module.exports = isMaskable;
var LazyWrapper = require('./_LazyWrapper'),getData = require('./_getData'),getFuncName = require('./_getFuncName'),lodash = require('./wrapperLodash');/*** Checks if `func` has a lazy counterpart.** @private* @param {Function} func The function to check.* @returns {boolean} Returns `true` if `func` has a lazy counterpart,* else `false`.*/function isLaziable(func) {var funcName = getFuncName(func),other = lodash[funcName];if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {return false;}if (func === other) {return true;}var data = getData(other);return !!data && func === data[0];}module.exports = isLaziable;
/*** Checks if `value` is suitable for use as unique object key.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is suitable, else `false`.*/function isKeyable(value) {var type = typeof value;return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')? (value !== '__proto__'): (value === null);}module.exports = isKeyable;
var isArray = require('./isArray'),isSymbol = require('./isSymbol');/** Used to match property names within property paths. */var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp = /^\w*$/;/*** Checks if `value` is a property name and not a property path.** @private* @param {*} value The value to check.* @param {Object} [object] The object to query keys on.* @returns {boolean} Returns `true` if `value` is a property name, else `false`.*/function isKey(value, object) {if (isArray(value)) {return false;}var type = typeof value;if (type == 'number' || type == 'symbol' || type == 'boolean' ||value == null || isSymbol(value)) {return true;}return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||(object != null && value in Object(object));}module.exports = isKey;
var eq = require('./eq'),isArrayLike = require('./isArrayLike'),isIndex = require('./_isIndex'),isObject = require('./isObject');/*** Checks if the given arguments are from an iteratee call.** @private* @param {*} value The potential iteratee value argument.* @param {*} index The potential iteratee index or key argument.* @param {*} object The potential iteratee object argument.* @returns {boolean} Returns `true` if the arguments are from an iteratee call,* else `false`.*/function isIterateeCall(value, index, object) {if (!isObject(object)) {return false;}var type = typeof index;if (type == 'number'? (isArrayLike(object) && isIndex(index, object.length)): (type == 'string' && index in object)) {return eq(object[index], value);}return false;}module.exports = isIterateeCall;
/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/** Used to detect unsigned integer values. */var reIsUint = /^(?:0|[1-9]\d*)$/;/*** Checks if `value` is a valid array-like index.** @private* @param {*} value The value to check.* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.*/function isIndex(value, length) {var type = typeof value;length = length == null ? MAX_SAFE_INTEGER : length;return !!length &&(type == 'number' ||(type != 'symbol' && reIsUint.test(value))) &&(value > -1 && value % 1 == 0 && value < length);}module.exports = isIndex;
var Symbol = require('./_Symbol'),isArguments = require('./isArguments'),isArray = require('./isArray');/** Built-in value references. */var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;/*** Checks if `value` is a flattenable `arguments` object or array.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is flattenable, else `false`.*/function isFlattenable(value) {return isArray(value) || isArguments(value) ||!!(spreadableSymbol && value && value[spreadableSymbol]);}module.exports = isFlattenable;
/** Used to match wrap detail comments. */var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;/*** Inserts wrapper `details` in a comment at the top of the `source` body.** @private* @param {string} source The source to modify.* @returns {Array} details The details to insert.* @returns {string} Returns the modified source.*/function insertWrapDetails(source, details) {var length = details.length;if (!length) {return source;}var lastIndex = length - 1;details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];details = details.join(length > 2 ? ', ' : ' ');return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');}module.exports = insertWrapDetails;
var baseCreate = require('./_baseCreate'),getPrototype = require('./_getPrototype'),isPrototype = require('./_isPrototype');/*** Initializes an object clone.** @private* @param {Object} object The object to clone.* @returns {Object} Returns the initialized clone.*/function initCloneObject(object) {return (typeof object.constructor == 'function' && !isPrototype(object))? baseCreate(getPrototype(object)): {};}module.exports = initCloneObject;
var cloneArrayBuffer = require('./_cloneArrayBuffer'),cloneDataView = require('./_cloneDataView'),cloneRegExp = require('./_cloneRegExp'),cloneSymbol = require('./_cloneSymbol'),cloneTypedArray = require('./_cloneTypedArray');/** `Object#toString` result references. */var boolTag = '[object Boolean]',dateTag = '[object Date]',mapTag = '[object Map]',numberTag = '[object Number]',regexpTag = '[object RegExp]',setTag = '[object Set]',stringTag = '[object String]',symbolTag = '[object Symbol]';var arrayBufferTag = '[object ArrayBuffer]',dataViewTag = '[object DataView]',float32Tag = '[object Float32Array]',float64Tag = '[object Float64Array]',int8Tag = '[object Int8Array]',int16Tag = '[object Int16Array]',int32Tag = '[object Int32Array]',uint8Tag = '[object Uint8Array]',uint8ClampedTag = '[object Uint8ClampedArray]',uint16Tag = '[object Uint16Array]',uint32Tag = '[object Uint32Array]';/*** Initializes an object clone based on its `toStringTag`.** **Note:** This function only supports cloning values with tags of* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.** @private* @param {Object} object The object to clone.* @param {string} tag The `toStringTag` of the object to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the initialized clone.*/function initCloneByTag(object, tag, isDeep) {var Ctor = object.constructor;switch (tag) {case arrayBufferTag:return cloneArrayBuffer(object);case boolTag:case dateTag:return new Ctor(+object);case dataViewTag:return cloneDataView(object, isDeep);case float32Tag: case float64Tag:case int8Tag: case int16Tag: case int32Tag:case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:return cloneTypedArray(object, isDeep);case mapTag:return new Ctor;case numberTag:case stringTag:return new Ctor(object);case regexpTag:return cloneRegExp(object);case setTag:return new Ctor;case symbolTag:return cloneSymbol(object);}}module.exports = initCloneByTag;
/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Initializes an array clone.** @private* @param {Array} array The array to clone.* @returns {Array} Returns the initialized clone.*/function initCloneArray(array) {var length = array.length,result = new array.constructor(length);// Add properties assigned by `RegExp#exec`.if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {result.index = array.index;result.input = array.input;}return result;}module.exports = initCloneArray;
var nativeCreate = require('./_nativeCreate');/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED = '__lodash_hash_undefined__';/*** Sets the hash `key` to `value`.** @private* @name set* @memberOf Hash* @param {string} key The key of the value to set.* @param {*} value The value to set.* @returns {Object} Returns the hash instance.*/function hashSet(key, value) {var data = this.__data__;this.size += this.has(key) ? 0 : 1;data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;return this;}module.exports = hashSet;
var nativeCreate = require('./_nativeCreate');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Checks if a hash value for `key` exists.** @private* @name has* @memberOf Hash* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function hashHas(key) {var data = this.__data__;return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);}module.exports = hashHas;
var nativeCreate = require('./_nativeCreate');/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED = '__lodash_hash_undefined__';/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Gets the hash value for `key`.** @private* @name get* @memberOf Hash* @param {string} key The key of the value to get.* @returns {*} Returns the entry value.*/function hashGet(key) {var data = this.__data__;if (nativeCreate) {var result = data[key];return result === HASH_UNDEFINED ? undefined : result;}return hasOwnProperty.call(data, key) ? data[key] : undefined;}module.exports = hashGet;
/*** Removes `key` and its value from the hash.** @private* @name delete* @memberOf Hash* @param {Object} hash The hash to modify.* @param {string} key The key of the value to remove.* @returns {boolean} Returns `true` if the entry was removed, else `false`.*/function hashDelete(key) {var result = this.has(key) && delete this.__data__[key];this.size -= result ? 1 : 0;return result;}module.exports = hashDelete;
var nativeCreate = require('./_nativeCreate');/*** Removes all key-value entries from the hash.** @private* @name clear* @memberOf Hash*/function hashClear() {this.__data__ = nativeCreate ? nativeCreate(null) : {};this.size = 0;}module.exports = hashClear;
/** Used to detect strings that need a more robust regexp to match words. */var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;/*** Checks if `string` contains a word composed of Unicode symbols.** @private* @param {string} string The string to inspect.* @returns {boolean} Returns `true` if a word is found, else `false`.*/function hasUnicodeWord(string) {return reHasUnicodeWord.test(string);}module.exports = hasUnicodeWord;
/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff',rsComboMarksRange = '\\u0300-\\u036f',reComboHalfMarksRange = '\\ufe20-\\ufe2f',rsComboSymbolsRange = '\\u20d0-\\u20ff',rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,rsVarRange = '\\ufe0e\\ufe0f';/** Used to compose unicode capture groups. */var rsZWJ = '\\u200d';/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');/*** Checks if `string` contains Unicode symbols.** @private* @param {string} string The string to inspect.* @returns {boolean} Returns `true` if a symbol is found, else `false`.*/function hasUnicode(string) {return reHasUnicode.test(string);}module.exports = hasUnicode;
var castPath = require('./_castPath'),isArguments = require('./isArguments'),isArray = require('./isArray'),isIndex = require('./_isIndex'),isLength = require('./isLength'),toKey = require('./_toKey');/*** Checks if `path` exists on `object`.** @private* @param {Object} object The object to query.* @param {Array|string} path The path to check.* @param {Function} hasFunc The function to check properties.* @returns {boolean} Returns `true` if `path` exists, else `false`.*/function hasPath(object, path, hasFunc) {path = castPath(path, object);var index = -1,length = path.length,result = false;while (++index < length) {var key = toKey(path[index]);if (!(result = object != null && hasFunc(object, key))) {break;}object = object[key];}if (result || ++index != length) {return result;}length = object == null ? 0 : object.length;return !!length && isLength(length) && isIndex(key, length) &&(isArray(object) || isArguments(object));}module.exports = hasPath;
/** Used to match wrap detail comments. */var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails = /,? & /;/*** Extracts wrapper details from the `source` body comment.** @private* @param {string} source The source to inspect.* @returns {Array} Returns the wrapper details.*/function getWrapDetails(source) {var match = source.match(reWrapDetails);return match ? match[1].split(reSplitDetails) : [];}module.exports = getWrapDetails;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max,nativeMin = Math.min;/*** Gets the view, applying any `transforms` to the `start` and `end` positions.** @private* @param {number} start The start of the view.* @param {number} end The end of the view.* @param {Array} transforms The transformations to apply to the view.* @returns {Object} Returns an object containing the `start` and `end`* positions of the view.*/function getView(start, end, transforms) {var index = -1,length = transforms.length;while (++index < length) {var data = transforms[index],size = data.size;switch (data.type) {case 'drop': start += size; break;case 'dropRight': end -= size; break;case 'take': end = nativeMin(end, start + size); break;case 'takeRight': start = nativeMax(start, end - size); break;}}return { 'start': start, 'end': end };}module.exports = getView;
/*** Gets the value at `key` of `object`.** @private* @param {Object} [object] The object to query.* @param {string} key The key of the property to get.* @returns {*} Returns the property value.*/function getValue(object, key) {return object == null ? undefined : object[key];}module.exports = getValue;
var DataView = require('./_DataView'),Map = require('./_Map'),Promise = require('./_Promise'),Set = require('./_Set'),WeakMap = require('./_WeakMap'),baseGetTag = require('./_baseGetTag'),toSource = require('./_toSource');/** `Object#toString` result references. */var mapTag = '[object Map]',objectTag = '[object Object]',promiseTag = '[object Promise]',setTag = '[object Set]',weakMapTag = '[object WeakMap]';var dataViewTag = '[object DataView]';/** Used to detect maps, sets, and weakmaps. */var dataViewCtorString = toSource(DataView),mapCtorString = toSource(Map),promiseCtorString = toSource(Promise),setCtorString = toSource(Set),weakMapCtorString = toSource(WeakMap);/*** Gets the `toStringTag` of `value`.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/var getTag = baseGetTag;// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||(Map && getTag(new Map) != mapTag) ||(Promise && getTag(Promise.resolve()) != promiseTag) ||(Set && getTag(new Set) != setTag) ||(WeakMap && getTag(new WeakMap) != weakMapTag)) {getTag = function(value) {var result = baseGetTag(value),Ctor = result == objectTag ? value.constructor : undefined,ctorString = Ctor ? toSource(Ctor) : '';if (ctorString) {switch (ctorString) {case dataViewCtorString: return dataViewTag;case mapCtorString: return mapTag;case promiseCtorString: return promiseTag;case setCtorString: return setTag;case weakMapCtorString: return weakMapTag;}}return result;};}module.exports = getTag;
var arrayPush = require('./_arrayPush'),getPrototype = require('./_getPrototype'),getSymbols = require('./_getSymbols'),stubArray = require('./stubArray');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeGetSymbols = Object.getOwnPropertySymbols;/*** Creates an array of the own and inherited enumerable symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of symbols.*/var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {var result = [];while (object) {arrayPush(result, getSymbols(object));object = getPrototype(object);}return result;};module.exports = getSymbolsIn;
var arrayFilter = require('./_arrayFilter'),stubArray = require('./stubArray');/** Used for built-in method references. */var objectProto = Object.prototype;/** Built-in value references. */var propertyIsEnumerable = objectProto.propertyIsEnumerable;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeGetSymbols = Object.getOwnPropertySymbols;/*** Creates an array of the own enumerable symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of symbols.*/var getSymbols = !nativeGetSymbols ? stubArray : function(object) {if (object == null) {return [];}object = Object(object);return arrayFilter(nativeGetSymbols(object), function(symbol) {return propertyIsEnumerable.call(object, symbol);});};module.exports = getSymbols;
var Symbol = require('./_Symbol');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/** Built-in value references. */var symToStringTag = Symbol ? Symbol.toStringTag : undefined;/*** A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.** @private* @param {*} value The value to query.* @returns {string} Returns the raw `toStringTag`.*/function getRawTag(value) {var isOwn = hasOwnProperty.call(value, symToStringTag),tag = value[symToStringTag];try {value[symToStringTag] = undefined;var unmasked = true;} catch (e) {}var result = nativeObjectToString.call(value);if (unmasked) {if (isOwn) {value[symToStringTag] = tag;} else {delete value[symToStringTag];}}return result;}module.exports = getRawTag;
var overArg = require('./_overArg');/** Built-in value references. */var getPrototype = overArg(Object.getPrototypeOf, Object);module.exports = getPrototype;
var baseIsNative = require('./_baseIsNative'),getValue = require('./_getValue');/*** Gets the native function at `key` of `object`.** @private* @param {Object} object The object to query.* @param {string} key The key of the method to get.* @returns {*} Returns the function if it's native, else `undefined`.*/function getNative(object, key) {var value = getValue(object, key);return baseIsNative(value) ? value : undefined;}module.exports = getNative;
var isStrictComparable = require('./_isStrictComparable'),keys = require('./keys');/*** Gets the property names, values, and compare flags of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the match data of `object`.*/function getMatchData(object) {var result = keys(object),length = result.length;while (length--) {var key = result[length],value = object[key];result[length] = [key, value, isStrictComparable(value)];}return result;}module.exports = getMatchData;
var isKeyable = require('./_isKeyable');/*** Gets the data for `map`.** @private* @param {Object} map The map to query.* @param {string} key The reference key.* @returns {*} Returns the map data.*/function getMapData(map, key) {var data = map.__data__;return isKeyable(key)? data[typeof key == 'string' ? 'string' : 'hash']: data.map;}module.exports = getMapData;
/*** Gets the argument placeholder value for `func`.** @private* @param {Function} func The function to inspect.* @returns {*} Returns the placeholder value.*/function getHolder(func) {var object = func;return object.placeholder;}module.exports = getHolder;
var realNames = require('./_realNames');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Gets the name of `func`.** @private* @param {Function} func The function to query.* @returns {string} Returns the function name.*/function getFuncName(func) {var result = (func.name + ''),array = realNames[result],length = hasOwnProperty.call(realNames, result) ? array.length : 0;while (length--) {var data = array[length],otherFunc = data.func;if (otherFunc == null || otherFunc == func) {return data.name;}}return result;}module.exports = getFuncName;
var metaMap = require('./_metaMap'),noop = require('./noop');/*** Gets metadata for `func`.** @private* @param {Function} func The function to query.* @returns {*} Returns the metadata for `func`.*/var getData = !metaMap ? noop : function(func) {return metaMap.get(func);};module.exports = getData;
var baseGetAllKeys = require('./_baseGetAllKeys'),getSymbolsIn = require('./_getSymbolsIn'),keysIn = require('./keysIn');/*** Creates an array of own and inherited enumerable property names and* symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names and symbols.*/function getAllKeysIn(object) {return baseGetAllKeys(object, keysIn, getSymbolsIn);}module.exports = getAllKeysIn;
var baseGetAllKeys = require('./_baseGetAllKeys'),getSymbols = require('./_getSymbols'),keys = require('./keys');/*** Creates an array of own enumerable property names and symbols of `object`.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names and symbols.*/function getAllKeys(object) {return baseGetAllKeys(object, keys, getSymbols);}module.exports = getAllKeys;
/** Detect free variable `global` from Node.js. */var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;module.exports = freeGlobal;
var flatten = require('./flatten'),overRest = require('./_overRest'),setToString = require('./_setToString');/*** A specialized version of `baseRest` which flattens the rest array.** @private* @param {Function} func The function to apply a rest parameter to.* @returns {Function} Returns the new function.*/function flatRest(func) {return setToString(overRest(func, undefined, flatten), func + '');}module.exports = flatRest;
/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes = {'\\': '\\',"'": "'",'\n': 'n','\r': 'r','\u2028': 'u2028','\u2029': 'u2029'};/*** Used by `_.template` to escape characters for inclusion in compiled string literals.** @private* @param {string} chr The matched character to escape.* @returns {string} Returns the escaped character.*/function escapeStringChar(chr) {return '\\' + stringEscapes[chr];}module.exports = escapeStringChar;
var basePropertyOf = require('./_basePropertyOf');/** Used to map characters to HTML entities. */var htmlEscapes = {'&': '&','<': '<','>': '>','"': '"',"'": '''};/*** Used by `_.escape` to convert characters to HTML entities.** @private* @param {string} chr The matched character to escape.* @returns {string} Returns the escaped character.*/var escapeHtmlChar = basePropertyOf(htmlEscapes);module.exports = escapeHtmlChar;
var getAllKeys = require('./_getAllKeys');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1;/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** A specialized version of `baseIsEqualDeep` for objects with support for* partial deep comparisons.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,objProps = getAllKeys(object),objLength = objProps.length,othProps = getAllKeys(other),othLength = othProps.length;if (objLength != othLength && !isPartial) {return false;}var index = objLength;while (index--) {var key = objProps[index];if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {return false;}}// Check that cyclic values are equal.var objStacked = stack.get(object);var othStacked = stack.get(other);if (objStacked && othStacked) {return objStacked == other && othStacked == object;}var result = true;stack.set(object, other);stack.set(other, object);var skipCtor = isPartial;while (++index < objLength) {key = objProps[index];var objValue = object[key],othValue = other[key];if (customizer) {var compared = isPartial? customizer(othValue, objValue, key, other, object, stack): customizer(objValue, othValue, key, object, other, stack);}// Recursively compare objects (susceptible to call stack limits).if (!(compared === undefined? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)): compared)) {result = false;break;}skipCtor || (skipCtor = key == 'constructor');}if (result && !skipCtor) {var objCtor = object.constructor,othCtor = other.constructor;// Non `Object` object instances with different constructors are not equal.if (objCtor != othCtor &&('constructor' in object && 'constructor' in other) &&!(typeof objCtor == 'function' && objCtor instanceof objCtor &&typeof othCtor == 'function' && othCtor instanceof othCtor)) {result = false;}}stack['delete'](object);stack['delete'](other);return result;}module.exports = equalObjects;
var Symbol = require('./_Symbol'),Uint8Array = require('./_Uint8Array'),eq = require('./eq'),equalArrays = require('./_equalArrays'),mapToArray = require('./_mapToArray'),setToArray = require('./_setToArray');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/** `Object#toString` result references. */var boolTag = '[object Boolean]',dateTag = '[object Date]',errorTag = '[object Error]',mapTag = '[object Map]',numberTag = '[object Number]',regexpTag = '[object RegExp]',setTag = '[object Set]',stringTag = '[object String]',symbolTag = '[object Symbol]';var arrayBufferTag = '[object ArrayBuffer]',dataViewTag = '[object DataView]';/** Used to convert symbols to primitives and strings. */var symbolProto = Symbol ? Symbol.prototype : undefined,symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;/*** A specialized version of `baseIsEqualDeep` for comparing objects of* the same `toStringTag`.** **Note:** This function only supports comparing values with tags of* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {string} tag The `toStringTag` of the objects to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {switch (tag) {case dataViewTag:if ((object.byteLength != other.byteLength) ||(object.byteOffset != other.byteOffset)) {return false;}object = object.buffer;other = other.buffer;case arrayBufferTag:if ((object.byteLength != other.byteLength) ||!equalFunc(new Uint8Array(object), new Uint8Array(other))) {return false;}return true;case boolTag:case dateTag:case numberTag:// Coerce booleans to `1` or `0` and dates to milliseconds.// Invalid dates are coerced to `NaN`.return eq(+object, +other);case errorTag:return object.name == other.name && object.message == other.message;case regexpTag:case stringTag:// Coerce regexes to strings and treat strings, primitives and objects,// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring// for more details.return object == (other + '');case mapTag:var convert = mapToArray;case setTag:var isPartial = bitmask & COMPARE_PARTIAL_FLAG;convert || (convert = setToArray);if (object.size != other.size && !isPartial) {return false;}// Assume cyclic values are equal.var stacked = stack.get(object);if (stacked) {return stacked == other;}bitmask |= COMPARE_UNORDERED_FLAG;// Recursively compare objects (susceptible to call stack limits).stack.set(object, other);var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);stack['delete'](object);return result;case symbolTag:if (symbolValueOf) {return symbolValueOf.call(object) == symbolValueOf.call(other);}}return false;}module.exports = equalByTag;
var SetCache = require('./_SetCache'),arraySome = require('./_arraySome'),cacheHas = require('./_cacheHas');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/*** A specialized version of `baseIsEqualDeep` for arrays with support for* partial deep comparisons.** @private* @param {Array} array The array to compare.* @param {Array} other The other array to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} stack Tracks traversed `array` and `other` objects.* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.*/function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {var isPartial = bitmask & COMPARE_PARTIAL_FLAG,arrLength = array.length,othLength = other.length;if (arrLength != othLength && !(isPartial && othLength > arrLength)) {return false;}// Check that cyclic values are equal.var arrStacked = stack.get(array);var othStacked = stack.get(other);if (arrStacked && othStacked) {return arrStacked == other && othStacked == array;}var index = -1,result = true,seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;stack.set(array, other);stack.set(other, array);// Ignore non-index properties.while (++index < arrLength) {var arrValue = array[index],othValue = other[index];if (customizer) {var compared = isPartial? customizer(othValue, arrValue, index, other, array, stack): customizer(arrValue, othValue, index, array, other, stack);}if (compared !== undefined) {if (compared) {continue;}result = false;break;}// Recursively compare arrays (susceptible to call stack limits).if (seen) {if (!arraySome(other, function(othValue, othIndex) {if (!cacheHas(seen, othIndex) &&(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {return seen.push(othIndex);}})) {result = false;break;}} else if (!(arrValue === othValue ||equalFunc(arrValue, othValue, bitmask, customizer, stack))) {result = false;break;}}stack['delete'](array);stack['delete'](other);return result;}module.exports = equalArrays;
var getNative = require('./_getNative');var defineProperty = (function() {try {var func = getNative(Object, 'defineProperty');func({}, '', {});return func;} catch (e) {}}());module.exports = defineProperty;
var basePropertyOf = require('./_basePropertyOf');/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters = {// Latin-1 Supplement block.'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A','\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a','\xc7': 'C', '\xe7': 'c','\xd0': 'D', '\xf0': 'd','\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E','\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e','\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I','\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i','\xd1': 'N', '\xf1': 'n','\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O','\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o','\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U','\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u','\xdd': 'Y', '\xfd': 'y', '\xff': 'y','\xc6': 'Ae', '\xe6': 'ae','\xde': 'Th', '\xfe': 'th','\xdf': 'ss',// Latin Extended-A block.'\u0100': 'A', '\u0102': 'A', '\u0104': 'A','\u0101': 'a', '\u0103': 'a', '\u0105': 'a','\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C','\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c','\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd','\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E','\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e','\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G','\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g','\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h','\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I','\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i','\u0134': 'J', '\u0135': 'j','\u0136': 'K', '\u0137': 'k', '\u0138': 'k','\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L','\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l','\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N','\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n','\u014c': 'O', '\u014e': 'O', '\u0150': 'O','\u014d': 'o', '\u014f': 'o', '\u0151': 'o','\u0154': 'R', '\u0156': 'R', '\u0158': 'R','\u0155': 'r', '\u0157': 'r', '\u0159': 'r','\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S','\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's','\u0162': 'T', '\u0164': 'T', '\u0166': 'T','\u0163': 't', '\u0165': 't', '\u0167': 't','\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U','\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u','\u0174': 'W', '\u0175': 'w','\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y','\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z','\u017a': 'z', '\u017c': 'z', '\u017e': 'z','\u0132': 'IJ', '\u0133': 'ij','\u0152': 'Oe', '\u0153': 'oe','\u0149': "'n", '\u017f': 's'};/*** Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A* letters to basic Latin letters.** @private* @param {string} letter The matched letter to deburr.* @returns {string} Returns the deburred letter.*/var deburrLetter = basePropertyOf(deburredLetters);module.exports = deburrLetter;
var isPlainObject = require('./isPlainObject');/*** Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain* objects.** @private* @param {*} value The value to inspect.* @param {string} key The key of the property to inspect.* @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.*/function customOmitClone(value) {return isPlainObject(value) ? undefined : value;}module.exports = customOmitClone;
var baseMerge = require('./_baseMerge'),isObject = require('./isObject');/*** Used by `_.defaultsDeep` to customize its `_.merge` use to merge source* objects into destination objects that are passed thru.** @private* @param {*} objValue The destination value.* @param {*} srcValue The source value.* @param {string} key The key of the property to merge.* @param {Object} object The parent object of `objValue`.* @param {Object} source The parent object of `srcValue`.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.* @returns {*} Returns the value to assign.*/function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {if (isObject(objValue) && isObject(srcValue)) {// Recursively merge objects and arrays (susceptible to call stack limits).stack.set(srcValue, objValue);baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);stack['delete'](srcValue);}return objValue;}module.exports = customDefaultsMerge;
var eq = require('./eq');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Used by `_.defaults` to customize its `_.assignIn` use to assign properties* of source objects to the destination object for all destination properties* that resolve to `undefined`.** @private* @param {*} objValue The destination value.* @param {*} srcValue The source value.* @param {string} key The key of the property to assign.* @param {Object} object The parent object of `objValue`.* @returns {*} Returns the value to assign.*/function customDefaultsAssignIn(objValue, srcValue, key, object) {if (objValue === undefined ||(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {return srcValue;}return objValue;}module.exports = customDefaultsAssignIn;
var baseSetData = require('./_baseSetData'),createBind = require('./_createBind'),createCurry = require('./_createCurry'),createHybrid = require('./_createHybrid'),createPartial = require('./_createPartial'),getData = require('./_getData'),mergeData = require('./_mergeData'),setData = require('./_setData'),setWrapToString = require('./_setWrapToString'),toInteger = require('./toInteger');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_FLAG = 8,WRAP_CURRY_RIGHT_FLAG = 16,WRAP_PARTIAL_FLAG = 32,WRAP_PARTIAL_RIGHT_FLAG = 64;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** Creates a function that either curries or invokes `func` with optional* `this` binding and partially applied arguments.** @private* @param {Function|string} func The function or method name to wrap.* @param {number} bitmask The bitmask flags.* 1 - `_.bind`* 2 - `_.bindKey`* 4 - `_.curry` or `_.curryRight` of a bound function* 8 - `_.curry`* 16 - `_.curryRight`* 32 - `_.partial`* 64 - `_.partialRight`* 128 - `_.rearg`* 256 - `_.ary`* 512 - `_.flip`* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to be partially applied.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;if (!isBindKey && typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}var length = partials ? partials.length : 0;if (!length) {bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);partials = holders = undefined;}ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);arity = arity === undefined ? arity : toInteger(arity);length -= holders ? holders.length : 0;if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {var partialsRight = partials,holdersRight = holders;partials = holders = undefined;}var data = isBindKey ? undefined : getData(func);var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,argPos, ary, arity];if (data) {mergeData(newData, data);}func = newData[0];bitmask = newData[1];thisArg = newData[2];partials = newData[3];holders = newData[4];arity = newData[9] = newData[9] === undefined? (isBindKey ? 0 : func.length): nativeMax(newData[9] - length, 0);if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);}if (!bitmask || bitmask == WRAP_BIND_FLAG) {var result = createBind(func, bitmask, thisArg);} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {result = createCurry(func, bitmask, arity);} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {result = createPartial(func, bitmask, thisArg, partials);} else {result = createHybrid.apply(undefined, newData);}var setter = data ? baseSetData : setData;return setWrapToString(setter(result, newData), func, bitmask);}module.exports = createWrap;
var baseToPairs = require('./_baseToPairs'),getTag = require('./_getTag'),mapToArray = require('./_mapToArray'),setToPairs = require('./_setToPairs');/** `Object#toString` result references. */var mapTag = '[object Map]',setTag = '[object Set]';/*** Creates a `_.toPairs` or `_.toPairsIn` function.** @private* @param {Function} keysFunc The function to get the keys of a given object.* @returns {Function} Returns the new pairs function.*/function createToPairs(keysFunc) {return function(object) {var tag = getTag(object);if (tag == mapTag) {return mapToArray(object);}if (tag == setTag) {return setToPairs(object);}return baseToPairs(object, keysFunc(object));};}module.exports = createToPairs;
var Set = require('./_Set'),noop = require('./noop'),setToArray = require('./_setToArray');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/*** Creates a set object of `values`.** @private* @param {Array} values The values to add to the set.* @returns {Object} Returns the new set.*/var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {return new Set(values);};module.exports = createSet;
var root = require('./_root'),toInteger = require('./toInteger'),toNumber = require('./toNumber'),toString = require('./toString');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsFinite = root.isFinite,nativeMin = Math.min;/*** Creates a function like `_.round`.** @private* @param {string} methodName The name of the `Math` method to use when rounding.* @returns {Function} Returns the new round function.*/function createRound(methodName) {var func = Math[methodName];return function(number, precision) {number = toNumber(number);precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);if (precision && nativeIsFinite(number)) {// Shift with exponential notation to avoid floating-point issues.// See [MDN](https://mdn.io/round#Examples) for more details.var pair = (toString(number) + 'e').split('e'),value = func(pair[0] + 'e' + (+pair[1] + precision));pair = (toString(value) + 'e').split('e');return +(pair[0] + 'e' + (+pair[1] - precision));}return func(number);};}module.exports = createRound;
var toNumber = require('./toNumber');/*** Creates a function that performs a relational operation on two values.** @private* @param {Function} operator The function to perform the operation.* @returns {Function} Returns the new relational operation function.*/function createRelationalOperation(operator) {return function(value, other) {if (!(typeof value == 'string' && typeof other == 'string')) {value = toNumber(value);other = toNumber(other);}return operator(value, other);};}module.exports = createRelationalOperation;
var isLaziable = require('./_isLaziable'),setData = require('./_setData'),setWrapToString = require('./_setWrapToString');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_BOUND_FLAG = 4,WRAP_CURRY_FLAG = 8,WRAP_PARTIAL_FLAG = 32,WRAP_PARTIAL_RIGHT_FLAG = 64;/*** Creates a function that wraps `func` to continue currying.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {Function} wrapFunc The function to create the `func` wrapper.* @param {*} placeholder The placeholder value.* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to prepend to those provided to* the new function.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {var isCurry = bitmask & WRAP_CURRY_FLAG,newHolders = isCurry ? holders : undefined,newHoldersRight = isCurry ? undefined : holders,newPartials = isCurry ? partials : undefined,newPartialsRight = isCurry ? undefined : partials;bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);}var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,newHoldersRight, argPos, ary, arity];var result = wrapFunc.apply(undefined, newData);if (isLaziable(func)) {setData(result, newData);}result.placeholder = placeholder;return setWrapToString(result, func, bitmask);}module.exports = createRecurry;
var baseRange = require('./_baseRange'),isIterateeCall = require('./_isIterateeCall'),toFinite = require('./toFinite');/*** Creates a `_.range` or `_.rangeRight` function.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new range function.*/function createRange(fromRight) {return function(start, end, step) {if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {end = step = undefined;}// Ensure the sign of `-0` is preserved.start = toFinite(start);if (end === undefined) {end = start;start = 0;} else {end = toFinite(end);}step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);return baseRange(start, end, step, fromRight);};}module.exports = createRange;
var apply = require('./_apply'),createCtor = require('./_createCtor'),root = require('./_root');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1;/*** Creates a function that wraps `func` to invoke it with the `this` binding* of `thisArg` and `partials` prepended to the arguments it receives.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} thisArg The `this` binding of `func`.* @param {Array} partials The arguments to prepend to those provided to* the new function.* @returns {Function} Returns the new wrapped function.*/function createPartial(func, bitmask, thisArg, partials) {var isBind = bitmask & WRAP_BIND_FLAG,Ctor = createCtor(func);function wrapper() {var argsIndex = -1,argsLength = arguments.length,leftIndex = -1,leftLength = partials.length,args = Array(leftLength + argsLength),fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;while (++leftIndex < leftLength) {args[leftIndex] = partials[leftIndex];}while (argsLength--) {args[leftIndex++] = arguments[++argsIndex];}return apply(fn, isBind ? thisArg : this, args);}return wrapper;}module.exports = createPartial;
var baseRepeat = require('./_baseRepeat'),baseToString = require('./_baseToString'),castSlice = require('./_castSlice'),hasUnicode = require('./_hasUnicode'),stringSize = require('./_stringSize'),stringToArray = require('./_stringToArray');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil;/*** Creates the padding for `string` based on `length`. The `chars` string* is truncated if the number of characters exceeds `length`.** @private* @param {number} length The padding length.* @param {string} [chars=' '] The string used as padding.* @returns {string} Returns the padding for `string`.*/function createPadding(length, chars) {chars = chars === undefined ? ' ' : baseToString(chars);var charsLength = chars.length;if (charsLength < 2) {return charsLength ? baseRepeat(chars, length) : chars;}var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));return hasUnicode(chars)? castSlice(stringToArray(result), 0, length).join(''): result.slice(0, length);}module.exports = createPadding;
var apply = require('./_apply'),arrayMap = require('./_arrayMap'),baseIteratee = require('./_baseIteratee'),baseRest = require('./_baseRest'),baseUnary = require('./_baseUnary'),flatRest = require('./_flatRest');/*** Creates a function like `_.over`.** @private* @param {Function} arrayFunc The function to iterate over iteratees.* @returns {Function} Returns the new over function.*/function createOver(arrayFunc) {return flatRest(function(iteratees) {iteratees = arrayMap(iteratees, baseUnary(baseIteratee));return baseRest(function(args) {var thisArg = this;return arrayFunc(iteratees, function(iteratee) {return apply(iteratee, thisArg, args);});});});}module.exports = createOver;
var baseToNumber = require('./_baseToNumber'),baseToString = require('./_baseToString');/*** Creates a function that performs a mathematical operation on two values.** @private* @param {Function} operator The function to perform the operation.* @param {number} [defaultValue] The value used for `undefined` arguments.* @returns {Function} Returns the new mathematical operation function.*/function createMathOperation(operator, defaultValue) {return function(value, other) {var result;if (value === undefined && other === undefined) {return defaultValue;}if (value !== undefined) {result = value;}if (other !== undefined) {if (result === undefined) {return other;}if (typeof value == 'string' || typeof other == 'string') {value = baseToString(value);other = baseToString(other);} else {value = baseToNumber(value);other = baseToNumber(other);}result = operator(value, other);}return result;};}module.exports = createMathOperation;
var baseInverter = require('./_baseInverter');/*** Creates a function like `_.invertBy`.** @private* @param {Function} setter The function to set accumulator values.* @param {Function} toIteratee The function to resolve iteratees.* @returns {Function} Returns the new inverter function.*/function createInverter(setter, toIteratee) {return function(object, iteratee) {return baseInverter(object, setter, toIteratee(iteratee), {});};}module.exports = createInverter;
var composeArgs = require('./_composeArgs'),composeArgsRight = require('./_composeArgsRight'),countHolders = require('./_countHolders'),createCtor = require('./_createCtor'),createRecurry = require('./_createRecurry'),getHolder = require('./_getHolder'),reorder = require('./_reorder'),replaceHolders = require('./_replaceHolders'),root = require('./_root');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1,WRAP_BIND_KEY_FLAG = 2,WRAP_CURRY_FLAG = 8,WRAP_CURRY_RIGHT_FLAG = 16,WRAP_ARY_FLAG = 128,WRAP_FLIP_FLAG = 512;/*** Creates a function that wraps `func` to invoke it with optional `this`* binding of `thisArg`, partial application, and currying.** @private* @param {Function|string} func The function or method name to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} [thisArg] The `this` binding of `func`.* @param {Array} [partials] The arguments to prepend to those provided to* the new function.* @param {Array} [holders] The `partials` placeholder indexes.* @param {Array} [partialsRight] The arguments to append to those provided* to the new function.* @param {Array} [holdersRight] The `partialsRight` placeholder indexes.* @param {Array} [argPos] The argument positions of the new function.* @param {number} [ary] The arity cap of `func`.* @param {number} [arity] The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {var isAry = bitmask & WRAP_ARY_FLAG,isBind = bitmask & WRAP_BIND_FLAG,isBindKey = bitmask & WRAP_BIND_KEY_FLAG,isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),isFlip = bitmask & WRAP_FLIP_FLAG,Ctor = isBindKey ? undefined : createCtor(func);function wrapper() {var length = arguments.length,args = Array(length),index = length;while (index--) {args[index] = arguments[index];}if (isCurried) {var placeholder = getHolder(wrapper),holdersCount = countHolders(args, placeholder);}if (partials) {args = composeArgs(args, partials, holders, isCurried);}if (partialsRight) {args = composeArgsRight(args, partialsRight, holdersRight, isCurried);}length -= holdersCount;if (isCurried && length < arity) {var newHolders = replaceHolders(args, placeholder);return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg,args, newHolders, argPos, ary, arity - length);}var thisBinding = isBind ? thisArg : this,fn = isBindKey ? thisBinding[func] : func;length = args.length;if (argPos) {args = reorder(args, argPos);} else if (isFlip && length > 1) {args.reverse();}if (isAry && ary < length) {args.length = ary;}if (this && this !== root && this instanceof wrapper) {fn = Ctor || createCtor(fn);}return fn.apply(thisBinding, args);}return wrapper;}module.exports = createHybrid;
var LodashWrapper = require('./_LodashWrapper'),flatRest = require('./_flatRest'),getData = require('./_getData'),getFuncName = require('./_getFuncName'),isArray = require('./isArray'),isLaziable = require('./_isLaziable');/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/** Used to compose bitmasks for function metadata. */var WRAP_CURRY_FLAG = 8,WRAP_PARTIAL_FLAG = 32,WRAP_ARY_FLAG = 128,WRAP_REARG_FLAG = 256;/*** Creates a `_.flow` or `_.flowRight` function.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new flow function.*/function createFlow(fromRight) {return flatRest(function(funcs) {var length = funcs.length,index = length,prereq = LodashWrapper.prototype.thru;if (fromRight) {funcs.reverse();}while (index--) {var func = funcs[index];if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}if (prereq && !wrapper && getFuncName(func) == 'wrapper') {var wrapper = new LodashWrapper([], true);}}index = wrapper ? index : length;while (++index < length) {func = funcs[index];var funcName = getFuncName(func),data = funcName == 'wrapper' ? getData(func) : undefined;if (data && isLaziable(data[0]) &&data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&!data[4].length && data[9] == 1) {wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);} else {wrapper = (func.length == 1 && isLaziable(func))? wrapper[funcName](): wrapper.thru(func);}}return function() {var args = arguments,value = args[0];if (wrapper && args.length == 1 && isArray(value)) {return wrapper.plant(value).value();}var index = 0,result = length ? funcs[index].apply(this, args) : value;while (++index < length) {result = funcs[index].call(this, result);}return result;};});}module.exports = createFlow;
var baseIteratee = require('./_baseIteratee'),isArrayLike = require('./isArrayLike'),keys = require('./keys');/*** Creates a `_.find` or `_.findLast` function.** @private* @param {Function} findIndexFunc The function to find the collection index.* @returns {Function} Returns the new find function.*/function createFind(findIndexFunc) {return function(collection, predicate, fromIndex) {var iterable = Object(collection);if (!isArrayLike(collection)) {var iteratee = baseIteratee(predicate, 3);collection = keys(collection);predicate = function(key) { return iteratee(iterable[key], key, iterable); };}var index = findIndexFunc(collection, predicate, fromIndex);return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;};}module.exports = createFind;
var apply = require('./_apply'),createCtor = require('./_createCtor'),createHybrid = require('./_createHybrid'),createRecurry = require('./_createRecurry'),getHolder = require('./_getHolder'),replaceHolders = require('./_replaceHolders'),root = require('./_root');/*** Creates a function that wraps `func` to enable currying.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {number} arity The arity of `func`.* @returns {Function} Returns the new wrapped function.*/function createCurry(func, bitmask, arity) {var Ctor = createCtor(func);function wrapper() {var length = arguments.length,args = Array(length),index = length,placeholder = getHolder(wrapper);while (index--) {args[index] = arguments[index];}var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)? []: replaceHolders(args, placeholder);length -= holders.length;if (length < arity) {return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined,args, holders, undefined, undefined, arity - length);}var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;return apply(fn, this, args);}return wrapper;}module.exports = createCurry;
var baseCreate = require('./_baseCreate'),isObject = require('./isObject');/*** Creates a function that produces an instance of `Ctor` regardless of* whether it was invoked as part of a `new` expression or by `call` or `apply`.** @private* @param {Function} Ctor The constructor to wrap.* @returns {Function} Returns the new wrapped function.*/function createCtor(Ctor) {return function() {// Use a `switch` statement to work with class constructors. See// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist// for more details.var args = arguments;switch (args.length) {case 0: return new Ctor;case 1: return new Ctor(args[0]);case 2: return new Ctor(args[0], args[1]);case 3: return new Ctor(args[0], args[1], args[2]);case 4: return new Ctor(args[0], args[1], args[2], args[3]);case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}var thisBinding = baseCreate(Ctor.prototype),result = Ctor.apply(thisBinding, args);// Mimic the constructor's `return` behavior.// See https://es5.github.io/#x13.2.2 for more details.return isObject(result) ? result : thisBinding;};}module.exports = createCtor;
var arrayReduce = require('./_arrayReduce'),deburr = require('./deburr'),words = require('./words');/** Used to compose unicode capture groups. */var rsApos = "['\u2019]";/** Used to match apostrophes. */var reApos = RegExp(rsApos, 'g');/*** Creates a function like `_.camelCase`.** @private* @param {Function} callback The function to combine each word.* @returns {Function} Returns the new compounder function.*/function createCompounder(callback) {return function(string) {return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');};}module.exports = createCompounder;
var castSlice = require('./_castSlice'),hasUnicode = require('./_hasUnicode'),stringToArray = require('./_stringToArray'),toString = require('./toString');/*** Creates a function like `_.lowerFirst`.** @private* @param {string} methodName The name of the `String` case method to use.* @returns {Function} Returns the new case function.*/function createCaseFirst(methodName) {return function(string) {string = toString(string);var strSymbols = hasUnicode(string)? stringToArray(string): undefined;var chr = strSymbols? strSymbols[0]: string.charAt(0);var trailing = strSymbols? castSlice(strSymbols, 1).join(''): string.slice(1);return chr[methodName]() + trailing;};}module.exports = createCaseFirst;
var createCtor = require('./_createCtor'),root = require('./_root');/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG = 1;/*** Creates a function that wraps `func` to invoke it with the optional `this`* binding of `thisArg`.** @private* @param {Function} func The function to wrap.* @param {number} bitmask The bitmask flags. See `createWrap` for more details.* @param {*} [thisArg] The `this` binding of `func`.* @returns {Function} Returns the new wrapped function.*/function createBind(func, bitmask, thisArg) {var isBind = bitmask & WRAP_BIND_FLAG,Ctor = createCtor(func);function wrapper() {var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;return fn.apply(isBind ? thisArg : this, arguments);}return wrapper;}module.exports = createBind;
/*** Creates a base function for methods like `_.forIn` and `_.forOwn`.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseFor(fromRight) {return function(object, iteratee, keysFunc) {var index = -1,iterable = Object(object),props = keysFunc(object),length = props.length;while (length--) {var key = props[fromRight ? length : ++index];if (iteratee(iterable[key], key, iterable) === false) {break;}}return object;};}module.exports = createBaseFor;
var isArrayLike = require('./isArrayLike');/*** Creates a `baseEach` or `baseEachRight` function.** @private* @param {Function} eachFunc The function to iterate over a collection.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseEach(eachFunc, fromRight) {return function(collection, iteratee) {if (collection == null) {return collection;}if (!isArrayLike(collection)) {return eachFunc(collection, iteratee);}var length = collection.length,index = fromRight ? length : -1,iterable = Object(collection);while ((fromRight ? index-- : ++index < length)) {if (iteratee(iterable[index], index, iterable) === false) {break;}}return collection;};}module.exports = createBaseEach;
var baseRest = require('./_baseRest'),isIterateeCall = require('./_isIterateeCall');/*** Creates a function like `_.assign`.** @private* @param {Function} assigner The function to assign values.* @returns {Function} Returns the new assigner function.*/function createAssigner(assigner) {return baseRest(function(object, sources) {var index = -1,length = sources.length,customizer = length > 1 ? sources[length - 1] : undefined,guard = length > 2 ? sources[2] : undefined;customizer = (assigner.length > 3 && typeof customizer == 'function')? (length--, customizer): undefined;if (guard && isIterateeCall(sources[0], sources[1], guard)) {customizer = length < 3 ? undefined : customizer;length = 1;}object = Object(object);while (++index < length) {var source = sources[index];if (source) {assigner(object, source, index, customizer);}}return object;});}module.exports = createAssigner;
var arrayAggregator = require('./_arrayAggregator'),baseAggregator = require('./_baseAggregator'),baseIteratee = require('./_baseIteratee'),isArray = require('./isArray');/*** Creates a function like `_.groupBy`.** @private* @param {Function} setter The function to set accumulator values.* @param {Function} [initializer] The accumulator object initializer.* @returns {Function} Returns the new aggregator function.*/function createAggregator(setter, initializer) {return function(collection, iteratee) {var func = isArray(collection) ? arrayAggregator : baseAggregator,accumulator = initializer ? initializer() : {};return func(collection, setter, baseIteratee(iteratee, 2), accumulator);};}module.exports = createAggregator;
/*** Gets the number of `placeholder` occurrences in `array`.** @private* @param {Array} array The array to inspect.* @param {*} placeholder The placeholder to search for.* @returns {number} Returns the placeholder count.*/function countHolders(array, placeholder) {var length = array.length,result = 0;while (length--) {if (array[length] === placeholder) {++result;}}return result;}module.exports = countHolders;
var root = require('./_root');/** Used to detect overreaching core-js shims. */var coreJsData = root['__core-js_shared__'];module.exports = coreJsData;
var copyObject = require('./_copyObject'),getSymbolsIn = require('./_getSymbolsIn');/*** Copies own and inherited symbols of `source` to `object`.** @private* @param {Object} source The object to copy symbols from.* @param {Object} [object={}] The object to copy symbols to.* @returns {Object} Returns `object`.*/function copySymbolsIn(source, object) {return copyObject(source, getSymbolsIn(source), object);}module.exports = copySymbolsIn;
var copyObject = require('./_copyObject'),getSymbols = require('./_getSymbols');/*** Copies own symbols of `source` to `object`.** @private* @param {Object} source The object to copy symbols from.* @param {Object} [object={}] The object to copy symbols to.* @returns {Object} Returns `object`.*/function copySymbols(source, object) {return copyObject(source, getSymbols(source), object);}module.exports = copySymbols;
var assignValue = require('./_assignValue'),baseAssignValue = require('./_baseAssignValue');/*** Copies properties of `source` to `object`.** @private* @param {Object} source The object to copy properties from.* @param {Array} props The property identifiers to copy.* @param {Object} [object={}] The object to copy properties to.* @param {Function} [customizer] The function to customize copied values.* @returns {Object} Returns `object`.*/function copyObject(source, props, object, customizer) {var isNew = !object;object || (object = {});var index = -1,length = props.length;while (++index < length) {var key = props[index];var newValue = customizer? customizer(object[key], source[key], key, object, source): undefined;if (newValue === undefined) {newValue = source[key];}if (isNew) {baseAssignValue(object, key, newValue);} else {assignValue(object, key, newValue);}}return object;}module.exports = copyObject;
/*** Copies the values of `source` to `array`.** @private* @param {Array} source The array to copy values from.* @param {Array} [array=[]] The array to copy values to.* @returns {Array} Returns `array`.*/function copyArray(source, array) {var index = -1,length = source.length;array || (array = Array(length));while (++index < length) {array[index] = source[index];}return array;}module.exports = copyArray;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** This function is like `composeArgs` except that the arguments composition* is tailored for `_.partialRight`.** @private* @param {Array} args The provided arguments.* @param {Array} partials The arguments to append to those provided.* @param {Array} holders The `partials` placeholder indexes.* @params {boolean} [isCurried] Specify composing for a curried function.* @returns {Array} Returns the new array of composed arguments.*/function composeArgsRight(args, partials, holders, isCurried) {var argsIndex = -1,argsLength = args.length,holdersIndex = -1,holdersLength = holders.length,rightIndex = -1,rightLength = partials.length,rangeLength = nativeMax(argsLength - holdersLength, 0),result = Array(rangeLength + rightLength),isUncurried = !isCurried;while (++argsIndex < rangeLength) {result[argsIndex] = args[argsIndex];}var offset = argsIndex;while (++rightIndex < rightLength) {result[offset + rightIndex] = partials[rightIndex];}while (++holdersIndex < holdersLength) {if (isUncurried || argsIndex < argsLength) {result[offset + holders[holdersIndex]] = args[argsIndex++];}}return result;}module.exports = composeArgsRight;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max;/*** Creates an array that is the composition of partially applied arguments,* placeholders, and provided arguments into a single array of arguments.** @private* @param {Array} args The provided arguments.* @param {Array} partials The arguments to prepend to those provided.* @param {Array} holders The `partials` placeholder indexes.* @params {boolean} [isCurried] Specify composing for a curried function.* @returns {Array} Returns the new array of composed arguments.*/function composeArgs(args, partials, holders, isCurried) {var argsIndex = -1,argsLength = args.length,holdersLength = holders.length,leftIndex = -1,leftLength = partials.length,rangeLength = nativeMax(argsLength - holdersLength, 0),result = Array(leftLength + rangeLength),isUncurried = !isCurried;while (++leftIndex < leftLength) {result[leftIndex] = partials[leftIndex];}while (++argsIndex < holdersLength) {if (isUncurried || argsIndex < argsLength) {result[holders[argsIndex]] = args[argsIndex];}}while (rangeLength--) {result[leftIndex++] = args[argsIndex++];}return result;}module.exports = composeArgs;
var compareAscending = require('./_compareAscending');/*** Used by `_.orderBy` to compare multiple properties of a value to another* and stable sort them.** If `orders` is unspecified, all values are sorted in ascending order. Otherwise,* specify an order of "desc" for descending or "asc" for ascending sort order* of corresponding values.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {boolean[]|string[]} orders The order to sort by for each property.* @returns {number} Returns the sort order indicator for `object`.*/function compareMultiple(object, other, orders) {var index = -1,objCriteria = object.criteria,othCriteria = other.criteria,length = objCriteria.length,ordersLength = orders.length;while (++index < length) {var result = compareAscending(objCriteria[index], othCriteria[index]);if (result) {if (index >= ordersLength) {return result;}var order = orders[index];return result * (order == 'desc' ? -1 : 1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications// that causes it, under certain circumstances, to provide the same value for// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247// for more details.//// This also ensures a stable sort in V8 and other engines.// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.return object.index - other.index;}module.exports = compareMultiple;
var isSymbol = require('./isSymbol');/*** Compares values to sort them in ascending order.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {number} Returns the sort order indicator for `value`.*/function compareAscending(value, other) {if (value !== other) {var valIsDefined = value !== undefined,valIsNull = value === null,valIsReflexive = value === value,valIsSymbol = isSymbol(value);var othIsDefined = other !== undefined,othIsNull = other === null,othIsReflexive = other === other,othIsSymbol = isSymbol(other);if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||(valIsNull && othIsDefined && othIsReflexive) ||(!valIsDefined && othIsReflexive) ||!valIsReflexive) {return 1;}if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||(othIsNull && valIsDefined && valIsReflexive) ||(!othIsDefined && valIsReflexive) ||!othIsReflexive) {return -1;}}return 0;}module.exports = compareAscending;
var cloneArrayBuffer = require('./_cloneArrayBuffer');/*** Creates a clone of `typedArray`.** @private* @param {Object} typedArray The typed array to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the cloned typed array.*/function cloneTypedArray(typedArray, isDeep) {var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);}module.exports = cloneTypedArray;
var Symbol = require('./_Symbol');/** Used to convert symbols to primitives and strings. */var symbolProto = Symbol ? Symbol.prototype : undefined,symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;/*** Creates a clone of the `symbol` object.** @private* @param {Object} symbol The symbol object to clone.* @returns {Object} Returns the cloned symbol object.*/function cloneSymbol(symbol) {return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};}module.exports = cloneSymbol;
/** Used to match `RegExp` flags from their coerced string values. */var reFlags = /\w*$/;/*** Creates a clone of `regexp`.** @private* @param {Object} regexp The regexp to clone.* @returns {Object} Returns the cloned regexp.*/function cloneRegExp(regexp) {var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));result.lastIndex = regexp.lastIndex;return result;}module.exports = cloneRegExp;
var cloneArrayBuffer = require('./_cloneArrayBuffer');/*** Creates a clone of `dataView`.** @private* @param {Object} dataView The data view to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Object} Returns the cloned data view.*/function cloneDataView(dataView, isDeep) {var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);}module.exports = cloneDataView;
var root = require('./_root');/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports = freeModule && freeModule.exports === freeExports;/** Built-in value references. */var Buffer = moduleExports ? root.Buffer : undefined,allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;/*** Creates a clone of `buffer`.** @private* @param {Buffer} buffer The buffer to clone.* @param {boolean} [isDeep] Specify a deep clone.* @returns {Buffer} Returns the cloned buffer.*/function cloneBuffer(buffer, isDeep) {if (isDeep) {return buffer.slice();}var length = buffer.length,result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);buffer.copy(result);return result;}module.exports = cloneBuffer;
var Uint8Array = require('./_Uint8Array');/*** Creates a clone of `arrayBuffer`.** @private* @param {ArrayBuffer} arrayBuffer The array buffer to clone.* @returns {ArrayBuffer} Returns the cloned array buffer.*/function cloneArrayBuffer(arrayBuffer) {var result = new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}module.exports = cloneArrayBuffer;
var baseIndexOf = require('./_baseIndexOf');/*** Used by `_.trim` and `_.trimStart` to get the index of the first string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the first unmatched string symbol.*/function charsStartIndex(strSymbols, chrSymbols) {var index = -1,length = strSymbols.length;while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}module.exports = charsStartIndex;
var baseIndexOf = require('./_baseIndexOf');/*** Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the last unmatched string symbol.*/function charsEndIndex(strSymbols, chrSymbols) {var index = strSymbols.length;while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}module.exports = charsEndIndex;
var baseSlice = require('./_baseSlice');/*** Casts `array` to a slice if it's needed.** @private* @param {Array} array The array to inspect.* @param {number} start The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the cast slice.*/function castSlice(array, start, end) {var length = array.length;end = end === undefined ? length : end;return (!start && end >= length) ? array : baseSlice(array, start, end);}module.exports = castSlice;
var baseRest = require('./_baseRest');/*** A `baseRest` alias which can be replaced with `identity` by module* replacement plugins.** @private* @type {Function}* @param {Function} func The function to apply a rest parameter to.* @returns {Function} Returns the new function.*/var castRest = baseRest;module.exports = castRest;
var isArray = require('./isArray'),isKey = require('./_isKey'),stringToPath = require('./_stringToPath'),toString = require('./toString');/*** Casts `value` to a path array if it's not one.** @private* @param {*} value The value to inspect.* @param {Object} [object] The object to query keys on.* @returns {Array} Returns the cast property path array.*/function castPath(value, object) {if (isArray(value)) {return value;}return isKey(value, object) ? [value] : stringToPath(toString(value));}module.exports = castPath;
var identity = require('./identity');/*** Casts `value` to `identity` if it's not a function.** @private* @param {*} value The value to inspect.* @returns {Function} Returns cast function.*/function castFunction(value) {return typeof value == 'function' ? value : identity;}module.exports = castFunction;
var isArrayLikeObject = require('./isArrayLikeObject');/*** Casts `value` to an empty array if it's not an array like object.** @private* @param {*} value The value to inspect.* @returns {Array|Object} Returns the cast array-like object.*/function castArrayLikeObject(value) {return isArrayLikeObject(value) ? value : [];}module.exports = castArrayLikeObject;
/*** Checks if a `cache` value for `key` exists.** @private* @param {Object} cache The cache to query.* @param {string} key The key of the entry to check.* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.*/function cacheHas(cache, key) {return cache.has(key);}module.exports = cacheHas;
/*** This base implementation of `_.zipObject` which assigns values using `assignFunc`.** @private* @param {Array} props The property identifiers.* @param {Array} values The property values.* @param {Function} assignFunc The function to assign values.* @returns {Object} Returns the new object.*/function baseZipObject(props, values, assignFunc) {var index = -1,length = props.length,valsLength = values.length,result = {};while (++index < length) {var value = index < valsLength ? values[index] : undefined;assignFunc(result, props[index], value);}return result;}module.exports = baseZipObject;
var baseDifference = require('./_baseDifference'),baseFlatten = require('./_baseFlatten'),baseUniq = require('./_baseUniq');/*** The base implementation of methods like `_.xor`, without support for* iteratee shorthands, that accepts an array of arrays to inspect.** @private* @param {Array} arrays The arrays to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of values.*/function baseXor(arrays, iteratee, comparator) {var length = arrays.length;if (length < 2) {return length ? baseUniq(arrays[0]) : [];}var index = -1,result = Array(length);while (++index < length) {var array = arrays[index],othIndex = -1;while (++othIndex < length) {if (othIndex != index) {result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);}}}return baseUniq(baseFlatten(result, 1), iteratee, comparator);}module.exports = baseXor;
var LazyWrapper = require('./_LazyWrapper'),arrayPush = require('./_arrayPush'),arrayReduce = require('./_arrayReduce');/*** The base implementation of `wrapperValue` which returns the result of* performing a sequence of actions on the unwrapped `value`, where each* successive action is supplied the return value of the previous.** @private* @param {*} value The unwrapped value.* @param {Array} actions Actions to perform to resolve the unwrapped value.* @returns {*} Returns the resolved value.*/function baseWrapperValue(value, actions) {var result = value;if (result instanceof LazyWrapper) {result = result.value();}return arrayReduce(actions, function(result, action) {return action.func.apply(action.thisArg, arrayPush([result], action.args));}, result);}module.exports = baseWrapperValue;
var baseSlice = require('./_baseSlice');/*** The base implementation of methods like `_.dropWhile` and `_.takeWhile`* without support for iteratee shorthands.** @private* @param {Array} array The array to query.* @param {Function} predicate The function invoked per iteration.* @param {boolean} [isDrop] Specify dropping elements instead of taking them.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Array} Returns the slice of `array`.*/function baseWhile(array, predicate, isDrop, fromRight) {var length = array.length,index = fromRight ? length : -1;while ((fromRight ? index-- : ++index < length) &&predicate(array[index], index, array)) {}return isDrop? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)): baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));}module.exports = baseWhile;
var arrayMap = require('./_arrayMap');/*** The base implementation of `_.values` and `_.valuesIn` which creates an* array of `object` property values corresponding to the property names* of `props`.** @private* @param {Object} object The object to query.* @param {Array} props The property names to get values for.* @returns {Object} Returns the array of property values.*/function baseValues(object, props) {return arrayMap(props, function(key) {return object[key];});}module.exports = baseValues;
var baseGet = require('./_baseGet'),baseSet = require('./_baseSet');/*** The base implementation of `_.update`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to update.* @param {Function} updater The function to produce the updated value.* @param {Function} [customizer] The function to customize path creation.* @returns {Object} Returns `object`.*/function baseUpdate(object, path, updater, customizer) {return baseSet(object, path, updater(baseGet(object, path)), customizer);}module.exports = baseUpdate;
var castPath = require('./_castPath'),last = require('./last'),parent = require('./_parent'),toKey = require('./_toKey');/*** The base implementation of `_.unset`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The property path to unset.* @returns {boolean} Returns `true` if the property is deleted, else `false`.*/function baseUnset(object, path) {path = castPath(path, object);object = parent(object, path);return object == null || delete object[toKey(last(path))];}module.exports = baseUnset;
var SetCache = require('./_SetCache'),arrayIncludes = require('./_arrayIncludes'),arrayIncludesWith = require('./_arrayIncludesWith'),cacheHas = require('./_cacheHas'),createSet = require('./_createSet'),setToArray = require('./_setToArray');/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE = 200;/*** The base implementation of `_.uniqBy` without support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new duplicate free array.*/function baseUniq(array, iteratee, comparator) {var index = -1,includes = arrayIncludes,length = array.length,isCommon = true,result = [],seen = result;if (comparator) {isCommon = false;includes = arrayIncludesWith;}else if (length >= LARGE_ARRAY_SIZE) {var set = iteratee ? null : createSet(array);if (set) {return setToArray(set);}isCommon = false;includes = cacheHas;seen = new SetCache;}else {seen = iteratee ? [] : result;}outer:while (++index < length) {var value = array[index],computed = iteratee ? iteratee(value) : value;value = (comparator || value !== 0) ? value : 0;if (isCommon && computed === computed) {var seenIndex = seen.length;while (seenIndex--) {if (seen[seenIndex] === computed) {continue outer;}}if (iteratee) {seen.push(computed);}result.push(value);}else if (!includes(seen, computed, comparator)) {if (seen !== result) {seen.push(computed);}result.push(value);}}return result;}module.exports = baseUniq;
/*** The base implementation of `_.unary` without support for storing metadata.** @private* @param {Function} func The function to cap arguments for.* @returns {Function} Returns the new capped function.*/function baseUnary(func) {return function(value) {return func(value);};}module.exports = baseUnary;
var Symbol = require('./_Symbol'),arrayMap = require('./_arrayMap'),isArray = require('./isArray'),isSymbol = require('./isSymbol');/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/** Used to convert symbols to primitives and strings. */var symbolProto = Symbol ? Symbol.prototype : undefined,symbolToString = symbolProto ? symbolProto.toString : undefined;/*** The base implementation of `_.toString` which doesn't convert nullish* values to empty strings.** @private* @param {*} value The value to process.* @returns {string} Returns the string.*/function baseToString(value) {// Exit early for strings to avoid a performance hit in some environments.if (typeof value == 'string') {return value;}if (isArray(value)) {// Recursively convert values (susceptible to call stack limits).return arrayMap(value, baseToString) + '';}if (isSymbol(value)) {return symbolToString ? symbolToString.call(value) : '';}var result = (value + '');return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;}module.exports = baseToString;
var arrayMap = require('./_arrayMap');/*** The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array* of key-value pairs for `object` corresponding to the property names of `props`.** @private* @param {Object} object The object to query.* @param {Array} props The property names to get values for.* @returns {Object} Returns the key-value pairs.*/function baseToPairs(object, props) {return arrayMap(props, function(key) {return [key, object[key]];});}module.exports = baseToPairs;
var isSymbol = require('./isSymbol');/** Used as references for various `Number` constants. */var NAN = 0 / 0;/*** The base implementation of `_.toNumber` which doesn't ensure correct* conversions of binary, hexadecimal, or octal string values.** @private* @param {*} value The value to process.* @returns {number} Returns the number.*/function baseToNumber(value) {if (typeof value == 'number') {return value;}if (isSymbol(value)) {return NAN;}return +value;}module.exports = baseToNumber;
/*** The base implementation of `_.times` without support for iteratee shorthands* or max array length checks.** @private* @param {number} n The number of times to invoke `iteratee`.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the array of results.*/function baseTimes(n, iteratee) {var index = -1,result = Array(n);while (++index < n) {result[index] = iteratee(index);}return result;}module.exports = baseTimes;
/*** The base implementation of `_.sum` and `_.sumBy` without support for* iteratee shorthands.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {number} Returns the sum.*/function baseSum(array, iteratee) {var result,index = -1,length = array.length;while (++index < length) {var current = iteratee(array[index]);if (current !== undefined) {result = result === undefined ? current : (result + current);}}return result;}module.exports = baseSum;
var eq = require('./eq');/*** The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @returns {Array} Returns the new duplicate free array.*/function baseSortedUniq(array, iteratee) {var index = -1,length = array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index],computed = iteratee ? iteratee(value) : value;if (!index || !eq(computed, seen)) {var seen = computed;result[resIndex++] = value === 0 ? 0 : value;}}return result;}module.exports = baseSortedUniq;
var isSymbol = require('./isSymbol');/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295,MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeFloor = Math.floor,nativeMin = Math.min;/*** The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`* which invokes `iteratee` for `value` and each element of `array` to compute* their sort ranking. The iteratee is invoked with one argument; (value).** @private* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {Function} iteratee The iteratee invoked per element.* @param {boolean} [retHighest] Specify returning the highest qualified index.* @returns {number} Returns the index at which `value` should be inserted* into `array`.*/function baseSortedIndexBy(array, value, iteratee, retHighest) {var low = 0,high = array == null ? 0 : array.length;if (high === 0) {return 0;}value = iteratee(value);var valIsNaN = value !== value,valIsNull = value === null,valIsSymbol = isSymbol(value),valIsUndefined = value === undefined;while (low < high) {var mid = nativeFloor((low + high) / 2),computed = iteratee(array[mid]),othIsDefined = computed !== undefined,othIsNull = computed === null,othIsReflexive = computed === computed,othIsSymbol = isSymbol(computed);if (valIsNaN) {var setLow = retHighest || othIsReflexive;} else if (valIsUndefined) {setLow = othIsReflexive && (retHighest || othIsDefined);} else if (valIsNull) {setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);} else if (valIsSymbol) {setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);} else if (othIsNull || othIsSymbol) {setLow = false;} else {setLow = retHighest ? (computed <= value) : (computed < value);}if (setLow) {low = mid + 1;} else {high = mid;}}return nativeMin(high, MAX_ARRAY_INDEX);}module.exports = baseSortedIndexBy;
var baseSortedIndexBy = require('./_baseSortedIndexBy'),identity = require('./identity'),isSymbol = require('./isSymbol');/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295,HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;/*** The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which* performs a binary search of `array` to determine the index at which `value`* should be inserted into `array` in order to maintain its sort order.** @private* @param {Array} array The sorted array to inspect.* @param {*} value The value to evaluate.* @param {boolean} [retHighest] Specify returning the highest qualified index.* @returns {number} Returns the index at which `value` should be inserted* into `array`.*/function baseSortedIndex(array, value, retHighest) {var low = 0,high = array == null ? low : array.length;if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {while (low < high) {var mid = (low + high) >>> 1,computed = array[mid];if (computed !== null && !isSymbol(computed) &&(retHighest ? (computed <= value) : (computed < value))) {low = mid + 1;} else {high = mid;}}return high;}return baseSortedIndexBy(array, value, identity, retHighest);}module.exports = baseSortedIndex;
/*** The base implementation of `_.sortBy` which uses `comparer` to define the* sort order of `array` and replaces criteria objects with their corresponding* values.** @private* @param {Array} array The array to sort.* @param {Function} comparer The function to define sort order.* @returns {Array} Returns `array`.*/function baseSortBy(array, comparer) {var length = array.length;array.sort(comparer);while (length--) {array[length] = array[length].value;}return array;}module.exports = baseSortBy;
var baseEach = require('./_baseEach');/*** The base implementation of `_.some` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.*/function baseSome(collection, predicate) {var result;baseEach(collection, function(value, index, collection) {result = predicate(value, index, collection);return !result;});return !!result;}module.exports = baseSome;
/*** The base implementation of `_.slice` without an iteratee call guard.** @private* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function baseSlice(array, start, end) {var index = -1,length = array.length;if (start < 0) {start = -start > length ? 0 : (length + start);}end = end > length ? length : end;if (end < 0) {end += length;}length = start > end ? 0 : ((end - start) >>> 0);start >>>= 0;var result = Array(length);while (++index < length) {result[index] = array[index + start];}return result;}module.exports = baseSlice;
var shuffleSelf = require('./_shuffleSelf'),values = require('./values');/*** The base implementation of `_.shuffle`.** @private* @param {Array|Object} collection The collection to shuffle.* @returns {Array} Returns the new shuffled array.*/function baseShuffle(collection) {return shuffleSelf(values(collection));}module.exports = baseShuffle;
var constant = require('./constant'),defineProperty = require('./_defineProperty'),identity = require('./identity');/*** The base implementation of `setToString` without support for hot loop shorting.** @private* @param {Function} func The function to modify.* @param {Function} string The `toString` result.* @returns {Function} Returns `func`.*/var baseSetToString = !defineProperty ? identity : function(func, string) {return defineProperty(func, 'toString', {'configurable': true,'enumerable': false,'value': constant(string),'writable': true});};module.exports = baseSetToString;
var identity = require('./identity'),metaMap = require('./_metaMap');/*** The base implementation of `setData` without support for hot loop shorting.** @private* @param {Function} func The function to associate metadata with.* @param {*} data The metadata.* @returns {Function} Returns `func`.*/var baseSetData = !metaMap ? identity : function(func, data) {metaMap.set(func, data);return func;};module.exports = baseSetData;
var assignValue = require('./_assignValue'),castPath = require('./_castPath'),isIndex = require('./_isIndex'),isObject = require('./isObject'),toKey = require('./_toKey');/*** The base implementation of `_.set`.** @private* @param {Object} object The object to modify.* @param {Array|string} path The path of the property to set.* @param {*} value The value to set.* @param {Function} [customizer] The function to customize path creation.* @returns {Object} Returns `object`.*/function baseSet(object, path, value, customizer) {if (!isObject(object)) {return object;}path = castPath(path, object);var index = -1,length = path.length,lastIndex = length - 1,nested = object;while (nested != null && ++index < length) {var key = toKey(path[index]),newValue = value;if (key === '__proto__' || key === 'constructor' || key === 'prototype') {return object;}if (index != lastIndex) {var objValue = nested[key];newValue = customizer ? customizer(objValue, key, nested) : undefined;if (newValue === undefined) {newValue = isObject(objValue)? objValue: (isIndex(path[index + 1]) ? [] : {});}}assignValue(nested, key, newValue);nested = nested[key];}return object;}module.exports = baseSet;
var baseClamp = require('./_baseClamp'),shuffleSelf = require('./_shuffleSelf'),values = require('./values');/*** The base implementation of `_.sampleSize` without param guards.** @private* @param {Array|Object} collection The collection to sample.* @param {number} n The number of elements to sample.* @returns {Array} Returns the random elements.*/function baseSampleSize(collection, n) {var array = values(collection);return shuffleSelf(array, baseClamp(n, 0, array.length));}module.exports = baseSampleSize;
var arraySample = require('./_arraySample'),values = require('./values');/*** The base implementation of `_.sample`.** @private* @param {Array|Object} collection The collection to sample.* @returns {*} Returns the random element.*/function baseSample(collection) {return arraySample(values(collection));}module.exports = baseSample;
var identity = require('./identity'),overRest = require('./_overRest'),setToString = require('./_setToString');/*** The base implementation of `_.rest` which doesn't validate or coerce arguments.** @private* @param {Function} func The function to apply a rest parameter to.* @param {number} [start=func.length-1] The start position of the rest parameter.* @returns {Function} Returns the new function.*/function baseRest(func, start) {return setToString(overRest(func, start, identity), func + '');}module.exports = baseRest;
/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeFloor = Math.floor;/*** The base implementation of `_.repeat` which doesn't coerce arguments.** @private* @param {string} string The string to repeat.* @param {number} n The number of times to repeat the string.* @returns {string} Returns the repeated string.*/function baseRepeat(string, n) {var result = '';if (!string || n < 1 || n > MAX_SAFE_INTEGER) {return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat.// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.do {if (n % 2) {result += string;}n = nativeFloor(n / 2);if (n) {string += string;}} while (n);return result;}module.exports = baseRepeat;
/*** The base implementation of `_.reduce` and `_.reduceRight`, without support* for iteratee shorthands, which iterates over `collection` using `eachFunc`.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} accumulator The initial value.* @param {boolean} initAccum Specify using the first or last element of* `collection` as the initial value.* @param {Function} eachFunc The function to iterate over `collection`.* @returns {*} Returns the accumulated value.*/function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {eachFunc(collection, function(value, index, collection) {accumulator = initAccum? (initAccum = false, value): iteratee(accumulator, value, index, collection);});return accumulator;}module.exports = baseReduce;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil,nativeMax = Math.max;/*** The base implementation of `_.range` and `_.rangeRight` which doesn't* coerce arguments.** @private* @param {number} start The start of the range.* @param {number} end The end of the range.* @param {number} step The value to increment or decrement by.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Array} Returns the range of numbers.*/function baseRange(start, end, step, fromRight) {var index = -1,length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),result = Array(length);while (length--) {result[fromRight ? length : ++index] = start;start += step;}return result;}module.exports = baseRange;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeFloor = Math.floor,nativeRandom = Math.random;/*** The base implementation of `_.random` without support for returning* floating-point numbers.** @private* @param {number} lower The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the random number.*/function baseRandom(lower, upper) {return lower + nativeFloor(nativeRandom() * (upper - lower + 1));}module.exports = baseRandom;
var baseUnset = require('./_baseUnset'),isIndex = require('./_isIndex');/** Used for built-in method references. */var arrayProto = Array.prototype;/** Built-in value references. */var splice = arrayProto.splice;/*** The base implementation of `_.pullAt` without support for individual* indexes or capturing the removed elements.** @private* @param {Array} array The array to modify.* @param {number[]} indexes The indexes of elements to remove.* @returns {Array} Returns `array`.*/function basePullAt(array, indexes) {var length = array ? indexes.length : 0,lastIndex = length - 1;while (length--) {var index = indexes[length];if (length == lastIndex || index !== previous) {var previous = index;if (isIndex(index)) {splice.call(array, index, 1);} else {baseUnset(array, index);}}}return array;}module.exports = basePullAt;
var arrayMap = require('./_arrayMap'),baseIndexOf = require('./_baseIndexOf'),baseIndexOfWith = require('./_baseIndexOfWith'),baseUnary = require('./_baseUnary'),copyArray = require('./_copyArray');/** Used for built-in method references. */var arrayProto = Array.prototype;/** Built-in value references. */var splice = arrayProto.splice;/*** The base implementation of `_.pullAllBy` without support for iteratee* shorthands.** @private* @param {Array} array The array to modify.* @param {Array} values The values to remove.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns `array`.*/function basePullAll(array, values, iteratee, comparator) {var indexOf = comparator ? baseIndexOfWith : baseIndexOf,index = -1,length = values.length,seen = array;if (array === values) {values = copyArray(values);}if (iteratee) {seen = arrayMap(array, baseUnary(iteratee));}while (++index < length) {var fromIndex = 0,value = values[index],computed = iteratee ? iteratee(value) : value;while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {if (seen !== array) {splice.call(seen, fromIndex, 1);}splice.call(array, fromIndex, 1);}}return array;}module.exports = basePullAll;
/*** The base implementation of `_.propertyOf` without support for deep paths.** @private* @param {Object} object The object to query.* @returns {Function} Returns the new accessor function.*/function basePropertyOf(object) {return function(key) {return object == null ? undefined : object[key];};}module.exports = basePropertyOf;
var baseGet = require('./_baseGet');/*** A specialized version of `baseProperty` which supports deep paths.** @private* @param {Array|string} path The path of the property to get.* @returns {Function} Returns the new accessor function.*/function basePropertyDeep(path) {return function(object) {return baseGet(object, path);};}module.exports = basePropertyDeep;
/*** The base implementation of `_.property` without support for deep paths.** @private* @param {string} key The key of the property to get.* @returns {Function} Returns the new accessor function.*/function baseProperty(key) {return function(object) {return object == null ? undefined : object[key];};}module.exports = baseProperty;
var baseGet = require('./_baseGet'),baseSet = require('./_baseSet'),castPath = require('./_castPath');/*** The base implementation of `_.pickBy` without support for iteratee shorthands.** @private* @param {Object} object The source object.* @param {string[]} paths The property paths to pick.* @param {Function} predicate The function invoked per property.* @returns {Object} Returns the new object.*/function basePickBy(object, paths, predicate) {var index = -1,length = paths.length,result = {};while (++index < length) {var path = paths[index],value = baseGet(object, path);if (predicate(value, path)) {baseSet(result, castPath(path, object), value);}}return result;}module.exports = basePickBy;
var basePickBy = require('./_basePickBy'),hasIn = require('./hasIn');/*** The base implementation of `_.pick` without support for individual* property identifiers.** @private* @param {Object} object The source object.* @param {string[]} paths The property paths to pick.* @returns {Object} Returns the new object.*/function basePick(object, paths) {return basePickBy(object, paths, function(value, path) {return hasIn(object, path);});}module.exports = basePick;
var arrayMap = require('./_arrayMap'),baseGet = require('./_baseGet'),baseIteratee = require('./_baseIteratee'),baseMap = require('./_baseMap'),baseSortBy = require('./_baseSortBy'),baseUnary = require('./_baseUnary'),compareMultiple = require('./_compareMultiple'),identity = require('./identity'),isArray = require('./isArray');/*** The base implementation of `_.orderBy` without param guards.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.* @param {string[]} orders The sort orders of `iteratees`.* @returns {Array} Returns the new sorted array.*/function baseOrderBy(collection, iteratees, orders) {if (iteratees.length) {iteratees = arrayMap(iteratees, function(iteratee) {if (isArray(iteratee)) {return function(value) {return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);}}return iteratee;});} else {iteratees = [identity];}var index = -1;iteratees = arrayMap(iteratees, baseUnary(baseIteratee));var result = baseMap(collection, function(value, key, collection) {var criteria = arrayMap(iteratees, function(iteratee) {return iteratee(value);});return { 'criteria': criteria, 'index': ++index, 'value': value };});return baseSortBy(result, function(object, other) {return compareMultiple(object, other, orders);});}module.exports = baseOrderBy;
var isIndex = require('./_isIndex');/*** The base implementation of `_.nth` which doesn't coerce arguments.** @private* @param {Array} array The array to query.* @param {number} n The index of the element to return.* @returns {*} Returns the nth element of `array`.*/function baseNth(array, n) {var length = array.length;if (!length) {return;}n += n < 0 ? length : 0;return isIndex(n, length) ? array[n] : undefined;}module.exports = baseNth;
var assignMergeValue = require('./_assignMergeValue'),cloneBuffer = require('./_cloneBuffer'),cloneTypedArray = require('./_cloneTypedArray'),copyArray = require('./_copyArray'),initCloneObject = require('./_initCloneObject'),isArguments = require('./isArguments'),isArray = require('./isArray'),isArrayLikeObject = require('./isArrayLikeObject'),isBuffer = require('./isBuffer'),isFunction = require('./isFunction'),isObject = require('./isObject'),isPlainObject = require('./isPlainObject'),isTypedArray = require('./isTypedArray'),safeGet = require('./_safeGet'),toPlainObject = require('./toPlainObject');/*** A specialized version of `baseMerge` for arrays and objects which performs* deep merges and tracks traversed objects enabling objects with circular* references to be merged.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @param {string} key The key of the value to merge.* @param {number} srcIndex The index of `source`.* @param {Function} mergeFunc The function to merge values.* @param {Function} [customizer] The function to customize assigned values.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.*/function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {var objValue = safeGet(object, key),srcValue = safeGet(source, key),stacked = stack.get(srcValue);if (stacked) {assignMergeValue(object, key, stacked);return;}var newValue = customizer? customizer(objValue, srcValue, (key + ''), object, source, stack): undefined;var isCommon = newValue === undefined;if (isCommon) {var isArr = isArray(srcValue),isBuff = !isArr && isBuffer(srcValue),isTyped = !isArr && !isBuff && isTypedArray(srcValue);newValue = srcValue;if (isArr || isBuff || isTyped) {if (isArray(objValue)) {newValue = objValue;}else if (isArrayLikeObject(objValue)) {newValue = copyArray(objValue);}else if (isBuff) {isCommon = false;newValue = cloneBuffer(srcValue, true);}else if (isTyped) {isCommon = false;newValue = cloneTypedArray(srcValue, true);}else {newValue = [];}}else if (isPlainObject(srcValue) || isArguments(srcValue)) {newValue = objValue;if (isArguments(objValue)) {newValue = toPlainObject(objValue);}else if (!isObject(objValue) || isFunction(objValue)) {newValue = initCloneObject(srcValue);}}else {isCommon = false;}}if (isCommon) {// Recursively merge objects and arrays (susceptible to call stack limits).stack.set(srcValue, newValue);mergeFunc(newValue, srcValue, srcIndex, customizer, stack);stack['delete'](srcValue);}assignMergeValue(object, key, newValue);}module.exports = baseMergeDeep;
var Stack = require('./_Stack'),assignMergeValue = require('./_assignMergeValue'),baseFor = require('./_baseFor'),baseMergeDeep = require('./_baseMergeDeep'),isObject = require('./isObject'),keysIn = require('./keysIn'),safeGet = require('./_safeGet');/*** The base implementation of `_.merge` without support for multiple sources.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @param {number} srcIndex The index of `source`.* @param {Function} [customizer] The function to customize merged values.* @param {Object} [stack] Tracks traversed source values and their merged* counterparts.*/function baseMerge(object, source, srcIndex, customizer, stack) {if (object === source) {return;}baseFor(source, function(srcValue, key) {stack || (stack = new Stack);if (isObject(srcValue)) {baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);}else {var newValue = customizer? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack): undefined;if (newValue === undefined) {newValue = srcValue;}assignMergeValue(object, key, newValue);}}, keysIn);}module.exports = baseMerge;
var baseSum = require('./_baseSum');/** Used as references for various `Number` constants. */var NAN = 0 / 0;/*** The base implementation of `_.mean` and `_.meanBy` without support for* iteratee shorthands.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {number} Returns the mean.*/function baseMean(array, iteratee) {var length = array == null ? 0 : array.length;return length ? (baseSum(array, iteratee) / length) : NAN;}module.exports = baseMean;
var baseIsEqual = require('./_baseIsEqual'),get = require('./get'),hasIn = require('./hasIn'),isKey = require('./_isKey'),isStrictComparable = require('./_isStrictComparable'),matchesStrictComparable = require('./_matchesStrictComparable'),toKey = require('./_toKey');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/*** The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.** @private* @param {string} path The path of the property to get.* @param {*} srcValue The value to match.* @returns {Function} Returns the new spec function.*/function baseMatchesProperty(path, srcValue) {if (isKey(path) && isStrictComparable(srcValue)) {return matchesStrictComparable(toKey(path), srcValue);}return function(object) {var objValue = get(object, path);return (objValue === undefined && objValue === srcValue)? hasIn(object, path): baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);};}module.exports = baseMatchesProperty;
var baseIsMatch = require('./_baseIsMatch'),getMatchData = require('./_getMatchData'),matchesStrictComparable = require('./_matchesStrictComparable');/*** The base implementation of `_.matches` which doesn't clone `source`.** @private* @param {Object} source The object of property values to match.* @returns {Function} Returns the new spec function.*/function baseMatches(source) {var matchData = getMatchData(source);if (matchData.length == 1 && matchData[0][2]) {return matchesStrictComparable(matchData[0][0], matchData[0][1]);}return function(object) {return object === source || baseIsMatch(object, source, matchData);};}module.exports = baseMatches;
var baseEach = require('./_baseEach'),isArrayLike = require('./isArrayLike');/*** The base implementation of `_.map` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function baseMap(collection, iteratee) {var index = -1,result = isArrayLike(collection) ? Array(collection.length) : [];baseEach(collection, function(value, key, collection) {result[++index] = iteratee(value, key, collection);});return result;}module.exports = baseMap;
/*** The base implementation of `_.lt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is less than `other`,* else `false`.*/function baseLt(value, other) {return value < other;}module.exports = baseLt;
/*** The function whose prototype chain sequence wrappers inherit from.** @private*/function baseLodash() {// No operation performed.}module.exports = baseLodash;
var isObject = require('./isObject'),isPrototype = require('./_isPrototype'),nativeKeysIn = require('./_nativeKeysIn');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function baseKeysIn(object) {if (!isObject(object)) {return nativeKeysIn(object);}var isProto = isPrototype(object),result = [];for (var key in object) {if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {result.push(key);}}return result;}module.exports = baseKeysIn;
var isPrototype = require('./_isPrototype'),nativeKeys = require('./_nativeKeys');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** The base implementation of `_.keys` which doesn't treat sparse arrays as dense.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function baseKeys(object) {if (!isPrototype(object)) {return nativeKeys(object);}var result = [];for (var key in Object(object)) {if (hasOwnProperty.call(object, key) && key != 'constructor') {result.push(key);}}return result;}module.exports = baseKeys;
var baseMatches = require('./_baseMatches'),baseMatchesProperty = require('./_baseMatchesProperty'),identity = require('./identity'),isArray = require('./isArray'),property = require('./property');/*** The base implementation of `_.iteratee`.** @private* @param {*} [value=_.identity] The value to convert to an iteratee.* @returns {Function} Returns the iteratee.*/function baseIteratee(value) {// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.if (typeof value == 'function') {return value;}if (value == null) {return identity;}if (typeof value == 'object') {return isArray(value)? baseMatchesProperty(value[0], value[1]): baseMatches(value);}return property(value);}module.exports = baseIteratee;
var baseGetTag = require('./_baseGetTag'),isLength = require('./isLength'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var argsTag = '[object Arguments]',arrayTag = '[object Array]',boolTag = '[object Boolean]',dateTag = '[object Date]',errorTag = '[object Error]',funcTag = '[object Function]',mapTag = '[object Map]',numberTag = '[object Number]',objectTag = '[object Object]',regexpTag = '[object RegExp]',setTag = '[object Set]',stringTag = '[object String]',weakMapTag = '[object WeakMap]';var arrayBufferTag = '[object ArrayBuffer]',dataViewTag = '[object DataView]',float32Tag = '[object Float32Array]',float64Tag = '[object Float64Array]',int8Tag = '[object Int8Array]',int16Tag = '[object Int16Array]',int32Tag = '[object Int32Array]',uint8Tag = '[object Uint8Array]',uint8ClampedTag = '[object Uint8ClampedArray]',uint16Tag = '[object Uint16Array]',uint32Tag = '[object Uint32Array]';/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags = {};typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =typedArrayTags[uint32Tag] = true;typedArrayTags[argsTag] = typedArrayTags[arrayTag] =typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =typedArrayTags[errorTag] = typedArrayTags[funcTag] =typedArrayTags[mapTag] = typedArrayTags[numberTag] =typedArrayTags[objectTag] = typedArrayTags[regexpTag] =typedArrayTags[setTag] = typedArrayTags[stringTag] =typedArrayTags[weakMapTag] = false;/*** The base implementation of `_.isTypedArray` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.*/function baseIsTypedArray(value) {return isObjectLike(value) &&isLength(value.length) && !!typedArrayTags[baseGetTag(value)];}module.exports = baseIsTypedArray;
var getTag = require('./_getTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var setTag = '[object Set]';/*** The base implementation of `_.isSet` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a set, else `false`.*/function baseIsSet(value) {return isObjectLike(value) && getTag(value) == setTag;}module.exports = baseIsSet;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var regexpTag = '[object RegExp]';/*** The base implementation of `_.isRegExp` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a regexp, else `false`.*/function baseIsRegExp(value) {return isObjectLike(value) && baseGetTag(value) == regexpTag;}module.exports = baseIsRegExp;
var isFunction = require('./isFunction'),isMasked = require('./_isMasked'),isObject = require('./isObject'),toSource = require('./_toSource');/*** Used to match `RegExp`* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).*/var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;/** Used to detect host constructors (Safari). */var reIsHostCtor = /^\[object .+?Constructor\]$/;/** Used for built-in method references. */var funcProto = Function.prototype,objectProto = Object.prototype;/** Used to resolve the decompiled source of functions. */var funcToString = funcProto.toString;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/** Used to detect if a method is native. */var reIsNative = RegExp('^' +funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');/*** The base implementation of `_.isNative` without bad shim checks.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a native function,* else `false`.*/function baseIsNative(value) {if (!isObject(value) || isMasked(value)) {return false;}var pattern = isFunction(value) ? reIsNative : reIsHostCtor;return pattern.test(toSource(value));}module.exports = baseIsNative;
/*** The base implementation of `_.isNaN` without support for number objects.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.*/function baseIsNaN(value) {return value !== value;}module.exports = baseIsNaN;
var Stack = require('./_Stack'),baseIsEqual = require('./_baseIsEqual');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1,COMPARE_UNORDERED_FLAG = 2;/*** The base implementation of `_.isMatch` without support for iteratee shorthands.** @private* @param {Object} object The object to inspect.* @param {Object} source The object of property values to match.* @param {Array} matchData The property names, values, and compare flags to match.* @param {Function} [customizer] The function to customize comparisons.* @returns {boolean} Returns `true` if `object` is a match, else `false`.*/function baseIsMatch(object, source, matchData, customizer) {var index = matchData.length,length = index,noCustomizer = !customizer;if (object == null) {return !length;}object = Object(object);while (index--) {var data = matchData[index];if ((noCustomizer && data[2])? data[1] !== object[data[0]]: !(data[0] in object)) {return false;}}while (++index < length) {data = matchData[index];var key = data[0],objValue = object[key],srcValue = data[1];if (noCustomizer && data[2]) {if (objValue === undefined && !(key in object)) {return false;}} else {var stack = new Stack;if (customizer) {var result = customizer(objValue, srcValue, key, object, source, stack);}if (!(result === undefined? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack): result)) {return false;}}}return true;}module.exports = baseIsMatch;
var getTag = require('./_getTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var mapTag = '[object Map]';/*** The base implementation of `_.isMap` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a map, else `false`.*/function baseIsMap(value) {return isObjectLike(value) && getTag(value) == mapTag;}module.exports = baseIsMap;
var Stack = require('./_Stack'),equalArrays = require('./_equalArrays'),equalByTag = require('./_equalByTag'),equalObjects = require('./_equalObjects'),getTag = require('./_getTag'),isArray = require('./isArray'),isBuffer = require('./isBuffer'),isTypedArray = require('./isTypedArray');/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG = 1;/** `Object#toString` result references. */var argsTag = '[object Arguments]',arrayTag = '[object Array]',objectTag = '[object Object]';/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** A specialized version of `baseIsEqual` for arrays and objects which performs* deep comparisons and tracks traversed objects enabling objects with circular* references to be compared.** @private* @param {Object} object The object to compare.* @param {Object} other The other object to compare.* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.* @param {Function} customizer The function to customize comparisons.* @param {Function} equalFunc The function to determine equivalents of values.* @param {Object} [stack] Tracks traversed `object` and `other` objects.* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.*/function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {var objIsArr = isArray(object),othIsArr = isArray(other),objTag = objIsArr ? arrayTag : getTag(object),othTag = othIsArr ? arrayTag : getTag(other);objTag = objTag == argsTag ? objectTag : objTag;othTag = othTag == argsTag ? objectTag : othTag;var objIsObj = objTag == objectTag,othIsObj = othTag == objectTag,isSameTag = objTag == othTag;if (isSameTag && isBuffer(object)) {if (!isBuffer(other)) {return false;}objIsArr = true;objIsObj = false;}if (isSameTag && !objIsObj) {stack || (stack = new Stack);return (objIsArr || isTypedArray(object))? equalArrays(object, other, bitmask, customizer, equalFunc, stack): equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);}if (!(bitmask & COMPARE_PARTIAL_FLAG)) {var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');if (objIsWrapped || othIsWrapped) {var objUnwrapped = objIsWrapped ? object.value() : object,othUnwrapped = othIsWrapped ? other.value() : other;stack || (stack = new Stack);return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);}}if (!isSameTag) {return false;}stack || (stack = new Stack);return equalObjects(object, other, bitmask, customizer, equalFunc, stack);}module.exports = baseIsEqualDeep;
var baseIsEqualDeep = require('./_baseIsEqualDeep'),isObjectLike = require('./isObjectLike');/*** The base implementation of `_.isEqual` which supports partial comparisons* and tracks traversed objects.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @param {boolean} bitmask The bitmask flags.* 1 - Unordered comparison* 2 - Partial comparison* @param {Function} [customizer] The function to customize comparisons.* @param {Object} [stack] Tracks traversed `value` and `other` objects.* @returns {boolean} Returns `true` if the values are equivalent, else `false`.*/function baseIsEqual(value, other, bitmask, customizer, stack) {if (value === other) {return true;}if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {return value !== value && other !== other;}return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);}module.exports = baseIsEqual;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var dateTag = '[object Date]';/*** The base implementation of `_.isDate` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a date object, else `false`.*/function baseIsDate(value) {return isObjectLike(value) && baseGetTag(value) == dateTag;}module.exports = baseIsDate;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');var arrayBufferTag = '[object ArrayBuffer]';/*** The base implementation of `_.isArrayBuffer` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.*/function baseIsArrayBuffer(value) {return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;}module.exports = baseIsArrayBuffer;
var baseGetTag = require('./_baseGetTag'),isObjectLike = require('./isObjectLike');/** `Object#toString` result references. */var argsTag = '[object Arguments]';/*** The base implementation of `_.isArguments`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,*/function baseIsArguments(value) {return isObjectLike(value) && baseGetTag(value) == argsTag;}module.exports = baseIsArguments;
var apply = require('./_apply'),castPath = require('./_castPath'),last = require('./last'),parent = require('./_parent'),toKey = require('./_toKey');/*** The base implementation of `_.invoke` without support for individual* method arguments.** @private* @param {Object} object The object to query.* @param {Array|string} path The path of the method to invoke.* @param {Array} args The arguments to invoke the method with.* @returns {*} Returns the result of the invoked method.*/function baseInvoke(object, path, args) {path = castPath(path, object);object = parent(object, path);var func = object == null ? object : object[toKey(last(path))];return func == null ? undefined : apply(func, object, args);}module.exports = baseInvoke;
var baseForOwn = require('./_baseForOwn');/*** The base implementation of `_.invert` and `_.invertBy` which inverts* `object` with values transformed by `iteratee` and set by `setter`.** @private* @param {Object} object The object to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform values.* @param {Object} accumulator The initial inverted object.* @returns {Function} Returns `accumulator`.*/function baseInverter(object, setter, iteratee, accumulator) {baseForOwn(object, function(value, key, object) {setter(accumulator, iteratee(value), key, object);});return accumulator;}module.exports = baseInverter;
var SetCache = require('./_SetCache'),arrayIncludes = require('./_arrayIncludes'),arrayIncludesWith = require('./_arrayIncludesWith'),arrayMap = require('./_arrayMap'),baseUnary = require('./_baseUnary'),cacheHas = require('./_cacheHas');/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMin = Math.min;/*** The base implementation of methods like `_.intersection`, without support* for iteratee shorthands, that accepts an array of arrays to inspect.** @private* @param {Array} arrays The arrays to inspect.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of shared values.*/function baseIntersection(arrays, iteratee, comparator) {var includes = comparator ? arrayIncludesWith : arrayIncludes,length = arrays[0].length,othLength = arrays.length,othIndex = othLength,caches = Array(othLength),maxLength = Infinity,result = [];while (othIndex--) {var array = arrays[othIndex];if (othIndex && iteratee) {array = arrayMap(array, baseUnary(iteratee));}maxLength = nativeMin(array.length, maxLength);caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))? new SetCache(othIndex && array): undefined;}array = arrays[0];var index = -1,seen = caches[0];outer:while (++index < length && result.length < maxLength) {var value = array[index],computed = iteratee ? iteratee(value) : value;value = (comparator || value !== 0) ? value : 0;if (!(seen? cacheHas(seen, computed): includes(result, computed, comparator))) {othIndex = othLength;while (--othIndex) {var cache = caches[othIndex];if (!(cache? cacheHas(cache, computed): includes(arrays[othIndex], computed, comparator))) {continue outer;}}if (seen) {seen.push(computed);}result.push(value);}}return result;}module.exports = baseIntersection;
/*** This function is like `baseIndexOf` except that it accepts a comparator.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @param {Function} comparator The comparator invoked per element.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseIndexOfWith(array, value, fromIndex, comparator) {var index = fromIndex - 1,length = array.length;while (++index < length) {if (comparator(array[index], value)) {return index;}}return -1;}module.exports = baseIndexOfWith;
var baseFindIndex = require('./_baseFindIndex'),baseIsNaN = require('./_baseIsNaN'),strictIndexOf = require('./_strictIndexOf');/*** The base implementation of `_.indexOf` without `fromIndex` bounds checks.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseIndexOf(array, value, fromIndex) {return value === value? strictIndexOf(array, value, fromIndex): baseFindIndex(array, baseIsNaN, fromIndex);}module.exports = baseIndexOf;
/* Built-in method references for those with the same name as other `lodash` methods. */var nativeMax = Math.max,nativeMin = Math.min;/*** The base implementation of `_.inRange` which doesn't coerce arguments.** @private* @param {number} number The number to check.* @param {number} start The start of the range.* @param {number} end The end of the range.* @returns {boolean} Returns `true` if `number` is in the range, else `false`.*/function baseInRange(number, start, end) {return number >= nativeMin(start, end) && number < nativeMax(start, end);}module.exports = baseInRange;
/*** The base implementation of `_.hasIn` without support for deep paths.** @private* @param {Object} [object] The object to query.* @param {Array|string} key The key to check.* @returns {boolean} Returns `true` if `key` exists, else `false`.*/function baseHasIn(object, key) {return object != null && key in Object(object);}module.exports = baseHasIn;
/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** The base implementation of `_.has` without support for deep paths.** @private* @param {Object} [object] The object to query.* @param {Array|string} key The key to check.* @returns {boolean} Returns `true` if `key` exists, else `false`.*/function baseHas(object, key) {return object != null && hasOwnProperty.call(object, key);}module.exports = baseHas;
/*** The base implementation of `_.gt` which doesn't coerce arguments.** @private* @param {*} value The value to compare.* @param {*} other The other value to compare.* @returns {boolean} Returns `true` if `value` is greater than `other`,* else `false`.*/function baseGt(value, other) {return value > other;}module.exports = baseGt;
var Symbol = require('./_Symbol'),getRawTag = require('./_getRawTag'),objectToString = require('./_objectToString');/** `Object#toString` result references. */var nullTag = '[object Null]',undefinedTag = '[object Undefined]';/** Built-in value references. */var symToStringTag = Symbol ? Symbol.toStringTag : undefined;/*** The base implementation of `getTag` without fallbacks for buggy environments.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/function baseGetTag(value) {if (value == null) {return value === undefined ? undefinedTag : nullTag;}return (symToStringTag && symToStringTag in Object(value))? getRawTag(value): objectToString(value);}module.exports = baseGetTag;
var arrayPush = require('./_arrayPush'),isArray = require('./isArray');/*** The base implementation of `getAllKeys` and `getAllKeysIn` which uses* `keysFunc` and `symbolsFunc` to get the enumerable property names and* symbols of `object`.** @private* @param {Object} object The object to query.* @param {Function} keysFunc The function to get the keys of `object`.* @param {Function} symbolsFunc The function to get the symbols of `object`.* @returns {Array} Returns the array of property names and symbols.*/function baseGetAllKeys(object, keysFunc, symbolsFunc) {var result = keysFunc(object);return isArray(object) ? result : arrayPush(result, symbolsFunc(object));}module.exports = baseGetAllKeys;
var castPath = require('./_castPath'),toKey = require('./_toKey');/*** The base implementation of `_.get` without support for default values.** @private* @param {Object} object The object to query.* @param {Array|string} path The path of the property to get.* @returns {*} Returns the resolved value.*/function baseGet(object, path) {path = castPath(path, object);var index = 0,length = path.length;while (object != null && index < length) {object = object[toKey(path[index++])];}return (index && index == length) ? object : undefined;}module.exports = baseGet;
var arrayFilter = require('./_arrayFilter'),isFunction = require('./isFunction');/*** The base implementation of `_.functions` which creates an array of* `object` function property names filtered from `props`.** @private* @param {Object} object The object to inspect.* @param {Array} props The property names to filter.* @returns {Array} Returns the function names.*/function baseFunctions(object, props) {return arrayFilter(props, function(key) {return isFunction(object[key]);});}module.exports = baseFunctions;
var createBaseFor = require('./_createBaseFor');/*** This function is like `baseFor` except that it iterates over properties* in the opposite order.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseForRight = createBaseFor(true);module.exports = baseForRight;
var baseForRight = require('./_baseForRight'),keys = require('./keys');/*** The base implementation of `_.forOwnRight` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwnRight(object, iteratee) {return object && baseForRight(object, iteratee, keys);}module.exports = baseForOwnRight;
var baseFor = require('./_baseFor'),keys = require('./keys');/*** The base implementation of `_.forOwn` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwn(object, iteratee) {return object && baseFor(object, iteratee, keys);}module.exports = baseForOwn;
var createBaseFor = require('./_createBaseFor');/*** The base implementation of `baseForOwn` which iterates over `object`* properties returned by `keysFunc` and invokes `iteratee` for each property.* Iteratee functions may exit iteration early by explicitly returning `false`.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseFor = createBaseFor();module.exports = baseFor;
var arrayPush = require('./_arrayPush'),isFlattenable = require('./_isFlattenable');/*** The base implementation of `_.flatten` with support for restricting flattening.** @private* @param {Array} array The array to flatten.* @param {number} depth The maximum recursion depth.* @param {boolean} [predicate=isFlattenable] The function invoked per iteration.* @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.* @param {Array} [result=[]] The initial result value.* @returns {Array} Returns the new flattened array.*/function baseFlatten(array, depth, predicate, isStrict, result) {var index = -1,length = array.length;predicate || (predicate = isFlattenable);result || (result = []);while (++index < length) {var value = array[index];if (depth > 0 && predicate(value)) {if (depth > 1) {// Recursively flatten arrays (susceptible to call stack limits).baseFlatten(value, depth - 1, predicate, isStrict, result);} else {arrayPush(result, value);}} else if (!isStrict) {result[result.length] = value;}}return result;}module.exports = baseFlatten;
/*** The base implementation of methods like `_.findKey` and `_.findLastKey`,* without support for iteratee shorthands, which iterates over `collection`* using `eachFunc`.** @private* @param {Array|Object} collection The collection to inspect.* @param {Function} predicate The function invoked per iteration.* @param {Function} eachFunc The function to iterate over `collection`.* @returns {*} Returns the found element or its key, else `undefined`.*/function baseFindKey(collection, predicate, eachFunc) {var result;eachFunc(collection, function(value, key, collection) {if (predicate(value, key, collection)) {result = key;return false;}});return result;}module.exports = baseFindKey;
/*** The base implementation of `_.findIndex` and `_.findLastIndex` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} predicate The function invoked per iteration.* @param {number} fromIndex The index to search from.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseFindIndex(array, predicate, fromIndex, fromRight) {var length = array.length,index = fromIndex + (fromRight ? 1 : -1);while ((fromRight ? index-- : ++index < length)) {if (predicate(array[index], index, array)) {return index;}}return -1;}module.exports = baseFindIndex;
var baseEach = require('./_baseEach');/*** The base implementation of `_.filter` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {Array} Returns the new filtered array.*/function baseFilter(collection, predicate) {var result = [];baseEach(collection, function(value, index, collection) {if (predicate(value, index, collection)) {result.push(value);}});return result;}module.exports = baseFilter;
var toInteger = require('./toInteger'),toLength = require('./toLength');/*** The base implementation of `_.fill` without an iteratee call guard.** @private* @param {Array} array The array to fill.* @param {*} value The value to fill `array` with.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns `array`.*/function baseFill(array, value, start, end) {var length = array.length;start = toInteger(start);if (start < 0) {start = -start > length ? 0 : (length + start);}end = (end === undefined || end > length) ? length : toInteger(end);if (end < 0) {end += length;}end = start > end ? 0 : toLength(end);while (start < end) {array[start++] = value;}return array;}module.exports = baseFill;
var isSymbol = require('./isSymbol');/*** The base implementation of methods like `_.max` and `_.min` which accepts a* `comparator` to determine the extremum value.** @private* @param {Array} array The array to iterate over.* @param {Function} iteratee The iteratee invoked per iteration.* @param {Function} comparator The comparator used to compare values.* @returns {*} Returns the extremum value.*/function baseExtremum(array, iteratee, comparator) {var index = -1,length = array.length;while (++index < length) {var value = array[index],current = iteratee(value);if (current != null && (computed === undefined? (current === current && !isSymbol(current)): comparator(current, computed))) {var computed = current,result = value;}}return result;}module.exports = baseExtremum;
var baseEach = require('./_baseEach');/*** The base implementation of `_.every` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`*/function baseEvery(collection, predicate) {var result = true;baseEach(collection, function(value, index, collection) {result = !!predicate(value, index, collection);return result;});return result;}module.exports = baseEvery;
var baseForOwnRight = require('./_baseForOwnRight'),createBaseEach = require('./_createBaseEach');/*** The base implementation of `_.forEachRight` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array|Object} Returns `collection`.*/var baseEachRight = createBaseEach(baseForOwnRight, true);module.exports = baseEachRight;
var baseForOwn = require('./_baseForOwn'),createBaseEach = require('./_createBaseEach');/*** The base implementation of `_.forEach` without support for iteratee shorthands.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array|Object} Returns `collection`.*/var baseEach = createBaseEach(baseForOwn);module.exports = baseEach;
var SetCache = require('./_SetCache'),arrayIncludes = require('./_arrayIncludes'),arrayIncludesWith = require('./_arrayIncludesWith'),arrayMap = require('./_arrayMap'),baseUnary = require('./_baseUnary'),cacheHas = require('./_cacheHas');/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE = 200;/*** The base implementation of methods like `_.difference` without support* for excluding multiple arrays or iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Array} values The values to exclude.* @param {Function} [iteratee] The iteratee invoked per element.* @param {Function} [comparator] The comparator invoked per element.* @returns {Array} Returns the new array of filtered values.*/function baseDifference(array, values, iteratee, comparator) {var index = -1,includes = arrayIncludes,isCommon = true,length = array.length,result = [],valuesLength = values.length;if (!length) {return result;}if (iteratee) {values = arrayMap(values, baseUnary(iteratee));}if (comparator) {includes = arrayIncludesWith;isCommon = false;}else if (values.length >= LARGE_ARRAY_SIZE) {includes = cacheHas;isCommon = false;values = new SetCache(values);}outer:while (++index < length) {var value = array[index],computed = iteratee == null ? value : iteratee(value);value = (comparator || value !== 0) ? value : 0;if (isCommon && computed === computed) {var valuesIndex = valuesLength;while (valuesIndex--) {if (values[valuesIndex] === computed) {continue outer;}}result.push(value);}else if (!includes(values, computed, comparator)) {result.push(value);}}return result;}module.exports = baseDifference;
/** Error message constants. */var FUNC_ERROR_TEXT = 'Expected a function';/*** The base implementation of `_.delay` and `_.defer` which accepts `args`* to provide to `func`.** @private* @param {Function} func The function to delay.* @param {number} wait The number of milliseconds to delay invocation.* @param {Array} args The arguments to provide to `func`.* @returns {number|Object} Returns the timer id or timeout object.*/function baseDelay(func, wait, args) {if (typeof func != 'function') {throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function() { func.apply(undefined, args); }, wait);}module.exports = baseDelay;
var isObject = require('./isObject');/** Built-in value references. */var objectCreate = Object.create;/*** The base implementation of `_.create` without support for assigning* properties to the created object.** @private* @param {Object} proto The object to inherit from.* @returns {Object} Returns the new object.*/var baseCreate = (function() {function object() {}return function(proto) {if (!isObject(proto)) {return {};}if (objectCreate) {return objectCreate(proto);}object.prototype = proto;var result = new object;object.prototype = undefined;return result;};}());module.exports = baseCreate;
/*** The base implementation of `_.conformsTo` which accepts `props` to check.** @private* @param {Object} object The object to inspect.* @param {Object} source The object of property predicates to conform to.* @returns {boolean} Returns `true` if `object` conforms, else `false`.*/function baseConformsTo(object, source, props) {var length = props.length;if (object == null) {return !length;}object = Object(object);while (length--) {var key = props[length],predicate = source[key],value = object[key];if ((value === undefined && !(key in object)) || !predicate(value)) {return false;}}return true;}module.exports = baseConformsTo;
var baseConformsTo = require('./_baseConformsTo'),keys = require('./keys');/*** The base implementation of `_.conforms` which doesn't clone `source`.** @private* @param {Object} source The object of property predicates to conform to.* @returns {Function} Returns the new spec function.*/function baseConforms(source) {var props = keys(source);return function(object) {return baseConformsTo(object, source, props);};}module.exports = baseConforms;
var Stack = require('./_Stack'),arrayEach = require('./_arrayEach'),assignValue = require('./_assignValue'),baseAssign = require('./_baseAssign'),baseAssignIn = require('./_baseAssignIn'),cloneBuffer = require('./_cloneBuffer'),copyArray = require('./_copyArray'),copySymbols = require('./_copySymbols'),copySymbolsIn = require('./_copySymbolsIn'),getAllKeys = require('./_getAllKeys'),getAllKeysIn = require('./_getAllKeysIn'),getTag = require('./_getTag'),initCloneArray = require('./_initCloneArray'),initCloneByTag = require('./_initCloneByTag'),initCloneObject = require('./_initCloneObject'),isArray = require('./isArray'),isBuffer = require('./isBuffer'),isMap = require('./isMap'),isObject = require('./isObject'),isSet = require('./isSet'),keys = require('./keys'),keysIn = require('./keysIn');/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG = 1,CLONE_FLAT_FLAG = 2,CLONE_SYMBOLS_FLAG = 4;/** `Object#toString` result references. */var argsTag = '[object Arguments]',arrayTag = '[object Array]',boolTag = '[object Boolean]',dateTag = '[object Date]',errorTag = '[object Error]',funcTag = '[object Function]',genTag = '[object GeneratorFunction]',mapTag = '[object Map]',numberTag = '[object Number]',objectTag = '[object Object]',regexpTag = '[object RegExp]',setTag = '[object Set]',stringTag = '[object String]',symbolTag = '[object Symbol]',weakMapTag = '[object WeakMap]';var arrayBufferTag = '[object ArrayBuffer]',dataViewTag = '[object DataView]',float32Tag = '[object Float32Array]',float64Tag = '[object Float64Array]',int8Tag = '[object Int8Array]',int16Tag = '[object Int16Array]',int32Tag = '[object Int32Array]',uint8Tag = '[object Uint8Array]',uint8ClampedTag = '[object Uint8ClampedArray]',uint16Tag = '[object Uint16Array]',uint32Tag = '[object Uint32Array]';/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags = {};cloneableTags[argsTag] = cloneableTags[arrayTag] =cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =cloneableTags[boolTag] = cloneableTags[dateTag] =cloneableTags[float32Tag] = cloneableTags[float64Tag] =cloneableTags[int8Tag] = cloneableTags[int16Tag] =cloneableTags[int32Tag] = cloneableTags[mapTag] =cloneableTags[numberTag] = cloneableTags[objectTag] =cloneableTags[regexpTag] = cloneableTags[setTag] =cloneableTags[stringTag] = cloneableTags[symbolTag] =cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;cloneableTags[errorTag] = cloneableTags[funcTag] =cloneableTags[weakMapTag] = false;/*** The base implementation of `_.clone` and `_.cloneDeep` which tracks* traversed objects.** @private* @param {*} value The value to clone.* @param {boolean} bitmask The bitmask flags.* 1 - Deep clone* 2 - Flatten inherited properties* 4 - Clone symbols* @param {Function} [customizer] The function to customize cloning.* @param {string} [key] The key of `value`.* @param {Object} [object] The parent object of `value`.* @param {Object} [stack] Tracks traversed objects and their clone counterparts.* @returns {*} Returns the cloned value.*/function baseClone(value, bitmask, customizer, key, object, stack) {var result,isDeep = bitmask & CLONE_DEEP_FLAG,isFlat = bitmask & CLONE_FLAT_FLAG,isFull = bitmask & CLONE_SYMBOLS_FLAG;if (customizer) {result = object ? customizer(value, key, object, stack) : customizer(value);}if (result !== undefined) {return result;}if (!isObject(value)) {return value;}var isArr = isArray(value);if (isArr) {result = initCloneArray(value);if (!isDeep) {return copyArray(value, result);}} else {var tag = getTag(value),isFunc = tag == funcTag || tag == genTag;if (isBuffer(value)) {return cloneBuffer(value, isDeep);}if (tag == objectTag || tag == argsTag || (isFunc && !object)) {result = (isFlat || isFunc) ? {} : initCloneObject(value);if (!isDeep) {return isFlat? copySymbolsIn(value, baseAssignIn(result, value)): copySymbols(value, baseAssign(result, value));}} else {if (!cloneableTags[tag]) {return object ? value : {};}result = initCloneByTag(value, tag, isDeep);}}// Check for circular references and return its corresponding clone.stack || (stack = new Stack);var stacked = stack.get(value);if (stacked) {return stacked;}stack.set(value, result);if (isSet(value)) {value.forEach(function(subValue) {result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));});} else if (isMap(value)) {value.forEach(function(subValue, key) {result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));});}var keysFunc = isFull? (isFlat ? getAllKeysIn : getAllKeys): (isFlat ? keysIn : keys);var props = isArr ? undefined : keysFunc(value);arrayEach(props || value, function(subValue, key) {if (props) {key = subValue;subValue = value[key];}// Recursively populate clone (susceptible to call stack limits).assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));});return result;}module.exports = baseClone;
/*** The base implementation of `_.clamp` which doesn't coerce arguments.** @private* @param {number} number The number to clamp.* @param {number} [lower] The lower bound.* @param {number} upper The upper bound.* @returns {number} Returns the clamped number.*/function baseClamp(number, lower, upper) {if (number === number) {if (upper !== undefined) {number = number <= upper ? number : upper;}if (lower !== undefined) {number = number >= lower ? number : lower;}}return number;}module.exports = baseClamp;
var get = require('./get');/*** The base implementation of `_.at` without support for individual paths.** @private* @param {Object} object The object to iterate over.* @param {string[]} paths The property paths to pick.* @returns {Array} Returns the picked elements.*/function baseAt(object, paths) {var index = -1,length = paths.length,result = Array(length),skip = object == null;while (++index < length) {result[index] = skip ? undefined : get(object, paths[index]);}return result;}module.exports = baseAt;
var defineProperty = require('./_defineProperty');/*** The base implementation of `assignValue` and `assignMergeValue` without* value checks.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function baseAssignValue(object, key, value) {if (key == '__proto__' && defineProperty) {defineProperty(object, key, {'configurable': true,'enumerable': true,'value': value,'writable': true});} else {object[key] = value;}}module.exports = baseAssignValue;
var copyObject = require('./_copyObject'),keysIn = require('./keysIn');/*** The base implementation of `_.assignIn` without support for multiple sources* or `customizer` functions.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @returns {Object} Returns `object`.*/function baseAssignIn(object, source) {return object && copyObject(source, keysIn(source), object);}module.exports = baseAssignIn;
var copyObject = require('./_copyObject'),keys = require('./keys');/*** The base implementation of `_.assign` without support for multiple sources* or `customizer` functions.** @private* @param {Object} object The destination object.* @param {Object} source The source object.* @returns {Object} Returns `object`.*/function baseAssign(object, source) {return object && copyObject(source, keys(source), object);}module.exports = baseAssign;
var baseEach = require('./_baseEach');/*** Aggregates elements of `collection` on `accumulator` with keys transformed* by `iteratee` and values set by `setter`.** @private* @param {Array|Object} collection The collection to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform keys.* @param {Object} accumulator The initial aggregated object.* @returns {Function} Returns `accumulator`.*/function baseAggregator(collection, setter, iteratee, accumulator) {baseEach(collection, function(value, key, collection) {setter(accumulator, value, iteratee(value), collection);});return accumulator;}module.exports = baseAggregator;
var eq = require('./eq');/*** Gets the index at which the `key` is found in `array` of key-value pairs.** @private* @param {Array} array The array to inspect.* @param {*} key The key to search for.* @returns {number} Returns the index of the matched value, else `-1`.*/function assocIndexOf(array, key) {var length = array.length;while (length--) {if (eq(array[length][0], key)) {return length;}}return -1;}module.exports = assocIndexOf;
var baseAssignValue = require('./_baseAssignValue'),eq = require('./eq');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Assigns `value` to `key` of `object` if the existing value is not equivalent* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)* for equality comparisons.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function assignValue(object, key, value) {var objValue = object[key];if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||(value === undefined && !(key in object))) {baseAssignValue(object, key, value);}}module.exports = assignValue;
var baseAssignValue = require('./_baseAssignValue'),eq = require('./eq');/*** This function is like `assignValue` except that it doesn't assign* `undefined` values.** @private* @param {Object} object The object to modify.* @param {string} key The key of the property to assign.* @param {*} value The value to assign.*/function assignMergeValue(object, key, value) {if ((value !== undefined && !eq(object[key], value)) ||(value === undefined && !(key in object))) {baseAssignValue(object, key, value);}}module.exports = assignMergeValue;
/** Used to match words composed of alphanumeric characters. */var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;/*** Splits an ASCII `string` into an array of its words.** @private* @param {string} The string to inspect.* @returns {Array} Returns the words of `string`.*/function asciiWords(string) {return string.match(reAsciiWord) || [];}module.exports = asciiWords;
/*** Converts an ASCII `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function asciiToArray(string) {return string.split('');}module.exports = asciiToArray;
var baseProperty = require('./_baseProperty');/*** Gets the size of an ASCII `string`.** @private* @param {string} string The string inspect.* @returns {number} Returns the string size.*/var asciiSize = baseProperty('length');module.exports = asciiSize;
/*** A specialized version of `_.some` for arrays without support for iteratee* shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if any element passes the predicate check,* else `false`.*/function arraySome(array, predicate) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (predicate(array[index], index, array)) {return true;}}return false;}module.exports = arraySome;
var copyArray = require('./_copyArray'),shuffleSelf = require('./_shuffleSelf');/*** A specialized version of `_.shuffle` for arrays.** @private* @param {Array} array The array to shuffle.* @returns {Array} Returns the new shuffled array.*/function arrayShuffle(array) {return shuffleSelf(copyArray(array));}module.exports = arrayShuffle;
var baseClamp = require('./_baseClamp'),copyArray = require('./_copyArray'),shuffleSelf = require('./_shuffleSelf');/*** A specialized version of `_.sampleSize` for arrays.** @private* @param {Array} array The array to sample.* @param {number} n The number of elements to sample.* @returns {Array} Returns the random elements.*/function arraySampleSize(array, n) {return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));}module.exports = arraySampleSize;
var baseRandom = require('./_baseRandom');/*** A specialized version of `_.sample` for arrays.** @private* @param {Array} array The array to sample.* @returns {*} Returns the random element.*/function arraySample(array) {var length = array.length;return length ? array[baseRandom(0, length - 1)] : undefined;}module.exports = arraySample;
/*** A specialized version of `_.reduceRight` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} [accumulator] The initial value.* @param {boolean} [initAccum] Specify using the last element of `array` as* the initial value.* @returns {*} Returns the accumulated value.*/function arrayReduceRight(array, iteratee, accumulator, initAccum) {var length = array == null ? 0 : array.length;if (initAccum && length) {accumulator = array[--length];}while (length--) {accumulator = iteratee(accumulator, array[length], length, array);}return accumulator;}module.exports = arrayReduceRight;
/*** A specialized version of `_.reduce` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {*} [accumulator] The initial value.* @param {boolean} [initAccum] Specify using the first element of `array` as* the initial value.* @returns {*} Returns the accumulated value.*/function arrayReduce(array, iteratee, accumulator, initAccum) {var index = -1,length = array == null ? 0 : array.length;if (initAccum && length) {accumulator = array[++index];}while (++index < length) {accumulator = iteratee(accumulator, array[index], index, array);}return accumulator;}module.exports = arrayReduce;
/*** Appends the elements of `values` to `array`.** @private* @param {Array} array The array to modify.* @param {Array} values The values to append.* @returns {Array} Returns `array`.*/function arrayPush(array, values) {var index = -1,length = values.length,offset = array.length;while (++index < length) {array[offset + index] = values[index];}return array;}module.exports = arrayPush;
/*** A specialized version of `_.map` for arrays without support for iteratee* shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function arrayMap(array, iteratee) {var index = -1,length = array == null ? 0 : array.length,result = Array(length);while (++index < length) {result[index] = iteratee(array[index], index, array);}return result;}module.exports = arrayMap;
var baseTimes = require('./_baseTimes'),isArguments = require('./isArguments'),isArray = require('./isArray'),isBuffer = require('./isBuffer'),isIndex = require('./_isIndex'),isTypedArray = require('./isTypedArray');/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Creates an array of the enumerable property names of the array-like `value`.** @private* @param {*} value The value to query.* @param {boolean} inherited Specify returning inherited property names.* @returns {Array} Returns the array of property names.*/function arrayLikeKeys(value, inherited) {var isArr = isArray(value),isArg = !isArr && isArguments(value),isBuff = !isArr && !isArg && isBuffer(value),isType = !isArr && !isArg && !isBuff && isTypedArray(value),skipIndexes = isArr || isArg || isBuff || isType,result = skipIndexes ? baseTimes(value.length, String) : [],length = result.length;for (var key in value) {if ((inherited || hasOwnProperty.call(value, key)) &&!(skipIndexes && (// Safari 9 has enumerable `arguments.length` in strict mode.key == 'length' ||// Node.js 0.10 has enumerable non-index properties on buffers.(isBuff && (key == 'offset' || key == 'parent')) ||// PhantomJS 2 has enumerable non-index properties on typed arrays.(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||// Skip index properties.isIndex(key, length)))) {result.push(key);}}return result;}module.exports = arrayLikeKeys;
/*** This function is like `arrayIncludes` except that it accepts a comparator.** @private* @param {Array} [array] The array to inspect.* @param {*} target The value to search for.* @param {Function} comparator The comparator invoked per element.* @returns {boolean} Returns `true` if `target` is found, else `false`.*/function arrayIncludesWith(array, value, comparator) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (comparator(value, array[index])) {return true;}}return false;}module.exports = arrayIncludesWith;
var baseIndexOf = require('./_baseIndexOf');/*** A specialized version of `_.includes` for arrays without support for* specifying an index to search from.** @private* @param {Array} [array] The array to inspect.* @param {*} target The value to search for.* @returns {boolean} Returns `true` if `target` is found, else `false`.*/function arrayIncludes(array, value) {var length = array == null ? 0 : array.length;return !!length && baseIndexOf(array, value, 0) > -1;}module.exports = arrayIncludes;
/*** A specialized version of `_.filter` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {Array} Returns the new filtered array.*/function arrayFilter(array, predicate) {var index = -1,length = array == null ? 0 : array.length,resIndex = 0,result = [];while (++index < length) {var value = array[index];if (predicate(value, index, array)) {result[resIndex++] = value;}}return result;}module.exports = arrayFilter;
/*** A specialized version of `_.every` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} predicate The function invoked per iteration.* @returns {boolean} Returns `true` if all elements pass the predicate check,* else `false`.*/function arrayEvery(array, predicate) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (!predicate(array[index], index, array)) {return false;}}return true;}module.exports = arrayEvery;
/*** A specialized version of `_.forEachRight` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns `array`.*/function arrayEachRight(array, iteratee) {var length = array == null ? 0 : array.length;while (length--) {if (iteratee(array[length], length, array) === false) {break;}}return array;}module.exports = arrayEachRight;
/*** A specialized version of `_.forEach` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns `array`.*/function arrayEach(array, iteratee) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (iteratee(array[index], index, array) === false) {break;}}return array;}module.exports = arrayEach;
/*** A specialized version of `baseAggregator` for arrays.** @private* @param {Array} [array] The array to iterate over.* @param {Function} setter The function to set `accumulator` values.* @param {Function} iteratee The iteratee to transform keys.* @param {Object} accumulator The initial aggregated object.* @returns {Function} Returns `accumulator`.*/function arrayAggregator(array, setter, iteratee, accumulator) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {var value = array[index];setter(accumulator, value, iteratee(value), array);}return accumulator;}module.exports = arrayAggregator;
/*** A faster alternative to `Function#apply`, this function invokes `func`* with the `this` binding of `thisArg` and the arguments of `args`.** @private* @param {Function} func The function to invoke.* @param {*} thisArg The `this` binding of `func`.* @param {Array} args The arguments to invoke `func` with.* @returns {*} Returns the result of `func`.*/function apply(func, thisArg, args) {switch (args.length) {case 0: return func.call(thisArg);case 1: return func.call(thisArg, args[0]);case 2: return func.call(thisArg, args[0], args[1]);case 3: return func.call(thisArg, args[0], args[1], args[2]);}return func.apply(thisArg, args);}module.exports = apply;
var getNative = require('./_getNative'),root = require('./_root');/* Built-in method references that are verified to be native. */var WeakMap = getNative(root, 'WeakMap');module.exports = WeakMap;
var root = require('./_root');/** Built-in value references. */var Uint8Array = root.Uint8Array;module.exports = Uint8Array;
var root = require('./_root');/** Built-in value references. */var Symbol = root.Symbol;module.exports = Symbol;
var ListCache = require('./_ListCache'),stackClear = require('./_stackClear'),stackDelete = require('./_stackDelete'),stackGet = require('./_stackGet'),stackHas = require('./_stackHas'),stackSet = require('./_stackSet');/*** Creates a stack cache object to store key-value pairs.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function Stack(entries) {var data = this.__data__ = new ListCache(entries);this.size = data.size;}// Add methods to `Stack`.Stack.prototype.clear = stackClear;Stack.prototype['delete'] = stackDelete;Stack.prototype.get = stackGet;Stack.prototype.has = stackHas;Stack.prototype.set = stackSet;module.exports = Stack;
var MapCache = require('./_MapCache'),setCacheAdd = require('./_setCacheAdd'),setCacheHas = require('./_setCacheHas');/**** Creates an array cache object to store unique values.** @private* @constructor* @param {Array} [values] The values to cache.*/function SetCache(values) {var index = -1,length = values == null ? 0 : values.length;this.__data__ = new MapCache;while (++index < length) {this.add(values[index]);}}// Add methods to `SetCache`.SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;SetCache.prototype.has = setCacheHas;module.exports = SetCache;
var getNative = require('./_getNative'),root = require('./_root');/* Built-in method references that are verified to be native. */var Set = getNative(root, 'Set');module.exports = Set;
var getNative = require('./_getNative'),root = require('./_root');/* Built-in method references that are verified to be native. */var Promise = getNative(root, 'Promise');module.exports = Promise;
var mapCacheClear = require('./_mapCacheClear'),mapCacheDelete = require('./_mapCacheDelete'),mapCacheGet = require('./_mapCacheGet'),mapCacheHas = require('./_mapCacheHas'),mapCacheSet = require('./_mapCacheSet');/*** Creates a map cache object to store key-value pairs.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function MapCache(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}// Add methods to `MapCache`.MapCache.prototype.clear = mapCacheClear;MapCache.prototype['delete'] = mapCacheDelete;MapCache.prototype.get = mapCacheGet;MapCache.prototype.has = mapCacheHas;MapCache.prototype.set = mapCacheSet;module.exports = MapCache;
var getNative = require('./_getNative'),root = require('./_root');/* Built-in method references that are verified to be native. */var Map = getNative(root, 'Map');module.exports = Map;
var baseCreate = require('./_baseCreate'),baseLodash = require('./_baseLodash');/*** The base constructor for creating `lodash` wrapper objects.** @private* @param {*} value The value to wrap.* @param {boolean} [chainAll] Enable explicit method chain sequences.*/function LodashWrapper(value, chainAll) {this.__wrapped__ = value;this.__actions__ = [];this.__chain__ = !!chainAll;this.__index__ = 0;this.__values__ = undefined;}LodashWrapper.prototype = baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor = LodashWrapper;module.exports = LodashWrapper;
var listCacheClear = require('./_listCacheClear'),listCacheDelete = require('./_listCacheDelete'),listCacheGet = require('./_listCacheGet'),listCacheHas = require('./_listCacheHas'),listCacheSet = require('./_listCacheSet');/*** Creates an list cache object.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function ListCache(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}// Add methods to `ListCache`.ListCache.prototype.clear = listCacheClear;ListCache.prototype['delete'] = listCacheDelete;ListCache.prototype.get = listCacheGet;ListCache.prototype.has = listCacheHas;ListCache.prototype.set = listCacheSet;module.exports = ListCache;
var baseCreate = require('./_baseCreate'),baseLodash = require('./_baseLodash');/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH = 4294967295;/*** Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.** @private* @constructor* @param {*} value The value to wrap.*/function LazyWrapper(value) {this.__wrapped__ = value;this.__actions__ = [];this.__dir__ = 1;this.__filtered__ = false;this.__iteratees__ = [];this.__takeCount__ = MAX_ARRAY_LENGTH;this.__views__ = [];}// Ensure `LazyWrapper` is an instance of `baseLodash`.LazyWrapper.prototype = baseCreate(baseLodash.prototype);LazyWrapper.prototype.constructor = LazyWrapper;module.exports = LazyWrapper;
var hashClear = require('./_hashClear'),hashDelete = require('./_hashDelete'),hashGet = require('./_hashGet'),hashHas = require('./_hashHas'),hashSet = require('./_hashSet');/*** Creates a hash object.** @private* @constructor* @param {Array} [entries] The key-value pairs to cache.*/function Hash(entries) {var index = -1,length = entries == null ? 0 : entries.length;this.clear();while (++index < length) {var entry = entries[index];this.set(entry[0], entry[1]);}}// Add methods to `Hash`.Hash.prototype.clear = hashClear;Hash.prototype['delete'] = hashDelete;Hash.prototype.get = hashGet;Hash.prototype.has = hashHas;Hash.prototype.set = hashSet;module.exports = Hash;
var getNative = require('./_getNative'),root = require('./_root');/* Built-in method references that are verified to be native. */var DataView = getNative(root, 'DataView');module.exports = DataView;
# lodash v4.17.20The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.## InstallationUsing npm:```shell$ npm i -g npm$ npm i --save lodash```In Node.js:```js// Load the full build.var _ = require('lodash');// Load the core build.var _ = require('lodash/core');// Load the FP build for immutable auto-curried iteratee-first data-last methods.var fp = require('lodash/fp');// Load method categories.var array = require('lodash/array');var object = require('lodash/fp/object');// Cherry-pick methods for smaller browserify/rollup/webpack bundles.var at = require('lodash/at');var curryN = require('lodash/fp/curryN');```See the [package source](https://github.com/lodash/lodash/tree/4.17.20-npm) for more details.**Note:**<br>Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.## SupportTested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.<br>Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available.
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>Based on Underscore.js, copyright Jeremy Ashkenas,DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>This software consists of voluntary contributions made by manyindividuals. For exact contribution history, see the revision historyavailable at https://github.com/lodash/lodashThe following license applies to all parts of this software except asdocumented below:====Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.====Copyright and related rights for sample code are waived via CC0. Samplecode is defined as all source code displayed within the prose of thedocumentation.CC0: http://creativecommons.org/publicdomain/zero/1.0/====Files located in the node_modules and vendor directories are externallymaintained libraries used by this software which have their ownlicenses; we recommend you read them, as their terms may differ from theterms above.
{"_from": "http-server@^0.12.3","_id": "http-server@0.12.3","_inBundle": false,"_integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==","_location": "/http-server","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "http-server@^0.12.3","name": "http-server","escapedName": "http-server","rawSpec": "^0.12.3","saveSpec": null,"fetchSpec": "^0.12.3"},"_requiredBy": ["/"],"_resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz","_shasum": "ba0471d0ecc425886616cb35c4faf279140a0d37","_spec": "http-server@^0.12.3","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts","bin": {"http-server": "bin/http-server","hs": "bin/http-server"},"bugs": {"url": "https://github.com/http-party/http-server/issues"},"bundleDependencies": false,"contributors": [{"name": "Charlie Robbins","email": "charlie.robbins@gmail.com"},{"name": "Marak Squires","email": "marak.squires@gmail.com"},{"name": "Charlie McConnell","email": "charlie@charlieistheman.com"},{"name": "Joshua Holbrook","email": "josh.holbrook@gmail.com"},{"name": "Maciej Małecki","email": "maciej.malecki@notimplemented.org"},{"name": "Matthew Bergman","email": "mzbphoto@gmail.com"},{"name": "brad dunbar","email": "dunbarb2@gmail.com"},{"name": "Dominic Tarr"},{"name": "Travis Person","email": "travis.person@gmail.com"},{"name": "Jinkwon Lee","email": "master@bdyne.net"},{"name": "BigBlueHat","email": "byoung@bigbluehat.com"},{"name": "Daniel Dalton","email": "daltond2@hawkmail.newpaltz.edu"},{"name": "Jade Michael Thornton","email": "jade@jmthornton.net"}],"dependencies": {"basic-auth": "^1.0.3","colors": "^1.4.0","corser": "^2.0.1","ecstatic": "^3.3.2","http-proxy": "^1.18.0","minimist": "^1.2.5","opener": "^1.5.1","portfinder": "^1.0.25","secure-compare": "3.0.1","union": "~0.5.0"},"deprecated": false,"description": "A simple zero-configuration command-line http server","devDependencies": {"common-style": "^3.0.0","request": "^2.88.2","vows": "~0.8.3"},"engines": {"node": ">=6"},"files": ["lib","bin","doc"],"homepage": "https://github.com/http-party/http-server#readme","keywords": ["cli","command","http","server"],"license": "MIT","main": "./lib/http-server","man": ["./doc/http-server.1"],"name": "http-server","preferGlobal": true,"repository": {"type": "git","url": "git://github.com/http-party/http-server.git"},"scripts": {"pretest": "common bin/http-server lib/ test","start": "node ./bin/http-server","test": "vows --spec --isolate"},"version": "0.12.3"}
'use strict';var fs = require('fs'),union = require('union'),ecstatic = require('ecstatic'),auth = require('basic-auth'),httpProxy = require('http-proxy'),corser = require('corser'),path = require('path'),secureCompare = require('secure-compare');// a hacky and direct workaround to fix https://github.com/http-party/http-server/issues/525function getCaller() {try {var stack = new Error().stack;var stackLines = stack.split('\n');var callerStack = stackLines[3];return callerStack.match(/at (.+) \(/)[1];}catch (error) {return '';}}var _pathNormalize = path.normalize;path.normalize = function (p) {var caller = getCaller();var result = _pathNormalize(p);// https://github.com/jfhbrook/node-ecstatic/blob/master/lib/ecstatic.js#L20if (caller === 'decodePathname') {result = result.replace(/\\/g, '/');}return result;};//// Remark: backwards compatibility for previous// case convention of HTTP//exports.HttpServer = exports.HTTPServer = HttpServer;/*** Returns a new instance of HttpServer with the* specified `options`.*/exports.createServer = function (options) {return new HttpServer(options);};/*** Constructor function for the HttpServer object* which is responsible for serving static files along* with other HTTP-related features.*/function HttpServer(options) {options = options || {};if (options.root) {this.root = options.root;}else {try {fs.lstatSync('./public');this.root = './public';}catch (err) {this.root = './';}}this.headers = options.headers || {};this.cache = (options.cache === undefined ? 3600 :// -1 is a special case to turn off caching.// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#Preventing_cachingoptions.cache === -1 ? 'no-cache, no-store, must-revalidate' :options.cache // in seconds.);this.showDir = options.showDir !== 'false';this.autoIndex = options.autoIndex !== 'false';this.showDotfiles = options.showDotfiles;this.gzip = options.gzip === true;this.brotli = options.brotli === true;if (options.ext) {this.ext = options.ext === true? 'html': options.ext;}this.contentType = options.contentType ||this.ext === 'html' ? 'text/html' : 'application/octet-stream';var before = options.before ? options.before.slice() : [];if (options.logFn) {before.push(function (req, res) {options.logFn(req, res);res.emit('next');});}if (options.username || options.password) {before.push(function (req, res) {var credentials = auth(req);// We perform these outside the if to avoid short-circuiting and giving// an attacker knowledge of whether the username is correct via a timing// attack.if (credentials) {// if credentials is defined, name and pass are guaranteed to be string// typevar usernameEqual = secureCompare(options.username.toString(), credentials.name);var passwordEqual = secureCompare(options.password.toString(), credentials.pass);if (usernameEqual && passwordEqual) {return res.emit('next');}}res.statusCode = 401;res.setHeader('WWW-Authenticate', 'Basic realm=""');res.end('Access denied');});}if (options.cors) {this.headers['Access-Control-Allow-Origin'] = '*';this.headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Range';if (options.corsHeaders) {options.corsHeaders.split(/\s*,\s*/).forEach(function (h) { this.headers['Access-Control-Allow-Headers'] += ', ' + h; }, this);}before.push(corser.create(options.corsHeaders ? {requestHeaders: this.headers['Access-Control-Allow-Headers'].split(/\s*,\s*/)} : null));}if (options.robots) {before.push(function (req, res) {if (req.url === '/robots.txt') {res.setHeader('Content-Type', 'text/plain');var robots = options.robots === true? 'User-agent: *\nDisallow: /': options.robots.replace(/\\n/, '\n');return res.end(robots);}res.emit('next');});}before.push(ecstatic({root: this.root,cache: this.cache,showDir: this.showDir,showDotfiles: this.showDotfiles,autoIndex: this.autoIndex,defaultExt: this.ext,gzip: this.gzip,brotli: this.brotli,contentType: this.contentType,handleError: typeof options.proxy !== 'string'}));if (typeof options.proxy === 'string') {var proxy = httpProxy.createProxyServer({});before.push(function (req, res) {proxy.web(req, res, {target: options.proxy,changeOrigin: true}, function (err, req, res, target) {if (options.logFn) {options.logFn(req, res, {message: err.message,status: res.statusCode });}res.emit('next');});});}var serverOptions = {before: before,headers: this.headers,onError: function (err, req, res) {if (options.logFn) {options.logFn(req, res, err);}res.end();}};if (options.https) {serverOptions.https = options.https;}this.server = union.createServer(serverOptions);if (options.timeout !== undefined) {this.server.setTimeout(options.timeout);}}HttpServer.prototype.listen = function () {this.server.listen.apply(this.server, arguments);};HttpServer.prototype.close = function () {return this.server.close();};
.TH http-server 1 "April 2020" GNU "http-server man page".SH NAMEhttp-server \- a simple zero-configuration command-line http server.SH SYNOPSIS.B http-server[\fIPATH\fR][\fIOPTIONS\fR].SH DESCRIPTION\fBhttp-server\fR is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning..SH OPTIONS.TP.BI [\fIPATH\fR]The directory to serve.Defaults to ./public if it exists, and ./ otherwise..TP.BI \-p ", " \-\-port " " \fIPORT\fRPort to use.Default is 8080..TP.BI \-a " " \fIADDRESS\fRAddress to use.Default is 0.0.0.0..TP.BI \-dShow directory listings.Default is true..TP.BI \-iDisplay autoIndex.Default is true..TP.BI \-g ", " \-\-gzipServe gzip files when possible.Default is false..TP.BI \-b ", " \-\-brotliServe brotli files when possible.If both brotli and gzip are enabled, brotli takes precedence.Default is false..TP.BI \-e ", " \-\-ext " " \fIEXTENSION\fRDefault file extension is none is provided..TP.BI \-s ", " \-\-silentSuppress log messages from output..TP.BI \-\-cors " " [\fIHEADERS\fR]Enable CORS via the "Access-Control-Allow-Origin" header.Optionally provide CORS headers list separated by commas..TP.BI \-o " " [\fIPATH\fR]Open default browser window after starting the server.Optionally provide a URL path to open the browser window to..TP.BI \-c " " \fITIME\fRCache time (max-age) in seconds.To disable caching, use \-c \-1.Default is 3600..TP.BI \-U ", " \-\-utcUse UTC time format in log messages..TP.BI \-\-log\-ipEnable logging of the client IP address..TP.BI \-P ", " \-\-proxyFallback proxy if the request cannot be resolved..TP.BI \-\-username " " \fIUSERNAME\fRUsername for basic authentication.Can also be specified with the environment variable NODE_HTTP_SERVER_USERNAME.Defaults to none..TP.BI \-\-password " " \fIPASSWORD\fRPassword for basic authentication.Can also be specified with the environment variable NODE_HTTP_SERVER_PASSWORD.Defaults to none..TP.BI \-S ", " \-\-sslEnable https..TP.BI \-C ", " \-\-cert " " [\fIFILE\fR]Path to SSL certificate file.If not specified, uses cert.pem..TP.BI \-K ", " \-\-key " " [\fIFILE\fR]Path to SSL key file.If not specified, uses key.pem..TP.BI \-r ", " \-\-robots " " [\fIUSER\-AGENT\fR]Respond to /robots.txt request.If not specified, uses "User-agent: *\\nDisallow: /]".TP.BI \-\-no\-dotfilesDo not show dotfiles..TP.BI \-h ", " \-\-helpPrint usage and exit..TP.BI \-v ", " \-\-versionPrint version and exit..SH FILES.B index.htmlwill be served as the default file to any directory requests..B 404.htmlwill be served if a file is not found. This can be used for SPA hosting to serve the entry page..SH COPYINGCopyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE..SH VERSIONVersion 0.12.2
#!/usr/bin/env node'use strict';var colors = require('colors/safe'),os = require('os'),httpServer = require('../lib/http-server'),portfinder = require('portfinder'),opener = require('opener'),fs = require('fs'),argv = require('minimist')(process.argv.slice(2));var ifaces = os.networkInterfaces();process.title = 'http-server';if (argv.h || argv.help) {console.log(['usage: http-server [path] [options]','','options:',' -p --port Port to use [8080]',' -a Address to use [0.0.0.0]',' -d Show directory listings [true]',' -i Display autoIndex [true]',' -g --gzip Serve gzip files when possible [false]',' -b --brotli Serve brotli files when possible [false]',' If both brotli and gzip are enabled, brotli takes precedence',' -e --ext Default file extension if none supplied [none]',' -s --silent Suppress log messages from output',' --cors[=headers] Enable CORS via the "Access-Control-Allow-Origin" header',' Optionally provide CORS headers list separated by commas',' -o [path] Open browser window after starting the server.',' Optionally provide a URL path to open the browser window to.',' -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.',' To disable caching, use -c-1.',' -t Connections timeout in seconds [120], e.g. -t60 for 1 minute.',' To disable timeout, use -t0',' -U --utc Use UTC time format in log messages.',' --log-ip Enable logging of the client\'s IP address','',' -P --proxy Fallback proxy if the request cannot be resolved. e.g.: http://someurl.com','',' --username Username for basic authentication [none]',' Can also be specified with the env variable NODE_HTTP_SERVER_USERNAME',' --password Password for basic authentication [none]',' Can also be specified with the env variable NODE_HTTP_SERVER_PASSWORD','',' -S --ssl Enable https.',' -C --cert Path to ssl cert file (default: cert.pem).',' -K --key Path to ssl key file (default: key.pem).','',' -r --robots Respond to /robots.txt [User-agent: *\\nDisallow: /]',' --no-dotfiles Do not show dotfiles',' -h --help Print this list and exit.',' -v --version Print the version and exit.'].join('\n'));process.exit();}var port = argv.p || argv.port || parseInt(process.env.PORT, 10),host = argv.a || '0.0.0.0',ssl = argv.S || argv.ssl,proxy = argv.P || argv.proxy,utc = argv.U || argv.utc,version = argv.v || argv.version,logger;if (!argv.s && !argv.silent) {logger = {info: console.log,request: function (req, res, error) {var date = utc ? new Date().toUTCString() : new Date();var ip = argv['log-ip']? req.headers['x-forwarded-for'] || '' + req.connection.remoteAddress: '';if (error) {logger.info('[%s] %s "%s %s" Error (%s): "%s"',date, ip, colors.red(req.method), colors.red(req.url),colors.red(error.status.toString()), colors.red(error.message));}else {logger.info('[%s] %s "%s %s" "%s"',date, ip, colors.cyan(req.method), colors.cyan(req.url),req.headers['user-agent']);}}};}else if (colors) {logger = {info: function () {},request: function () {}};}if (version) {logger.info('v' + require('../package.json').version);process.exit();}if (!port) {portfinder.basePort = 8080;portfinder.getPort(function (err, port) {if (err) { throw err; }listen(port);});}else {listen(port);}function listen(port) {var options = {root: argv._[0],cache: argv.c,timeout: argv.t,showDir: argv.d,autoIndex: argv.i,gzip: argv.g || argv.gzip,brotli: argv.b || argv.brotli,robots: argv.r || argv.robots,ext: argv.e || argv.ext,logFn: logger.request,proxy: proxy,showDotfiles: argv.dotfiles,username: argv.username || process.env.NODE_HTTP_SERVER_USERNAME,password: argv.password || process.env.NODE_HTTP_SERVER_PASSWORD};if (argv.cors) {options.cors = true;if (typeof argv.cors === 'string') {options.corsHeaders = argv.cors;}}if (ssl) {options.https = {cert: argv.C || argv.cert || 'cert.pem',key: argv.K || argv.key || 'key.pem'};try {fs.lstatSync(options.https.cert);}catch (err) {logger.info(colors.red('Error: Could not find certificate ' + options.https.cert));process.exit(1);}try {fs.lstatSync(options.https.key);}catch (err) {logger.info(colors.red('Error: Could not find private key ' + options.https.key));process.exit(1);}}var server = httpServer.createServer(options);server.listen(port, host, function () {var canonicalHost = host === '0.0.0.0' ? '127.0.0.1' : host,protocol = ssl ? 'https://' : 'http://';logger.info([colors.yellow('Starting up http-server, serving '),colors.cyan(server.root),ssl ? (colors.yellow(' through') + colors.cyan(' https')) : '',colors.yellow('\nAvailable on:')].join(''));if (argv.a && host !== '0.0.0.0') {logger.info((' ' + protocol + canonicalHost + ':' + colors.green(port.toString())));}else {Object.keys(ifaces).forEach(function (dev) {ifaces[dev].forEach(function (details) {if (details.family === 'IPv4') {logger.info((' ' + protocol + details.address + ':' + colors.green(port.toString())));}});});}if (typeof proxy === 'string') {logger.info('Unhandled requests will be served from: ' + proxy);}logger.info('Hit CTRL-C to stop the server');if (argv.o) {var openUrl = protocol + canonicalHost + ':' + port;if (typeof argv.o === 'string') {openUrl += argv.o[0] === '/' ? argv.o : '/' + argv.o;}logger.info('open: ' + openUrl);opener(openUrl);}});}if (process.platform === 'win32') {require('readline').createInterface({input: process.stdin,output: process.stdout}).on('SIGINT', function () {process.emit('SIGINT');});}process.on('SIGINT', function () {logger.info(colors.red('http-server stopped.'));process.exit();});process.on('SIGTERM', function () {logger.info(colors.red('http-server stopped.'));process.exit();});
[](https://travis-ci.org/http-party/http-server)[](https://www.npmjs.com/package/http-server) [](https://formulae.brew.sh/formula/http-server) [](https://www.npmjs.com/package/http-server)[](https://github.com/http-party/http-server)# http-server: a command-line http server`http-server` is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.## Installation:#### Globally via `npm`npm install --global http-serverThis will install `http-server` globally so that it may be run from the command line anywhere.#### Globally via Homebrewbrew install http-server#### Running on-demand:Using `npx` you can run the script without installing it first:npx http-server [path] [options]#### As a dependency in your `npm` package:npm install http-server## Usage:http-server [path] [options]`[path]` defaults to `./public` if the folder exists, and `./` otherwise.*Now you can visit http://localhost:8080 to view your server***Note:** Caching is on by default. Add `-c-1` as an option to disable caching.## Available Options:`-p` or `--port` Port to use (defaults to 8080)`-a` Address to use (defaults to 0.0.0.0)`-d` Show directory listings (defaults to `true`)`-i` Display autoIndex (defaults to `true`)`-g` or `--gzip` When enabled (defaults to `false`) it will serve `./public/some-file.js.gz` in place of `./public/some-file.js` when a gzipped version of the file exists and the request accepts gzip encoding. If brotli is also enabled, it will try to serve brotli first.`-b` or `--brotli` When enabled (defaults to `false`) it will serve `./public/some-file.js.br` in place of `./public/some-file.js` when a brotli compressed version of the file exists and the request accepts `br` encoding. If gzip is also enabled, it will try to serve brotli first.`-e` or `--ext` Default file extension if none supplied (defaults to `html`)`-s` or `--silent` Suppress log messages from output`--cors` Enable CORS via the `Access-Control-Allow-Origin` header`-o [path]` Open browser window after starting the server. Optionally provide a URL path to open. e.g.: -o /other/dir/`-c` Set cache time (in seconds) for cache-control max-age header, e.g. `-c10` for 10 seconds (defaults to `3600`). To disable caching, use `-c-1`.`-U` or `--utc` Use UTC time format in log messages.`--log-ip` Enable logging of the client's IP address (default: `false`).`-P` or `--proxy` Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com`--username` Username for basic authentication [none]`--password` Password for basic authentication [none]`-S` or `--ssl` Enable https.`-C` or `--cert` Path to ssl cert file (default: `cert.pem`).`-K` or `--key` Path to ssl key file (default: `key.pem`).`-r` or `--robots` Provide a /robots.txt (whose content defaults to `User-agent: *\nDisallow: /`)`--no-dotfiles` Do not show dotfiles`-h` or `--help` Print this list and exit.`-v` or `--version` Print the version and exit.## Magic Files- `index.html` will be served as the default file to any directory requests.- `404.html` will be served if a file is not found. This can be used for Single-Page App (SPA) hosting to serve the entry page.## Catch-all redirectTo implement a catch-all redirect, use the index page itself as the proxy with:```http-server --proxy http://localhost:8080?```Note the `?` at the end of the proxy URL. Thanks to [@houston3](https://github.com/houston3) for this clever hack!## TLS/SSLFirst, you need to make sure that [openssl](https://github.com/openssl/openssl) is installed correctly, and you have `key.pem` and `cert.pem` files. You can generate them using this command:``` shopenssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem```You will be prompted with a few questions after entering the command. Use `127.0.0.1` as value for `Common name` if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted.This generates a cert-key pair and it will be valid for 3650 days (about 10 years).Then you need to run the server with `-S` for enabling SSL and `-C` for your certificate file.``` shhttp-server -S -C cert.pem```This is what should be output if successful:``` shStarting up http-server, serving ./ through httpsAvailable on:https:127.0.0.1:8080https:192.168.1.101:8080https:192.168.1.104:8080Hit CTRL-C to stop the server```# DevelopmentCheckout this repository locally, then:```sh$ npm i$ node bin/http-server```*Now you can visit http://localhost:8080 to view your server*You should see the turtle image in the screenshot above hosted at that URL. Seethe `./public` folder for demo content.
Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{"platform": "github","autodiscover": false,"requireConfig": true,"ignoreNpmrcFile": true,"rangeStrategy": "replace","packageRules": [{"packagePatterns": ["*"],"minor": {"groupName": "all non-major dependencies","groupSlug": "all-minor-patch"}}],"commitMessagePrefix": "[dist]"}
{"_from": "http-proxy@^1.18.0","_id": "http-proxy@1.18.1","_inBundle": false,"_integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==","_location": "/http-proxy","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "http-proxy@^1.18.0","name": "http-proxy","escapedName": "http-proxy","rawSpec": "^1.18.0","saveSpec": null,"fetchSpec": "^1.18.0"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz","_shasum": "401541f0534884bbf95260334e72f88ee3976549","_spec": "http-proxy@^1.18.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Charlie Robbins","email": "charlie.robbins@gmail.com"},"bugs": {"url": "https://github.com/http-party/node-http-proxy/issues"},"bundleDependencies": false,"dependencies": {"eventemitter3": "^4.0.0","follow-redirects": "^1.0.0","requires-port": "^1.0.0"},"deprecated": false,"description": "HTTP proxying for the masses","devDependencies": {"async": "^3.0.0","auto-changelog": "^1.15.0","concat-stream": "^2.0.0","expect.js": "~0.3.1","mocha": "^3.5.3","nyc": "^14.0.0","semver": "^5.0.3","socket.io": "^2.1.0","socket.io-client": "^2.1.0","sse": "0.0.8","ws": "^3.0.0"},"engines": {"node": ">=8.0.0"},"homepage": "https://github.com/http-party/node-http-proxy#readme","license": "MIT","main": "index.js","maintainers": [{"name": "jcrugzz","email": "jcrugzz@gmail.com"}],"name": "http-proxy","repository": {"type": "git","url": "git+https://github.com/http-party/node-http-proxy.git"},"scripts": {"mocha": "mocha test/*-test.js","test": "nyc --reporter=text --reporter=lcov npm run mocha","version": "auto-changelog -p && git add CHANGELOG.md"},"version": "1.18.1"}
// Use explicit /index.js to help browserify negociation in require '/lib/http-proxy' (!)var ProxyServer = require('./http-proxy/index.js').Server;/*** Creates the proxy server.** Examples:** httpProxy.createProxyServer({ .. }, 8000)* // => '{ web: [Function], ws: [Function] ... }'** @param {Object} Options Config object passed to the proxy** @return {Object} Proxy Proxy object with handlers for `ws` and `web` requests** @api public*/function createProxyServer(options) {/** `options` is needed and it must have the following layout:** {* target : <url string to be parsed with the url module>* forward: <url string to be parsed with the url module>* agent : <object to be passed to http(s).request>* ssl : <object to be passed to https.createServer()>* ws : <true/false, if you want to proxy websockets>* xfwd : <true/false, adds x-forward headers>* secure : <true/false, verify SSL certificate>* toProxy: <true/false, explicitly specify if we are proxying to another proxy>* prependPath: <true/false, Default: true - specify whether you want to prepend the target's path to the proxy path>* ignorePath: <true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request>* localAddress : <Local interface string to bind for outgoing connections>* changeOrigin: <true/false, Default: false - changes the origin of the host header to the target URL>* preserveHeaderKeyCase: <true/false, Default: false - specify whether you want to keep letter case of response header key >* auth : Basic authentication i.e. 'user:password' to compute an Authorization header.* hostRewrite: rewrites the location hostname on (201/301/302/307/308) redirects, Default: null.* autoRewrite: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false.* protocolRewrite: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null.* }** NOTE: `options.ws` and `options.ssl` are optional.* `options.target and `options.forward` cannot be* both missing* }*/return new ProxyServer(options);}ProxyServer.createProxyServer = createProxyServer;ProxyServer.createServer = createProxyServer;ProxyServer.createProxy = createProxyServer;/*** Export the proxy "Server" as the main export.*/module.exports = ProxyServer;
var http = require('http'),https = require('https'),common = require('../common');/*!* Array of passes.** A `pass` is just a function that is executed on `req, socket, options`* so that you can easily add new checks while still keeping the base* flexible.*//** Websockets Passes**/module.exports = {/*** WebSocket requests must have the `GET` method and* the `upgrade:websocket` header** @param {ClientRequest} Req Request object* @param {Socket} Websocket** @api private*/checkMethodAndHeader : function checkMethodAndHeader(req, socket) {if (req.method !== 'GET' || !req.headers.upgrade) {socket.destroy();return true;}if (req.headers.upgrade.toLowerCase() !== 'websocket') {socket.destroy();return true;}},/*** Sets `x-forwarded-*` headers if specified in config.** @param {ClientRequest} Req Request object* @param {Socket} Websocket* @param {Object} Options Config object passed to the proxy** @api private*/XHeaders : function XHeaders(req, socket, options) {if(!options.xfwd) return;var values = {for : req.connection.remoteAddress || req.socket.remoteAddress,port : common.getPort(req),proto: common.hasEncryptedConnection(req) ? 'wss' : 'ws'};['for', 'port', 'proto'].forEach(function(header) {req.headers['x-forwarded-' + header] =(req.headers['x-forwarded-' + header] || '') +(req.headers['x-forwarded-' + header] ? ',' : '') +values[header];});},/*** Does the actual proxying. Make the request and upgrade it* send the Switching Protocols request and pipe the sockets.** @param {ClientRequest} Req Request object* @param {Socket} Websocket* @param {Object} Options Config object passed to the proxy** @api private*/stream : function stream(req, socket, options, head, server, clb) {var createHttpHeader = function(line, headers) {return Object.keys(headers).reduce(function (head, key) {var value = headers[key];if (!Array.isArray(value)) {head.push(key + ': ' + value);return head;}for (var i = 0; i < value.length; i++) {head.push(key + ': ' + value[i]);}return head;}, [line]).join('\r\n') + '\r\n\r\n';}common.setupSocket(socket);if (head && head.length) socket.unshift(head);var proxyReq = (common.isSSL.test(options.target.protocol) ? https : http).request(common.setupOutgoing(options.ssl || {}, options, req));// Enable developers to modify the proxyReq before headers are sentif (server) { server.emit('proxyReqWs', proxyReq, req, socket, options, head); }// Error HandlerproxyReq.on('error', onOutgoingError);proxyReq.on('response', function (res) {// if upgrade event isn't going to happen, close the socketif (!res.upgrade) {socket.write(createHttpHeader('HTTP/' + res.httpVersion + ' ' + res.statusCode + ' ' + res.statusMessage, res.headers));res.pipe(socket);}});proxyReq.on('upgrade', function(proxyRes, proxySocket, proxyHead) {proxySocket.on('error', onOutgoingError);// Allow us to listen when the websocket has completedproxySocket.on('end', function () {server.emit('close', proxyRes, proxySocket, proxyHead);});// The pipe below will end proxySocket if socket closes cleanly, but not// if it errors (eg, vanishes from the net and starts returning// EHOSTUNREACH). We need to do that explicitly.socket.on('error', function () {proxySocket.end();});common.setupSocket(proxySocket);if (proxyHead && proxyHead.length) proxySocket.unshift(proxyHead);//// Remark: Handle writing the headers to the socket when switching protocols// Also handles when a header is an array//socket.write(createHttpHeader('HTTP/1.1 101 Switching Protocols', proxyRes.headers));proxySocket.pipe(socket).pipe(proxySocket);server.emit('open', proxySocket);server.emit('proxySocket', proxySocket); //DEPRECATED.});return proxyReq.end(); // XXX: CHECK IF THIS IS THIS CORRECTfunction onOutgoingError(err) {if (clb) {clb(err, req, socket);} else {server.emit('error', err, req, socket);}socket.end();}}};
var url = require('url'),common = require('../common');var redirectRegex = /^201|30(1|2|7|8)$/;/*!* Array of passes.** A `pass` is just a function that is executed on `req, res, options`* so that you can easily add new checks while still keeping the base* flexible.*/module.exports = { // <--/*** If is a HTTP 1.0 request, remove chunk headers** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {proxyResponse} Res Response object from the proxy request** @api private*/removeChunked: function removeChunked(req, res, proxyRes) {if (req.httpVersion === '1.0') {delete proxyRes.headers['transfer-encoding'];}},/*** If is a HTTP 1.0 request, set the correct connection header* or if connection header not present, then use `keep-alive`** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {proxyResponse} Res Response object from the proxy request** @api private*/setConnection: function setConnection(req, res, proxyRes) {if (req.httpVersion === '1.0') {proxyRes.headers.connection = req.headers.connection || 'close';} else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) {proxyRes.headers.connection = req.headers.connection || 'keep-alive';}},setRedirectHostRewrite: function setRedirectHostRewrite(req, res, proxyRes, options) {if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite)&& proxyRes.headers['location']&& redirectRegex.test(proxyRes.statusCode)) {var target = url.parse(options.target);var u = url.parse(proxyRes.headers['location']);// make sure the redirected host matches the target host before rewritingif (target.host != u.host) {return;}if (options.hostRewrite) {u.host = options.hostRewrite;} else if (options.autoRewrite) {u.host = req.headers['host'];}if (options.protocolRewrite) {u.protocol = options.protocolRewrite;}proxyRes.headers['location'] = u.format();}},/*** Copy headers from proxyResponse to response* set each header in response object.** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {proxyResponse} Res Response object from the proxy request* @param {Object} Options options.cookieDomainRewrite: Config to rewrite cookie domain** @api private*/writeHeaders: function writeHeaders(req, res, proxyRes, options) {var rewriteCookieDomainConfig = options.cookieDomainRewrite,rewriteCookiePathConfig = options.cookiePathRewrite,preserveHeaderKeyCase = options.preserveHeaderKeyCase,rawHeaderKeyMap,setHeader = function(key, header) {if (header == undefined) return;if (rewriteCookieDomainConfig && key.toLowerCase() === 'set-cookie') {header = common.rewriteCookieProperty(header, rewriteCookieDomainConfig, 'domain');}if (rewriteCookiePathConfig && key.toLowerCase() === 'set-cookie') {header = common.rewriteCookieProperty(header, rewriteCookiePathConfig, 'path');}res.setHeader(String(key).trim(), header);};if (typeof rewriteCookieDomainConfig === 'string') { //also test for ''rewriteCookieDomainConfig = { '*': rewriteCookieDomainConfig };}if (typeof rewriteCookiePathConfig === 'string') { //also test for ''rewriteCookiePathConfig = { '*': rewriteCookiePathConfig };}// message.rawHeaders is added in: v0.11.6// https://nodejs.org/api/http.html#http_message_rawheadersif (preserveHeaderKeyCase && proxyRes.rawHeaders != undefined) {rawHeaderKeyMap = {};for (var i = 0; i < proxyRes.rawHeaders.length; i += 2) {var key = proxyRes.rawHeaders[i];rawHeaderKeyMap[key.toLowerCase()] = key;}}Object.keys(proxyRes.headers).forEach(function(key) {var header = proxyRes.headers[key];if (preserveHeaderKeyCase && rawHeaderKeyMap) {key = rawHeaderKeyMap[key] || key;}setHeader(key, header);});},/*** Set the statusCode from the proxyResponse** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {proxyResponse} Res Response object from the proxy request** @api private*/writeStatusCode: function writeStatusCode(req, res, proxyRes) {// From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers])if(proxyRes.statusMessage) {res.statusCode = proxyRes.statusCode;res.statusMessage = proxyRes.statusMessage;} else {res.statusCode = proxyRes.statusCode;}}};
var httpNative = require('http'),httpsNative = require('https'),web_o = require('./web-outgoing'),common = require('../common'),followRedirects = require('follow-redirects');web_o = Object.keys(web_o).map(function(pass) {return web_o[pass];});var nativeAgents = { http: httpNative, https: httpsNative };/*!* Array of passes.** A `pass` is just a function that is executed on `req, res, options`* so that you can easily add new checks while still keeping the base* flexible.*/module.exports = {/*** Sets `content-length` to '0' if request is of DELETE type.** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {Object} Options Config object passed to the proxy** @api private*/deleteLength: function deleteLength(req, res, options) {if((req.method === 'DELETE' || req.method === 'OPTIONS')&& !req.headers['content-length']) {req.headers['content-length'] = '0';delete req.headers['transfer-encoding'];}},/*** Sets timeout in request socket if it was specified in options.** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {Object} Options Config object passed to the proxy** @api private*/timeout: function timeout(req, res, options) {if(options.timeout) {req.socket.setTimeout(options.timeout);}},/*** Sets `x-forwarded-*` headers if specified in config.** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {Object} Options Config object passed to the proxy** @api private*/XHeaders: function XHeaders(req, res, options) {if(!options.xfwd) return;var encrypted = req.isSpdy || common.hasEncryptedConnection(req);var values = {for : req.connection.remoteAddress || req.socket.remoteAddress,port : common.getPort(req),proto: encrypted ? 'https' : 'http'};['for', 'port', 'proto'].forEach(function(header) {req.headers['x-forwarded-' + header] =(req.headers['x-forwarded-' + header] || '') +(req.headers['x-forwarded-' + header] ? ',' : '') +values[header];});req.headers['x-forwarded-host'] = req.headers['x-forwarded-host'] || req.headers['host'] || '';},/*** Does the actual proxying. If `forward` is enabled fires up* a ForwardStream, same happens for ProxyStream. The request* just dies otherwise.** @param {ClientRequest} Req Request object* @param {IncomingMessage} Res Response object* @param {Object} Options Config object passed to the proxy** @api private*/stream: function stream(req, res, options, _, server, clb) {// And we begin!server.emit('start', req, res, options.target || options.forward);var agents = options.followRedirects ? followRedirects : nativeAgents;var http = agents.http;var https = agents.https;if(options.forward) {// If forward enable, so just pipe the requestvar forwardReq = (options.forward.protocol === 'https:' ? https : http).request(common.setupOutgoing(options.ssl || {}, options, req, 'forward'));// error handler (e.g. ECONNRESET, ECONNREFUSED)// Handle errors on incoming request as well as it makes sense tovar forwardError = createErrorHandler(forwardReq, options.forward);req.on('error', forwardError);forwardReq.on('error', forwardError);(options.buffer || req).pipe(forwardReq);if(!options.target) { return res.end(); }}// Request initalizationvar proxyReq = (options.target.protocol === 'https:' ? https : http).request(common.setupOutgoing(options.ssl || {}, options, req));// Enable developers to modify the proxyReq before headers are sentproxyReq.on('socket', function(socket) {if(server && !proxyReq.getHeader('expect')) {server.emit('proxyReq', proxyReq, req, res, options);}});// allow outgoing socket to timeout so that we could// show an error page at the initial requestif(options.proxyTimeout) {proxyReq.setTimeout(options.proxyTimeout, function() {proxyReq.abort();});}// Ensure we abort proxy if request is abortedreq.on('aborted', function () {proxyReq.abort();});// handle errors in proxy and incoming request, just like for forward proxyvar proxyError = createErrorHandler(proxyReq, options.target);req.on('error', proxyError);proxyReq.on('error', proxyError);function createErrorHandler(proxyReq, url) {return function proxyError(err) {if (req.socket.destroyed && err.code === 'ECONNRESET') {server.emit('econnreset', err, req, res, url);return proxyReq.abort();}if (clb) {clb(err, req, res, url);} else {server.emit('error', err, req, res, url);}}}(options.buffer || req).pipe(proxyReq);proxyReq.on('response', function(proxyRes) {if(server) { server.emit('proxyRes', proxyRes, req, res); }if(!res.headersSent && !options.selfHandleResponse) {for(var i=0; i < web_o.length; i++) {if(web_o[i](req, res, proxyRes, options)) { break; }}}if (!res.finished) {// Allow us to listen when the proxy has completedproxyRes.on('end', function () {if (server) server.emit('end', req, res, proxyRes);});// We pipe to the response unless its expected to be handled by the userif (!options.selfHandleResponse) proxyRes.pipe(res);} else {if (server) server.emit('end', req, res, proxyRes);}});}};
var httpProxy = module.exports,extend = require('util')._extend,parse_url = require('url').parse,EE3 = require('eventemitter3'),http = require('http'),https = require('https'),web = require('./passes/web-incoming'),ws = require('./passes/ws-incoming');httpProxy.Server = ProxyServer;/*** Returns a function that creates the loader for* either `ws` or `web`'s passes.** Examples:** httpProxy.createRightProxy('ws')* // => [Function]** @param {String} Type Either 'ws' or 'web'** @return {Function} Loader Function that when called returns an iterator for the right passes** @api private*/function createRightProxy(type) {return function(options) {return function(req, res /*, [head], [opts] */) {var passes = (type === 'ws') ? this.wsPasses : this.webPasses,args = [].slice.call(arguments),cntr = args.length - 1,head, cbl;/* optional args parse begin */if(typeof args[cntr] === 'function') {cbl = args[cntr];cntr--;}var requestOptions = options;if(!(args[cntr] instanceof Buffer) &&args[cntr] !== res) {//Copy global optionsrequestOptions = extend({}, options);//Overwrite with request optionsextend(requestOptions, args[cntr]);cntr--;}if(args[cntr] instanceof Buffer) {head = args[cntr];}/* optional args parse end */['target', 'forward'].forEach(function(e) {if (typeof requestOptions[e] === 'string')requestOptions[e] = parse_url(requestOptions[e]);});if (!requestOptions.target && !requestOptions.forward) {return this.emit('error', new Error('Must provide a proper URL as target'));}for(var i=0; i < passes.length; i++) {/*** Call of passes functions* pass(req, res, options, head)** In WebSockets case the `res` variable* refer to the connection socket* pass(req, socket, options, head)*/if(passes[i](req, res, requestOptions, head, this, cbl)) { // passes can return a truthy value to halt the loopbreak;}}};};}httpProxy.createRightProxy = createRightProxy;function ProxyServer(options) {EE3.call(this);options = options || {};options.prependPath = options.prependPath === false ? false : true;this.web = this.proxyRequest = createRightProxy('web')(options);this.ws = this.proxyWebsocketRequest = createRightProxy('ws')(options);this.options = options;this.webPasses = Object.keys(web).map(function(pass) {return web[pass];});this.wsPasses = Object.keys(ws).map(function(pass) {return ws[pass];});this.on('error', this.onError, this);}require('util').inherits(ProxyServer, EE3);ProxyServer.prototype.onError = function (err) {//// Remark: Replicate node core behavior using EE3// so we force people to handle their own errors//if(this.listeners('error').length === 1) {throw err;}};ProxyServer.prototype.listen = function(port, hostname) {var self = this,closure = function(req, res) { self.web(req, res); };this._server = this.options.ssl ?https.createServer(this.options.ssl, closure) :http.createServer(closure);if(this.options.ws) {this._server.on('upgrade', function(req, socket, head) { self.ws(req, socket, head); });}this._server.listen(port, hostname);return this;};ProxyServer.prototype.close = function(callback) {var self = this;if (this._server) {this._server.close(done);}// Wrap callback to nullify server after all open connections are closed.function done() {self._server = null;if (callback) {callback.apply(null, arguments);}};};ProxyServer.prototype.before = function(type, passName, callback) {if (type !== 'ws' && type !== 'web') {throw new Error('type must be `web` or `ws`');}var passes = (type === 'ws') ? this.wsPasses : this.webPasses,i = false;passes.forEach(function(v, idx) {if(v.name === passName) i = idx;})if(i === false) throw new Error('No such pass');passes.splice(i, 0, callback);};ProxyServer.prototype.after = function(type, passName, callback) {if (type !== 'ws' && type !== 'web') {throw new Error('type must be `web` or `ws`');}var passes = (type === 'ws') ? this.wsPasses : this.webPasses,i = false;passes.forEach(function(v, idx) {if(v.name === passName) i = idx;})if(i === false) throw new Error('No such pass');passes.splice(i++, 0, callback);};
var common = exports,url = require('url'),extend = require('util')._extend,required = require('requires-port');var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i,isSSL = /^https|wss/;/*** Simple Regex for testing if protocol is https*/common.isSSL = isSSL;/*** Copies the right headers from `options` and `req` to* `outgoing` which is then used to fire the proxied* request.** Examples:** common.setupOutgoing(outgoing, options, req)* // => { host: ..., hostname: ...}** @param {Object} Outgoing Base object to be filled with required properties* @param {Object} Options Config object passed to the proxy* @param {ClientRequest} Req Request Object* @param {String} Forward String to select forward or target** @return {Object} Outgoing Object with all required properties set** @api private*/common.setupOutgoing = function(outgoing, options, req, forward) {outgoing.port = options[forward || 'target'].port ||(isSSL.test(options[forward || 'target'].protocol) ? 443 : 80);['host', 'hostname', 'socketPath', 'pfx', 'key','passphrase', 'cert', 'ca', 'ciphers', 'secureProtocol'].forEach(function(e) { outgoing[e] = options[forward || 'target'][e]; });outgoing.method = options.method || req.method;outgoing.headers = extend({}, req.headers);if (options.headers){extend(outgoing.headers, options.headers);}if (options.auth) {outgoing.auth = options.auth;}if (options.ca) {outgoing.ca = options.ca;}if (isSSL.test(options[forward || 'target'].protocol)) {outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure;}outgoing.agent = options.agent || false;outgoing.localAddress = options.localAddress;//// Remark: If we are false and not upgrading, set the connection: close. This is the right thing to do// as node core doesn't handle this COMPLETELY properly yet.//if (!outgoing.agent) {outgoing.headers = outgoing.headers || {};if (typeof outgoing.headers.connection !== 'string'|| !upgradeHeader.test(outgoing.headers.connection)) { outgoing.headers.connection = 'close'; }}// the final path is target path + relative path requested by user:var target = options[forward || 'target'];var targetPath = target && options.prependPath !== false? (target.path || ''): '';//// Remark: Can we somehow not use url.parse as a perf optimization?//var outgoingPath = !options.toProxy? (url.parse(req.url).path || ''): req.url;//// Remark: ignorePath will just straight up ignore whatever the request's// path is. This can be labeled as FOOT-GUN material if you do not know what// you are doing and are using conflicting options.//outgoingPath = !options.ignorePath ? outgoingPath : '';outgoing.path = common.urlJoin(targetPath, outgoingPath);if (options.changeOrigin) {outgoing.headers.host =required(outgoing.port, options[forward || 'target'].protocol) && !hasPort(outgoing.host)? outgoing.host + ':' + outgoing.port: outgoing.host;}return outgoing;};/*** Set the proper configuration for sockets,* set no delay and set keep alive, also set* the timeout to 0.** Examples:** common.setupSocket(socket)* // => Socket** @param {Socket} Socket instance to setup** @return {Socket} Return the configured socket.** @api private*/common.setupSocket = function(socket) {socket.setTimeout(0);socket.setNoDelay(true);socket.setKeepAlive(true, 0);return socket;};/*** Get the port number from the host. Or guess it based on the connection type.** @param {Request} req Incoming HTTP request.** @return {String} The port number.** @api private*/common.getPort = function(req) {var res = req.headers.host ? req.headers.host.match(/:(\d+)/) : '';return res ?res[1] :common.hasEncryptedConnection(req) ? '443' : '80';};/*** Check if the request has an encrypted connection.** @param {Request} req Incoming HTTP request.** @return {Boolean} Whether the connection is encrypted or not.** @api private*/common.hasEncryptedConnection = function(req) {return Boolean(req.connection.encrypted || req.connection.pair);};/*** OS-agnostic join (doesn't break on URLs like path.join does on Windows)>** @return {String} The generated path.** @api private*/common.urlJoin = function() {//// We do not want to mess with the query string. All we want to touch is the path.//var args = Array.prototype.slice.call(arguments),lastIndex = args.length - 1,last = args[lastIndex],lastSegs = last.split('?'),retSegs;args[lastIndex] = lastSegs.shift();//// Join all strings, but remove empty strings so we don't get extra slashes from// joining e.g. ['', 'am']//retSegs = [args.filter(Boolean).join('/').replace(/\/+/g, '/').replace('http:/', 'http://').replace('https:/', 'https://')];// Only join the query string if it exists so we don't have trailing a '?'// on every request// Handle case where there could be multiple ? in the URL.retSegs.push.apply(retSegs, lastSegs);return retSegs.join('?')};/*** Rewrites or removes the domain of a cookie header** @param {String|Array} Header* @param {Object} Config, mapping of domain to rewritten domain.* '*' key to match any domain, null value to remove the domain.** @api private*/common.rewriteCookieProperty = function rewriteCookieProperty(header, config, property) {if (Array.isArray(header)) {return header.map(function (headerElement) {return rewriteCookieProperty(headerElement, config, property);});}return header.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", 'i'), function(match, prefix, previousValue) {var newValue;if (previousValue in config) {newValue = config[previousValue];} else if ('*' in config) {newValue = config['*'];} else {//no match, return previous valuereturn match;}if (newValue) {//replace valuereturn prefix + newValue;} else {//remove valuereturn '';}});};/*** Check the host and see if it potentially has a port in it (keep it simple)** @returns {Boolean} Whether we have one or not** @api private*/function hasPort(host) {return !!~host.indexOf(':');};
/*!* Caron dimonio, con occhi di bragia* loro accennando, tutte le raccoglie;* batte col remo qualunque s’adagia** Charon the demon, with the eyes of glede,* Beckoning to them, collects them all together,* Beats with his oar whoever lags behind** Dante - The Divine Comedy (Canto III)*/module.exports = require('./lib/http-proxy');
coverage:parsers:javascript:enable_partials: yesstatus:project:default:target: "70%"patch:enabled: false
<p align="center"><img src="https://raw.github.com/http-party/node-http-proxy/master/doc/logo.png"/></p># node-http-proxy [](https://travis-ci.org/http-party/node-http-proxy) [](https://codecov.io/gh/http-party/node-http-proxy)`node-http-proxy` is an HTTP programmable proxying library that supportswebsockets. It is suitable for implementing components such as reverseproxies and load balancers.### Table of Contents* [Installation](#installation)* [Upgrading from 0.8.x ?](#upgrading-from-08x-)* [Core Concept](#core-concept)* [Use Cases](#use-cases)* [Setup a basic stand-alone proxy server](#setup-a-basic-stand-alone-proxy-server)* [Setup a stand-alone proxy server with custom server logic](#setup-a-stand-alone-proxy-server-with-custom-server-logic)* [Setup a stand-alone proxy server with proxy request header re-writing](#setup-a-stand-alone-proxy-server-with-proxy-request-header-re-writing)* [Modify a response from a proxied server](#modify-a-response-from-a-proxied-server)* [Setup a stand-alone proxy server with latency](#setup-a-stand-alone-proxy-server-with-latency)* [Using HTTPS](#using-https)* [Proxying WebSockets](#proxying-websockets)* [Options](#options)* [Listening for proxy events](#listening-for-proxy-events)* [Shutdown](#shutdown)* [Miscellaneous](#miscellaneous)* [Test](#test)* [ProxyTable API](#proxytable-api)* [Logo](#logo)* [Contributing and Issues](#contributing-and-issues)* [License](#license)### Installation`npm install http-proxy --save`**[Back to top](#table-of-contents)**### Upgrading from 0.8.x ?Click [here](UPGRADING.md)**[Back to top](#table-of-contents)**### Core ConceptA new proxy is created by calling `createProxyServer` and passingan `options` object as argument ([valid properties are available here](lib/http-proxy.js#L26-L42))```javascriptvar httpProxy = require('http-proxy');var proxy = httpProxy.createProxyServer(options); // See (†)```†Unless listen(..) is invoked on the object, this does not create a webserver. See below.An object will be returned with four methods:* web `req, res, [options]` (used for proxying regular HTTP(S) requests)* ws `req, socket, head, [options]` (used for proxying WS(S) requests)* listen `port` (a function that wraps the object in a webserver, for your convenience)* close `[callback]` (a function that closes the inner webserver and stops listening on given port)It is then possible to proxy requests by calling these functions```javascripthttp.createServer(function(req, res) {proxy.web(req, res, { target: 'http://mytarget.com:8080' });});```Errors can be listened on either using the Event Emitter API```javascriptproxy.on('error', function(e) {...});```or using the callback API```javascriptproxy.web(req, res, { target: 'http://mytarget.com:8080' }, function(e) { ... });```When a request is proxied it follows two different pipelines ([available here](lib/http-proxy/passes))which apply transformations to both the `req` and `res` object.The first pipeline (incoming) is responsible for the creation and manipulation of the stream that connects your client to the target.The second pipeline (outgoing) is responsible for the creation and manipulation of the stream that, from your target, returns datato the client.**[Back to top](#table-of-contents)**### Use Cases#### Setup a basic stand-alone proxy server```jsvar http = require('http'),httpProxy = require('http-proxy');//// Create your proxy server and set the target in the options.//httpProxy.createProxyServer({target:'http://localhost:9000'}).listen(8000); // See (†)//// Create your target server//http.createServer(function (req, res) {res.writeHead(200, { 'Content-Type': 'text/plain' });res.write('request successfully proxied!' + '\n' + JSON.stringify(req.headers, true, 2));res.end();}).listen(9000);```†Invoking listen(..) triggers the creation of a web server. Otherwise, just the proxy instance is created.**[Back to top](#table-of-contents)**#### Setup a stand-alone proxy server with custom server logicThis example shows how you can proxy a request using your own HTTP serverand also you can put your own logic to handle the request.```jsvar http = require('http'),httpProxy = require('http-proxy');//// Create a proxy server with custom application logic//var proxy = httpProxy.createProxyServer({});//// Create your custom server and just call `proxy.web()` to proxy// a web request to the target passed in the options// also you can use `proxy.ws()` to proxy a websockets request//var server = http.createServer(function(req, res) {// You can define here your custom logic to handle the request// and then proxy the request.proxy.web(req, res, { target: 'http://127.0.0.1:5050' });});console.log("listening on port 5050")server.listen(5050);```**[Back to top](#table-of-contents)**#### Setup a stand-alone proxy server with proxy request header re-writingThis example shows how you can proxy a request using your own HTTP server thatmodifies the outgoing proxy request by adding a special header.```jsvar http = require('http'),httpProxy = require('http-proxy');//// Create a proxy server with custom application logic//var proxy = httpProxy.createProxyServer({});// To modify the proxy connection before data is sent, you can listen// for the 'proxyReq' event. When the event is fired, you will receive// the following arguments:// (http.ClientRequest proxyReq, http.IncomingMessage req,// http.ServerResponse res, Object options). This mechanism is useful when// you need to modify the proxy request before the proxy connection// is made to the target.//proxy.on('proxyReq', function(proxyReq, req, res, options) {proxyReq.setHeader('X-Special-Proxy-Header', 'foobar');});var server = http.createServer(function(req, res) {// You can define here your custom logic to handle the request// and then proxy the request.proxy.web(req, res, {target: 'http://127.0.0.1:5050'});});console.log("listening on port 5050")server.listen(5050);```**[Back to top](#table-of-contents)**#### Modify a response from a proxied serverSometimes when you have received a HTML/XML document from the server of origin you would like to modify it before forwarding it on.[Harmon](https://github.com/No9/harmon) allows you to do this in a streaming style so as to keep the pressure on the proxy to a minimum.**[Back to top](#table-of-contents)**#### Setup a stand-alone proxy server with latency```jsvar http = require('http'),httpProxy = require('http-proxy');//// Create a proxy server with latency//var proxy = httpProxy.createProxyServer();//// Create your server that makes an operation that waits a while// and then proxies the request//http.createServer(function (req, res) {// This simulates an operation that takes 500ms to executesetTimeout(function () {proxy.web(req, res, {target: 'http://localhost:9008'});}, 500);}).listen(8008);//// Create your target server//http.createServer(function (req, res) {res.writeHead(200, { 'Content-Type': 'text/plain' });res.write('request successfully proxied to: ' + req.url + '\n' + JSON.stringify(req.headers, true, 2));res.end();}).listen(9008);```**[Back to top](#table-of-contents)**#### Using HTTPSYou can activate the validation of a secure SSL certificate to the target connection (avoid self-signed certs), just set `secure: true` in the options.##### HTTPS -> HTTP```js//// Create the HTTPS proxy server in front of a HTTP server//httpProxy.createServer({target: {host: 'localhost',port: 9009},ssl: {key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')}}).listen(8009);```##### HTTPS -> HTTPS```js//// Create the proxy server listening on port 443//httpProxy.createServer({ssl: {key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')},target: 'https://localhost:9010',secure: true // Depends on your needs, could be false.}).listen(443);```##### HTTP -> HTTPS (using a PKCS12 client certificate)```js//// Create an HTTP proxy server with an HTTPS target//httpProxy.createProxyServer({target: {protocol: 'https:',host: 'my-domain-name',port: 443,pfx: fs.readFileSync('path/to/certificate.p12'),passphrase: 'password',},changeOrigin: true,}).listen(8000);```**[Back to top](#table-of-contents)**#### Proxying WebSocketsYou can activate the websocket support for the proxy using `ws:true` in the options.```js//// Create a proxy server for websockets//httpProxy.createServer({target: 'ws://localhost:9014',ws: true}).listen(8014);```Also you can proxy the websocket requests just calling the `ws(req, socket, head)` method.```js//// Setup our server to proxy standard HTTP requests//var proxy = new httpProxy.createProxyServer({target: {host: 'localhost',port: 9015}});var proxyServer = http.createServer(function (req, res) {proxy.web(req, res);});//// Listen to the `upgrade` event and proxy the// WebSocket requests as well.//proxyServer.on('upgrade', function (req, socket, head) {proxy.ws(req, socket, head);});proxyServer.listen(8015);```**[Back to top](#table-of-contents)**### Options`httpProxy.createProxyServer` supports the following options:* **target**: url string to be parsed with the url module* **forward**: url string to be parsed with the url module* **agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects)* **ssl**: object to be passed to https.createServer()* **ws**: true/false, if you want to proxy websockets* **xfwd**: true/false, adds x-forward headers* **secure**: true/false, if you want to verify the SSL Certs* **toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies)* **prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path* **ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required).* **localAddress**: Local interface string to bind for outgoing connections* **changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL* **preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key* **auth**: Basic authentication i.e. 'user:password' to compute an Authorization header.* **hostRewrite**: rewrites the location hostname on (201/301/302/307/308) redirects.* **autoRewrite**: rewrites the location host/port on (201/301/302/307/308) redirects based on requested host/port. Default: false.* **protocolRewrite**: rewrites the location protocol on (201/301/302/307/308) redirects to 'http' or 'https'. Default: null.* **cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:* `false` (default): disable cookie rewriting* String: new domain, for example `cookieDomainRewrite: "new.domain"`. To remove the domain, use `cookieDomainRewrite: ""`.* Object: mapping of domains to new domains, use `"*"` to match all domains.For example keep one domain unchanged, rewrite one domain and remove other domains:```cookieDomainRewrite: {"unchanged.domain": "unchanged.domain","old.domain": "new.domain","*": ""}```* **cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:* `false` (default): disable cookie rewriting* String: new path, for example `cookiePathRewrite: "/newPath/"`. To remove the path, use `cookiePathRewrite: ""`. To set path to root use `cookiePathRewrite: "/"`.* Object: mapping of paths to new paths, use `"*"` to match all paths.For example, to keep one path unchanged, rewrite one path and remove other paths:```cookiePathRewrite: {"/unchanged.path/": "/unchanged.path/","/old.path/": "/new.path/","*": ""}```* **headers**: object with extra headers to be added to target requests.* **proxyTimeout**: timeout (in millis) for outgoing proxy requests* **timeout**: timeout (in millis) for incoming requests* **followRedirects**: true/false, Default: false - specify whether you want to follow redirects* **selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event* **buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option:```'use strict';const streamify = require('stream-array');const HttpProxy = require('http-proxy');const proxy = new HttpProxy();module.exports = (req, res, next) => {proxy.web(req, res, {target: 'http://localhost:4003/',buffer: streamify(req.rawBody)}, next);};```**NOTE:**`options.ws` and `options.ssl` are optional.`options.target` and `options.forward` cannot both be missingIf you are using the `proxyServer.listen` method, the following options are also applicable:* **ssl**: object to be passed to https.createServer()* **ws**: true/false, if you want to proxy websockets**[Back to top](#table-of-contents)**### Listening for proxy events* `error`: The error event is emitted if the request to the target fail. **We do not do any error handling of messages passed between client and proxy, and messages passed between proxy and target, so it is recommended that you listen on errors and handle them.*** `proxyReq`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "web" connections* `proxyReqWs`: This event is emitted before the data is sent. It gives you a chance to alter the proxyReq request object. Applies to "websocket" connections* `proxyRes`: This event is emitted if the request to the target got a response.* `open`: This event is emitted once the proxy websocket was created and piped into the target websocket.* `close`: This event is emitted once the proxy websocket was closed.* (DEPRECATED) `proxySocket`: Deprecated in favor of `open`.```jsvar httpProxy = require('http-proxy');// Error example//// Http Proxy Server with bad target//var proxy = httpProxy.createServer({target:'http://localhost:9005'});proxy.listen(8005);//// Listen for the `error` event on `proxy`.proxy.on('error', function (err, req, res) {res.writeHead(500, {'Content-Type': 'text/plain'});res.end('Something went wrong. And we are reporting a custom error message.');});//// Listen for the `proxyRes` event on `proxy`.//proxy.on('proxyRes', function (proxyRes, req, res) {console.log('RAW Response from the target', JSON.stringify(proxyRes.headers, true, 2));});//// Listen for the `open` event on `proxy`.//proxy.on('open', function (proxySocket) {// listen for messages coming FROM the target hereproxySocket.on('data', hybiParseAndLogMessage);});//// Listen for the `close` event on `proxy`.//proxy.on('close', function (res, socket, head) {// view disconnected websocket connectionsconsole.log('Client disconnected');});```**[Back to top](#table-of-contents)**### Shutdown* When testing or running server within another program it may be necessary to close the proxy.* This will stop the proxy from accepting new connections.```jsvar proxy = new httpProxy.createProxyServer({target: {host: 'localhost',port: 1337}});proxy.close();```**[Back to top](#table-of-contents)**### MiscellaneousIf you want to handle your own response after receiving the `proxyRes`, you can doso with `selfHandleResponse`. As you can see below, if you use this option, youare able to intercept and read the `proxyRes` but you must also make sure toreply to the `res` itself otherwise the original client will never receive anydata.### Modify response```jsvar option = {target: target,selfHandleResponse : true};proxy.on('proxyRes', function (proxyRes, req, res) {var body = [];proxyRes.on('data', function (chunk) {body.push(chunk);});proxyRes.on('end', function () {body = Buffer.concat(body).toString();console.log("res from proxied server:", body);res.end("my response to cli");});});proxy.web(req, res, option);```#### ProxyTable APIA proxy table API is available through this add-on [module](https://github.com/donasaur/http-proxy-rules), which lets you define a set of rules to translate matching routes to target routes that the reverse proxy will talk to.#### Test```$ npm test```#### LogoLogo created by [Diego Pasquali](http://dribbble.com/diegopq)**[Back to top](#table-of-contents)**### Contributing and Issues* Read carefully our [Code Of Conduct](https://github.com/http-party/node-http-proxy/blob/master/CODE_OF_CONDUCT.md)* Search on Google/Github* If you can't find anything, open an issue* If you feel comfortable about fixing the issue, fork the repo* Commit to your local branch (which must be different from `master`)* Submit your Pull Request (be sure to include tests and update documentation)**[Back to top](#table-of-contents)**### License>The MIT License (MIT)>>Copyright (c) 2010 - 2016 Charlie Robbins, Jarrett Cruger & the Contributors.>>Permission is hereby granted, free of charge, to any person obtaining a copy>of this software and associated documentation files (the "Software"), to deal>in the Software without restriction, including without limitation the rights>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell>copies of the Software, and to permit persons to whom the Software is>furnished to do so, subject to the following conditions:>>The above copyright notice and this permission notice shall be included in>all copies or substantial portions of the Software.>>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN>THE SOFTWARE.
node-http-proxyCopyright (c) 2010-2016 Charlie Robbins, Jarrett Cruger & the Contributors.Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor Covenant Code of Conduct## Our PledgeIn the interest of fostering an open and welcoming environment, we ascontributors and maintainers pledge to making participation in our project andour community a harassment-free experience for everyone, regardless of age, bodysize, disability, ethnicity, gender identity and expression, level of experience,nationality, personal appearance, race, religion, or sexual identity andorientation.## Our StandardsExamples of behavior that contributes to creating a positive environmentinclude:* Using welcoming and inclusive language* Being respectful of differing viewpoints and experiences* Gracefully accepting constructive criticism* Focusing on what is best for the community* Showing empathy towards other community membersExamples of unacceptable behavior by participants include:* The use of sexualized language or imagery and unwelcome sexual attention oradvances* Trolling, insulting/derogatory comments, and personal or political attacks* Public or private harassment* Publishing others' private information, such as a physical or electronicaddress, without explicit permission* Other conduct which could reasonably be considered inappropriate in aprofessional setting## Our ResponsibilitiesProject maintainers are responsible for clarifying the standards of acceptablebehavior and are expected to take appropriate and fair corrective action inresponse to any instances of unacceptable behavior.Project maintainers have the right and responsibility to remove, edit, orreject comments, commits, code, wiki edits, issues, and other contributionsthat are not aligned to this Code of Conduct, or to ban temporarily orpermanently any contributor for other behaviors that they deem inappropriate,threatening, offensive, or harmful.## ScopeThis Code of Conduct applies both within project spaces and in public spaceswhen an individual is representing the project or its community. Examples ofrepresenting a project or community include using an official project e-mailaddress, posting via an official social media account, or acting as an appointedrepresentative at an online or offline event. Representation of a project may befurther defined and clarified by project maintainers.## EnforcementInstances of abusive, harassing, or otherwise unacceptable behavior may bereported by contacting the project team at <https://github.com/http-party/node-http-proxy>. Allcomplaints will be reviewed and investigated and will result in a response thatis deemed necessary and appropriate to the circumstances. The project team isobligated to maintain confidentiality with regard to the reporter of an incident.Further details of specific enforcement policies may be posted separately.Project maintainers who do not follow or enforce the Code of Conduct in goodfaith may face temporary or permanent repercussions as determined by othermembers of the project's leadership.## AttributionThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,available at [http://contributor-covenant.org/version/1/4][version][homepage]: http://contributor-covenant.org[version]: http://contributor-covenant.org/version/1/4/
# ChangelogAll notable changes to this project will be documented in this file.The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).## [v1.18.1](https://github.com/http-party/node-http-proxy/compare/1.18.0...v1.18.1) - 2020-05-17### Merged- Skip sending the proxyReq event when the expect header is present [`#1447`](https://github.com/http-party/node-http-proxy/pull/1447)- Remove node6 support, add node12 to build [`#1397`](https://github.com/http-party/node-http-proxy/pull/1397)## [1.18.0](https://github.com/http-party/node-http-proxy/compare/1.17.0...1.18.0) - 2019-09-18### Merged- Added in auto-changelog module set to keepachangelog format [`#1373`](https://github.com/http-party/node-http-proxy/pull/1373)- fix 'Modify Response' readme section to avoid unnecessary array copying [`#1300`](https://github.com/http-party/node-http-proxy/pull/1300)- Fix incorrect target name for reverse proxy example [`#1135`](https://github.com/http-party/node-http-proxy/pull/1135)- Fix modify response middleware example [`#1139`](https://github.com/http-party/node-http-proxy/pull/1139)- [dist] Update dependency async to v3 [`#1359`](https://github.com/http-party/node-http-proxy/pull/1359)- Fix path to local http-proxy in examples. [`#1072`](https://github.com/http-party/node-http-proxy/pull/1072)- fix reverse-proxy example require path [`#1067`](https://github.com/http-party/node-http-proxy/pull/1067)- Update README.md [`#970`](https://github.com/http-party/node-http-proxy/pull/970)- [dist] Update dependency request to ~2.88.0 [SECURITY] [`#1357`](https://github.com/http-party/node-http-proxy/pull/1357)- [dist] Update dependency eventemitter3 to v4 [`#1365`](https://github.com/http-party/node-http-proxy/pull/1365)- [dist] Update dependency colors to v1 [`#1360`](https://github.com/http-party/node-http-proxy/pull/1360)- [dist] Update all non-major dependencies [`#1356`](https://github.com/http-party/node-http-proxy/pull/1356)- [dist] Update dependency agentkeepalive to v4 [`#1358`](https://github.com/http-party/node-http-proxy/pull/1358)- [dist] Update dependency nyc to v14 [`#1367`](https://github.com/http-party/node-http-proxy/pull/1367)- [dist] Update dependency concat-stream to v2 [`#1363`](https://github.com/http-party/node-http-proxy/pull/1363)- x-forwarded-host overwrite for mutli level proxies [`#1267`](https://github.com/http-party/node-http-proxy/pull/1267)- [refactor doc] Complete rename to http-party org. [`#1362`](https://github.com/http-party/node-http-proxy/pull/1362)- Highlight correct lines for createProxyServer [`#1117`](https://github.com/http-party/node-http-proxy/pull/1117)- Fix docs for rewrite options - 201 also handled [`#1147`](https://github.com/http-party/node-http-proxy/pull/1147)- Update .nyc_output [`#1339`](https://github.com/http-party/node-http-proxy/pull/1339)- Configure Renovate [`#1355`](https://github.com/http-party/node-http-proxy/pull/1355)- [examples] Restream body before proxying, support for Content-Type of application/x-www-form-urlencoded [`#1264`](https://github.com/http-party/node-http-proxy/pull/1264)### Commits- [dist] New test fixtures. [`7e4a0e5`](https://github.com/http-party/node-http-proxy/commit/7e4a0e511bc30c059216860153301de2cdd1e97f)- [dist] End of an era. [`a9b09cc`](https://github.com/http-party/node-http-proxy/commit/a9b09cce43f072db99fb5170030a05536177ccb7)- [dist] Version bump. 1.18.0 [`9bbe486`](https://github.com/http-party/node-http-proxy/commit/9bbe486c5efcc356fb4d189ef38eee275bbde345)- [fix] Latest versions. [`59c4403`](https://github.com/http-party/node-http-proxy/commit/59c4403e9dc15ab9b19ee2a3f4aecbfc6c3d94c4)- [fix test] Update tests. [`dd1d08b`](https://github.com/http-party/node-http-proxy/commit/dd1d08b6319d1def729554446a5b0176978a8dad)- [dist] Update dependency ws to v3 [SECURITY] [`b00911c`](https://github.com/http-party/node-http-proxy/commit/b00911c93740a00c5cfbacbb91565cb6912ed255)- [dist] .gitattributes all the things. [`fc93520`](https://github.com/http-party/node-http-proxy/commit/fc93520d741ec80be8ae31ca005f3e9c199e330e)- [dist] Regenerate package-lock.json. [`16d4f8a`](https://github.com/http-party/node-http-proxy/commit/16d4f8a95162b2e2e4ee6657c500f1208c044b2d)## [1.17.0](https://github.com/http-party/node-http-proxy/compare/1.16.2...1.17.0) - 2018-04-20### Merged- Fix overwriting of global options [`#1074`](https://github.com/http-party/node-http-proxy/pull/1074)- Update README.md [`#1131`](https://github.com/http-party/node-http-proxy/pull/1131)- Update README.md with CoC link [`#1120`](https://github.com/http-party/node-http-proxy/pull/1120)- Add Code Of Conduct [`#1119`](https://github.com/http-party/node-http-proxy/pull/1119)- [deps] Update eventemitter3 to version 2.0.x [`#1109`](https://github.com/http-party/node-http-proxy/pull/1109)### Fixed- Fix "Can't set headers after they are sent" errors [`#930`](https://github.com/http-party/node-http-proxy/issues/930)- Include websocket non-upgrade response [`#890`](https://github.com/http-party/node-http-proxy/issues/890)### Commits- Add followRedirects option [`c9a556c`](https://github.com/http-party/node-http-proxy/commit/c9a556cfa57c7ce0b877e16f2c2e1448d8cc278d)- [test] add test for selfHandleRequest and remove modifyResponse as selfHandleRequest is the only way that functionality works [`4a37175`](https://github.com/http-party/node-http-proxy/commit/4a37175a5296d2ea2da0fc15a3f8fe08599bb592)- Adding ability to set cookie path [`2c98416`](https://github.com/http-party/node-http-proxy/commit/2c98416ac2bf17bb5f515b9e10ee4485f5913846)- Updating docs and adding more tests. [`f5c2381`](https://github.com/http-party/node-http-proxy/commit/f5c2381395e01bf8d6655cc70e14032c8f0aaa67)- [dist] make tests work reliably, add package-lock.json [`09dcb98`](https://github.com/http-party/node-http-proxy/commit/09dcb984565dabb159a01a75a188b974f8c176ad)- add support for modify response [`e5c02b8`](https://github.com/http-party/node-http-proxy/commit/e5c02b8a8a902e204eee886acafbbfe46c4a3aef)- [wip] proper tests and reporting [`f4ff100`](https://github.com/http-party/node-http-proxy/commit/f4ff1006b9e71eb4185a3edf03333dbe514a84c9)- Add detail about "buffer" option [`6f88caf`](https://github.com/http-party/node-http-proxy/commit/6f88caf6e46d84a809910c591e138250b333b39f)- Add use case for proxy to HTTPS using a PKCS12 client certificate [`d2f9db8`](https://github.com/http-party/node-http-proxy/commit/d2f9db824136358a06dc3dd566644f3a016f24e2)- [test] for override method feature [`81d58c5`](https://github.com/http-party/node-http-proxy/commit/81d58c531be3f61efb56d2489a66c73a7b2325fe)- [dist] doc updates [`e94d529`](https://github.com/http-party/node-http-proxy/commit/e94d52973a26cf817a9de12d97e5ae603093f70d)- feat: 添加response自处理参数 [`89f9ef8`](https://github.com/http-party/node-http-proxy/commit/89f9ef87e0532d54d086719c5ace1a968a42e51b)- [dist][test] codecov config [`a4bccc3`](https://github.com/http-party/node-http-proxy/commit/a4bccc332d36d7db93db984674cd7e51b43a1b99)- Removing unnecessary check since this is a private API [`bc6a237`](https://github.com/http-party/node-http-proxy/commit/bc6a23709c37c65b5b16cc802d05cb57f099b0ce)- issue #953: stop using writeHead [`2c44039`](https://github.com/http-party/node-http-proxy/commit/2c44039a7c30b190043da654ee7e5aed0304e979)- [fix] move badges [`543636d`](https://github.com/http-party/node-http-proxy/commit/543636d0f662308ec8c9afdbf641f4036f002bfd)- fix small typos in README [`8231984`](https://github.com/http-party/node-http-proxy/commit/8231984fb02dca331b4ef77e089db50855eea4f5)- Added timeout option to docs [`107c187`](https://github.com/http-party/node-http-proxy/commit/107c18720c3906f9049cc14d075b31910c0ccf55)- [dist] document the feature [`d533a1b`](https://github.com/http-party/node-http-proxy/commit/d533a1be437b37fed5bd25f5e58298eea819f974)- [fix] slightly more tolerant [`de1b808`](https://github.com/http-party/node-http-proxy/commit/de1b80851ab1b1251b5eaeaf0beab164024f09b6)- Forgot 'i' flag when changing from regex shorthand to string. [`50f58b4`](https://github.com/http-party/node-http-proxy/commit/50f58b4cd9b4422a11512a6a065432159b5bc806)- Update common.js [`c5d8466`](https://github.com/http-party/node-http-proxy/commit/c5d846648304f2e36a172b25d9fb8300d8131f8c)- [fix] rm newline [`e6f24ba`](https://github.com/http-party/node-http-proxy/commit/e6f24ba6173c4fdd26089b3c729de5dbdd71ad74)- [dist] update package-lock.json [`abf882e`](https://github.com/http-party/node-http-proxy/commit/abf882e03c92cf1665d5b7d4dbdaf87feb50a677)## [1.16.2](https://github.com/http-party/node-http-proxy/compare/1.16.1...1.16.2) - 2016-12-06### Merged- [WIP] Revert default behavior of writeHeaders method [`#1104`](https://github.com/http-party/node-http-proxy/pull/1104)## [1.16.1](https://github.com/http-party/node-http-proxy/compare/1.16.0...1.16.1) - 2016-12-04### Commits- Enable proxy response to have multiple Set-Cookie raw headers #1101 [`8cb451f`](https://github.com/http-party/node-http-proxy/commit/8cb451f20cff0a19fc9576fc2558307fb17a5710)- [dist] Version bump. 1.16.1 [`ac1a01b`](https://github.com/http-party/node-http-proxy/commit/ac1a01b1f3caa3a2a9433341bf5e7a95072d6612)## [1.16.0](https://github.com/http-party/node-http-proxy/compare/1.15.2...1.16.0) - 2016-12-02### Merged- Fix newly introduced error in error handler for ECONNREFUSED in forward proxy [`#1100`](https://github.com/http-party/node-http-proxy/pull/1100)- Keep original letter case of response header keys [`#1098`](https://github.com/http-party/node-http-proxy/pull/1098)- Handle errors for forward request, add test case [`#1099`](https://github.com/http-party/node-http-proxy/pull/1099)### Commits- add node 6 to travis [`2f7f037`](https://github.com/http-party/node-http-proxy/commit/2f7f03778cfb94396acf0d778061ea197212fbb5)## [1.15.2](https://github.com/http-party/node-http-proxy/compare/1.15.1...1.15.2) - 2016-10-22### Merged- Add proxy-timeout option to documentation [`#1075`](https://github.com/http-party/node-http-proxy/pull/1075)### Commits- Do not rely on func.name (no scope) [`61c2889`](https://github.com/http-party/node-http-proxy/commit/61c28891093b256bbc0dae78e45e2c5f0acf2101)- Do not rely on func.name (no scope) [`d48f67e`](https://github.com/http-party/node-http-proxy/commit/d48f67eb90d8af66211093e91efdd6638859e0bf)- Expose full callback names [`220f5fb`](https://github.com/http-party/node-http-proxy/commit/220f5fb795d2977c5a68ae59d7db65089efed50c)- test case added [`f5217d6`](https://github.com/http-party/node-http-proxy/commit/f5217d6c20c164ed412a3b20f660786b6f88b35b)- [fix] style nits [`d0f1dfe`](https://github.com/http-party/node-http-proxy/commit/d0f1dfeb8277d46a057017cd888b50e85f6725d6)- With a comment [`fbc2668`](https://github.com/http-party/node-http-proxy/commit/fbc266809c289fbdb59d7944345816a858303c96)- Fix browserification [`8eddf45`](https://github.com/http-party/node-http-proxy/commit/8eddf45f2a043e4e1b3f6e33c304e68fe7e1c406)- not setting connection header in case of http2 as it is deprecated [`2d01edc`](https://github.com/http-party/node-http-proxy/commit/2d01edc5a5ace591784022b85860a3bbc48c5e12)## [1.15.1](https://github.com/http-party/node-http-proxy/compare/1.15.0...1.15.1) - 2016-09-14### Merged- Properly write response header optionally including statusMessage [`#1061`](https://github.com/http-party/node-http-proxy/pull/1061)### Commits- [dist] Version bump. 1.15.1 [`912cd3a`](https://github.com/http-party/node-http-proxy/commit/912cd3acaef484f7ea08affc9339250082e04058)## [1.15.0](https://github.com/http-party/node-http-proxy/compare/1.14.0...1.15.0) - 2016-09-14### Merged- Made it not to crash with omited Host http header [`#1050`](https://github.com/http-party/node-http-proxy/pull/1050)- README.md: fix typo: 'ingoing' should be 'incoming' [`#1060`](https://github.com/http-party/node-http-proxy/pull/1060)- Fix for Reason-Phrase being overwritten on proxy response. [`#1051`](https://github.com/http-party/node-http-proxy/pull/1051)- cookieDomainRewrite option [`#1009`](https://github.com/http-party/node-http-proxy/pull/1009)- Update ntlm-authentication.js [`#1025`](https://github.com/http-party/node-http-proxy/pull/1025)- Restream body before proxying [`#1027`](https://github.com/http-party/node-http-proxy/pull/1027)- Location rewriting for responses with status 201 [`#1024`](https://github.com/http-party/node-http-proxy/pull/1024)- #866 Copy CA from options into outbound proxy [`#1042`](https://github.com/http-party/node-http-proxy/pull/1042)### Fixed- Restream body before proxying (#1027) [`#955`](https://github.com/http-party/node-http-proxy/issues/955)### Commits- [dist] Version bump. 1.15.0 [`b98c75b`](https://github.com/http-party/node-http-proxy/commit/b98c75b1ff3ebdf7f78224eb0d9aa857af2db1d9)## [1.14.0](https://github.com/http-party/node-http-proxy/compare/1.13.3...1.14.0) - 2016-06-15### Merged- Emit disconnected event instead of error when ECONNRESET [`#966`](https://github.com/http-party/node-http-proxy/pull/966)- fix test for node 0.10 + socket.io-client@1.4.6 (engine.io-client@1.6.9) [`#1010`](https://github.com/http-party/node-http-proxy/pull/1010)### Commits- [dist] Version bump. 1.14.0 [`fcfb0b3`](https://github.com/http-party/node-http-proxy/commit/fcfb0b37f6ac61369565507446377f91d955cf29)## [1.13.3](https://github.com/http-party/node-http-proxy/compare/1.13.2...1.13.3) - 2016-05-16### Merged- fix browserify compatibility [`#975`](https://github.com/http-party/node-http-proxy/pull/975)- alter message error [`#998`](https://github.com/http-party/node-http-proxy/pull/998)- Sanitize header keys before setting them [`#997`](https://github.com/http-party/node-http-proxy/pull/997)- Update ntlm-authentication.js [`#989`](https://github.com/http-party/node-http-proxy/pull/989)- Add expected datatype to readme [`#983`](https://github.com/http-party/node-http-proxy/pull/983)- Update README [`#982`](https://github.com/http-party/node-http-proxy/pull/982)- Fix formatting of the `headers` option [`#974`](https://github.com/http-party/node-http-proxy/pull/974)- Set the x-forwarded-host flag when xfwd is enabled [`#967`](https://github.com/http-party/node-http-proxy/pull/967)### Fixed- Sanitize header keys before setting them (#997) [`#996`](https://github.com/http-party/node-http-proxy/issues/996)### Commits- [dist] Update LICENSE to reflect 2015 changes. [`f345a1a`](https://github.com/http-party/node-http-proxy/commit/f345a1ac2dde1884e72b952a685a0a1796059f14)- [dist] Version bump. 1.13.3 [`5082acc`](https://github.com/http-party/node-http-proxy/commit/5082acc067bbf287f503bbd5b776f798ab169db1)## [1.13.2](https://github.com/http-party/node-http-proxy/compare/1.13.1...1.13.2) - 2016-02-17### Merged- Fixed missing documentation: #options.headers [`#806`](https://github.com/http-party/node-http-proxy/pull/806)- #949 Proxy example using req instead res on README [`#950`](https://github.com/http-party/node-http-proxy/pull/950)- mocha: Use default reporter [`#962`](https://github.com/http-party/node-http-proxy/pull/962)- Remove "transfer-encoding" header if "content-length" is set to zero [`#961`](https://github.com/http-party/node-http-proxy/pull/961)### Commits- [dist] Version bump. 1.13.2 [`e1b2f4c`](https://github.com/http-party/node-http-proxy/commit/e1b2f4c31b34464431db251b3b6169689dadf518)## [1.13.1](https://github.com/http-party/node-http-proxy/compare/1.13.0...1.13.1) - 2016-02-02### Merged- README.md: summary to specify reverse proxy [`#932`](https://github.com/http-party/node-http-proxy/pull/932)- fix(common) urlJoin replace: ":/" -> "http?s:/" [`#947`](https://github.com/http-party/node-http-proxy/pull/947)- Update README.md [`#948`](https://github.com/http-party/node-http-proxy/pull/948)### Commits- [dist] Version bump. 1.13.1 [`9d9fa94`](https://github.com/http-party/node-http-proxy/commit/9d9fa940cff3aa6134c60732c23aea8171fc7296)## [1.13.0](https://github.com/http-party/node-http-proxy/compare/1.12.1...1.13.0) - 2016-01-26### Merged- Fix for #839 (Ignore path and the trailing slash) [`#934`](https://github.com/http-party/node-http-proxy/pull/934)- Update license year range to 2016 [`#943`](https://github.com/http-party/node-http-proxy/pull/943)### Commits- [dist] Version bump. 1.13.0 [`268994e`](https://github.com/http-party/node-http-proxy/commit/268994ea45d9f8737343001ab9542e03023a5c96)## [1.12.1](https://github.com/http-party/node-http-proxy/compare/1.12.0...1.12.1) - 2016-01-24### Merged- Bump version for npm publish [`#942`](https://github.com/http-party/node-http-proxy/pull/942)- Added check to passes/web-outgoing.js to make sure the header being s… [`#940`](https://github.com/http-party/node-http-proxy/pull/940)- Created reverse-proxy.js example. [`#825`](https://github.com/http-party/node-http-proxy/pull/825)- SSE example and test [`#922`](https://github.com/http-party/node-http-proxy/pull/922)- More structured readme [`#912`](https://github.com/http-party/node-http-proxy/pull/912)- Updated markdown docs to mention proxy rules module [`#910`](https://github.com/http-party/node-http-proxy/pull/910)- Add tests for forwarding of continuation frames [`#901`](https://github.com/http-party/node-http-proxy/pull/901)- Bump requires-port, server and ws [`#904`](https://github.com/http-party/node-http-proxy/pull/904)- [example] add an example for NTLM authentication [`#903`](https://github.com/http-party/node-http-proxy/pull/903)### Commits- Organized README more [`cd1d777`](https://github.com/http-party/node-http-proxy/commit/cd1d7776e8fb5d67e2c52b9ef27d8c932e7b72e2)- Add tests for testing forwarding of continuation frames [`64fa520`](https://github.com/http-party/node-http-proxy/commit/64fa52078913c6d4fe95673f182aac4924961e8b)- Added back to top helpers [`6106d4c`](https://github.com/http-party/node-http-proxy/commit/6106d4c32f7c7960f0391591661e6f0d229db52d)- [ci] use node 4.2 to test and do not allow failures [`f82ce18`](https://github.com/http-party/node-http-proxy/commit/f82ce18d2f187b085c2c4f49d857755d21c582b1)- [fix] bump requires-port, server and ws [`9ea1e89`](https://github.com/http-party/node-http-proxy/commit/9ea1e89a2fd9c392cd40265bdb13494a3614e290)- Updated markdown docs to mention proxy rules [`eea79ca`](https://github.com/http-party/node-http-proxy/commit/eea79cab53f27371cad387a524ee3aaefa742c48)- Fixed tests depending on ignorePath [`f9540de`](https://github.com/http-party/node-http-proxy/commit/f9540de7b13f41091be2dcb68d8f23be65ad3885)- Added check to passes/web-outgoing.js to make sure the header being set is not undefined, which should be the only falsey value that could accidently show up and break that call. This fixes windows NTLM auth issues behind http-proxy. [`3b39d2c`](https://github.com/http-party/node-http-proxy/commit/3b39d2c3dcb1785cc06043fcb226c652f554941e)- No longer appends / to path if ignorePath is set [`f2093b5`](https://github.com/http-party/node-http-proxy/commit/f2093b5313c855cd6309cc0ddebb31f369e525ed)- README.md: introduction to specify reverse proxy [`41414a5`](https://github.com/http-party/node-http-proxy/commit/41414a56a11ddfac3a337711ac4c64124eb62377)- Added note for appending trailing / when using ignorePath [`0cb1d3c`](https://github.com/http-party/node-http-proxy/commit/0cb1d3c68e793fed9aa4a7624c32a018e796aa95)## [1.12.0](https://github.com/http-party/node-http-proxy/compare/1.11.3...1.12.0) - 2015-10-22### Merged- Issue #896: provide a "proxyReq" event also for websocket connections. [`#897`](https://github.com/http-party/node-http-proxy/pull/897)### Commits- Provide a "proxyReq" event also for websocket connections. [`a05fc2d`](https://github.com/http-party/node-http-proxy/commit/a05fc2d1692d038f1eaad6d9b26c174039bc1949)- fixes after PR review [`9752652`](https://github.com/http-party/node-http-proxy/commit/9752652e76da3bcfb6a635620e4162518ca43203)- [dist] Version bump. 1.12.0 [`b5a6d0e`](https://github.com/http-party/node-http-proxy/commit/b5a6d0e58396363f4c457f6d1654614bdfcfcb73)## [1.11.3](https://github.com/http-party/node-http-proxy/compare/1.11.2...1.11.3) - 2015-10-19### Merged- Removed unspecified trailing slash in proxy url [`#893`](https://github.com/http-party/node-http-proxy/pull/893)- Updating the upgrading doc [`#892`](https://github.com/http-party/node-http-proxy/pull/892)### Commits- [dist] Update .travis.yml to be more modern. [`302d981`](https://github.com/http-party/node-http-proxy/commit/302d981dd2cf06dbf751b1f64e3dfea08d0f9476)- [dist] Version bump. 1.11.3 [`60baca5`](https://github.com/http-party/node-http-proxy/commit/60baca5aed4f45ef1d7b3f7edd909375853d344b)- docs: options.headers [`c86ae51`](https://github.com/http-party/node-http-proxy/commit/c86ae51bb9658309a9628f4f5182d4c45c803b84)## [1.11.2](https://github.com/http-party/node-http-proxy/compare/v1.11.1...1.11.2) - 2015-08-30### Merged- Update gzip-middleware.js [`#870`](https://github.com/http-party/node-http-proxy/pull/870)- Fix broken option list indentation [`#863`](https://github.com/http-party/node-http-proxy/pull/863)- Added missing configuration options [`#852`](https://github.com/http-party/node-http-proxy/pull/852)- Added installation instructions [`#823`](https://github.com/http-party/node-http-proxy/pull/823)- fixes comment [`#817`](https://github.com/http-party/node-http-proxy/pull/817)### Commits- Created reverse-proxy.js example. [`38864d0`](https://github.com/http-party/node-http-proxy/commit/38864d016794b9ff3d8d1d1cb81a730b40a1bf9c)- Added websocket set-cookie headers test [`855cebd`](https://github.com/http-party/node-http-proxy/commit/855cebdac4d33ef5f2fab4c4c78fdc07cdb61402)- [fix] make more functional [`cea0e86`](https://github.com/http-party/node-http-proxy/commit/cea0e8676b3e609828320bb03051eaf78cc43b54)- Modify the set-cookie header fix to work with node 0.10.x. [`da674ec`](https://github.com/http-party/node-http-proxy/commit/da674ec4df2b371f09e912f3b376c48581090a0f)- Use raw headers instead parsed. [`8bfd90c`](https://github.com/http-party/node-http-proxy/commit/8bfd90c4d9331fd129f17a788ef9fc733654b7e0)- Replaced Object.keys().map with for in loop. [`3d2350c`](https://github.com/http-party/node-http-proxy/commit/3d2350c54ff0fb9271f5fcfea1d23f22ad97c47c)- [dist] Version bump. 1.11.2 [`30e3b37`](https://github.com/http-party/node-http-proxy/commit/30e3b371de0116e40e15156394f31c7e0b0aa9f1)- Websocket key was unnecessary long. [`ca73208`](https://github.com/http-party/node-http-proxy/commit/ca732087498582df01ab78fb7da77912dab8f138)## [v1.11.1](https://github.com/http-party/node-http-proxy/compare/v1.11.0...v1.11.1) - 2015-04-22### Commits- [dist] Version bump. 1.11.1 [`7e6c66a`](https://github.com/http-party/node-http-proxy/commit/7e6c66a7e485a6c0ec3a1c567bbe800fdc56c9fd)- [fix] dont use bind in the one case we do [`d26ef56`](https://github.com/http-party/node-http-proxy/commit/d26ef56e1bc2a1232b06c01b4740e3bf35d63eda)- [dist] update to new version of EE3 [`607f96c`](https://github.com/http-party/node-http-proxy/commit/607f96c00cbda2a6b881b8ff1db05437dbf4ce77)- [fix] use the main export for EE3 [`18c77ca`](https://github.com/http-party/node-http-proxy/commit/18c77cafc7d5479502cf5c4d2b663d8f85cfd6d4)## [v1.11.0](https://github.com/http-party/node-http-proxy/compare/v1.10.1...v1.11.0) - 2015-04-20### Merged- [api] add an ignorePath option if you want to disregard the path of the ... [`#759`](https://github.com/http-party/node-http-proxy/pull/759)### Commits- [dist] Version bump. 1.11.0 [`934e6c4`](https://github.com/http-party/node-http-proxy/commit/934e6c4d54292a1b961452074e02fb5d45da729a)## [v1.10.1](https://github.com/http-party/node-http-proxy/compare/v1.10.0...v1.10.1) - 2015-04-02### Merged- Fix default port detection with node 0.12.x [`#799`](https://github.com/http-party/node-http-proxy/pull/799)### Commits- [dist] add semver and normalize package.json with --save-dev [`1b89bc9`](https://github.com/http-party/node-http-proxy/commit/1b89bc9a76c229070ff2572f7a0e1b969c4b4701)- fix protocol and default port detection on node 0.12.x, compatible with 0.10.x [`5f14bca`](https://github.com/http-party/node-http-proxy/commit/5f14bcaa704fe8a5e6f59d3a89722f22958cade9)- fix expected error message when node 0.12.x [`0ee314c`](https://github.com/http-party/node-http-proxy/commit/0ee314c436226391318b9a1b623cb3f7e8bf4df7)- force cipher AES128-GCM-SHA256 in https tests [`c33d161`](https://github.com/http-party/node-http-proxy/commit/c33d1616cdbd60587ca2eb326c48b8a87ac56092)- [fix] properly support iojs with test checking for HTTPS [`c6dfb04`](https://github.com/http-party/node-http-proxy/commit/c6dfb04a67f3b5ac9a402b7b08c1b8baf29f89e6)- [dist] Version bump. 1.10.1 [`0bd446c`](https://github.com/http-party/node-http-proxy/commit/0bd446c680e9991accfaa3a6a70e411fdac79164)- [ci] add 0.12 and iojs to travis [`a6ae6c4`](https://github.com/http-party/node-http-proxy/commit/a6ae6c499743ddade9db12b9f7404d980c79f683)## [v1.10.0](https://github.com/http-party/node-http-proxy/compare/v1.9.1...v1.10.0) - 2015-04-01### Merged- Fixes / additions to URL rewriting [`#787`](https://github.com/http-party/node-http-proxy/pull/787)### Commits- [dist] Version bump. 1.10.0 [`1dabda2`](https://github.com/http-party/node-http-proxy/commit/1dabda241f3b93eb9195134042e7a3b84fd0ef57)## [v1.9.1](https://github.com/http-party/node-http-proxy/compare/v1.9.0...v1.9.1) - 2015-04-01### Merged- Fix #747 [`#798`](https://github.com/http-party/node-http-proxy/pull/798)### Fixed- Merge pull request #798 from damonmcminn/master [`#747`](https://github.com/http-party/node-http-proxy/issues/747)- Fix https://github.com/nodejitsu/node-http-proxy/issues/747 [`#747`](https://github.com/nodejitsu/node-http-proxy/issues/747)### Commits- Add test for https://github.com/nodejitsu/node-http-proxy/issues/747 [`d145152`](https://github.com/http-party/node-http-proxy/commit/d145152655a69479348b0ebc726d4dc19720a12b)- [dist] Version bump. 1.9.1 [`21b30b7`](https://github.com/http-party/node-http-proxy/commit/21b30b754db4f6410c3d2052bc123b3fdae57c46)## [v1.9.0](https://github.com/http-party/node-http-proxy/compare/v1.8.1...v1.9.0) - 2015-03-12### Merged- Adding the nodejs0.12 auth option [`#792`](https://github.com/http-party/node-http-proxy/pull/792)- fix "x-forwarded-proto" in node 0.12 and iojs [`#789`](https://github.com/http-party/node-http-proxy/pull/789)- Add support for auto host rewriting and protocol rewriting [`#1`](https://github.com/http-party/node-http-proxy/pull/1)- changed highlighted part - very minor [`#756`](https://github.com/http-party/node-http-proxy/pull/756)- Update README.md for benchmarks [`#625`](https://github.com/http-party/node-http-proxy/pull/625)### Fixed- fix "x-forwarded-proto" in node 0.12 and iojs [`#772`](https://github.com/http-party/node-http-proxy/issues/772)- [api] add an ignorePath option if you want to disregard the path of the incoming request when proxying to the target server fixes #758 [`#758`](https://github.com/http-party/node-http-proxy/issues/758)### Commits- added auth header test [`df158bf`](https://github.com/http-party/node-http-proxy/commit/df158bfc53e35e62609d8169f3883f6dcf12b73c)- added auth header test [`ff1626f`](https://github.com/http-party/node-http-proxy/commit/ff1626f0719652c92895cf80f9aacc22ededadad)- refactor some tests for greater readability [`14415a5`](https://github.com/http-party/node-http-proxy/commit/14415a50741d1f258da884686455d87d68eb8121)- only rewrite redirect urls when it matches target [`26029ba`](https://github.com/http-party/node-http-proxy/commit/26029ba7ac948b5dc0befb2091cc9a5862d0641c)- auth header added [`ab5c3e5`](https://github.com/http-party/node-http-proxy/commit/ab5c3e5c819ca993e0616d178bc1d282af539508)- [dist] Version bump. 1.9.0 [`87a92a7`](https://github.com/http-party/node-http-proxy/commit/87a92a72802a27f817fcba87382d55831fd04ddb)- end of file line space [`e907d7b`](https://github.com/http-party/node-http-proxy/commit/e907d7bb2aa2825b43d9355cb1ee25bec47b15ad)- space instead of tabs [`7298510`](https://github.com/http-party/node-http-proxy/commit/7298510e9170d74ff057487085bc1e898f044177)- space instead of tabs [`63c9262`](https://github.com/http-party/node-http-proxy/commit/63c9262df5bd04d83432db44fce2a4d5b19a59ea)- auth header added tests [`f55ffa3`](https://github.com/http-party/node-http-proxy/commit/f55ffa356a259c09685c6b768a404e4b73f674ce)## [v1.8.1](https://github.com/http-party/node-http-proxy/compare/v1.8.0...v1.8.1) - 2014-12-17### Commits- Pass HTTPS client parameters. [`402ab05`](https://github.com/http-party/node-http-proxy/commit/402ab057340a29db7a521ff239c5e21ac0c12be8)- [dist] Version bump. 1.8.1 [`3311106`](https://github.com/http-party/node-http-proxy/commit/3311106c2c2346f3ac1ffe402b80bca3c7c59275)## [v1.8.0](https://github.com/http-party/node-http-proxy/compare/v1.7.3...v1.8.0) - 2014-12-17### Merged- Fix variables scope in test [`#752`](https://github.com/http-party/node-http-proxy/pull/752)- Fix typo [`#751`](https://github.com/http-party/node-http-proxy/pull/751)### Commits- Added websocket close event test [`8bff3dd`](https://github.com/http-party/node-http-proxy/commit/8bff3ddc1276e3ba18fd68c34d8982148cd21455)- Deprecated proxySocket event in favor to open event. [`c62610e`](https://github.com/http-party/node-http-proxy/commit/c62610e8e4d59e8ba4642370ff3fb933c6ddb4eb)- Update README.md [`05d18a4`](https://github.com/http-party/node-http-proxy/commit/05d18a4e1ba6c2de41b0b803cd1793357979384d)- [fix] style spacing wtf [`ea0a4de`](https://github.com/http-party/node-http-proxy/commit/ea0a4ded803b30144e442344ad5a38a0d34bb3ba)- [api] add close event in ws-incoming.js [`2653786`](https://github.com/http-party/node-http-proxy/commit/26537866b3ca522927aa4604a958f90774c0c0c0)- [minor] grammar [`f304861`](https://github.com/http-party/node-http-proxy/commit/f30486195cfa6cfcf6400ac445975d5adada72e4)- Changed proxyServer and destiny to local variables. [`8a8a894`](https://github.com/http-party/node-http-proxy/commit/8a8a894092ddbec8f0365ced0e94a75b1307ecf1)- [dist] Version bump. 1.8.0 [`f0db5b3`](https://github.com/http-party/node-http-proxy/commit/f0db5b3f708b0858f617d472dfdd0ba211b774ef)## [v1.7.3](https://github.com/http-party/node-http-proxy/compare/v1.7.2...v1.7.3) - 2014-12-09### Fixed- [fix] use simple regex instead of indexOf to check the protocol to support without the colon fixes #711 [`#711`](https://github.com/http-party/node-http-proxy/issues/711)### Commits- [test] show that we support protocol without the colon [`89f9ca1`](https://github.com/http-party/node-http-proxy/commit/89f9ca1e89d679b2b85a8f85b65e8b0878694207)- [dist] Version bump. 1.7.3 [`6a330ff`](https://github.com/http-party/node-http-proxy/commit/6a330ff904d02a41f9a1cac338a98da1849c54ca)## [v1.7.2](https://github.com/http-party/node-http-proxy/compare/v1.7.1...v1.7.2) - 2014-12-08### Merged- Fix grammar in README.md [`#749`](https://github.com/http-party/node-http-proxy/pull/749)### Fixed- [fix] properly include port in host header with changeOrigin in all cases fixes #750 [`#750`](https://github.com/http-party/node-http-proxy/issues/750)### Commits- [test] add tests for the changeOrigin cases in properly setting the host header [`71a06aa`](https://github.com/http-party/node-http-proxy/commit/71a06aab0249487ff650c8a47906cc8281561664)- [dist] pin down deps and add requires-port [`81874f7`](https://github.com/http-party/node-http-proxy/commit/81874f795b7df7929e03d9d4cb98a947b1ef114b)- [dist] Version bump. 1.7.2 [`2086e49`](https://github.com/http-party/node-http-proxy/commit/2086e4917c97f347f84c54b166799bc8db9f4162)## [v1.7.1](https://github.com/http-party/node-http-proxy/compare/v1.7.0...v1.7.1) - 2014-12-02### Merged- Adding harmon to the README [`#716`](https://github.com/http-party/node-http-proxy/pull/716)### Fixed- [fix] fix #738 [`#738`](https://github.com/http-party/node-http-proxy/issues/738)- [fix] simple fixes #748 #744 #746 [`#748`](https://github.com/http-party/node-http-proxy/issues/748)### Commits- [test] add proper failing test case for #738 [`410a8ce`](https://github.com/http-party/node-http-proxy/commit/410a8ce94ccea566a8e50daf3b78e633b82875cb)- [Bugfix] Allow for multiple ? in outgoing urls. [`70ed1c4`](https://github.com/http-party/node-http-proxy/commit/70ed1c4273bc64500e8bae9b60d7fd6a19135246)- [dist] Version bump. 1.7.1 [`56a7b77`](https://github.com/http-party/node-http-proxy/commit/56a7b77645b13d337c1a2f879460193d310454c8)## [v1.7.0](https://github.com/http-party/node-http-proxy/compare/v1.6.2...v1.7.0) - 2014-11-25### Merged- Allow optional redirect host rewriting. [`#741`](https://github.com/http-party/node-http-proxy/pull/741)- Set `Content-Length` header for OPTIONS requests [`#742`](https://github.com/http-party/node-http-proxy/pull/742)- copy headers instead of referencing them so they don't unexpectedly get overwritten [`#736`](https://github.com/http-party/node-http-proxy/pull/736)- Updated to support error callback on proxy.web and start/proxyReq/end co... [`#735`](https://github.com/http-party/node-http-proxy/pull/735)### Commits- :pencil: Add host rewrite docs and specs. [`add8133`](https://github.com/http-party/node-http-proxy/commit/add81338a90dae132f9e74fd5a5905fbcef030b7)- [minor] style consistency [`48ae5d8`](https://github.com/http-party/node-http-proxy/commit/48ae5d828c23d6f19c9e2dd8c922d88a09f5ed0f)- Updated to support error callback on proxy.web and start/proxyReq/end continue working. [`9ba8311`](https://github.com/http-party/node-http-proxy/commit/9ba8311343fd01b32505b8607ecf4294200f9dde)- style changes [`84036e9`](https://github.com/http-party/node-http-proxy/commit/84036e9ddd1d4d925006c5438b3bcc0f17ba7a48)- [fix] be defensive and ensure location is in headers before running url.parse() [`8d68ac0`](https://github.com/http-party/node-http-proxy/commit/8d68ac0e0fa3080b31580aa08e92a46cc1f27696)- [dist] Version bump. 1.7.0 [`276f65a`](https://github.com/http-party/node-http-proxy/commit/276f65a3b810ded01757ec4bfd4fe2b00a1e66a8)## [v1.6.2](https://github.com/http-party/node-http-proxy/compare/v1.6.1...v1.6.2) - 2014-11-11### Merged- do not modify the query string [`#733`](https://github.com/http-party/node-http-proxy/pull/733)### Commits- [fix] style changes [`7c5e40a`](https://github.com/http-party/node-http-proxy/commit/7c5e40a429fbc0c538f38d29d74acb633cb9b8d4)- [minor] this shouldnt be in var block [`3f19e6e`](https://github.com/http-party/node-http-proxy/commit/3f19e6e178e168a16beee74186691f3e0e54d517)- [dist] Version bump. 1.6.2 [`709b3e9`](https://github.com/http-party/node-http-proxy/commit/709b3e96560d619fab2617f9ddb902b4982b4103)## [v1.6.1](https://github.com/http-party/node-http-proxy/compare/v1.6.0...v1.6.1) - 2014-11-04### Merged- websocket needs to respect `options.secure` too [`#729`](https://github.com/http-party/node-http-proxy/pull/729)- changeOrigin option docs fix [`#724`](https://github.com/http-party/node-http-proxy/pull/724)### Commits- [dist] Version bump. 1.6.1 [`fa797fc`](https://github.com/http-party/node-http-proxy/commit/fa797fca900c10ebc848a2b445204b47da799483)## [v1.6.0](https://github.com/http-party/node-http-proxy/compare/v1.5.3...v1.6.0) - 2014-10-29### Merged- Added changeOrigin option with test and docs [`#723`](https://github.com/http-party/node-http-proxy/pull/723)- I presume you mean couchdb here [`#717`](https://github.com/http-party/node-http-proxy/pull/717)- update modify request body eg [`#712`](https://github.com/http-party/node-http-proxy/pull/712)### Commits- harmon notes [`9f684d0`](https://github.com/http-party/node-http-proxy/commit/9f684d0439174d889d7b9a4ef6e2353e09481b2d)- [dist] Version bump. 1.6.0 [`43641b0`](https://github.com/http-party/node-http-proxy/commit/43641b00b34ccc05bdf09f904695061d7c857aeb)## [v1.5.3](https://github.com/http-party/node-http-proxy/compare/v1.5.2...v1.5.3) - 2014-10-01### Merged- close socket if upstream request fails [`#709`](https://github.com/http-party/node-http-proxy/pull/709)### Commits- [dist] Version bump. 1.5.3 [`9577a0f`](https://github.com/http-party/node-http-proxy/commit/9577a0faf2b78af606168673407ac47a851c084c)## [v1.5.2](https://github.com/http-party/node-http-proxy/compare/v1.5.1...v1.5.2) - 2014-10-01### Merged- close websocket if proxyReq is closed before upgrade [`#708`](https://github.com/http-party/node-http-proxy/pull/708)### Commits- test closing upstream socket prior to upgrade [`7730548`](https://github.com/http-party/node-http-proxy/commit/77305489d9b88d283802477e155340e5dacfcc2c)- [dist] Version bump. 1.5.2 [`43c6f0c`](https://github.com/http-party/node-http-proxy/commit/43c6f0c7c06d25a670c410500a8623531df458b1)## [v1.5.1](https://github.com/http-party/node-http-proxy/compare/v1.5.0...v1.5.1) - 2014-09-30### Commits- [fix] do a check to make sure the server exists before we try and emit [`10a294a`](https://github.com/http-party/node-http-proxy/commit/10a294af4d4baac30b98ea9bec683a974443b83d)- [dist] Version bump. 1.5.1 [`f0bf741`](https://github.com/http-party/node-http-proxy/commit/f0bf7418156db2cb87a616b0a34bb1f028db9142)## [v1.5.0](https://github.com/http-party/node-http-proxy/compare/v1.4.3...v1.5.0) - 2014-09-30### Merged- exposing proxySocket on socket to support sniffing messages coming from proxy target [`#706`](https://github.com/http-party/node-http-proxy/pull/706)- Fixed misleading documentation [`#705`](https://github.com/http-party/node-http-proxy/pull/705)- Fix typo in README.md [`#702`](https://github.com/http-party/node-http-proxy/pull/702)- handle 'upgrade' in comma-separated connection header [`#691`](https://github.com/http-party/node-http-proxy/pull/691)### Commits- test new detection of connection: upgrade [`ec683b9`](https://github.com/http-party/node-http-proxy/commit/ec683b924b1ef8cbdd2cd2bfb7e141b502773163)- emitting proxySocket on proxyServer [`000eb53`](https://github.com/http-party/node-http-proxy/commit/000eb533de144cad01cfd97edf9ab6c350593d3c)- [fix] perf optimization so we have a precompiled regexp [`c0a796b`](https://github.com/http-party/node-http-proxy/commit/c0a796b3e31de4f22eef00d93164e7238d9aa3ba)- use regex to check for upgrade header [`65a21bc`](https://github.com/http-party/node-http-proxy/commit/65a21bce6dbbc6142a851dc959e237c0ef2b1091)- [dist] Version bump. 1.5.0 [`232258b`](https://github.com/http-party/node-http-proxy/commit/232258b6ec2229497fe557454a121d917968f5e8)- [minor] extra space [`e7d50b1`](https://github.com/http-party/node-http-proxy/commit/e7d50b1a376035a50c82db38605e99feb30afd36)## [v1.4.3](https://github.com/http-party/node-http-proxy/compare/v1.4.2...v1.4.3) - 2014-09-12### Merged- Urgent: Fix breaking bug on url joining resulting in paths like `///path`. [`#699`](https://github.com/http-party/node-http-proxy/pull/699)### Commits- [minor] Added missing JSDoc comments [`73e8a4c`](https://github.com/http-party/node-http-proxy/commit/73e8a4cdd576868bf61d0848cc51f083a75454f9)- Fix breaking bug on url joining resulting in paths like `///path`. [`73d865b`](https://github.com/http-party/node-http-proxy/commit/73d865bc9f8940f61c1ad4812f220920ead553b5)- [minor] Code style adjustment. [`3ab6e95`](https://github.com/http-party/node-http-proxy/commit/3ab6e9591e66c203647605b4f275d374472c9d5f)- Bump version v1.4.3 [`554f59c`](https://github.com/http-party/node-http-proxy/commit/554f59c5182d58b359df0159a29ff5ea35dd3830)- [ignore] Ignore npm-debug.log [`a934cb6`](https://github.com/http-party/node-http-proxy/commit/a934cb6a46298c380e9bc794f18873576cf73c4c)## [v1.4.2](https://github.com/http-party/node-http-proxy/compare/v1.4.1...v1.4.2) - 2014-09-12### Commits- [fix] ensure path works on windows because path.join doesnt like URLs [`ed73f06`](https://github.com/http-party/node-http-proxy/commit/ed73f06ed307ad2204e565781cc3154047941a8c)- [dist] Version bump. 1.4.2 [`df12aeb`](https://github.com/http-party/node-http-proxy/commit/df12aeb12de79de1157898d45f4347fd0037dd70)## [v1.4.1](https://github.com/http-party/node-http-proxy/compare/v1.3.1...v1.4.1) - 2014-09-11### Merged- Trimming contents of distributed npm package. [`#644`](https://github.com/http-party/node-http-proxy/pull/644)- Remove changelog - it was not maintained [`#669`](https://github.com/http-party/node-http-proxy/pull/669)- Removed duplicated imported dependencies [`#695`](https://github.com/http-party/node-http-proxy/pull/695)### Commits- [test] add test for prependPath option [`e44fabe`](https://github.com/http-party/node-http-proxy/commit/e44fabe58a233b367d42f26f15113e2022f71d7b)- [api] add prependPath option to go with path change [`9a534c6`](https://github.com/http-party/node-http-proxy/commit/9a534c6ff63d776140918bc839801d247affd18d)- [dist] Version bump. 1.4.1 [`d5c656b`](https://github.com/http-party/node-http-proxy/commit/d5c656bceb50dc9008ef223bc58b918adcf05352)- [dist] Version bump. 1.4.0 [`dceef40`](https://github.com/http-party/node-http-proxy/commit/dceef407a1130033679e7e836c6753b76187ce5f)## [v1.3.1](https://github.com/http-party/node-http-proxy/compare/v1.3.0...v1.3.1) - 2014-09-09### Merged- Allow proxy to maintain the original target path [`#693`](https://github.com/http-party/node-http-proxy/pull/693)- Clarify usable parameters for 'proxyRes' event [`#686`](https://github.com/http-party/node-http-proxy/pull/686)### Commits- fix tests for maintaining proxy path [`a65021d`](https://github.com/http-party/node-http-proxy/commit/a65021d52b0ee039486819b5a95f442229458776)- Fix proxy path [`511b7b3`](https://github.com/http-party/node-http-proxy/commit/511b7b3d4743636de9d9fbe8ff409730d221d273)- Clarify usable parameters for proxyRes event. [`49a0de1`](https://github.com/http-party/node-http-proxy/commit/49a0de1e7cdcec9b555695605ab914038f99d66b)- [dist] Version bump. 1.3.1 [`fc73828`](https://github.com/http-party/node-http-proxy/commit/fc73828035baf3cea3664560f8964f2a2a200d0a)- [ci] remove 0.11.x to avoid failing builds caused by TLS errors [`6b83ae4`](https://github.com/http-party/node-http-proxy/commit/6b83ae47bbf2d5eab8ac94b4d6130e09a21ac85b)## [v1.3.0](https://github.com/http-party/node-http-proxy/compare/v1.2.1...v1.3.0) - 2014-08-14### Merged- Added functionality to close proxy. [`#679`](https://github.com/http-party/node-http-proxy/pull/679)### Commits- [fix] cleanup and stylize close function [`261742a`](https://github.com/http-party/node-http-proxy/commit/261742a4295268ef93f45aa0f1e3a04208a2aed3)- updated close function for safety [`8be9d94`](https://github.com/http-party/node-http-proxy/commit/8be9d945d03169056bbf84d702292b5763b015dc)- [dist] Version bump. 1.3.0 [`05f0b89`](https://github.com/http-party/node-http-proxy/commit/05f0b891a610fb7779f90916fcd9ed750df818b2)## [v1.2.1](https://github.com/http-party/node-http-proxy/compare/v1.2.0...v1.2.1) - 2014-08-14### Commits- Added close method to proxy server. [`a3d0219`](https://github.com/http-party/node-http-proxy/commit/a3d02196c5e62cd58bc0ebe8a66afcdb905d96b3)- [fix] emit an error if proper URL is not passed in as a target [`37036dd`](https://github.com/http-party/node-http-proxy/commit/37036dd32565f72ad5777e47509293db18b60ed3)- [dist] Version bump. 1.2.1 [`0a6b424`](https://github.com/http-party/node-http-proxy/commit/0a6b424e2c3b6cef68362a71f0e56740b2605af7)## [v1.2.0](https://github.com/http-party/node-http-proxy/compare/v1.1.6...v1.2.0) - 2014-08-05### Merged- [api] Add event-based ability to modify pre-flight proxy requests. [`#673`](https://github.com/http-party/node-http-proxy/pull/673)### Commits- [dist] Version bump. 1.2.0 [`63c53a1`](https://github.com/http-party/node-http-proxy/commit/63c53a177217283ec14e4f7c2e891db48842ab4b)## [v1.1.6](https://github.com/http-party/node-http-proxy/compare/v1.1.5...v1.1.6) - 2014-07-17### Fixed- do proper checking for a pass not existing. fixes #671 [`#671`](https://github.com/http-party/node-http-proxy/issues/671)### Commits- Remove changelog - it was not maintained [`e336b52`](https://github.com/http-party/node-http-proxy/commit/e336b52629276e647abeee300d7091db44e5b885)- [dist] Version bump. 1.1.6 [`ed9e12b`](https://github.com/http-party/node-http-proxy/commit/ed9e12b0edb0fc206610e94bd696425619868474)## [v1.1.5](https://github.com/http-party/node-http-proxy/compare/v1.1.4...v1.1.5) - 2014-07-10### Merged- Fix simple-balancer example [`#666`](https://github.com/http-party/node-http-proxy/pull/666)- Added proxyTimeout option and two tests for timeout [`#658`](https://github.com/http-party/node-http-proxy/pull/658)### Fixed- Fix #657 [`#657`](https://github.com/http-party/node-http-proxy/issues/657)- Fix #657 [`#657`](https://github.com/http-party/node-http-proxy/issues/657)### Commits- Added targetTimeout option and two tests for timeout [`0f24351`](https://github.com/http-party/node-http-proxy/commit/0f243516e1c6737b95fba220a5028439264b5de6)- Change name targetTimeout to proxyTimeout [`7b79a74`](https://github.com/http-party/node-http-proxy/commit/7b79a7409ade7a8c79b2ae5761abc4843529063a)- Trimming contents of distributed npm package. [`431aba7`](https://github.com/http-party/node-http-proxy/commit/431aba79d8d521e228c1403aaf4fd4a26fba03c3)- [api] also emit the target on a proxy error [`d1baa36`](https://github.com/http-party/node-http-proxy/commit/d1baa3684e449610a2aae270816a7b8a907e588e)- [dist] Version bump. 1.1.5 [`7104a7c`](https://github.com/http-party/node-http-proxy/commit/7104a7c023073a49091969f825738c79ae036123)- fix balancer example [`9df4bc1`](https://github.com/http-party/node-http-proxy/commit/9df4bc1e1216a8e53675f0be16fb9081c11da225)## [v1.1.4](https://github.com/http-party/node-http-proxy/compare/v1.1.3...v1.1.4) - 2014-05-11### Merged- `proxyRes` event, provide access to the req and res objects [`#642`](https://github.com/http-party/node-http-proxy/pull/642)### Commits- Add a test for the proxyRes event [`1385635`](https://github.com/http-party/node-http-proxy/commit/1385635e18f081af759c8e088f2f6b0219df83db)- [dist] Version bump. 1.1.4 [`7cb98a4`](https://github.com/http-party/node-http-proxy/commit/7cb98a4e417312f01cf4432b52dbb3773aca60a0)- Add the req and res objects to the proxyRes event [`1213e46`](https://github.com/http-party/node-http-proxy/commit/1213e46b1b0975ad1d5c5d0aaeace40a0811118f)## [v1.1.3](https://github.com/http-party/node-http-proxy/compare/v1.1.2...v1.1.3) - 2014-05-11### Merged- Don't override connection header if Upgrading [`#640`](https://github.com/http-party/node-http-proxy/pull/640)### Commits- Adding test cases on preventing upgrade override [`8aa7c51`](https://github.com/http-party/node-http-proxy/commit/8aa7c519b15f734af7db34d2102781adbeae10aa)- Update README.md for benchmarks [`4947484`](https://github.com/http-party/node-http-proxy/commit/4947484806f839d5e0a1b615b56a1bc847b8f534)- [minor] style [`ccad177`](https://github.com/http-party/node-http-proxy/commit/ccad17795417de74bea2bcb6d6c559a4601af76d)- [dist] Version bump. 1.1.3 [`c472527`](https://github.com/http-party/node-http-proxy/commit/c472527ea60da8b2f737d5742bc61ad2772b7e0b)## [v1.1.2](https://github.com/http-party/node-http-proxy/compare/v1.1.1...v1.1.2) - 2014-04-14### Commits- [fix test] handle proxy error since we are properly aborting the proxy Request [`61c8734`](https://github.com/http-party/node-http-proxy/commit/61c8734e8b1115fab0e0db23fd8eeccbae61eee0)- [fix] handle error on incoming request as well and properly abort proxy if client request is aborted [`77a1cff`](https://github.com/http-party/node-http-proxy/commit/77a1cff9bcf697eab27819eef054024bdc0a2ba3)- [dist] Version bump. 1.1.2 [`c54278b`](https://github.com/http-party/node-http-proxy/commit/c54278bd3b00e82f4253393b6f6beb1d5a1b19e5)## [v1.1.1](https://github.com/http-party/node-http-proxy/compare/v1.1.0...v1.1.1) - 2014-04-11### Commits- [dist] Version bump. 1.1.1 [`d908e2a`](https://github.com/http-party/node-http-proxy/commit/d908e2ad61013ed1f6e2f80c4b67a6dce7d0f504)- [fix] let user make the decision on what to do with the buffer [`4f07dc2`](https://github.com/http-party/node-http-proxy/commit/4f07dc220d700ac90bd8405f7cb0724bdae4b430)## [v1.1.0](https://github.com/http-party/node-http-proxy/compare/v1.0.3...v1.1.0) - 2014-04-09### Merged- Update UPGRADING.md [`#616`](https://github.com/http-party/node-http-proxy/pull/616)### Fixed- [fix] always be an eventemitter for consistency fixes #606 [`#606`](https://github.com/http-party/node-http-proxy/issues/606)### Commits- [api] emit a start an an end event [`8b48a9f`](https://github.com/http-party/node-http-proxy/commit/8b48a9fdab01624f7249c53f25919b1295eefb10)- [dist] Version bump. 1.1.0 [`97ceeb3`](https://github.com/http-party/node-http-proxy/commit/97ceeb37d04e5d2195352365985165866323c4d7)- [minor] missing angle bracket [`eca765a`](https://github.com/http-party/node-http-proxy/commit/eca765a856164c077ff9128949019552cdaf9a67)## [v1.0.3](https://github.com/http-party/node-http-proxy/compare/v1.0.2...v1.0.3) - 2014-03-27### Merged- Fix for #591 [`#592`](https://github.com/http-party/node-http-proxy/pull/592)- Add Repository field to package.json [`#578`](https://github.com/http-party/node-http-proxy/pull/578)- Fix doc: option lines [`#575`](https://github.com/http-party/node-http-proxy/pull/575)### Fixed- [api] add toProxy method to allow absolute URLs to be sent when sending to another proxy fixes #603 [`#603`](https://github.com/http-party/node-http-proxy/issues/603)### Commits- [doc] update docs with toProxy option [`ece85b4`](https://github.com/http-party/node-http-proxy/commit/ece85b4e1ba379b3ed084bd8f606e285c14d4db3)- [fix] set connection to CLOSE in cases where the agent is false. [`89a22bc`](https://github.com/http-party/node-http-proxy/commit/89a22bc00396f069eeb054ce30891a204077d16d)- @xtreme-topher-bullock - update package.json to have proper repository key and formatting [`68fa17b`](https://github.com/http-party/node-http-proxy/commit/68fa17bbcaa73ae2d9539cba6f6ddff29f9e30d5)- [dist] Version bump. 1.0.3 [`07fceb7`](https://github.com/http-party/node-http-proxy/commit/07fceb7c7aed25a8991d0295db4b4a7e50d79cf9)- Add support for localAddress [`e633b0f`](https://github.com/http-party/node-http-proxy/commit/e633b0f7e4fd719d809eaeb4725e589f79c271ab)## [v1.0.2](https://github.com/http-party/node-http-proxy/compare/v1.0.1...v1.0.2) - 2014-01-28### Merged- Update README.md [`#566`](https://github.com/http-party/node-http-proxy/pull/566)- Fix argument order for ws stream pass [`#560`](https://github.com/http-party/node-http-proxy/pull/560)- Extend listen to enable IPv6 support. [`#558`](https://github.com/http-party/node-http-proxy/pull/558)- Fix before and after type check [`#556`](https://github.com/http-party/node-http-proxy/pull/556)### Fixed- Close outgoing ws if incoming ws emits error [`#559`](https://github.com/http-party/node-http-proxy/issues/559)- [fix] closes #555 [`#555`](https://github.com/http-party/node-http-proxy/issues/555)### Commits- [fix] replicate node core behavior and throw an error if the user does not add their own error listener [`daad470`](https://github.com/http-party/node-http-proxy/commit/daad4703f3a80014936c89f4d67affdc3246f478)- [dist] Version bump. 1.0.2 [`4bdc3e4`](https://github.com/http-party/node-http-proxy/commit/4bdc3e4f455b2749c03961404db74e3112a3e9e8)- [doc] Fix broken image in npm by using an absolute link [`8004f4e`](https://github.com/http-party/node-http-proxy/commit/8004f4e5fc0f535806e92ec4e1bd973a45367dac)## [v1.0.1](https://github.com/http-party/node-http-proxy/compare/v1.0.0...v1.0.1) - 2014-01-17### Fixed- [fix] closes #553 [`#553`](https://github.com/http-party/node-http-proxy/issues/553)### Commits- [dist] bump v1.0.1 [`68c5512`](https://github.com/http-party/node-http-proxy/commit/68c55123039369cdf8a55a64b36b719c96b672cf)- typo [`689459f`](https://github.com/http-party/node-http-proxy/commit/689459fe46885a1b3b8e32a4df55f2d1339143e5)## [v1.0.0](https://github.com/http-party/node-http-proxy/compare/v0.10.4...v1.0.0) - 2014-01-16### Merged- Http proxy 1.0 [`#552`](https://github.com/http-party/node-http-proxy/pull/552)- Caronte [`#551`](https://github.com/http-party/node-http-proxy/pull/551)- Only emit response if a valid server is present [`#549`](https://github.com/http-party/node-http-proxy/pull/549)- [fix] add `type` to before and after to grab correct `passes`, fixes #537 [`#539`](https://github.com/http-party/node-http-proxy/pull/539)- export the proxy itself from the main require [`#536`](https://github.com/http-party/node-http-proxy/pull/536)### Fixed- [fix] closes #547 [`#547`](https://github.com/http-party/node-http-proxy/issues/547)- Merge pull request #539 from nodejitsu/fix-before-after [`#537`](https://github.com/http-party/node-http-proxy/issues/537)- [fix] add `type` to before and after to grab correct `passes`, fixes #537 [`#537`](https://github.com/http-party/node-http-proxy/issues/537)### Commits- [nuke] old files [`a4ee8f9`](https://github.com/http-party/node-http-proxy/commit/a4ee8f9d82f71ef423c401b1f5e9f712b13cbc98)- [docs] upgrade UPGRADING.md [`e599151`](https://github.com/http-party/node-http-proxy/commit/e5991519dbc7838aa4b8aeb5077d1c1ec5a13813)- [api] export the httpProxy.Server as the main export but preserve the createServer factory [`182c76c`](https://github.com/http-party/node-http-proxy/commit/182c76cd2322d4d4c041c2a964d51db396c5c96b)- [fix] remove caronte [`d6d2d0c`](https://github.com/http-party/node-http-proxy/commit/d6d2d0c8821bba9888eee7c3881fc408b3b2008e)- [fix] ee3 error handling [`d23353d`](https://github.com/http-party/node-http-proxy/commit/d23353d980d8aa1b2606e3d36a83d27432952bef)- [fix] comments [`6fa23e1`](https://github.com/http-party/node-http-proxy/commit/6fa23e11f6dc0b9c09766b268611ade919bfaa08)## [v0.10.4](https://github.com/http-party/node-http-proxy/compare/v0.10.3...v0.10.4) - 2013-12-27### Merged- Update README.md [`#521`](https://github.com/http-party/node-http-proxy/pull/521)- Better examples [`#520`](https://github.com/http-party/node-http-proxy/pull/520)- Send path in req.path and not the url [`#416`](https://github.com/http-party/node-http-proxy/pull/416)- Fix websocket error handing [`#518`](https://github.com/http-party/node-http-proxy/pull/518)- attempting to fix links to 2 source locations in README.md [`#502`](https://github.com/http-party/node-http-proxy/pull/502)- [merge] rename codename to actual project name [`#492`](https://github.com/http-party/node-http-proxy/pull/492)- [merge] Added error handling example [`#484`](https://github.com/http-party/node-http-proxy/pull/484)- [merge] https & agent [`#482`](https://github.com/http-party/node-http-proxy/pull/482)- [merge] caronte tests [`#476`](https://github.com/http-party/node-http-proxy/pull/476)- FIX: ws error event [`#475`](https://github.com/http-party/node-http-proxy/pull/475)- Fix accidental write to global variable. [`#472`](https://github.com/http-party/node-http-proxy/pull/472)- [fix] 2 spelling mistakes [`#14`](https://github.com/http-party/node-http-proxy/pull/14)- [fix] add ability to proxy websockets over HTTPS [`#11`](https://github.com/http-party/node-http-proxy/pull/11)- Tests [`#3`](https://github.com/http-party/node-http-proxy/pull/3)### Fixed- determine x-forwarded-port from host header [`#341`](https://github.com/http-party/node-http-proxy/issues/341)- [fix] closes #529 [`#529`](https://github.com/http-party/node-http-proxy/issues/529)- [fix] fixes #341 [`#341`](https://github.com/http-party/node-http-proxy/issues/341)- [tests] https test pass, fix #511. Exposed the rejectUnauthorized flag [`#511`](https://github.com/http-party/node-http-proxy/issues/511)- [fix] pass proper options object that extend the global options and parse the per proxy args into options. fixes #510 [`#510`](https://github.com/http-party/node-http-proxy/issues/510)- [readme] add links to badges on readme, fix #483 [`#483`](https://github.com/http-party/node-http-proxy/issues/483)- [fix] pooled connections, closes #478 [`#478`](https://github.com/http-party/node-http-proxy/issues/478)- [fix] add 0.10 link, fixes #459 [`#459`](https://github.com/http-party/node-http-proxy/issues/459)- [fix] closes #473 [`#473`](https://github.com/http-party/node-http-proxy/issues/473)- [fix] add 0.10 compatibily.. closes #474 [`#474`](https://github.com/http-party/node-http-proxy/issues/474)- [fix] headers, closes #469 [`#469`](https://github.com/http-party/node-http-proxy/issues/469)- [fix] headers, fixes #467 [`#467`](https://github.com/http-party/node-http-proxy/issues/467)- [fix] yawnt baaaka .. fixes #8 [`#8`](https://github.com/http-party/node-http-proxy/issues/8)### Commits- [fix] more jshint intendation [`17399e7`](https://github.com/http-party/node-http-proxy/commit/17399e7c3ef9addf9dd8f7c628b273e693f128a1)- [fix] tests [`a255f98`](https://github.com/http-party/node-http-proxy/commit/a255f984fecf24c9290f3ad58d1b68e54a7509eb)- [minor] remove coverage [`335af81`](https://github.com/http-party/node-http-proxy/commit/335af81d0244e62ecb501690bd15bc5a04ec51a3)- [examples] updated websockets examples [`ed8c9ee`](https://github.com/http-party/node-http-proxy/commit/ed8c9eeba99d60f39f5c36c4f34ed1a781d2cfd8)- [tests] removed unused tests [`7e25bde`](https://github.com/http-party/node-http-proxy/commit/7e25bded27effc1b3d47121ce21465a4e2ec7c0b)- [tests] Added a test case for run all the examples [`bc236d7`](https://github.com/http-party/node-http-proxy/commit/bc236d7e95ef10bc17cf551eea2cd2fb9bf265eb)- [tests] drop the test of own streams, moved the usable tests [`dc9d7e5`](https://github.com/http-party/node-http-proxy/commit/dc9d7e5452c7d39ae1d242cb8021ca75e4f736d4)- [fix] default port [`d166354`](https://github.com/http-party/node-http-proxy/commit/d1663549ec070e7ae8bc45ffb148f40ee903192f)- [tests] added the ws passes test and the streams webscokets test [`8b3fe32`](https://github.com/http-party/node-http-proxy/commit/8b3fe32f6ae60ae067bc5e40cdc43015e689467f)- [refactor minor] s/caronte/http-proxy/ or s/caronte/httpProxy/ where appropriate. [`bb0d28c`](https://github.com/http-party/node-http-proxy/commit/bb0d28c58729e2cc70e8446f7fbf1113a6fa9310)- [examples] updated bodyDecoder middleware example [`c82ff2c`](https://github.com/http-party/node-http-proxy/commit/c82ff2c3c0c0165421fbc4e7e94fa3f59d59aa38)- [dist] first [`4d13156`](https://github.com/http-party/node-http-proxy/commit/4d131567211bcefc6ef0b0592d374fef7bd5abd8)- [examples] update forward and custom error examples [`b726116`](https://github.com/http-party/node-http-proxy/commit/b7261161343c3471201d6de36ba1030aced26425)- [refactor docs] add descriptions [`d05af4a`](https://github.com/http-party/node-http-proxy/commit/d05af4af60a5f3d308aa68bf09ab0cf9e5528c52)- [tests] make the tests run with the last refactor [`5bb83b9`](https://github.com/http-party/node-http-proxy/commit/5bb83b967edb514402698eecfe3db7ab5fe60b06)- [examples] deleted this examples [`bdeabb7`](https://github.com/http-party/node-http-proxy/commit/bdeabb767a537bcb9f98ef74f6efe9762a9b1c34)- websocket draft [`07551c6`](https://github.com/http-party/node-http-proxy/commit/07551c63e428551e5d6e52362efd9620a14c71b4)- [fix] naming [`2a59366`](https://github.com/http-party/node-http-proxy/commit/2a593664a5768c90d9b2edf4c298460416b38926)- [dist doc] Added documentation for consistent benchmarking of node-http-proxy [`f7f5fa7`](https://github.com/http-party/node-http-proxy/commit/f7f5fa727e8f1d3f4946e61ad03830dab1da01a5)- [examples] update old examples [`7e44d36`](https://github.com/http-party/node-http-proxy/commit/7e44d3669bbd1b13e6452f265d52b22396f68b5d)- [docs] more short examples to the Readme [`0393b5d`](https://github.com/http-party/node-http-proxy/commit/0393b5da990bb45e873bb80d87a0bc9e4dd6a477)- [examples] updated old proxy examples [`e02317c`](https://github.com/http-party/node-http-proxy/commit/e02317ce86ff2dabd496cf7e2741e219a22ac817)- [wip] Initial HTTPS->HTTP test, updated https-secure example. Work in progress, need to add more https tests [`33a2462`](https://github.com/http-party/node-http-proxy/commit/33a2462d28c7d1fa26b03bcf290242ff7cd83e7a)- [docs] readme [`886a870`](https://github.com/http-party/node-http-proxy/commit/886a8707078f59d0467b34686455bb5bdfadbc0c)- [examples] added error-handling using callbacks and HTTP-to-HTTPS examples [`d7064f2`](https://github.com/http-party/node-http-proxy/commit/d7064f2e1e149fe870cbb158932cb99f9f192fce)- [examples] updated old examples [`588327c`](https://github.com/http-party/node-http-proxy/commit/588327c2c4392618b515164989f08ef20a30842b)- stuff [`e45bfd6`](https://github.com/http-party/node-http-proxy/commit/e45bfd66a21a2470c5a4a4cc1d6095494bbc0f6b)- [doc] added some documentation to functions and comments to understand better the code [`5dcdf2b`](https://github.com/http-party/node-http-proxy/commit/5dcdf2b36c24a9584f044b7529265b9ac861d8c7)- Fixed issue where error callback would not invoke, including new test cases. Added req/res values to error events. [`0bfb9be`](https://github.com/http-party/node-http-proxy/commit/0bfb9be418926f2113489e92504038127d4c04bb)- [examples] updated balancer examples [`831a44b`](https://github.com/http-party/node-http-proxy/commit/831a44b3c8c3acf6c046c47703a07cd6362a0d1c)- socket.io stuff [`a74cd85`](https://github.com/http-party/node-http-proxy/commit/a74cd85c8a5aae2851acf7139648fefd6a02a57b)- [tests] move contributions of @mmoulton to correct place [`7c72f3b`](https://github.com/http-party/node-http-proxy/commit/7c72f3b407a084a896e420c23ababc3e9357feca)- [tests] this file is not necessary anymore [`881c7e6`](https://github.com/http-party/node-http-proxy/commit/881c7e62e0bef7b4b9f81b6fd121f7ad6641bd77)- [refactor] move to leaner architecture [`8273cb6`](https://github.com/http-party/node-http-proxy/commit/8273cb6461e4d33f36e583b0354d1bea038d0a56)- [fix] remove trailing whitespaces [`0aeaba7`](https://github.com/http-party/node-http-proxy/commit/0aeaba7fe6c51f150d0322eb90a77c1701ed88f5)- [test] added tests for web-outgoing.js [`16a4d9d`](https://github.com/http-party/node-http-proxy/commit/16a4d9da1136b79f40ad80482d3fd17dc74274b1)- [fix] some stuff start debugging proxystream [`d4f0da8`](https://github.com/http-party/node-http-proxy/commit/d4f0da898e5e8a2d6740e50a7fc34576435e1132)- [tests] now each test use a different port to avoid some slow opening and closing ports [`c75d06c`](https://github.com/http-party/node-http-proxy/commit/c75d06c5f92eb7c814deb49bb33cf9fffc632d97)- [tests] fixed inherits problem and listen for the correct event [`c65ffbb`](https://github.com/http-party/node-http-proxy/commit/c65ffbb976467dc1768983dcffe111d18e8f2db1)- [fix] ProxyStraem now works [`356f43d`](https://github.com/http-party/node-http-proxy/commit/356f43d719998d135e0fc404ac8508e330cf1e5b)- [examples] fix the copyright header of example files [`e592c53`](https://github.com/http-party/node-http-proxy/commit/e592c53d1a23b7920d603a9e9ac294fc0e841f6d)- [feature] start working on the new server [`b79bd29`](https://github.com/http-party/node-http-proxy/commit/b79bd29d5e984f34b9c07fbdc803aed83b3fd0bb)- ENH: updated examples [`f566a42`](https://github.com/http-party/node-http-proxy/commit/f566a42e511f4a6a8f3620f64e05df209e61b64f)- [examples] add example of gzip using the connect.compress() middleware [`2142c50`](https://github.com/http-party/node-http-proxy/commit/2142c506e08f56d52e1995da5506c3e032f19c3c)- [fix] refactor error handling [`601dbcb`](https://github.com/http-party/node-http-proxy/commit/601dbcbfe929af31995568b4f36b877245809058)- [tests] fixed according new refactor and added test to common.setupSocket() [`1cb967b`](https://github.com/http-party/node-http-proxy/commit/1cb967b90aaa5b9da57727b8acbd95108437797a)- [feature] websocket support [`79a14ac`](https://github.com/http-party/node-http-proxy/commit/79a14acfd2b2bf03f5ae2b334e7a37e619da6bb9)- keepalive sockets [`dad211e`](https://github.com/http-party/node-http-proxy/commit/dad211e71c9ac3b32eba1ea3755edb688053b9d3)- [tests] Using target field, tests now pass. We are missing the tests using forward field [`8085178`](https://github.com/http-party/node-http-proxy/commit/8085178dc2c24567adfb872a583863709ce60b5b)- [fix] callback as optional error handler [`c7924e0`](https://github.com/http-party/node-http-proxy/commit/c7924e01f92aeec07333273f0882c1dd5e9521ae)- ENH: added new https example, needs to be simplified before merge [`427d8d8`](https://github.com/http-party/node-http-proxy/commit/427d8d85369b0cd1d38afa0dd0f28ac98fa16001)- [test] proxystream test [`c961279`](https://github.com/http-party/node-http-proxy/commit/c9612798f1207a4c40b616608bf6274d79ad0e4d)- [lib] initial draft to websockets passes [`79f7f99`](https://github.com/http-party/node-http-proxy/commit/79f7f99528661162ae4153856888f078f666e017)- [fix] minor [`7599cee`](https://github.com/http-party/node-http-proxy/commit/7599cee3fd03a5ce645e313f35557a41c9ac1aee)- [tests] added HTTPS to HTTPS test [`31d919b`](https://github.com/http-party/node-http-proxy/commit/31d919b0a3d0b7f574e88fc5eed093c6b1a53548)- [feature] started working on error propagation, kinda sucks, gotta think it over [`9ab8749`](https://github.com/http-party/node-http-proxy/commit/9ab8749a9bec33b49c495975e8364336ad7be1a3)- [test] testing the onResponse proxy method [`27df8d7`](https://github.com/http-party/node-http-proxy/commit/27df8d72ad86d02cfce00a6e5c183d93dd50f97e)- [fix] remove duplicate [`10c0f11`](https://github.com/http-party/node-http-proxy/commit/10c0f11b68e39552051e508c7bf20d65d2d59177)- [tests] add more tests [`cedc5c4`](https://github.com/http-party/node-http-proxy/commit/cedc5c4bd2059585e1222ec4f03f09e8bcc808fc)- [docs] Update readme with more how to [`ae0faef`](https://github.com/http-party/node-http-proxy/commit/ae0faef5aa0080d742a9740f9cb38bfd54b7d97e)- [tests] added test for socket.io proxying [`10a0db4`](https://github.com/http-party/node-http-proxy/commit/10a0db4f0dd4594839f9098b9d67130085a067bc)- [tests] added test HTTPS to HTTP using own server [`bbe3bfd`](https://github.com/http-party/node-http-proxy/commit/bbe3bfdf98255b82a185a798ff9f29e74615b6ca)- [examples] update the error-handling example using the new error handle way [`a1b25a1`](https://github.com/http-party/node-http-proxy/commit/a1b25a123b4ff71e731f9beb27c5e078acfead65)- [fix] quote [`c4ddc4e`](https://github.com/http-party/node-http-proxy/commit/c4ddc4edd324d9910a11eea14561a0e3b953f29c)- ENH: updated README and added examples file. [`07091b5`](https://github.com/http-party/node-http-proxy/commit/07091b5077a40dfee29f6fd33ecb38d3fa25b801)- [test] passes/web.js (first 2 funcs) [`d40e4be`](https://github.com/http-party/node-http-proxy/commit/d40e4beb62381b962b6cf3254451de0a39f182b1)- [test] add test for forwardstream [`8fc3389`](https://github.com/http-party/node-http-proxy/commit/8fc33893672d26013c2b2ff396b777bcf1751527)- [tests] fixing tests, fixed some typos and changed how passes are stored [`a704213`](https://github.com/http-party/node-http-proxy/commit/a7042132c881656dd32f915d9b0b962f0ef92efb)- [test] added the lib/caronte/streams/forward.js initial test, one test pending [`2fac7b9`](https://github.com/http-party/node-http-proxy/commit/2fac7b9b009b12a940efb22de3af6db55ee686a9)- [api] add draft for proxystream [`4f24664`](https://github.com/http-party/node-http-proxy/commit/4f24664e8a50aa9b9a3ea155d067b85f94a8c81b)- [experiment] new api for proxying [`07cfa6b`](https://github.com/http-party/node-http-proxy/commit/07cfa6b981ff54d8d96eea6c9aa4b560ee3867ec)- [tests] the options got a problem and this test probe that timeout is not being set [`1d1ee88`](https://github.com/http-party/node-http-proxy/commit/1d1ee8858283d7c8984f1c1d6c5185b6822f9235)- new error propagation [`3a39e44`](https://github.com/http-party/node-http-proxy/commit/3a39e444ff68a74f6b586f0736bbd3f8a2511ca5)- [fix] docs [`ec981c5`](https://github.com/http-party/node-http-proxy/commit/ec981c5b74bf43dd36c8ca89833b751f59f01d38)- [examples] added concurrent proxy example [`04c1011`](https://github.com/http-party/node-http-proxy/commit/04c10113f7a3b568fb95b18f30e4aca3e059d961)- [fix] closes number #487 [`cde08fb`](https://github.com/http-party/node-http-proxy/commit/cde08fb2ee2df03c9457678d8e6776a5d89165b2)- [test] started writing tests [`16eacfa`](https://github.com/http-party/node-http-proxy/commit/16eacfa961d2a2d80534e95eba83010ed6ab01b4)- [tests] added tests for websockets [`02007ed`](https://github.com/http-party/node-http-proxy/commit/02007ed0fb38f798436ae5669bb18d4f27496667)- Revert "[fix] fixed options and server reference to can access them from passes functions" [`babdf53`](https://github.com/http-party/node-http-proxy/commit/babdf531fecd32f9af0963902909fcfa2cd374f1)- mm test file [`1a7bef0`](https://github.com/http-party/node-http-proxy/commit/1a7bef0cda58243416a263075dc6eb51f22b6dec)- [fix] fixed options and server reference to can access them from passes functions [`90fb01d`](https://github.com/http-party/node-http-proxy/commit/90fb01d38ac5af7ef395547b24e985b6f63b4abc)- [examples] added forward example [`7a3f6df`](https://github.com/http-party/node-http-proxy/commit/7a3f6dfbcc80ba32fa81004438c637e8d29eb029)- [docs] add UPGRADING.md [`db12f6c`](https://github.com/http-party/node-http-proxy/commit/db12f6c24e22c034c698457cc28ff60c990b55a5)- DOC: Added error handling example [`32a4088`](https://github.com/http-party/node-http-proxy/commit/32a40889cedfd6b0d92224aa921700a7b7271c68)- [examples] updated the modifyResponse-middleware example [`de3ff11`](https://github.com/http-party/node-http-proxy/commit/de3ff11656b4a847de3a63b28feed39b6c816480)- [test] test onError part, proxying to no where [`b85aa16`](https://github.com/http-party/node-http-proxy/commit/b85aa16e75401a223a947cde444d42cf7eeafb67)- ENH: updated agent options in `common.setupOutgoing` [`12cda56`](https://github.com/http-party/node-http-proxy/commit/12cda561afe534427a5f84da9d7e0beb64a8ecbc)- [fix] minor and short fixes [`e0faaaf`](https://github.com/http-party/node-http-proxy/commit/e0faaaf81152203b96f0313c68706468e7ee7357)- support websockets [`4a4607d`](https://github.com/http-party/node-http-proxy/commit/4a4607d075a912746386d1751fd6b0fc98cf6b20)- [test] COVERAGE [`004a46c`](https://github.com/http-party/node-http-proxy/commit/004a46c09df2f0f7b15d8e8f7119bc6039e0c01c)- [misc] add a LICENSE file [`584ce76`](https://github.com/http-party/node-http-proxy/commit/584ce76e7576c906e25cdd04a2e079f97bcf86ff)- ENH: updated https and agent option [`13741a8`](https://github.com/http-party/node-http-proxy/commit/13741a823f1c1c884d4a37e597e4b188598b0e25)- [fix] write connection header [`2c10f25`](https://github.com/http-party/node-http-proxy/commit/2c10f256b658bc0e906c20f29d94ab7eaf653055)- [fix] merge #495, thanks @glasser [`d0862af`](https://github.com/http-party/node-http-proxy/commit/d0862aff0c693366dcb11649b6abe1d011268953)- support forward [`8c8c455`](https://github.com/http-party/node-http-proxy/commit/8c8c455541f21ad9a9ac7ca19d1f37368206a2e2)- [tests] fix tests set correct host headers [`cfd417d`](https://github.com/http-party/node-http-proxy/commit/cfd417de2352b0f05535b979dc15abff60c1fb96)- [fix] Optimize fix for `x-forwarded-for-port`. [`2d42709`](https://github.com/http-party/node-http-proxy/commit/2d42709c3283637de16a49e815b03e63432bbd29)- ENH: updated readme with an example [`edd8e2f`](https://github.com/http-party/node-http-proxy/commit/edd8e2f04e4b39391b062fa6437d61b4ebde8748)- [doc] update README.md [`dcb873a`](https://github.com/http-party/node-http-proxy/commit/dcb873ad9992b1534615d59b8a0a70e8b87d7884)- [test] passes/web.js XHeaders func [`c02b721`](https://github.com/http-party/node-http-proxy/commit/c02b721321c455bc287c3fed6b9b21392ce2fc70)- [fix] fixed passes functions, now 'this' can be used and options are stored on 'this.options' [`9b3e1eb`](https://github.com/http-party/node-http-proxy/commit/9b3e1eb247df29d18ea299ff4ebb2f10eeb71269)- Revert "[fix] fixed passes functions, now 'this' can be used and options are stored on 'this.options'" [`5e130de`](https://github.com/http-party/node-http-proxy/commit/5e130de8548ad41b821da49299b4fd1c9536c5f0)- [minor] Remove duplicate dependencies and cleanup of the scripts [`a51b062`](https://github.com/http-party/node-http-proxy/commit/a51b0622780f48160001f9e74340f7d720cbfce6)- TEST: added agent and header tests [`39b0c46`](https://github.com/http-party/node-http-proxy/commit/39b0c46a6967fda5329760ad93a8ec01bc4a6f14)- [examples] fix styling and bad spaces [`6a6dfbb`](https://github.com/http-party/node-http-proxy/commit/6a6dfbb79dc156679f75dd519344d19a5b61613b)- ENH: added error events [`1b867a7`](https://github.com/http-party/node-http-proxy/commit/1b867a7f594f7dfe49fc17ff53451a353ec509d9)- [test] remove chunked on http1.0 [`ca09263`](https://github.com/http-party/node-http-proxy/commit/ca092635e7ac4d967b554e3b94a16a931946d464)- [tests] fix test to use the new way to pass options [`52ecd52`](https://github.com/http-party/node-http-proxy/commit/52ecd52ee5aa78603e44ba8d5ff9187410351622)- [examples] fixed https examples [`a467b7b`](https://github.com/http-party/node-http-proxy/commit/a467b7b4a9614a7cbfdc256524e1495616e3d4d9)- Revert "[tests] fix test to use the new way to pass options" [`2bf20d6`](https://github.com/http-party/node-http-proxy/commit/2bf20d61d53201e9820c5f9215e641fcf88f5172)- [fix] better code [`3d8e538`](https://github.com/http-party/node-http-proxy/commit/3d8e5383cd9d527825f95d9071a87865fcebca05)- [feature] implement _write and _read [`6a4294c`](https://github.com/http-party/node-http-proxy/commit/6a4294cbdfe85fa162969b1393032adc9d418441)- [fix] use the correct arguments order [`cc09ae6`](https://github.com/http-party/node-http-proxy/commit/cc09ae6a345cfde1689e1d8731c5822675c59d4d)- [fix] fix the correct order of arguments in ws-incoming passes [`02df9a3`](https://github.com/http-party/node-http-proxy/commit/02df9a33c5cce17ea32a892017acbe5ce57ab2e5)- [fix] write status [`e08d4ed`](https://github.com/http-party/node-http-proxy/commit/e08d4edad339d0f7f55900b3e6e6a0e770960215)- [fix] finished jshint fixes [`455f97e`](https://github.com/http-party/node-http-proxy/commit/455f97e14cb4929e0a3a5c746471e9c5e76436fc)- Update the README to describe middleware err handler. [`25bb3bf`](https://github.com/http-party/node-http-proxy/commit/25bb3bfa7012e0f975e10f0311cae8c39183fa41)- Prevent headers to be sent twice [`8332e74`](https://github.com/http-party/node-http-proxy/commit/8332e744202ed9de94288d8f1c822cd9fe788983)- [examples] added package.json with the dependencies needed by examples [`d85ccdd`](https://github.com/http-party/node-http-proxy/commit/d85ccdd333edcfc7551bcf8e0ffd7dc166e38e61)- [tests] added .travis.yml file [`0602500`](https://github.com/http-party/node-http-proxy/commit/06025002303f351f71d9e5f78a93895257f0d283)- [dist minor] 2 space indents next time @samalba [`7e8041d`](https://github.com/http-party/node-http-proxy/commit/7e8041d2b687b8375a1d0fe45270029c6e8ddee6)- [fix] naming [`8931009`](https://github.com/http-party/node-http-proxy/commit/893100972c22febbf133134394bc0bcef47d9e12)- Fix for #458. Host header may cause some sites not to be proxyable with changeOrigin enabled [`781c038`](https://github.com/http-party/node-http-proxy/commit/781c038f2b4d14a01cc9297e1e0dba6ce39dd6cb)- [docs] typos, typos everywhere... [`03880d8`](https://github.com/http-party/node-http-proxy/commit/03880d8d069e9e17ca7d7aea6eb760f6626a869c)- ENH: updated `ws` and `web` functions to use the global options object as a base [`268afe3`](https://github.com/http-party/node-http-proxy/commit/268afe34bb51448d511c9cd73c03e97d1c1baee0)- [fix] make @mmalecki a happy camper [`c9cd6d2`](https://github.com/http-party/node-http-proxy/commit/c9cd6d2ad324e0e6222932c8f29f27621071e045)- write [`f97c0c6`](https://github.com/http-party/node-http-proxy/commit/f97c0c6167371c5ff92e6361b1df02e3fd5506d7)- [fix] [`a9f9e21`](https://github.com/http-party/node-http-proxy/commit/a9f9e21eda2f8e912523e6b62abb0101c0353505)- [fix] coveralls.. will it work? [`f36cb4d`](https://github.com/http-party/node-http-proxy/commit/f36cb4d5a110fc86272e878278f103f313c86f56)- ENH: updated target and forward options so that a string may be specified [`ef946a7`](https://github.com/http-party/node-http-proxy/commit/ef946a7697b38b13178881b3d1ebde63681dd4a1)- added option for eventlistenerCount(max) [`8eb6780`](https://github.com/http-party/node-http-proxy/commit/8eb6780f8705caff13a5375446539b0621d497d7)- [fix] support buffer [`1204a35`](https://github.com/http-party/node-http-proxy/commit/1204a35e467c6c1855ba0dac8f55d79f899148a6)- DOC: updated readme with options [`1b5fb1d`](https://github.com/http-party/node-http-proxy/commit/1b5fb1d8fc21421b8383919d93e4149b586b211b)- ENH: added 'headers' to available options, to add or overwrite existing headers [`7d840d3`](https://github.com/http-party/node-http-proxy/commit/7d840d35151be1aac612798754af47368594781d)- [fix] move logo [`57abb7f`](https://github.com/http-party/node-http-proxy/commit/57abb7f26c14e281c3be07a8b84e3c79e066f59f)- FIX: tests. still need to add more tests tho [`a350fad`](https://github.com/http-party/node-http-proxy/commit/a350fadea6bace293131581487f8c66948009449)- [fix] move logo [`aaff196`](https://github.com/http-party/node-http-proxy/commit/aaff1966e4e2eb42c9890e57737f57a64e8d964a)- [docs] add travis build status [`6b61878`](https://github.com/http-party/node-http-proxy/commit/6b618787598a2a37850898dbdb3b4fe8f3c3414d)- [fix] do not send chunked responses to http1.0 clients [`8663ac1`](https://github.com/http-party/node-http-proxy/commit/8663ac1c43505f0081d906c3cd8e702d4b5ddeb0)- [dist] Bump dependencies. [`a81dd8d`](https://github.com/http-party/node-http-proxy/commit/a81dd8d53e1595cba9acf5cc3ca9517165dcc4aa)- [fix] readme [`4d3a4e1`](https://github.com/http-party/node-http-proxy/commit/4d3a4e1ee7370347898d1863ab73aa68ed345d8d)- [fix] proxying to https [`26c4c43`](https://github.com/http-party/node-http-proxy/commit/26c4c43a06263ec6721bc0e8a90644297d0cf217)- [fix] new logo [`ee3cc38`](https://github.com/http-party/node-http-proxy/commit/ee3cc380665a31ec6af28ddb73dfc543f430d3f8)- [fix] naming convention [`7d71a86`](https://github.com/http-party/node-http-proxy/commit/7d71a867a8bdc375f7577cec3905cca89bbf415c)- fix docs [`9243444`](https://github.com/http-party/node-http-proxy/commit/9243444ac006f73c00b0f1f78c4a77f342b0b4e4)- [fix] short circuit [`a6256ca`](https://github.com/http-party/node-http-proxy/commit/a6256cac1df1739e3da78fe5f0cf122ef7ce6b14)- [tests] this test is already in web-incoming tests [`920f1e7`](https://github.com/http-party/node-http-proxy/commit/920f1e7707aa1751577533cd368529f8a704d7af)- Emit middlewareError when on middleware error. [`bc12ca3`](https://github.com/http-party/node-http-proxy/commit/bc12ca39394f9aeed3e3047f59035ba48afa2885)- DOC: updated readme [`7ad5c0f`](https://github.com/http-party/node-http-proxy/commit/7ad5c0f993294c9e2e7650e15fbc62d11a2cb062)- [docs] add logo [`8b05626`](https://github.com/http-party/node-http-proxy/commit/8b05626eed5e45e72cf9b1f14a4c4dca1dd2ed0f)- [fix] making @stoke a happy camper [`34f16e7`](https://github.com/http-party/node-http-proxy/commit/34f16e74647095199f84ab61e10c8dafd60b505a)- [feature] add buffer support [`e3f8d5f`](https://github.com/http-party/node-http-proxy/commit/e3f8d5fdbe1ebc4f04188d95bbef768d09718d2c)- [Fix] 2 spelling mistakes [`5823842`](https://github.com/http-party/node-http-proxy/commit/58238421945bcc4236e280ebca7799b831ae29a4)- [fix] do not call .end [`6e77cd3`](https://github.com/http-party/node-http-proxy/commit/6e77cd390929842088ae9f6deb922a6627ddfecd)- attempting to fix link to valid options properties [`bbe2b27`](https://github.com/http-party/node-http-proxy/commit/bbe2b2788a7ee3c74fd44fe88b6dcf213264436f)- [fix] slimmer proxying [`031aa0f`](https://github.com/http-party/node-http-proxy/commit/031aa0fbf30bd377696c4efa508f6fc769bf1070)- [fix] use agent pool [`abf1d90`](https://github.com/http-party/node-http-proxy/commit/abf1d90fdf05a17ebe05a3e90d464a592e0aee69)- [tests] fix test using undefined url [`c4d56a5`](https://github.com/http-party/node-http-proxy/commit/c4d56a5faf1e89cdeb911f0ece0efe065eb58c45)- [fix] legacy [`162a42f`](https://github.com/http-party/node-http-proxy/commit/162a42f58f515c5418ccfac0b68f4c928103b1e1)- [tests] fixing minor typos [`b333e63`](https://github.com/http-party/node-http-proxy/commit/b333e63648aa67ea1b1aaf17ba684e5fc6f751a6)- Updated readme [`bd106d6`](https://github.com/http-party/node-http-proxy/commit/bd106d69f074a1c7018e685a4e144e23a17beb8c)- [misc] use the local mocha instead the global [`f1aeb05`](https://github.com/http-party/node-http-proxy/commit/f1aeb0500cde39b63e570323e0e478530d1222ab)- added unlimited listeners to the reverproxy event obj. [`1333c0c`](https://github.com/http-party/node-http-proxy/commit/1333c0cc62e7b590843f9b00326fe80137163c5e)- [tests] throw error when no options, ALL TESTS PASSING! YAY [`86750c7`](https://github.com/http-party/node-http-proxy/commit/86750c7e594c419dfae957aaf7e44e61e1d480e8)- ENH: updated example [`1c7ace2`](https://github.com/http-party/node-http-proxy/commit/1c7ace26c5a36fb63497f1ab67793c5b75495063)- [merge] PR #470 [`38e6d7c`](https://github.com/http-party/node-http-proxy/commit/38e6d7cd5449a7264dcf5244b3dfd07b2dda60e1)- [fix] remove stuff [`6a03e5f`](https://github.com/http-party/node-http-proxy/commit/6a03e5f7cf356416ea13584e279f5bfa3791c058)- [test][misc] remove node@0.8 to test on travis [`8eff1a1`](https://github.com/http-party/node-http-proxy/commit/8eff1a1f26bb739dfc5a1ad90b140ff2a18921d5)- merge with @cronopio [`0fb3381`](https://github.com/http-party/node-http-proxy/commit/0fb33810f5e70b714bd9868557d85a531b8e11e3)- [merge] text [`98f29bd`](https://github.com/http-party/node-http-proxy/commit/98f29bdcfca9b818ffe107b09578539fdf379c8a)- [fix] woops [`bd3df45`](https://github.com/http-party/node-http-proxy/commit/bd3df45010f282997cae3a699c7ecb885c01bdf8)- [test] Test on newer version of node [`ebbba73`](https://github.com/http-party/node-http-proxy/commit/ebbba73eda49563ade09f38bdc8aef13d1cf6c00)- new error propagation - follows [`1993faf`](https://github.com/http-party/node-http-proxy/commit/1993faf8a4227acda3423d46cf2cf13b4d9861e7)- [fix] minor typo [`5a1504f`](https://github.com/http-party/node-http-proxy/commit/5a1504f0764b7747b53cc0d92a69ff3093e85ade)- [fix] proxy to http(s) [`3c91ed3`](https://github.com/http-party/node-http-proxy/commit/3c91ed3d26d9af640d0c7a09fb9cdaf80ad673ca)- Put the arguments the right way around in the README. [`1457980`](https://github.com/http-party/node-http-proxy/commit/145798062e332ac2aed7f8e8e3240e38464c870a)- [fix] use some [`4480699`](https://github.com/http-party/node-http-proxy/commit/4480699d3a2a5080c051e7b8a100689fd1f58657)- [fix] layout [`d7078e2`](https://github.com/http-party/node-http-proxy/commit/d7078e2fdd16d23d0b5f8f1d8a7ab3e9011fea4f)- [docs] logo [`dd0f7b8`](https://github.com/http-party/node-http-proxy/commit/dd0f7b8876ae5b57fffab8857735b25b159f2bdb)- [fix] url [`0637322`](https://github.com/http-party/node-http-proxy/commit/0637322d96e54bbcf5a14bf009dd73314cada4ce)- [fix] opts [`adc5be0`](https://github.com/http-party/node-http-proxy/commit/adc5be020c7fff09a1c05ac771d5c5ab61002c23)- [docs] fix syntax highlighting [`da9de70`](https://github.com/http-party/node-http-proxy/commit/da9de7034a452d1281217a349bc9403fddcc2b7f)- [fix] typo [`275a519`](https://github.com/http-party/node-http-proxy/commit/275a5192fa257f78287a954b347e65023795487d)- [tests] fix code coverage, changed pattern on blanket options [`4090250`](https://github.com/http-party/node-http-proxy/commit/40902506af3361b642b8798350b48404fe0a4e78)- Put the arguments the right way around in emitter. [`7c8ecc8`](https://github.com/http-party/node-http-proxy/commit/7c8ecc8ea85b59fc16b55b9a142372b6ac168b2a)- [fix] link [`72a89ea`](https://github.com/http-party/node-http-proxy/commit/72a89eab8bafef3742d78e8de8631094f961f427)- [fix] space [`69f126b`](https://github.com/http-party/node-http-proxy/commit/69f126b34cbd190be8541a854d21f13bfb5a61bf)- [fix] tests [`8269eca`](https://github.com/http-party/node-http-proxy/commit/8269eca2bb34d08336b8889e06e53d3522fa79fe)- [fix] console [`18341d5`](https://github.com/http-party/node-http-proxy/commit/18341d559717e0a86f5ee4da024109e4b5a595a7)- Set travis to run `npm test` while we fix coveralss.io integration [`e2a5d51`](https://github.com/http-party/node-http-proxy/commit/e2a5d513cac3ebceff446787fa106c7f00caf785)- [fix] making @jcrugzz a happy camper [`2e7343d`](https://github.com/http-party/node-http-proxy/commit/2e7343d728a3187d48821b88ec2e2d4699bb2afe)- [fix] minor typo [`5d66ce1`](https://github.com/http-party/node-http-proxy/commit/5d66ce11bb7eef7e704a2de2c0ef3b5f754843e9)- [tests] tests fixed [`d60353f`](https://github.com/http-party/node-http-proxy/commit/d60353f80bbbcba128a2c51066e107365270e878)- [tests] disabled the examples-test by now [`d83fdf6`](https://github.com/http-party/node-http-proxy/commit/d83fdf69a1121bfcfba72bbffcd3105ae5852c56)- [fix] _ because it is unused [`590bb60`](https://github.com/http-party/node-http-proxy/commit/590bb604dae11223a0ae80469b59d6d341488f1f)- [tests] disable test, by now is not throwing without options [`a2b1f0a`](https://github.com/http-party/node-http-proxy/commit/a2b1f0a4c9079342db6255c5f92db4a0cb992707)- [fix] support target and forward [`961d2f9`](https://github.com/http-party/node-http-proxy/commit/961d2f9400b4cfd236c3c8ccbf401d37f8e871b8)- [dist] Version bump. 0.10.4 [`840f6d8`](https://github.com/http-party/node-http-proxy/commit/840f6d8d29dffc11d3726123c2d400940ca2bdda)- [fix] remove old reminescence [`4d65280`](https://github.com/http-party/node-http-proxy/commit/4d65280ea313438a94589bacf55f7a09cc107888)- [feature] add emit proxyRes [`dda6f7a`](https://github.com/http-party/node-http-proxy/commit/dda6f7a45a46d2bf63e482d0b47b7c36ae548546)- [docs] test badge [`1ceea3e`](https://github.com/http-party/node-http-proxy/commit/1ceea3e5f9b6232d60d673946bbccb7d8ccb4beb)- [tests] remove caronte and use http-proxy for file names [`c9f5772`](https://github.com/http-party/node-http-proxy/commit/c9f5772fc18226aca31471bc96c44a6dbff5cbea)- [logo] [`4c2f2f3`](https://github.com/http-party/node-http-proxy/commit/4c2f2f3b9a5ba65f97403e778a670f14301d52c1)## [v0.10.3](https://github.com/http-party/node-http-proxy/compare/v0.10.2...v0.10.3) - 2013-06-20### Merged- Pass default certs to SNICallback example [`#419`](https://github.com/http-party/node-http-proxy/pull/419)### Fixed- Pass default certs to SNICallback example [`#399`](https://github.com/http-party/node-http-proxy/issues/399)### Commits- [dist] Bump version to 0.10.3 [`2fd748f`](https://github.com/http-party/node-http-proxy/commit/2fd748fb61dac7de0daa50aabbface7033c6a222)- [fix] Respect `maxSockets` from `target` options in `RoutingProxy` [`e1d384e`](https://github.com/http-party/node-http-proxy/commit/e1d384e769e9f4adc5a06c516cfb721ff24b4b6d)- Send path in req.path and not the url [`0c75323`](https://github.com/http-party/node-http-proxy/commit/0c753234c0c85333f909bdbef034ffb6e192bad5)## [v0.10.2](https://github.com/http-party/node-http-proxy/compare/v0.10.1...v0.10.2) - 2013-04-21### Merged- Correct keep-alive responses to HTTP 1.0 clients [`#407`](https://github.com/http-party/node-http-proxy/pull/407)### Fixed- [minor] Style compliance. Fixes #402. [`#402`](https://github.com/http-party/node-http-proxy/issues/402)### Commits- Correct keep-alive responses to HTTP 1.0 clients. [`a29b5e8`](https://github.com/http-party/node-http-proxy/commit/a29b5e8e289c34c00d2b450e5fb9dd1969db4b97)- [minor] Strip trailing whitespace. [`7fc39d7`](https://github.com/http-party/node-http-proxy/commit/7fc39d77f47311b82c24ab05f8e1a45a2733305c)- Add headers on 'handshake' [`985025c`](https://github.com/http-party/node-http-proxy/commit/985025c90f3b2fafede64d8b17c318326f2423d9)- Don't test raw HTTP 1.0 requests over HTTPS. [`daf53bd`](https://github.com/http-party/node-http-proxy/commit/daf53bd753879223dc84a49c92d0efaf576c1fd3)- [dist] Version bump. 0.10.2 [`de0928f`](https://github.com/http-party/node-http-proxy/commit/de0928f616dd62165e8a22c00d091cabf31e1e87)## [v0.10.1](https://github.com/http-party/node-http-proxy/compare/v0.10.0...v0.10.1) - 2013-04-12### Merged- Fix for slab buffer retention, leading to large memory consumption [`#370`](https://github.com/http-party/node-http-proxy/pull/370)### Commits- [dist] Version bump. 0.10.1 [`9c13ad4`](https://github.com/http-party/node-http-proxy/commit/9c13ad46e416125373d6604f3954ec3df1f55449)## [v0.10.0](https://github.com/http-party/node-http-proxy/compare/v0.9.1...v0.10.0) - 2013-03-18### Merged- Change the emitter of the `proxyResponse` event [`#385`](https://github.com/http-party/node-http-proxy/pull/385)- Fixing a bug that generates an unexpected TypeError [`#383`](https://github.com/http-party/node-http-proxy/pull/383)- Mention Harmon used for response modifications in the readme [`#384`](https://github.com/http-party/node-http-proxy/pull/384)### Commits- [dist] Update CHANGELOG.md [`8665f3c`](https://github.com/http-party/node-http-proxy/commit/8665f3cc600feecbb4c8229699823149c69a144f)- Harmon messsage [`35ba0db`](https://github.com/http-party/node-http-proxy/commit/35ba0db554c6bace21b1bacfa8f5fb6df4228db0)- [fix breaking] Emit the `proxyResponse` event on the HttpProxy instance to reduce listener churn and reference counts. [`2620f06`](https://github.com/http-party/node-http-proxy/commit/2620f06e2db9a267945566f10837c4c2a5df753d)- [dist] Version bump. 0.10.0 [`71183bf`](https://github.com/http-party/node-http-proxy/commit/71183bf30bc2b9ad2eaf57c51980eeb0bc7edff0)- Fixing the if statement as it lead to 'TypeError: Parameter 'url' must be a string, not undefined' in certain cases [`c9b6895`](https://github.com/http-party/node-http-proxy/commit/c9b6895c5e14add6aba4f826a2173458a1896a5f)- Harmon messsage [`4e42354`](https://github.com/http-party/node-http-proxy/commit/4e42354e77d5731a383d516fc0b249d5d0eda745)## [v0.9.1](https://github.com/http-party/node-http-proxy/compare/v0.9.0...v0.9.1) - 2013-03-09### Commits- [dist doc] Updated CHANGELOG.md for `v0.9.1` [`ea5e214`](https://github.com/http-party/node-http-proxy/commit/ea5e214522d8ac34d1129b28ff188c0f232ce63f)- [dist] Version bump. 0.9.1 [`701dc69`](https://github.com/http-party/node-http-proxy/commit/701dc698e3eb39ca6836a02611d8dce750f4e212)- [breaking] Ensure that `webSocketProxyError` also receives the error to be consistent with `proxyError` events. [`c78356e`](https://github.com/http-party/node-http-proxy/commit/c78356e9cf27a21c57e4c98ef7dd3c22abe864c2)## [v0.9.0](https://github.com/http-party/node-http-proxy/compare/v0.8.7...v0.9.0) - 2013-03-09### Merged- If HTTP 1.1 is used and backend doesn't return 'Connection' header, expicitly return Connection: keep-alive. [`#298`](https://github.com/http-party/node-http-proxy/pull/298)- add "with custom server logic" to the "Proxying WebSockets" section of the readme [`#332`](https://github.com/http-party/node-http-proxy/pull/332)- routing proxy 'this' reference bug? [`#365`](https://github.com/http-party/node-http-proxy/pull/365)- fixed issue #364 'proxyError' event emitted twice [`#374`](https://github.com/http-party/node-http-proxy/pull/374)- Misleading documentation for Websockets via .createServer [`#349`](https://github.com/http-party/node-http-proxy/pull/349)### Fixed- [api test] Manually merge #195 from @tglines since that fork was deleted. Update tests to use new macros. Fixes #195. Fixes #60. [`#195`](https://github.com/http-party/node-http-proxy/issues/195) [`#60`](https://github.com/http-party/node-http-proxy/issues/60)- [fix] Set "content-length" header to "0" if it is not already set on DELETE requests. Fixes #338. [`#338`](https://github.com/http-party/node-http-proxy/issues/338)- [fix] Do not use "Transfer-Encoding: chunked" header for proxied DELETE requests with no "Content-Length" header. Fixes #373. [`#373`](https://github.com/http-party/node-http-proxy/issues/373)- [fix] http-proxy should not modify the protocol in redirect request for external sites. Fixes #359. [`#359`](https://github.com/http-party/node-http-proxy/issues/359)- [fix] Emit `notFound` event when ProxyTable location does not exist. Fixes #355. Fixes #333. [`#355`](https://github.com/http-party/node-http-proxy/issues/355) [`#333`](https://github.com/http-party/node-http-proxy/issues/333)- [fix] Make options immutable in `RoutingProxy`. Fixes #248. [`#248`](https://github.com/http-party/node-http-proxy/issues/248)- [fix] Remove special case handling of `304` responses since it was fixed in 182dcd3. Fixes #322. [`#322`](https://github.com/http-party/node-http-proxy/issues/322)- [fix] Ensure `response.headers.location` is defined. Fixes #276. [`#276`](https://github.com/http-party/node-http-proxy/issues/276)### Commits- [minor] s/function(/function (/ s/){/) {/ [`9cecd97`](https://github.com/http-party/node-http-proxy/commit/9cecd97153ccce4f81c5eda35a49079e651fb27a)- working on x-forwarded-for [`1332409`](https://github.com/http-party/node-http-proxy/commit/133240937dc63aca0007388327837bc24808f79a)- Routing Proxy was not sending x-forward-*. Fixing It... [`916d44e`](https://github.com/http-party/node-http-proxy/commit/916d44e3d2a17bb9d5178f347ddad9796b988e05)- Added timeout option and test to test new timeout parameter, added requestFail assertion. [`89d43c2`](https://github.com/http-party/node-http-proxy/commit/89d43c20dd0dec1dda1fd70e57f3f250b9e3b431)- Add tests for headers bug fixes [`ecb5472`](https://github.com/http-party/node-http-proxy/commit/ecb547223f3f1d9bf551842c2026ee2f1a18638a)- Added simple round robin example with websocket support [`83fbd42`](https://github.com/http-party/node-http-proxy/commit/83fbd4250660f41de1ab2b5490a3bf58200ae148)- - support unix donain sockets and windows named pipes (socketPath) on node 0.8.x. On node 0.6.x the support was opaque via port, but on the new node, socketPath should be set explicitely. [`ffe74ed`](https://github.com/http-party/node-http-proxy/commit/ffe74ed299f81206b898147dbcc985519b2921f8)- pathnameOnly flag added. Ignores hostname and applies routing table to the paths being requested. [`46b078a`](https://github.com/http-party/node-http-proxy/commit/46b078a98d10de7726a3bbca89121acc57ad7625)- [doc] added comments to pathnameOnly block. [`5e6be6c`](https://github.com/http-party/node-http-proxy/commit/5e6be6ccf5a39ff450e57d7b24e374a83569fa85)- remove offending code, final fix for issue #364 [`3b84e27`](https://github.com/http-party/node-http-proxy/commit/3b84e27ab4efd5ce3b8ac837d699d4ff6661c7e7)- memory leak fix in closing of the scokets [`2055d0c`](https://github.com/http-party/node-http-proxy/commit/2055d0c8ec16699ffb06adf6d64d9506920b2071)- Fix truncated chunked responses [`ef66833`](https://github.com/http-party/node-http-proxy/commit/ef66833c4d7f07ae9f42026f2bcc0fbca2440579)- Re-added previous description [`603106a`](https://github.com/http-party/node-http-proxy/commit/603106a13d28c0199fa4456cc9aee1692eb2588c)- pathnameOnly option documented in the Readme.md [`a1607c1`](https://github.com/http-party/node-http-proxy/commit/a1607c1684a7d7617e5148a0dca882eb08a9f03b)- [fix minor] Prevent crashes from attempting to remove listeners more than once when proxying websocket requests. [`a681493`](https://github.com/http-party/node-http-proxy/commit/a681493371ae63f026e869bf58b6fea682dc5de3)- Added comments [`64efa7f`](https://github.com/http-party/node-http-proxy/commit/64efa7f9291a2377a32e942a247700b71b107993)- Revert "[fix minor] Prevent crashes from attempting to remove listeners more than once when proxying websocket requests." [`c6da760`](https://github.com/http-party/node-http-proxy/commit/c6da760ca9f375025229fe3fc174aca943362f38)- [doc dist] Update CHANGELOG.md for `v0.9.0`. [`133115c`](https://github.com/http-party/node-http-proxy/commit/133115c9760130dcef447efbd18c470c08795c90)- add support for loading CA bundles [`10f6b05`](https://github.com/http-party/node-http-proxy/commit/10f6b0577518bdfcb6b43c1f516dc988bdcade53)- problem: don't want to run my server as root to bind to privileged ports (e.g. 80, 443). [`2c36507`](https://github.com/http-party/node-http-proxy/commit/2c3650746cd90fed63b140a8d393e18bd35cd8f9)- Add 'proxyResponse' event so observer can modify response headers or abort response. [`3b86a7a`](https://github.com/http-party/node-http-proxy/commit/3b86a7aae3fc366c5fa8645285a4368dbac7a0dc)- [minor] Move private helper to end of file. [`476cbe7`](https://github.com/http-party/node-http-proxy/commit/476cbe741fc41b7f1eb269d841d922784e8b3c6b)- Fix for retaining large slab buffers in node core [`d2888c8`](https://github.com/http-party/node-http-proxy/commit/d2888c83f5eab3fb82425ef4fd51e62621bf2764)- [dist] Update `devDependencies` [`ad21310`](https://github.com/http-party/node-http-proxy/commit/ad213106d06cfc79004841f04b8e73fe7d7ef67a)- [minor] Small whitespace compliance. [`ea0587a`](https://github.com/http-party/node-http-proxy/commit/ea0587a8f98b1eedc38c66b69293ae091e24be6e)- [doc fix] Add undefined var in example. [`deca756`](https://github.com/http-party/node-http-proxy/commit/deca7565c51fd678354d26eaae7fe2481e36e2c3)- working on x-forwarded-for [`31fc94a`](https://github.com/http-party/node-http-proxy/commit/31fc94aa5e43c54033d5384caaf104eebf3889bd)- Allow event observers to access upstream response headers and data. [`4c130f5`](https://github.com/http-party/node-http-proxy/commit/4c130f5dac5f2cfbfc2618446b86244aff4cb04f)- [fix doc] Fix bad variable reference in `README.md`. [`440013c`](https://github.com/http-party/node-http-proxy/commit/440013c263a96c6681bfe92a8f56db93b58efa8d)- Change wording for handling websocket proxy events [`ee6bbe0`](https://github.com/http-party/node-http-proxy/commit/ee6bbe00244c90bd532b11ff1c796aea8c7372f8)- [dist] Version bump. 0.9.0 [`c68e038`](https://github.com/http-party/node-http-proxy/commit/c68e0389120d8530e578e20496d8ee091e69a580)- fix 'this' reference in routing proxy listener bindings [`15afc23`](https://github.com/http-party/node-http-proxy/commit/15afc23a275f3fa16653fff6179368122661a0af)- cleanning [`8d87399`](https://github.com/http-party/node-http-proxy/commit/8d8739999fcaf4cdd8f2471046f6f036c44dc8f7)- cleanning [`9672b99`](https://github.com/http-party/node-http-proxy/commit/9672b9927156a0dfe3ce4539f380aaf3172f6267)- Fix typo which slipped in during patch clean-up [`ba65a48`](https://github.com/http-party/node-http-proxy/commit/ba65a485fcf7230e85cee77f6eefcd17e46c8f86)- Remove data event that is not needed after-all. [`b1c4bd6`](https://github.com/http-party/node-http-proxy/commit/b1c4bd61e8ae5705d4cc97bf719c381554671967)## [v0.8.7](https://github.com/http-party/node-http-proxy/compare/v0.8.6...v0.8.7) - 2012-12-22### Commits- [fix] Handle errors on request object [`edfe869`](https://github.com/http-party/node-http-proxy/commit/edfe86915941e465a06c1d0a3330ee32e5834aa6)- [dist] Bump version to 0.8.7 [`26d3646`](https://github.com/http-party/node-http-proxy/commit/26d3646ff252129f35525ab0540a31f5617a31d2)- [fix] Don't remove `error` listener after response ends [`223eacd`](https://github.com/http-party/node-http-proxy/commit/223eacda85a4267f2860f6c46f7dedfa9db8c224)## [v0.8.6](https://github.com/http-party/node-http-proxy/compare/v0.8.5...v0.8.6) - 2012-12-21### Merged- http-proxy: 304 responses should emit 'end' too [`#337`](https://github.com/http-party/node-http-proxy/pull/337)### Commits- [bench] Remove silly "benchmarks" [`2bd9cd9`](https://github.com/http-party/node-http-proxy/commit/2bd9cd9adb6cea6763930468d22cb56fffab6218)- [bench] Add a benchmark for websockets throughput [`6797a27`](https://github.com/http-party/node-http-proxy/commit/6797a2705a309d19a655ab468bcc80ba2e43cf41)- [fix] Handle socket errors [`2a61ec8`](https://github.com/http-party/node-http-proxy/commit/2a61ec85bdaeed9a5fca2a117efb36a7f76becc4)- [dist] Update `devDependencies` [`b81d9b7`](https://github.com/http-party/node-http-proxy/commit/b81d9b71daa32a571384cff29d81227993299236)- [dist] Bump version to 0.8.6 [`6cd78f6`](https://github.com/http-party/node-http-proxy/commit/6cd78f6af9ca08b8797c409896eea2ae6bb6d835)- [bench] More exact size display [`7bc1a62`](https://github.com/http-party/node-http-proxy/commit/7bc1a628feab78f8931e9e6481737dd871debfeb)## [v0.8.5](https://github.com/http-party/node-http-proxy/compare/v0.8.4...v0.8.5) - 2012-11-16### Merged- lib: allow overriding maxSockets [`#323`](https://github.com/http-party/node-http-proxy/pull/323)### Fixed- [fix] Convert strings to numbers if possible in `.createServer` [`#321`](https://github.com/http-party/node-http-proxy/issues/321)### Commits- [test] Delete invalid core test [`886a395`](https://github.com/http-party/node-http-proxy/commit/886a395429f20163992ca76e7b0d059256f56ba6)- [test] Upgrade `common.js` from node core [`fefbf04`](https://github.com/http-party/node-http-proxy/commit/fefbf04ac03126858bdad07df7b10131a46e17d6)- add "with custom server logic" to the "Proxying WebSockets" section of the readme.md [`03dbe11`](https://github.com/http-party/node-http-proxy/commit/03dbe115c2b088737e5b9abcadf91a8298f56f1f)- [test] Kill child process when exiting test runner [`74ec175`](https://github.com/http-party/node-http-proxy/commit/74ec1757153c503ce57eb552031648fe79731d48)- [fix] Correctly kill test processes [`b8c27ed`](https://github.com/http-party/node-http-proxy/commit/b8c27ed565e416827b7c4bb123aa9ee119d008e6)- [test] Make global detection work with older node versions [`3531fd6`](https://github.com/http-party/node-http-proxy/commit/3531fd609a8ce156d27c27ca38ac912a73aebfeb)- [dist] Bump version to 0.8.5 [`22639b3`](https://github.com/http-party/node-http-proxy/commit/22639b378189ec78f9962dde64337df050e29a6f)- [test] Run core tests on `npm test` [`41c9a9c`](https://github.com/http-party/node-http-proxy/commit/41c9a9caad679221b8f1d4dcfb74f9b2bdb8270b)- [test] Stop testing on `node v0.9`, tests timeout [`9042665`](https://github.com/http-party/node-http-proxy/commit/9042665ea98a6587e1d6800e51d3c354c0a1b20a)## [v0.8.4](https://github.com/http-party/node-http-proxy/compare/v0.8.2...v0.8.4) - 2012-10-23### Merged- Events patch [`#320`](https://github.com/http-party/node-http-proxy/pull/320)- documentation for options [`#315`](https://github.com/http-party/node-http-proxy/pull/315)- Added travis build status [`#308`](https://github.com/http-party/node-http-proxy/pull/308)- Fix installation instructions: s/http/https/ [`#302`](https://github.com/http-party/node-http-proxy/pull/302)- If supplied pass changeOrigin option through to HttpProxy instance if set in RoutingProxy [`#285`](https://github.com/http-party/node-http-proxy/pull/285)### Commits- [fix test] Fix examples to use newest version of socket.io and helpers. Added tests for ensuring that examples require as expected with no errors. [`fd648a5`](https://github.com/http-party/node-http-proxy/commit/fd648a529090cefc202613fff3fdfec9ba0e6a72)- [fix] spdy should look like https when forwarding (until we get a client) [`698b01d`](https://github.com/http-party/node-http-proxy/commit/698b01da8e1fe6195b00e5006032d262a0a86f4e)- [docs] options [`4c8e1d9`](https://github.com/http-party/node-http-proxy/commit/4c8e1d96a36523a548959415903bc669ebcc138d)- http-proxy: emit websocket:start [`5df6e7b`](https://github.com/http-party/node-http-proxy/commit/5df6e7bdb8d4685a18e94ff1bf117ce8eff8d1c9)- [fix] `destroy()` websockets in case of an error [`0d00b06`](https://github.com/http-party/node-http-proxy/commit/0d00b06af307dc5c70c36e89617a08486eb665e2)- [fix] Suppress EADDRINUSE errors from `test/examples-test.js` since we are just looking for require-time errors. Isolate tests to ensure idempotency of ports [`c4a7b15`](https://github.com/http-party/node-http-proxy/commit/c4a7b1584302fe12a8fc06b6774db5ff602c3607)- [docs] more options [`d4cb9da`](https://github.com/http-party/node-http-proxy/commit/d4cb9dad6ce36a823c9e8970e0bb3266d844e536)- If HTTP 1.1 is used and backend doesn't return 'Connection' header, explicitly [`850171c`](https://github.com/http-party/node-http-proxy/commit/850171cdc41cb93343f7c31f650ac908a8d2dacb)- [refactor] Pass all options to `Agent` constructor [`eafdc74`](https://github.com/http-party/node-http-proxy/commit/eafdc744b67b33b5ed3cfc80de84dafcd850bdd0)- Fix socket leaks when FIN packet isn't responded to [`24b8406`](https://github.com/http-party/node-http-proxy/commit/24b84068eac1c704d9f8df3dc833b976850c328f)- [fix] Partial fix for rejecting self-signed certs in tests [`2e7d8a8`](https://github.com/http-party/node-http-proxy/commit/2e7d8a88f4b470dcc9da1639fe2a69e03251036c)- [fix] Dont use `-i` when running vows because it supresses `--target=` and `--proxy=` CLI arguments [`1783ab0`](https://github.com/http-party/node-http-proxy/commit/1783ab0625743355eecc11f5cfd57469c429daa0)- [test] Add `node v0.9` testing, test all branches [`4f6387c`](https://github.com/http-party/node-http-proxy/commit/4f6387c17f55c23da4aac161cf2e5a4dd2a25c40)- [minor] Remove `setEncoding` on incoming socket [`812868d`](https://github.com/http-party/node-http-proxy/commit/812868ddfc720b6c4fd26603c2fe4d5ae68f2492)- [dist] v0.8.3 [`a89a5b8`](https://github.com/http-party/node-http-proxy/commit/a89a5b80889a56dd31634096bc6546b6b7b26da2)- [fix] Ignore npm version errors when installing dependencies for examples [`a454666`](https://github.com/http-party/node-http-proxy/commit/a454666e7a0465ed65b7bbd29cf1b0c6c126d153)- [fix] function [`213e03c`](https://github.com/http-party/node-http-proxy/commit/213e03c99844c5c984fbf857bae32095165a1e8f)- [dist] Bump version to 0.8.4 [`4d7e8a8`](https://github.com/http-party/node-http-proxy/commit/4d7e8a808d83d3db1b729820aba5f481ab3d18f4)- [minor doc] Correct comment [`cee27fe`](https://github.com/http-party/node-http-proxy/commit/cee27feeddf9b4db06917dfa9e59e6bcd7e14c27)## [v0.8.2](https://github.com/http-party/node-http-proxy/compare/v0.8.1...v0.8.2) - 2012-07-22### Merged- Add example for gzip middleware using a proxy table. [`#221`](https://github.com/http-party/node-http-proxy/pull/221)- Implement RoutingProxy.prototype.remove [`#246`](https://github.com/http-party/node-http-proxy/pull/246)- prefer `target.hostname` over `target.host` [`#235`](https://github.com/http-party/node-http-proxy/pull/235)- add "Using two certificiates" to the https section of the readme.md [`#275`](https://github.com/http-party/node-http-proxy/pull/275)- Add support for setting the host in the executable [`#268`](https://github.com/http-party/node-http-proxy/pull/268)- Hi! I fixed some calls to "sys" for you! [`#270`](https://github.com/http-party/node-http-proxy/pull/270)- Fix bug: x-forwarded-proto set incorrectly as httphttps or wswss [`#266`](https://github.com/http-party/node-http-proxy/pull/266)### Commits- [refactor] Rewrite tests to use saner vows idioms. Update tests to use latest socket.io [`4ae7a5b`](https://github.com/http-party/node-http-proxy/commit/4ae7a5b84011bb5b9ec3a36ded4c5e5b3330db80)- [dist] Remove out-dated docco docs [`2d75510`](https://github.com/http-party/node-http-proxy/commit/2d75510d827c770c30a7292c31ef0f2007da7086)- [refactor test] Finish removing old test code. [`e2dc7f9`](https://github.com/http-party/node-http-proxy/commit/e2dc7f96937e5d565fea16c9f56b9f5d3e427de2)- [dist] Complete JSHint compliance except for `too many var statements` [`36226da`](https://github.com/http-party/node-http-proxy/commit/36226daa2e4cbc65fae80d2d09fd64c0e7ce36ba)- [refactor test] Add support for `http*-to-http*` testing from CLI arguments [`828dbeb`](https://github.com/http-party/node-http-proxy/commit/828dbebcaaf11e338a7727bf9d2fff8bfbd3726e)- [fix api] Optimize lookups in the ProxyTable. Ensure that RoutingProxy can proxy to `https` by default. [`55286a7`](https://github.com/http-party/node-http-proxy/commit/55286a7c499c0fe267f75d8e8441ff89f1e65f99)- Whitespace fixes. [`04ce49c`](https://github.com/http-party/node-http-proxy/commit/04ce49c5b289acb6ad72303e9ac70c637ea490b2)- [refactor tests] Finished refactoring tests to support `ws*-to-ws*` tests based on CLI arguments [`7e854d7`](https://github.com/http-party/node-http-proxy/commit/7e854d778b89201f7cb933e8bbda66316b98b0b4)- [doc] Minor formatting updates to README.md [`6753951`](https://github.com/http-party/node-http-proxy/commit/67539519faf1f32073fdb562404bd897072e24ee)- [fix] Changed require('util') to require('util') for compatibility with node v0.8 [`bf7e328`](https://github.com/http-party/node-http-proxy/commit/bf7e328fb837de69455c42f41822b0caae2777b6)- [test] Add .travis.yml file for Travis CI. [`29e6e74`](https://github.com/http-party/node-http-proxy/commit/29e6e748f780629d05635eebb421e8ee1d125058)- Use changeOrigin for proxyRequest. [`0273958`](https://github.com/http-party/node-http-proxy/commit/0273958b0a5c7823c6212cb6ce6e4f801a215d3b)- adding support for setting the host [`06e78f2`](https://github.com/http-party/node-http-proxy/commit/06e78f27475165d023fd66afbe5dd626a6a548af)- match style requested by @cronopio [`415d4ed`](https://github.com/http-party/node-http-proxy/commit/415d4ed908e45332421d683eb45e0d6873b85ae7)- Fix bug: x-forwarded-proto set incorrectly [`0933f1c`](https://github.com/http-party/node-http-proxy/commit/0933f1c598c1b62a75e040c3ed3ccb262612d3c9)- [dist] Version bump. 0.8.2 [`13c34d0`](https://github.com/http-party/node-http-proxy/commit/13c34d09b2f8be14fbbe4be77c49b23066667f1b)## [v0.8.1](https://github.com/http-party/node-http-proxy/compare/v0.8.0...v0.8.1) - 2012-06-05### Merged- [misc] Updating the changelog. Close #137 [`#256`](https://github.com/http-party/node-http-proxy/pull/256)- Fix problem with req.url not being not properly replaced. [`#218`](https://github.com/http-party/node-http-proxy/pull/218)- Re-emit 'start', 'forward' and 'end' events in RoutingProxy, and fix some hanging issues. [`#216`](https://github.com/http-party/node-http-proxy/pull/216)- Fixes to make the websockets example work. [`#225`](https://github.com/http-party/node-http-proxy/pull/225)- [minor] Syntax error [`#222`](https://github.com/http-party/node-http-proxy/pull/222)- [docs] Making README links consistent with latest project structure. [`#208`](https://github.com/http-party/node-http-proxy/pull/208)- [docs] improved grammar [`#205`](https://github.com/http-party/node-http-proxy/pull/205)- proposed doc addition for #180 [`#189`](https://github.com/http-party/node-http-proxy/pull/189)### Fixed- Merge pull request #256 from nodejitsu/changelog [`#137`](https://github.com/http-party/node-http-proxy/issues/137)- [misc] Updating the changelog. Close #137 [`#137`](https://github.com/http-party/node-http-proxy/issues/137)### Commits- Whitespace fixes [`e9fd3f4`](https://github.com/http-party/node-http-proxy/commit/e9fd3f43d7e890f0164b5a03a34f196dd162d043)- Added example for gzip middleware using a ProxyTable. [`6201328`](https://github.com/http-party/node-http-proxy/commit/62013281b8a980c53a38362f10d746bfbf36c52e)- [examples] Added simple load balancer example [`fd7fcd8`](https://github.com/http-party/node-http-proxy/commit/fd7fcd8decbf0c7ab00cab84e151991e380b8fae)- [dist] Update author field for consistency [`27316e2`](https://github.com/http-party/node-http-proxy/commit/27316e22e8e7786252583cdb9131cfd8cacb07c1)- Add documentation for listening for proxy events to prevent a common mistake. [`4f2bc58`](https://github.com/http-party/node-http-proxy/commit/4f2bc58431c7f44d486ee8c1ee3136b3637f9405)- Fix RoutingProxy hanging when there is an error [`b26b434`](https://github.com/http-party/node-http-proxy/commit/b26b434e9fc501f7e0c4a966dbee6220c355bc7c)- prefer `target.hostname` over `target.host` [`c4d185d`](https://github.com/http-party/node-http-proxy/commit/c4d185dca9696c77d5c38d24d897c2679f6762a0)- [doc] Fix style in websockets example [`ed06af9`](https://github.com/http-party/node-http-proxy/commit/ed06af97efe406ea2533009be64a6b568f9d0601)- Add tests for remapping URL properly. [`5d839dd`](https://github.com/http-party/node-http-proxy/commit/5d839dd5f8890c6d2af96807b96d1bd5bb0f7276)- fixed comment typos in examples/http/proxy-https-to-http.js and proxy-https-to-https.js, lines 37 and 46 [`868f7e7`](https://github.com/http-party/node-http-proxy/commit/868f7e7a287c4709c541c077f3e2303f45b1f072)- [misc] changelog updated to version 0.8.1 [`e9a3a30`](https://github.com/http-party/node-http-proxy/commit/e9a3a3012c5507dff46afd3e5cececf43b1717ae)- Implement RoutingProxy.prototype.remove [`0532995`](https://github.com/http-party/node-http-proxy/commit/0532995dfa0be53d285c886a9922b8915f297d36)- Making README links consistent with latest project structure. [`7fa6599`](https://github.com/http-party/node-http-proxy/commit/7fa6599f4f2c92bb29bc5fc8a9ba06d704652c5e)- Address ticket #180 here since that problem is so hard to discover when you run into it. If there was an error, people would search for the error text, but there isn't. [`73e415a`](https://github.com/http-party/node-http-proxy/commit/73e415a22634bfc9e5993377902f67ac3212714a)- [tests] used socket.io 0.6.17 fixed version for tests [`45d67f4`](https://github.com/http-party/node-http-proxy/commit/45d67f42cba373db4f47765d6a3dd38a7d19dae6)- [fix] x-forwarded-proto sets properly [`ca37ad7`](https://github.com/http-party/node-http-proxy/commit/ca37ad74367764cca479a1af63bd7491dc79606b)- [doc] add missing {} to make an object [`843901e`](https://github.com/http-party/node-http-proxy/commit/843901eeeb24611ad24889f13edcbfd5dee4314d)- fix the broken english and clarified the sentence (I hope) [`e15db4f`](https://github.com/http-party/node-http-proxy/commit/e15db4fb50db3e2191f3ebd30e12eeed9c376bc2)- Re-emit 'start', 'forward' and 'end' events in RoutingProxy. [`99ee542`](https://github.com/http-party/node-http-proxy/commit/99ee54259eae70c0c680ee82efc7dd184313f182)- [doc] call listen() to get the server started [`4fc1ee8`](https://github.com/http-party/node-http-proxy/commit/4fc1ee85d35d9feb468f808ddd11aaf186eaedd4)- syntax error fixed [`5842d0e`](https://github.com/http-party/node-http-proxy/commit/5842d0ee7de875378d9b8ae240748dd2af567be9)- [dist] Version bump 0.8.1 [`81f6095`](https://github.com/http-party/node-http-proxy/commit/81f6095cf08f84a84ae2bbda7ca0315729638fe0)- finally removed hidden char [`4358a4c`](https://github.com/http-party/node-http-proxy/commit/4358a4c1225acf8c13536fd742b845166f3a65a6)- [minor fix] delete white space [`df650d1`](https://github.com/http-party/node-http-proxy/commit/df650d11dd0a47653a4905f871d8d3d6c327d600)## [v0.8.0](https://github.com/http-party/node-http-proxy/compare/v0.7.3...v0.8.0) - 2011-12-23### Merged- Fix issue where front-end is HTTPS, back-end is HTTP, and server issues a redirect. [`#165`](https://github.com/http-party/node-http-proxy/pull/165)- Modified the ad-hoc proxy lookup to use _getKey(), rather than the error-prone in-line method. [`#164`](https://github.com/http-party/node-http-proxy/pull/164)- Allows node-http-proxy to append new values to existing headers for incoming "x-forward-for","x-forward-proto" and "x-forward-port" [`#163`](https://github.com/http-party/node-http-proxy/pull/163)- [fix] only set one drain listener while paused [`#136`](https://github.com/http-party/node-http-proxy/pull/136)- [docs] grammar correction [`#134`](https://github.com/http-party/node-http-proxy/pull/134)### Fixed- [fix] Avoid `Transfer-Encoding: chunked` for HTTP/1.0 client, closes #59. [`#59`](https://github.com/http-party/node-http-proxy/issues/59)### Commits- [refactor minor] Update vendor/websocket.js to be compatible with node@0.6.x [`ea7fea6`](https://github.com/http-party/node-http-proxy/commit/ea7fea627255ed34d39902438b55e740c7c9b08c)- [test] Add common.js file from core [`543f214`](https://github.com/http-party/node-http-proxy/commit/543f214361605cffdbee7b233029edf343c358c1)- [test] Add core `test-http-proxy` test [`feb324b`](https://github.com/http-party/node-http-proxy/commit/feb324b0d4c0a2307493b35be944ed08ffc9187a)- [test] Add core `test-http` test [`25a9e2d`](https://github.com/http-party/node-http-proxy/commit/25a9e2d217cabef07d6f161f5d6ded49342dbb2f)- [test] Add core `test-http-host-headers` test [`f298411`](https://github.com/http-party/node-http-proxy/commit/f298411f76a106791f34dd4d31ea033a7bdca9c7)- [test] Add core `test-http-extra-response` test [`c26ab5e`](https://github.com/http-party/node-http-proxy/commit/c26ab5e46ff2649f0ea6585f20d8f58b7d0cadef)- [test] Add core `test-http-set-cookies` test [`b3b5cce`](https://github.com/http-party/node-http-proxy/commit/b3b5cce3aee98a7fd5b50fb8e1bd6bd5e1c7512f)- [test] Add core `test-http-client-abort` test [`7bf8d4a`](https://github.com/http-party/node-http-proxy/commit/7bf8d4a7be668591b350144b4546559abf9a0b5f)- [test] Add core `test-http-client-upload` test [`7648fe5`](https://github.com/http-party/node-http-proxy/commit/7648fe50c1859597dc390e9e628db938372483e7)- [test] Add core `test-http-client-upload-buf` test [`5ac9878`](https://github.com/http-party/node-http-proxy/commit/5ac987857c934d07073b853f5243d2d8fc6d8c2b)- [test] Add core `test-http-upgrade-server2` test [`bc98c0d`](https://github.com/http-party/node-http-proxy/commit/bc98c0dbce154ef266eef83d3c2f737a2d60f0e6)- [test] Implement basic runner for multiple tests [`a4079c6`](https://github.com/http-party/node-http-proxy/commit/a4079c6a1c8b87334d12d47d67f060cbb1214696)- [test] Add core `test-http-upload-timeout` test [`60ff181`](https://github.com/http-party/node-http-proxy/commit/60ff181af9c22405d3822ce5955f178ab13de79d)- [test] Add core `test-http-status-code` test [`82060a5`](https://github.com/http-party/node-http-proxy/commit/82060a53430de05f2dc95450d8487bc8139544d5)- [test] Add core `test-http-many-keep-alive-connections` test [`4e1ca6e`](https://github.com/http-party/node-http-proxy/commit/4e1ca6e61899b11cad1b437cc9d9490b9d856665)- [test] Add core `test-http-chunked` test [`d7461f3`](https://github.com/http-party/node-http-proxy/commit/d7461f3206cca0691fbd438545ff325589770627)- [test] Add core `test-http-head-response-has-no-body-end` test [`13389db`](https://github.com/http-party/node-http-proxy/commit/13389db1bef38a7fc7ddc3ada479a608f033020c)- [test] Add core `test-http-server-multiheaders` test [`d7f15d0`](https://github.com/http-party/node-http-proxy/commit/d7f15d02f7477c76529fc76daddee5029079eb2d)- [test] Add core `test-http-multi-line-headers` test [`35d2088`](https://github.com/http-party/node-http-proxy/commit/35d2088c96bacb44b17755176b6e9451ed0299dd)- [test] Add core `test-http-head-response-has-no-body` test [`f79f3ad`](https://github.com/http-party/node-http-proxy/commit/f79f3adf0295ec5bb7fb9f6525b48ba5209d04c6)- [refactor] Improved event handler cleanup [`9f92332`](https://github.com/http-party/node-http-proxy/commit/9f923325d08ac018a3325beaa9e0805b5eda61e6)- [fix minor] Correctly set x-forwarded-proto in WebSocket requests [`c81bae2`](https://github.com/http-party/node-http-proxy/commit/c81bae2fdde3bf0087fe71a39855c61c43ffb145)- Revert "[refactor] Improved event handler cleanup " [`c83d88e`](https://github.com/http-party/node-http-proxy/commit/c83d88ee88faac10b53cd4296165ed85f26036b4)- Allowing the common proxy headers' value to be appended in proxy chain scenarios. [`621f9b4`](https://github.com/http-party/node-http-proxy/commit/621f9b425a272421de98a674f1679f0c47912733)- [test] Add basic test runner [`87999d0`](https://github.com/http-party/node-http-proxy/commit/87999d028880dfccca349c9c44f9e66a613c4d38)- [examples] Add some hand-crafted middleware [`6e65c20`](https://github.com/http-party/node-http-proxy/commit/6e65c20017a2e1a87dc6d58e847bc6db16440f3c)- [test] Add core `test-http-malformed-request` test [`a635389`](https://github.com/http-party/node-http-proxy/commit/a6353897cdbe8c380d52a060f5e66784f67ad98e)- [example] Response modification middleware [`dd83199`](https://github.com/http-party/node-http-proxy/commit/dd8319972c1c2f9421a90a21dce9560fd5ca199f)- [test] Add core `test-http-head-request` test [`c0857f2`](https://github.com/http-party/node-http-proxy/commit/c0857f2d59c33d91cb3e0c131c44ec1667f592fa)- [test] Add core `test-http-response-close` test [`f1c0be3`](https://github.com/http-party/node-http-proxy/commit/f1c0be3f0bd2c5e87d44a37ba4f29aafd9903ad4)- [refactor] core proxy logic. all tests should be passing. [`63ac925`](https://github.com/http-party/node-http-proxy/commit/63ac9252606d23e2003696da1fb34a539abee7ca)- [test] Add core `test-http-contentLength0` test [`275109b`](https://github.com/http-party/node-http-proxy/commit/275109b2f8c8519c56ca9f456096d4002698fab1)- [test] Add core `test-http-client-abort2` test [`98bbe54`](https://github.com/http-party/node-http-proxy/commit/98bbe541e4fa581f1b9e2eadb821c0609da6ab81)- adding tests for url segment proxytable routing [`91e9bb9`](https://github.com/http-party/node-http-proxy/commit/91e9bb90709cc8a361066d6f6b8f51f58bfd7e36)- [test] Add core `test-http-eof-on-connect` test [`80c216d`](https://github.com/http-party/node-http-proxy/commit/80c216df0cc59b88c6934f795c03ea16a737af34)- [example] Replace `sys` usages with `util` [`8d701bb`](https://github.com/http-party/node-http-proxy/commit/8d701bb20b593c6cdf0ff1bc35cf83051b21a35e)- [refactor] Updates to support http2 from @mikeal [`5b52c89`](https://github.com/http-party/node-http-proxy/commit/5b52c896947db42ac01e6038c9170d8859d33aea)- [refactor] Listen for `socket` events since reverseProxy.socket is no longer set synchronously [`3828616`](https://github.com/http-party/node-http-proxy/commit/38286168161d4f4ad24d2ad95ccd8335e9ed08a4)- [test] Run tests in `test/core/simple` by default [`68cebbe`](https://github.com/http-party/node-http-proxy/commit/68cebbe0e79ea283eea8a1ca850ab462c66c611a)- simplify proxytable path segment rewrite logic [`c03a450`](https://github.com/http-party/node-http-proxy/commit/c03a450d9b952e1463ae2609303029e317ff5da2)- change proxytable routing to route one level shallower [`4d50915`](https://github.com/http-party/node-http-proxy/commit/4d50915373b6afaafc7857a3e9366e8e77315683)- [docs] Little explanation for test/core directory [`8ca5d83`](https://github.com/http-party/node-http-proxy/commit/8ca5d83497cc106a2456ff7f2ebe3db5c8634d69)- [minor] Allow user to set `colors.mode` [`48d4a8b`](https://github.com/http-party/node-http-proxy/commit/48d4a8b263faa9acda06651bceeff50881f21b26)- [minor] Indentation fix [`9e630da`](https://github.com/http-party/node-http-proxy/commit/9e630daf81d10485206ec136c3e1a07fe065ffeb)- [v0.6] `http.Agent` uses different structure for sockets [`86b4122`](https://github.com/http-party/node-http-proxy/commit/86b4122323ca32d455714b1149b99acce49a9e45)- [minor] Nicer output from test runner [`5c3d41b`](https://github.com/http-party/node-http-proxy/commit/5c3d41bf4e101d0250fb0b3db4a8dc078104dcad)- Modified the ad-hoc proxy lookup to use _getKey(), rather than the [`553e7fb`](https://github.com/http-party/node-http-proxy/commit/553e7fbc335a9befd166d472f057aa50452a9d40)- [fix] When client request is aborted, abort server request [`4d43d81`](https://github.com/http-party/node-http-proxy/commit/4d43d81e5c2d7c8088716d4fd574019f43ebb5ce)- Fixes memory leak when clients abort connections [`c98ccb4`](https://github.com/http-party/node-http-proxy/commit/c98ccb40e9fe5c5198a1605fa8835efc3ff1856c)- [fix test] Make test runner exit after test exits [`31a8c68`](https://github.com/http-party/node-http-proxy/commit/31a8c6800ddf8d91b477d980605a4c19284a1648)- [test dist] Run core tests on `npm test` [`8358ef8`](https://github.com/http-party/node-http-proxy/commit/8358ef8a2bdf817c8ed515be7bc9cec0a9b5f486)- don't add upgrade handler if a custom handler is passed in [`d6ea3a4`](https://github.com/http-party/node-http-proxy/commit/d6ea3a425c203695394eaba4ce8abd57f7809e98)- always emit end in 0.4 [`182dcd3`](https://github.com/http-party/node-http-proxy/commit/182dcd34555f361c1bb2b8d2777689e64ce32f87)- [fix] Fix incorrect depth check. [`3ab02f3`](https://github.com/http-party/node-http-proxy/commit/3ab02f3ad7f2c59d73c621695eb238233c16d09c)- [minor] Everybody loves Unicode [`38bd906`](https://github.com/http-party/node-http-proxy/commit/38bd906f2bc9322b156b92c47457bb7904f0d23a)- [test minor] Update copyright notice on test runner [`2ccc5c7`](https://github.com/http-party/node-http-proxy/commit/2ccc5c73eaef30ab5a2af7e456bfcc270583c460)- [minor] When running tests output only basename [`e109eba`](https://github.com/http-party/node-http-proxy/commit/e109eba9724494737021579938c1094c9dfbc8ee)- [dist] Version bump. 0.8.0 [`5055689`](https://github.com/http-party/node-http-proxy/commit/5055689a11f3b990f848bf2699e0111d9e708d5f)- Revert "[dist] Adjusted engines field to allow for 0.6; version bump 0.7.7" [`1e33434`](https://github.com/http-party/node-http-proxy/commit/1e33434fcc4772c233825b5aada7472113c0be50)- changeOrigin option: set the host header to the proxy destination [`f27d26f`](https://github.com/http-party/node-http-proxy/commit/f27d26f4515c900ea4cf1756ef279257a189e308)- [dist] Adjusted engines field to allow for 0.6; version bump 0.7.7 [`30dac89`](https://github.com/http-party/node-http-proxy/commit/30dac898f30a8508b4c4b4236e9438987f320167)- [fix] In routing proxy, match line beginning [`63dfc7f`](https://github.com/http-party/node-http-proxy/commit/63dfc7f1757fc9a1a9bceeb3b035e97be6504692)- [v0.6] Don't use `agent.appendMessage()` [`6655e01`](https://github.com/http-party/node-http-proxy/commit/6655e0164216449a97090651230266da8ced0150)- bump version 0.7.4 [`3dfba2b`](https://github.com/http-party/node-http-proxy/commit/3dfba2ba4591e0fcd65ff0bfd012b3ab749a0a02)- bump version 0.7.6 [`c5dc929`](https://github.com/http-party/node-http-proxy/commit/c5dc9295c711177c165bfb34c67407e1a5a0ed06)- Revert "update outgoing.headers.host incase the destination does proxying" [`2061c71`](https://github.com/http-party/node-http-proxy/commit/2061c713664b044852fdf67aa5e173e5c3b6d874)- update outgoing.headers.host incase the destination does proxying [`65b7872`](https://github.com/http-party/node-http-proxy/commit/65b7872e6ad433deae4de823c63629cb341bd649)- bump version 0.7.5 [`b4d41c3`](https://github.com/http-party/node-http-proxy/commit/b4d41c3628ade82792eb361b095ab014a88d537a)- [minor] Fix indent on timeout notice [`c4124da`](https://github.com/http-party/node-http-proxy/commit/c4124da4f25860497790fc06c97dde6e8985ab73)- [minor] Change test runner output order [`b76680b`](https://github.com/http-party/node-http-proxy/commit/b76680b045f69e03759bc119f4827f337a8f395d)- grammar correction [`729496d`](https://github.com/http-party/node-http-proxy/commit/729496d2898612969f5369e7f1c313cb4034f96c)- [dist] Test runner depends on `async` [`219b0ff`](https://github.com/http-party/node-http-proxy/commit/219b0ff8f8780cde4714267273b0a1637c84679f)- [test fix] Remove unnecessary console.log in tests/websocket/websocket-proxy-test.js [`f188f4f`](https://github.com/http-party/node-http-proxy/commit/f188f4ffd8c47b6312cd88c28de7e5ac63565047)- [test refactor] `test/core/{run => run-single}` [`004be38`](https://github.com/http-party/node-http-proxy/commit/004be38048792d6f1d3efb361a5e7e66d5dbee8d)## [v0.7.3](https://github.com/http-party/node-http-proxy/compare/v0.7.2...v0.7.3) - 2011-10-03### Commits- added what is necessary for having proxyError on Routing proxywq [`b7adf86`](https://github.com/http-party/node-http-proxy/commit/b7adf866b595f0d64a3ef6bde19271276450e723)- [dist] Version bump. 0.7.3 [`db185bb`](https://github.com/http-party/node-http-proxy/commit/db185bb303ce9c413b2abccbc885f8ec43b61202)## [v0.7.2](https://github.com/http-party/node-http-proxy/compare/v0.7.1...v0.7.2) - 2011-09-30### Merged- [fix] Examples have working require paths now. [`#118`](https://github.com/http-party/node-http-proxy/pull/118)### Commits- [fix] Fixed require paths in examples [`2e8d4c6`](https://github.com/http-party/node-http-proxy/commit/2e8d4c6e49e2e9b27443c0b9ae2b96331715402b)- [websockets] add latest websockets support [`45ef87e`](https://github.com/http-party/node-http-proxy/commit/45ef87e71bc9cccefe5fb6afc3121fb09b8efbc3)- [dist] Version bump. 0.7.2 [`ccccc45`](https://github.com/http-party/node-http-proxy/commit/ccccc45f11fbe535017b1806fad43578f143649d)## [v0.7.1](https://github.com/http-party/node-http-proxy/compare/v0.7.0...v0.7.1) - 2011-09-21### Merged- Readme fixes [`#114`](https://github.com/http-party/node-http-proxy/pull/114)- #107: Set x-forwarded-for header (amongst others) [`#110`](https://github.com/http-party/node-http-proxy/pull/110)- command line tool - make sure targetPort is an integer [`#109`](https://github.com/http-party/node-http-proxy/pull/109)### Fixed- [dist] Version bump v0.7.1, closes #107 #112 [`#107`](https://github.com/http-party/node-http-proxy/issues/107)### Commits- [test] Added a test for the "x-forwarded-for" header [`66e9820`](https://github.com/http-party/node-http-proxy/commit/66e982060c6c41ad7dfadce1403c8e13d267781a)- [docs] Updated examples in README.md for 0.7.x API. [`24ef919`](https://github.com/http-party/node-http-proxy/commit/24ef9194953c27fb11a8f1ceb499e5feca11c30c)- [examples] Updated examples to v0.7.x API. [`8fc8d96`](https://github.com/http-party/node-http-proxy/commit/8fc8d966c4681d514af00516b348105608e13382)- [examples] More fixes to examples. [`549360a`](https://github.com/http-party/node-http-proxy/commit/549360a462c134cc2b02301070209084ec94c393)- [fix] x-forwarded http headers should set properly. [`2677bb6`](https://github.com/http-party/node-http-proxy/commit/2677bb6c44244ea0b584db744955bedf7aee2c62)- [fix] connection.socket -> socket for source of x-forwarded-for data [`1f33943`](https://github.com/http-party/node-http-proxy/commit/1f33943b231cdf2cb619977801c7b0d4e98ab6df)- Make sure the target port is an integer [`5ba25aa`](https://github.com/http-party/node-http-proxy/commit/5ba25aa3451f131b6c6c8892848a4f236f5b859e)## [v0.7.0](https://github.com/http-party/node-http-proxy/compare/v0.6.6...v0.7.0) - 2011-09-10### Fixed- [fix] Add `x-forward-*` headers for WebSocket requests. Closes #74 [`#74`](https://github.com/http-party/node-http-proxy/issues/74)- [doc] Document `setMaxSockets`. Fixes #81 [`#81`](https://github.com/http-party/node-http-proxy/issues/81)### Commits- [api test dist] Stubbed out the API for the higher-level `RoutingProxy` object to be exposed by `node-http-proxy` [`5927ecd`](https://github.com/http-party/node-http-proxy/commit/5927ecd62a082269c3b6a0ae4f5b4a673784bcdb)- [api] Finalized the RoutingProxy API [`f765f90`](https://github.com/http-party/node-http-proxy/commit/f765f90ec37defaa2b493f859a982add51e25b76)- [minor] Move private methods to the bottom of file(s) [`ec03d72`](https://github.com/http-party/node-http-proxy/commit/ec03d72c5d8749aee835f571869f69816be02265)- [test] Updated tests to reflect finalized API of the RoutingProxy [`734769f`](https://github.com/http-party/node-http-proxy/commit/734769fa9b2c3054d45e33c3e552af80ce3f4740)- [api doc] Rebuilt httpProxy.createServer() with the newer high-level RoutingProxy API [`598fe2e`](https://github.com/http-party/node-http-proxy/commit/598fe2e38def56518a1f0a8196b2fcb7f1bc569e)- [minor] Remove commented out debug statements. [`5575bcf`](https://github.com/http-party/node-http-proxy/commit/5575bcf60c87def74d1755b2e5cc73e085dbf8c3)- [doc] Updated examples [`13eaec5`](https://github.com/http-party/node-http-proxy/commit/13eaec55dc50e2aae164cb8adaa0f1a3c5a66c68)- Add flow control [`6a7fd14`](https://github.com/http-party/node-http-proxy/commit/6a7fd14bfa9f25694d75cf490e32817ff15a94fe)- Add flow control [`2b9e09b`](https://github.com/http-party/node-http-proxy/commit/2b9e09b00ac40e6c6de2b68754df7b8e8c1e3878)- Emit drain if it doesn't happen on its own in 100ms [`37e2541`](https://github.com/http-party/node-http-proxy/commit/37e25418916a31e4a513ee5866d6013858d579cf)- resume() can throw [`558a8a4`](https://github.com/http-party/node-http-proxy/commit/558a8a4f79716496dbdee13759c8641606458c05)- [fix] Memory leak hunting. [`ca1d12c`](https://github.com/http-party/node-http-proxy/commit/ca1d12cf1bbfbe98b5159f9c02e2f6c818a1c749)- Emit drain if it doesn't happen on its own in 100ms [`84be9f2`](https://github.com/http-party/node-http-proxy/commit/84be9f2c3a244c7dbfe2c6320fa26d85cf80ec31)- resume() can throw [`0c71119`](https://github.com/http-party/node-http-proxy/commit/0c71119ee58ee84068120be72308ecb28cb3e532)- [dist] Update examples/package.json to conform to nodejitsu style guidelines [`2937229`](https://github.com/http-party/node-http-proxy/commit/29372298208135f571538cc29dcc05f41f79b01c)- Fixed large DoS vector in the middleware implementation [`0e36912`](https://github.com/http-party/node-http-proxy/commit/0e36912906640fdb007e0492b75c3f6a7b580ec6)- [api] Added new `close()` method which cleans up sockets from HttpProxy instances [`0eae2a9`](https://github.com/http-party/node-http-proxy/commit/0eae2a913a2173d85478f8c9deec929388284ee2)- Fixed large DoS vector in the middleware implementation [`07c8d2e`](https://github.com/http-party/node-http-proxy/commit/07c8d2ee6017264c3d4deac9f42ca264a3740b48)- [minor] More contextual errors when middleware(s) error [`38315f6`](https://github.com/http-party/node-http-proxy/commit/38315f6b1f7b01bc6e55587878a57590135945c0)- [dist] Update scripts in package.json [`6e1ade0`](https://github.com/http-party/node-http-proxy/commit/6e1ade0bb8174b744abb58df72b098bd96134ca4)- [dist] Version bump. 0.7.0 [`0182ba3`](https://github.com/http-party/node-http-proxy/commit/0182ba37cd4c618cd50947ea2addef823349e49f)- [merge] Merge from significant internal refactor in v0.7.x. No external API changes [`f7010e5`](https://github.com/http-party/node-http-proxy/commit/f7010e5169ac23114b9b35da272e9a041743fbb9)- [minor] Small update to bin/node-http-proxy [`2cd8256`](https://github.com/http-party/node-http-proxy/commit/2cd8256c4d6089409f603655ea3b3a5ccf1fb065)- [dist] Update .gitignore [`6c1c554`](https://github.com/http-party/node-http-proxy/commit/6c1c5544515bf17f0e6ed3588e16ae1a75f8a25b)- [doc] Update README.md [`0ba5023`](https://github.com/http-party/node-http-proxy/commit/0ba5023e82fe8a08ed55194644d147c323368f41)- [doc] Drop version number from README.md. [`bdf48be`](https://github.com/http-party/node-http-proxy/commit/bdf48bea36eae441c775e9321ab6e17db470bf27)- [dist] Version bump. 0.7.0 [`00e34a1`](https://github.com/http-party/node-http-proxy/commit/00e34a10bd9ffca9e636b2e5aebb4f18ff6765ec)- [test] Whitespace fix [`3a4d312`](https://github.com/http-party/node-http-proxy/commit/3a4d312eda08e7a5cecb3c82b04023e22f368e2b)- [dist] Reorganize examples based on classification(s): http, websocket, or middleware [`81d6c31`](https://github.com/http-party/node-http-proxy/commit/81d6c318758231f77a52fab7de174fcc63b7a243)## [v0.6.6](https://github.com/http-party/node-http-proxy/compare/v0.6.5...v0.6.6) - 2011-08-31### Commits- Memory leak hunting. [`f4fcf93`](https://github.com/http-party/node-http-proxy/commit/f4fcf934030e84c15cceca620e974aafc35f1691)- [fix] Add guards to every throw-able res.end call [`e1c41d0`](https://github.com/http-party/node-http-proxy/commit/e1c41d06942b56f6cd65a079ae78b54456a8bbe1)- [fix] Only set `x-forward-*` headers if req.connection and req.connection.socket [`de4a6fe`](https://github.com/http-party/node-http-proxy/commit/de4a6fe8a5f78460b030e635e5f4a63312cd4a76)- [dist] Version bump. 0.6.6 [`967884c`](https://github.com/http-party/node-http-proxy/commit/967884c5de311f21b8405a5030730ef8db912531)## [v0.6.5](https://github.com/http-party/node-http-proxy/compare/v0.6.4...v0.6.5) - 2011-08-29### Commits- [fix] Use `req.connection` for all x-forward-* headers [`f6dc12a`](https://github.com/http-party/node-http-proxy/commit/f6dc12a971fdd892614b32d2a4fb2ff39ddc0e67)- [dist] Version bump. 0.6.5 [`7beead5`](https://github.com/http-party/node-http-proxy/commit/7beead54654bdc7f9ab4ed0c17000118a3e7b4fc)## [v0.6.4](https://github.com/http-party/node-http-proxy/compare/v0.6.3...v0.6.4) - 2011-08-28### Fixed- Fix #95 Don't look on req.connection if it's not set. [`#95`](https://github.com/http-party/node-http-proxy/issues/95)### Commits- [api breaking] Begin refactor to optimize node-http-proxy by managing one instance of HttpProxy per `host:port` location [`d2b0e43`](https://github.com/http-party/node-http-proxy/commit/d2b0e4399e8026d3e2ece78ac8fdb1def6649950)- [api test] Updated httpProxy.createServer() for new API exposed by simplified HttpProxy object. [`be4562d`](https://github.com/http-party/node-http-proxy/commit/be4562da9fafef8b26856f7f73f6c5a2c4e389b0)- [test fix] A few minor fixes to ensure basic WebSocket tests are working. Better scope tests by supported protocol [`daf9231`](https://github.com/http-party/node-http-proxy/commit/daf9231a66f10a25782d2227df1b1501099ac5d1)- [test] Updates for readability [`db10c4a`](https://github.com/http-party/node-http-proxy/commit/db10c4af918c3e4bc448163f4b9e9b9267145d47)- Add guards to every throw-able res.end call [`7bda25b`](https://github.com/http-party/node-http-proxy/commit/7bda25b1c60d082f0f2fd12fc61b45a33b74f13d)- [minor] Dont use `.bind()` [`340be42`](https://github.com/http-party/node-http-proxy/commit/340be42797e87fcc11859a771200075e7fe0c5f1)- [dist] Version bump. 0.6.4 [`216d46d`](https://github.com/http-party/node-http-proxy/commit/216d46dc81bda1aeb0feb1318e34f37bee38c8fb)## [v0.6.3](https://github.com/http-party/node-http-proxy/compare/v0.5.11...v0.6.3) - 2011-08-28### Merged- This adds a flag to ProxyRequest to disable the setting of x-forwarded-[for|port|proto] [`#73`](https://github.com/http-party/node-http-proxy/pull/73)### Fixed- Merge branch 'patch-1' of https://github.com/KimSchneider/node-http-proxy [`#80`](https://github.com/http-party/node-http-proxy/issues/80)### Commits- [minor] Style updates and whitespace cleaning for consistency [`f0917a3`](https://github.com/http-party/node-http-proxy/commit/f0917a3f97e8df2d58252f14c15ec54369c969ae)- [api] refactor out middlewares from examples. [`2cf4e0a`](https://github.com/http-party/node-http-proxy/commit/2cf4e0a9e6c78dfd093c098fc87100ae71bc9450)- [docs] add middleware examples (first draft) [`020290a`](https://github.com/http-party/node-http-proxy/commit/020290a162146c4996831f4f13d71c1dc949f508)- [fix] use routing table mhen proxying WebSockets. [`efa17ef`](https://github.com/http-party/node-http-proxy/commit/efa17ef6cf614b763fc3b76570a24e750e2ddd31)- Tested & fixed url middleware example, added comments. [`4cc18f4`](https://github.com/http-party/node-http-proxy/commit/4cc18f4217739b0bd1b3ac88287cc8a23d486b6b)- [minor] add middleware to node-http-proxy [`b54666f`](https://github.com/http-party/node-http-proxy/commit/b54666ff69c574d842ce1349700c6b6248484d24)- [minor] add middleware to node-http-proxy [`c773eed`](https://github.com/http-party/node-http-proxy/commit/c773eedeb6d0b22e2b41ab9215cfdc064a8095e3)- [minor] add url-proxying middleware example [`45f3df8`](https://github.com/http-party/node-http-proxy/commit/45f3df80937ffd5854727c91ea6b0e09cf77e160)- [fix] Removed bad example. [`2626308`](https://github.com/http-party/node-http-proxy/commit/2626308cd845982c82a284b0d0bc064090aaf116)- [minor] add example to test concurrency [`6ec8d6c`](https://github.com/http-party/node-http-proxy/commit/6ec8d6caace3797841c0447feb081aa7920aa0dd)- [minor] add example of using middleware to gzip response [`d3c0697`](https://github.com/http-party/node-http-proxy/commit/d3c06973a1bf1f1c54ca55a5d7f93b77133ef9a2)- support old (port,host) and (options) style when using middlewares [`7976de1`](https://github.com/http-party/node-http-proxy/commit/7976de1121a40f963e18ea0a4673d185f847df4c)- [minor] Added body decoder middleware example. Needs fixing. [`8eaec35`](https://github.com/http-party/node-http-proxy/commit/8eaec3507456731c1138c0b8ebb4e51dedc7c300)- [minor dist] Use `pkginfo`. Minor updates to variable scoping in `.createServer()` [`5d0bbb3`](https://github.com/http-party/node-http-proxy/commit/5d0bbb38c3af14907567e2dc7c4f84a915b60ce5)- [doc] add comments to examples/url-middleware.js [`f6484de`](https://github.com/http-party/node-http-proxy/commit/f6484de4112463c74105db82d27f131d64478f1d)- Handle cases where res.write throws [`be3a0d8`](https://github.com/http-party/node-http-proxy/commit/be3a0d84a1e75b45bc1fc63fe63cdabd9844eb59)- [minor] code style changes [`8b48b7e`](https://github.com/http-party/node-http-proxy/commit/8b48b7e0af656fdbd6da2b16ec6365beec47c302)- [doc] note in readme about middleware [`b5d5eaa`](https://github.com/http-party/node-http-proxy/commit/b5d5eaababa276f7d197e4b6a8a771b364b73139)- Allow forwarding for x-forwarded-[for|port|proto] to enabled layering of http-proxies. [`404818b`](https://github.com/http-party/node-http-proxy/commit/404818b1dce9e77a917ce9f0c187772eb8c18042)- [style] tidy [`0f8fe8e`](https://github.com/http-party/node-http-proxy/commit/0f8fe8e2460fd27edfba44989b78aa6b8c9a38e2)- [fix] do not use middleware code if it's not needed [`2012588`](https://github.com/http-party/node-http-proxy/commit/20125889b362c61c85924810de446e1e7b18d079)- [minor] minor fixes to gzip middleware example [`caa1f49`](https://github.com/http-party/node-http-proxy/commit/caa1f494ab4effabad6d08272c3606c1d82005ea)- [minor] default enableXForwarded to true [`e3d95ec`](https://github.com/http-party/node-http-proxy/commit/e3d95ecab24700535184df32f3a97e8699099b7f)- Updating to enableXForwarded [`ee3506a`](https://github.com/http-party/node-http-proxy/commit/ee3506a8e7262f780eeada331898d42ca0e9838a)- [api] Expose adapted version of `stack` so it can be used with HttpProxy instances not created by `httpProxy.createServer()` [`5d6e6b9`](https://github.com/http-party/node-http-proxy/commit/5d6e6b9f78eb98b28db01490a36b23c1aade133f)- The number of maxSockets has to be set after the agent is created. Setting the property in the constructor does not work. [`2caa5d2`](https://github.com/http-party/node-http-proxy/commit/2caa5d2b0d55898c133a0bf3a0048ee969efb121)- [fix] Dont use res.* in proxyWebSocketRequest [`f7452bc`](https://github.com/http-party/node-http-proxy/commit/f7452bc42d963406f7ee19dfa353d72ce3252dd6)- [fix] fix syntax errors. close issue #86 [`b8f8499`](https://github.com/http-party/node-http-proxy/commit/b8f84994b0515e12c9d87f89f81a8601be47a6ff)- [api] merge middleware branch [`e6ff8d6`](https://github.com/http-party/node-http-proxy/commit/e6ff8d6597a977baf0caf4f69c75bfa93d7281f3)- [dist] Version bump. 0.6.3 [`1389b70`](https://github.com/http-party/node-http-proxy/commit/1389b706b5c1d857c571c2947b7c758b5cc70ca3)- merged [`5ba0f89`](https://github.com/http-party/node-http-proxy/commit/5ba0f89aa356b2e76f5cf64c16e8578d71c45d8a)- [fix] handler variable in createServer was global (!) [`25c06a3`](https://github.com/http-party/node-http-proxy/commit/25c06a3a952068de6a24c643cb0c872f7b9a0846)- [dist] bump version 6.0 [`03475a5`](https://github.com/http-party/node-http-proxy/commit/03475a59445a1c1c1029d0673aafabe63af1e711)- [dist] bump version 0.6.2 [`d8068a8`](https://github.com/http-party/node-http-proxy/commit/d8068a832d437790ce8680b9b34a9f171d75786c)- [dist] bump version 5.12 [`5d33ad7`](https://github.com/http-party/node-http-proxy/commit/5d33ad711895b2afcbd6dd5e1c0449cee1ceae7b)- [dist] bump version 0.6.1 [`fea371d`](https://github.com/http-party/node-http-proxy/commit/fea371dc0a47dfb4f84427e5740e8756f4e5b285)- [fix] broken RegExp [`549bfea`](https://github.com/http-party/node-http-proxy/commit/549bfeac233888ec84edeec350ed5a7377f3773e)- [doc] add note on middleware to Using node-http-proxy section of the README [`5bf2d59`](https://github.com/http-party/node-http-proxy/commit/5bf2d59241a7695f43bb89e5cb41ade2ab7a0ad2)## [v0.5.11](https://github.com/http-party/node-http-proxy/compare/v0.5.10...v0.5.11) - 2011-06-26### Fixed- [api] Simplify the usage for the `.changeHeaders` option. Fixes #34 [`#34`](https://github.com/http-party/node-http-proxy/issues/34)### Commits- [api doc test] node-http-proxy now emits `websocket:*` on important WebSocket events. Added tests for these features and updated some code docs [`4f85ca0`](https://github.com/http-party/node-http-proxy/commit/4f85ca04e425a7d4df1e46c9cadd6026eeed32f6)- [doc] Updated docco docs [`f0649d8`](https://github.com/http-party/node-http-proxy/commit/f0649d8d6a9f84ac61d5f173c585fa4307ffb3c3)- [doc] Added examples/latent-websocket-proxy.js [`fcfe846`](https://github.com/http-party/node-http-proxy/commit/fcfe84626fff15be21ac83ccd69b96bf3ca1f7a2)- [doc] Added sample for custom error messages using the `proxyError` event [`4cdbf0e`](https://github.com/http-party/node-http-proxy/commit/4cdbf0e8729a0665904b577376240c00e56ad876)- [doc] Add examples/standalone-websocket-proxy.js [`1ee8ae7`](https://github.com/http-party/node-http-proxy/commit/1ee8ae710497e239716f72d45e2f61ead3995dc3)- [dist] Version bump. 0.5.11 [`baf0b9e`](https://github.com/http-party/node-http-proxy/commit/baf0b9e25af53e2738812ff78614cc12966e99e3)- [doc] Small update to code docs [`9d9509f`](https://github.com/http-party/node-http-proxy/commit/9d9509f791c4c566629c2e323259885f1c3db7ed)- [minor] Add missing space [`b608a02`](https://github.com/http-party/node-http-proxy/commit/b608a029f8aa26f1a74a917e0bec0ac37e4615a0)## [v0.5.10](https://github.com/http-party/node-http-proxy/compare/v0.5.9...v0.5.10) - 2011-06-13### Commits- [refactor] Manage our own internal list of Agent instances [`887c580`](https://github.com/http-party/node-http-proxy/commit/887c5808c90b7128c040e510e237ddb4d034fe3e)- [doc] Update docco docs for 0.5.9 [`b4ac4d4`](https://github.com/http-party/node-http-proxy/commit/b4ac4d441fe4fb84d463bd889a5ce8d7f4d596ca)- [test] Update tests to use `localhost` [`a1cdf00`](https://github.com/http-party/node-http-proxy/commit/a1cdf005b98c422c777c88a7d7baf2eeb91f732d)- [dist] Version bump. 0.5.10 [`7b574d3`](https://github.com/http-party/node-http-proxy/commit/7b574d3d3e52b09a6445c011b8f2ae0d78282111)- [doc] Bump version in README.md [`653c6ca`](https://github.com/http-party/node-http-proxy/commit/653c6ca1af607623b653d3148b1bb45a304aab87)## [v0.5.9](https://github.com/http-party/node-http-proxy/compare/v0.5.8...v0.5.9) - 2011-05-23### Commits- [fix] Change sec-websocket-location header when proxying WSS --> WS. Added test coverage for this scenario [`028d204`](https://github.com/http-party/node-http-proxy/commit/028d2044e71d70b7bc21d339de29e2275c3be5c2)- [dist] Version bump. 0.5.9 [`57ca62c`](https://github.com/http-party/node-http-proxy/commit/57ca62c878c9a953f2344719556e05492ece3435)## [v0.5.8](https://github.com/http-party/node-http-proxy/compare/v0.5.7...v0.5.8) - 2011-05-21### Commits- [doc] Regenerate docco docs [`c5fd368`](https://github.com/http-party/node-http-proxy/commit/c5fd368a8d803b6ab47e32e744a6fd6a6ca5361f)- [doc] Update docco docs [`74120d8`](https://github.com/http-party/node-http-proxy/commit/74120d8988627bb0686d3a26cb8ec1408cc41287)- [doc] Update to v0.5.7 in code and README.md [`6fd272a`](https://github.com/http-party/node-http-proxy/commit/6fd272ac18240811d8a8a39c85ee483557c414b3)- [dist] Version bump. 0.5.8. Forwards compatible with new versions of nodejs [`76ecb51`](https://github.com/http-party/node-http-proxy/commit/76ecb51e7b41a23288f922c9c5df3ce40f67bf80)- [fix] Dont force `Connection: close` now that Keep-Alive is supported [`a86d18b`](https://github.com/http-party/node-http-proxy/commit/a86d18bc7f93d013df715d1f4d88e651846f645d)- [test] Update to vows description for web-socket-proxy-test.js [`a865fe6`](https://github.com/http-party/node-http-proxy/commit/a865fe662ff04a4badcc90ce2af80d2380c40a85)## [v0.5.7](https://github.com/http-party/node-http-proxy/compare/v0.5.6...v0.5.7) - 2011-05-19### Commits- [api] Add `x-forwarded-proto` and `x-forwarded-port` to proxied HTTP requests [`421895f`](https://github.com/http-party/node-http-proxy/commit/421895fa308d49628bbbb546d542efa96769c3f4)- [dist] Version bump. v0.5.7. Only good on node v0.4.7. See issue #48. [`0911c17`](https://github.com/http-party/node-http-proxy/commit/0911c1719e641c6e4342027e8d5d82c47c6f310e)- [fix] Set `x-forwarded-for` from req.connection.socket.remoteAddress if req.connection.remoteAddress is not defined [`e9b3ec9`](https://github.com/http-party/node-http-proxy/commit/e9b3ec9b1d0ebf427e138176b28af44f0f973670)## [v0.5.6](https://github.com/http-party/node-http-proxy/compare/v0.5.5...v0.5.6) - 2011-05-19### Commits- [fix doc] Add `error` handler to reverseProxy request when proxying WebSockets to prevent unhandled ParseError. Rename some variables in proxyWebSocketRequest to make the code more readable [`76580c2`](https://github.com/http-party/node-http-proxy/commit/76580c292a152c0007352a9d383f59e48993cd03)- [doc] Regenerate docco docs [`bd45216`](https://github.com/http-party/node-http-proxy/commit/bd45216bc9207e5016f394a4bfee2bdffcc669c7)- [api minor] Small refactor to emit `webSocketProxyError` from a single helper function on any of the various `error` events in the proxy chain [`5d2192e`](https://github.com/http-party/node-http-proxy/commit/5d2192e654f23e1b76e0b66554debe1590a3af64)- [api] Manual merge of #46: add custom `proxyError` event and enable production error handling. [`652cca3`](https://github.com/http-party/node-http-proxy/commit/652cca37ea321ec9d1d55125217df0214c8090b6)- [dist] Version bump. v0.5.6 Only good on node v0.4.7. See issue #48. [`f1c0f64`](https://github.com/http-party/node-http-proxy/commit/f1c0f641aa14dc3c267de37370a7369c3131c636)## [v0.5.5](https://github.com/http-party/node-http-proxy/compare/v0.5.4...v0.5.5) - 2011-05-19### Commits- [fix] Change variable references for Websockets, bugs found from using wsbench [`7bf0cae`](https://github.com/http-party/node-http-proxy/commit/7bf0caef9fae86a34719f04f7b9926095fb6a146)- [dist] Version bump. 0.5.5. Only good on node v0.4.7. See issue #48. [`acacc05`](https://github.com/http-party/node-http-proxy/commit/acacc0561f2efabc0a7859b9a410e954f2dca6fd)## [v0.5.4](https://github.com/http-party/node-http-proxy/compare/v0.5.3...v0.5.4) - 2011-05-19### Commits- [doc] Update docco docs [`faf2618`](https://github.com/http-party/node-http-proxy/commit/faf2618cf3b53a972779514842bc4264ec9541fa)- [doc] Update README.md to reflect the new HTTPS to HTTP proxy capabilities [`abc01bc`](https://github.com/http-party/node-http-proxy/commit/abc01bce293f7c1a88f9be08b0540407d2b0f4a1)- [doc test api] Improve node-http-proxy API to allow for HTTPS to HTTP proxying scenarios. Update tests accordingly. [`895f577`](https://github.com/http-party/node-http-proxy/commit/895f577744e3cbcbb5f479c4aacec5323bb001f7)- [doc] Update examples for HTTPS to HTTP proxying [`91737fa`](https://github.com/http-party/node-http-proxy/commit/91737fadb640f30d3cd959f29069537473207efd)- [dist] Version bump. 0.5.4. Only good on node v0.4.7. See issue #48. [`c04eec1`](https://github.com/http-party/node-http-proxy/commit/c04eec1c370ca0eb212c96c0896c27b349f7ea97)- [minor] Update README.md to conform to Github flavored markdown [`32a15dd`](https://github.com/http-party/node-http-proxy/commit/32a15dd79d860343453c38a7eef8339d7b99718b)- [minor] Update README.md to conform to Github flavored markdown [`521fe27`](https://github.com/http-party/node-http-proxy/commit/521fe271853632563143fb4b76c032f7afa7831a)## [v0.5.3](https://github.com/http-party/node-http-proxy/compare/v0.5.2...v0.5.3) - 2011-05-18### Commits- [test] Continued work around Origin mismatch tests [`44a8566`](https://github.com/http-party/node-http-proxy/commit/44a85664a80fd67e20bbc36d280816dbd1a796c5)- [doc] Regenerate docco docs [`9e36d2d`](https://github.com/http-party/node-http-proxy/commit/9e36d2d2e619be322bb73092db2a9d72ef6709e8)- [fix test api] Only change Origin headers in WebSocket requests when the `changeOrigin` option is set explicitly. Added tests to ensure Origin and sec-websocket-origin headers match when proxying websockets. [`9c6c4b9`](https://github.com/http-party/node-http-proxy/commit/9c6c4b908b7d6ce67144ba9d41702b5694254099)- [test] Improve websocket tests to inspect outgoing and incoming HTTP headers to test origin mismatch bugs [`6e679c8`](https://github.com/http-party/node-http-proxy/commit/6e679c8019e1eb62b2b1da48628f89b8046203fd)- [test] Refined tests to begin checking Origin == Sec-Websocket-Origin [`9ab54ab`](https://github.com/http-party/node-http-proxy/commit/9ab54ab47fc43d98f3182da9c41487f524933783)- [doc minor] Update docs and code docs for v0.5.3 release [`03b9087`](https://github.com/http-party/node-http-proxy/commit/03b908744612faed82d9233f3b6d4af70368cf3c)- [dist] Version bump. v0.5.3. Only good on node v0.4.7. See issue #48. [`d9fa261`](https://github.com/http-party/node-http-proxy/commit/d9fa261cdc97aee71279064e536a4a22edbe3b5b)## [v0.5.2](https://github.com/http-party/node-http-proxy/compare/v0.5.1...v0.5.2) - 2011-05-17### Merged- Readme: fix syntax error, reformat code blocks [`#52`](https://github.com/http-party/node-http-proxy/pull/52)### Commits- format markdown for syntax highlighting on GitHub [`28f6dc1`](https://github.com/http-party/node-http-proxy/commit/28f6dc153a7d9fa9b6a08637c90765cf3a07fd3e)- [doc] Regenerate docco docs [`a5e1e3e`](https://github.com/http-party/node-http-proxy/commit/a5e1e3e70d02f32ab86b711ec4b262df5955a1a9)- [test] Fix tests in https mode [`1ee6bef`](https://github.com/http-party/node-http-proxy/commit/1ee6beff6aa3087e332701fd3cfda70b4e968ce8)- [fix] Manage bookkeeping for incoming requests to the underlying sockets behind reverse proxied websocket events. Only use the appropriate variables in the closure scope of the `upgrade` event from this bookkeeping [`85223ea`](https://github.com/http-party/node-http-proxy/commit/85223ea0800ad63ea82783c9dc2dc4a0e3345ae8)- [minor] Fix syntax in examples/ [`ff82946`](https://github.com/http-party/node-http-proxy/commit/ff829467d33d326c588861a46acc2bf9adbdddd2)- add spacing around code blocks to fix README rendering [`ab8c264`](https://github.com/http-party/node-http-proxy/commit/ab8c264e6d729de81c93982f97875006e52240f0)- [dist] Use devDependencies in package.json [`e6c52d4`](https://github.com/http-party/node-http-proxy/commit/e6c52d431f8a32e11cd347fbabeb7a03d0d40790)- don't highlight non-javascript as javascript [`d5b9ba7`](https://github.com/http-party/node-http-proxy/commit/d5b9ba7180376b8a67b9cbfebe9acf7399cab3ed)- fix syntax error in README example [`332d2d7`](https://github.com/http-party/node-http-proxy/commit/332d2d780ab62ccc996157dacd2498c568816ffc)- [minor] Ignore npm modules and debug logs [`e90cbd6`](https://github.com/http-party/node-http-proxy/commit/e90cbd6f148633ef7d3e2de06aaabe1cc493cc37)- [dist] Include docco module as a dev dependency [`d08c2bb`](https://github.com/http-party/node-http-proxy/commit/d08c2bb525ec661c0c8e6539e28605972b1ae9b8)- [dist] Version bump. 0.5.2. Only good on node v0.4.7. See issue #48. [`360e79a`](https://github.com/http-party/node-http-proxy/commit/360e79a005d298f40f36ee0e25c34fe534311b09)## [v0.5.1](https://github.com/http-party/node-http-proxy/compare/v0.5.0...v0.5.1) - 2011-05-10### Commits- [dist] Version bump. 0.5.1. Only good on node v0.4.7. See issue #48. [`6c80177`](https://github.com/http-party/node-http-proxy/commit/6c8017734053bc683f32a2b9f0ba18ba0c014855)- Revert "Fixed "Invalid argument to getAgent" when proxying HTTP" [`40dc9de`](https://github.com/http-party/node-http-proxy/commit/40dc9dee2d1e617af7f85a056d281b4f220f2802)- [fix] Fix typo in bin/node-http-proxy [`57127a3`](https://github.com/http-party/node-http-proxy/commit/57127a367193bcf12be2b367e1e01cbc57d685fe)- Merged pull request #39 from timmattison/master. [`ac425d7`](https://github.com/http-party/node-http-proxy/commit/ac425d70ef63b847fe6eb17dbfc4b084d0dd2d20)- Fixed "Invalid argument to getAgent" when proxying HTTP [`642e158`](https://github.com/http-party/node-http-proxy/commit/642e15805dbd572835bb4fee9527e4f2da658833)## [v0.5.0](https://github.com/http-party/node-http-proxy/compare/v0.4.2...v0.5.0) - 2011-04-17### Commits- [doc] Breakout demo.js into files in example/. Add web-socket-proxy.js example [`6e4bf6a`](https://github.com/http-party/node-http-proxy/commit/6e4bf6a9cbc400fcd2be420649ce08936417dd83)- [api test doc] Improve HTTPS support. Update minor documentation. Change tests accordingly. [`bf68dc3`](https://github.com/http-party/node-http-proxy/commit/bf68dc30a5c508bc8f533f52c083206b87963811)- [api] Update WebSocket support to use http.Agent APIs [`b0b0183`](https://github.com/http-party/node-http-proxy/commit/b0b0183c2b54fa63bd2a6f9c92475c7f56d811a3)- [api] Update `.proxyRequest()` and `.proxyWebSocketRequest()` APIs to take an options hash instead of a set of arguments. Add HTTPS support. [`cfddd12`](https://github.com/http-party/node-http-proxy/commit/cfddd12e821bd6b07ff2dbf0aa543ddfc3664dca)- [doc api] Update README.md and CHANGELOG.md for v0.5.0. Update bin/node-http-proxy to read files specified in `config.https` [`212009d`](https://github.com/http-party/node-http-proxy/commit/212009df6b08de3c0c97a4e9ec43f60f6bf49ea6)- [test] Add WebSocket tests [`4d18ac1`](https://github.com/http-party/node-http-proxy/commit/4d18ac1ae611f84e5e0cc599234124d183d81ffd)- [doc] Regenerate docco docs [`c485c87`](https://github.com/http-party/node-http-proxy/commit/c485c8742c86b504823020d2cf6c1342a1bcce48)- [doc test] Small updates to README.md. Update to try require socket.io [`12064d8`](https://github.com/http-party/node-http-proxy/commit/12064d8e5debf674cd5d367e563b699f10a4325e)- [api] Remove winston logging in favor of custom events [`a89b397`](https://github.com/http-party/node-http-proxy/commit/a89b3976b25516db9b601c0327948f3d90fab006)- [doc] Update README.md [`bd6a262`](https://github.com/http-party/node-http-proxy/commit/bd6a2622ad67b8c7ec15868037a48048207ce0df)- [dist] Version bump. v0.5.0 [`ddf31b2`](https://github.com/http-party/node-http-proxy/commit/ddf31b22ec71ef9dacca9c178ee26b6314d9fdf4)- [api] Update `request` event to be consistent by emitting both `req` and `res`. Add `x-forwarded-for` header. [`a3cb527`](https://github.com/http-party/node-http-proxy/commit/a3cb527be5e42d5192400933bf32a361b8c707c4)- [api] Emit `end` event when done proxying [`5681fc1`](https://github.com/http-party/node-http-proxy/commit/5681fc1a28ff06dfa91d9bf5512c688235cafac4)- [minor] Small update to README.md [`40c51a7`](https://github.com/http-party/node-http-proxy/commit/40c51a703baaf050b35f60131d3e78b42e7b0858)- [dist] Move pgriess' websocket client into vendor/* [`7cbf447`](https://github.com/http-party/node-http-proxy/commit/7cbf44732068dc788d31432553b3bdfcfb39f743)## [v0.4.2](https://github.com/http-party/node-http-proxy/compare/v0.4.1...v0.4.2) - 2011-04-13### Commits- [dist] Version bump. 0.4.2. Remove `eyes` dependency. [`a5d88aa`](https://github.com/http-party/node-http-proxy/commit/a5d88aaacc209bdceaf0799e99ff82bdce1bdc10)## [v0.4.1](https://github.com/http-party/node-http-proxy/compare/v0.4.0...v0.4.1) - 2011-03-20### Commits- [dist] Version bump. 0.4.1. Fix package.json [`0d1a3fe`](https://github.com/http-party/node-http-proxy/commit/0d1a3fe99511dda1ac949536a9eb4a045db39979)## [v0.4.0](https://github.com/http-party/node-http-proxy/compare/v0.3.1...v0.4.0) - 2011-03-20### Commits- [api] Further work on refactor for node 0.4.0 [`e39a9f9`](https://github.com/http-party/node-http-proxy/commit/e39a9f93d2f9ab6ea769fad5e9dda25d022d8a1a)- [doc] Added docco generated literate coding documentation [`3bc7d16`](https://github.com/http-party/node-http-proxy/commit/3bc7d16adc48ad1aa1161bb02bd0c27d4fb20639)- [doc api test] Wrap things up for v0.4.0 release: Add hostnameOnly routing to ProxyTable, add more documentation, fix edge-cases until they can be further investigated in node.js core [`5715318`](https://github.com/http-party/node-http-proxy/commit/571531820e2233b0d2f7268a1d4db8510fcabf91)- [api] First pass at removing pool and working with node v0.4.0 [`9faa924`](https://github.com/http-party/node-http-proxy/commit/9faa924a29544cfd84c28cb1c45489f495e3806a)- [doc api test] Rename HttpProxy.pause to HttpProxy.resume. Update documentation and tests accordingly [`4110448`](https://github.com/http-party/node-http-proxy/commit/4110448046dd945afe3e092968d9382d573a369a)- [doc] Added more documentation [`973f19f`](https://github.com/http-party/node-http-proxy/commit/973f19fd5a14e3bfad5f67e54710a4076a469fe0)- [doc] Regenerate docco docs [`6c42f04`](https://github.com/http-party/node-http-proxy/commit/6c42f045241194061c3786ba5827aebf88070201)- [api] Force connection header to be `close` until keep-alive is replemented [`3fd3c96`](https://github.com/http-party/node-http-proxy/commit/3fd3c96fa05fda45c7ef9ff44594644ac54f4a1e)- [dist] Version bump. 0.4.0 [`cbb5fbc`](https://github.com/http-party/node-http-proxy/commit/cbb5fbccd0e65c51eba14e75ef44184714cc8971)- [api test] All tests are passing when run as individual files [`389159d`](https://github.com/http-party/node-http-proxy/commit/389159da1b91ab60b8de3c379d84e76c703e6b59)- [minor doc] Update demo and small fix to node-http-proxy [`d8c5406`](https://github.com/http-party/node-http-proxy/commit/d8c54063dc5961fa619f7c04fa2d225da9aa1439)- [fix] Fixed cli parsing issue when --argument=value is not used [`34cba38`](https://github.com/http-party/node-http-proxy/commit/34cba38c297d6dcb845e95b9e1ce0271da1631d2)- [test] Small update to proxy-table-test.js [`3588687`](https://github.com/http-party/node-http-proxy/commit/3588687874eb691fe59407a207d38efa418211d0)- [minor] Expose version on module [`1dd9b3b`](https://github.com/http-party/node-http-proxy/commit/1dd9b3b15088a3c4595faae64822969014a61d52)- [doc] Update to v0.3.1 in README.md [`8ef2e1f`](https://github.com/http-party/node-http-proxy/commit/8ef2e1fe33e0fca2b80c0d6474dba994e625f094)- [dist] Change package.json for npm version bump [`0e7f362`](https://github.com/http-party/node-http-proxy/commit/0e7f3626718ecf108f3cafa814b0f4ffb3e6faa2)## [v0.3.1](https://github.com/http-party/node-http-proxy/compare/v0.3.0...v0.3.1) - 2010-11-22### Commits- [api test doc] Updated tests. Added ProxyTable functionality [`bedc7a3`](https://github.com/http-party/node-http-proxy/commit/bedc7a3ae57d5ec07b372a550fa69772f9fbc19e)- [test] Simplified tests. Added tests for experimental websocket support [`8c3e993`](https://github.com/http-party/node-http-proxy/commit/8c3e993833e2a09376fdb5e7c847ff00b53e70d8)- [test doc api] Added forward proxy functionality with tests [`c06f4bf`](https://github.com/http-party/node-http-proxy/commit/c06f4bf7fe50f29677dc5a5aad596193fc893018)- [dist minor] Removed vendored pool. Changed all references of sys to util [`8251296`](https://github.com/http-party/node-http-proxy/commit/8251296d7f5c472ec523316e905d678042b043d3)- WebSocket proxy support, fixed 304 code halting [`7249ef3`](https://github.com/http-party/node-http-proxy/commit/7249ef3ee776c66acc95036dc76a2d08dc3f6350)- [api] pseduo-vendor pool until pull request is finalized [`7c2eb5d`](https://github.com/http-party/node-http-proxy/commit/7c2eb5de3531f20ea92c99dd8ab207d26be9dce8)- No-server fix [`f84880f`](https://github.com/http-party/node-http-proxy/commit/f84880fcd946e55585d8e901e5bc32933f629837)- [api test bin doc] Added bin script and simple logging [`00014d6`](https://github.com/http-party/node-http-proxy/commit/00014d624c052e7404ce96c7e06769440c4eae2a)- [debug] Removed pool as a dependency for stress test [`73381cf`](https://github.com/http-party/node-http-proxy/commit/73381cf71ae92b9ed1c2da5986aa7ca31a7cf2e8)- 'end' event becomes 'close', added more try-catch handling [`cd78af5`](https://github.com/http-party/node-http-proxy/commit/cd78af5feaa67c5005df921a8d1a61575a58fca2)- Added support of automatic websocket tunneling, added test for it [`56003b5`](https://github.com/http-party/node-http-proxy/commit/56003b527625b2d83a191f3172005c87856aa87d)- [debug] Better debug messages to try to determine if pool is slowly losing clients to forever busy [`dd1918d`](https://github.com/http-party/node-http-proxy/commit/dd1918dc360dc0f9553c35c82f3f0f93ac3bfb46)- [doc dist] Version bump. Added CHANGELOG.md [`de53d5e`](https://github.com/http-party/node-http-proxy/commit/de53d5eb2c3d671be0ad0e736a6435c3bf5f55f4)- Moved error handling to response.on('end'), fixed error handling in websocket's part [`7e61f0c`](https://github.com/http-party/node-http-proxy/commit/7e61f0cf5725dedf37b956545639c2d6129855d3)- [minor] Pushing hot-fix from Mikeal for vendored pool repo [`60791f3`](https://github.com/http-party/node-http-proxy/commit/60791f361f8a11f9d1bad2c6366bf0ce72b40f66)- [api] Integrated commits from donnerjack and worked on pool changes [`3bb458e`](https://github.com/http-party/node-http-proxy/commit/3bb458e115037bc27691705d255b0d2e2504a9f1)- [doc] Updated Copyright ... added Fedor [`9128a8c`](https://github.com/http-party/node-http-proxy/commit/9128a8c5a15d0f64a0bae946f3e741ea708bc56f)- [minor] Listen to error event on pool so we dont fail out unexpectedly anymore [`711258e`](https://github.com/http-party/node-http-proxy/commit/711258ef469d064cc0dbe0f0320ed1047ed0bd54)- adding more debugging messages [`5d54ea5`](https://github.com/http-party/node-http-proxy/commit/5d54ea58c93c26635e0de96871e824baffea34dd)- adding some debug messages for live testing [`4069a7e`](https://github.com/http-party/node-http-proxy/commit/4069a7e98c22a48bae7fd57ad5f315d0e5006dfc)- [minor] Listen to error events re-emitted by pool into the ClientRequest [`f8bff4c`](https://github.com/http-party/node-http-proxy/commit/f8bff4c618ab2a6b6185ac973cd0e21cea19c23a)- [minor] Updated max clients for pool [`32aaf74`](https://github.com/http-party/node-http-proxy/commit/32aaf74e95f8a39d847b352ca984145e7abe89a6)- [debug] Trying to repair pool busy client growth [`7b0ea85`](https://github.com/http-party/node-http-proxy/commit/7b0ea85e2ac58d5f711f64b855f746fb2423a276)- [debug] Roll back last commit ... connection = close was ineffective [`266e524`](https://github.com/http-party/node-http-proxy/commit/266e5246eacb4877bb6ab557e6e6b9b8434ad612)## [v0.3.0](https://github.com/http-party/node-http-proxy/compare/v0.2.0...v0.3.0) - 2010-09-10### Commits- [api] Revert to old 0.1.x codebase for bug testing and performance comparison [`66afb2a`](https://github.com/http-party/node-http-proxy/commit/66afb2a2a35a479512ce2601c89b82f13596fc9f)- [api test dist doc] Updated for 0.3.0 release [`a9084b9`](https://github.com/http-party/node-http-proxy/commit/a9084b923afa66c3004abec4951ff02e031631da)- [api] Object creation is cheap for HttpProxy, so lets take advantage [`9f0aeac`](https://github.com/http-party/node-http-proxy/commit/9f0aeacab1a632136f5905a0d03ad04be9f93f51)- [doc] Update contributors for 0.3.0 [`6d47d98`](https://github.com/http-party/node-http-proxy/commit/6d47d98f5345b7f335c3b93f8e4a31dd90235dda)## [v0.2.0](https://github.com/http-party/node-http-proxy/compare/v0.1.5...v0.2.0) - 2010-09-07### Commits- [dist] Version bump and update to README + LICENCE. Word to Mikeal for coming thru for 0.2.0 [`69c162d`](https://github.com/http-party/node-http-proxy/commit/69c162dc3da334b2ece0a19be5ea4c8da7e0fe87)- [api dist] Merge of branch 0.2.0 [`fd61828`](https://github.com/http-party/node-http-proxy/commit/fd618289338ca2d7595f695c0b8531b40145bbca)- [api] Completely refactored node-http-proxy with help from Mikeal [`1221939`](https://github.com/http-party/node-http-proxy/commit/1221939accf00467adb25f8908e991e984043c85)- [api minor debug] Remove debug code, set Connection header if not set [`6d08f24`](https://github.com/http-party/node-http-proxy/commit/6d08f24c863e071eb4a0d3ede15656e5e7c27c4b)- [debug] Added some debugging to figure out why AB wont complete a test with v0.2.0 [`9715ebd`](https://github.com/http-party/node-http-proxy/commit/9715ebd40bdbbe883eb383676d5b0df24968dd72)- [api] Integrated a little more from Mikeal to make our return headers consistent [`eb39018`](https://github.com/http-party/node-http-proxy/commit/eb39018fd0b5751dd90fabce905997e52f2ffecd)- [doc] Updated README.md [`f291efb`](https://github.com/http-party/node-http-proxy/commit/f291efbaa4360d6e7ff4004cc11f8df0d737c1d0)## v0.1.5 - 2010-09-02### Commits- [api] More changes for createServer api [`5d94ae2`](https://github.com/http-party/node-http-proxy/commit/5d94ae27bc2d56d1f817b0cf1dfdb01dcc376393)- added colors and asciimo [`d490b50`](https://github.com/http-party/node-http-proxy/commit/d490b50ada8c1024cb785335966b71d69fae3407)- [api] First commit of http-proxy [`30b68c1`](https://github.com/http-party/node-http-proxy/commit/30b68c153270619119ec36615bb54ee7a2816ecc)- updating demo [`c4b7c0d`](https://github.com/http-party/node-http-proxy/commit/c4b7c0d8a0cc5fd7f43257594bd0a71c7bd12a63)- initial release v0.1.0, sure to have many updates coming. [`85f7372`](https://github.com/http-party/node-http-proxy/commit/85f73723415ec54539721777e77d5d10de383469)- fleshing out demo [`994f748`](https://github.com/http-party/node-http-proxy/commit/994f7481ce07c15afa5ab993b79d920b8220be44)- [docs] added benchmarks [`bbed176`](https://github.com/http-party/node-http-proxy/commit/bbed17640f84e56aaea06c6d4eb7d04952957fce)- updated paths to use npm [`972c8c0`](https://github.com/http-party/node-http-proxy/commit/972c8c05274c72c7320291389f88b0694ac290ca)- added spark demo [`d0ad931`](https://github.com/http-party/node-http-proxy/commit/d0ad93176d8430301a8a42f8c2b817674ce7ba32)- [test] Updated tests to include support for latent requests [`095e86a`](https://github.com/http-party/node-http-proxy/commit/095e86aa653c1c8e07cd1403697e0e4b638b8294)- started to flesh out simple demo based on tests [`2fb5ffb`](https://github.com/http-party/node-http-proxy/commit/2fb5ffba7765462e95badd0f7243e65395a3fd2e)- added createServer but hated it, gonna remove [`b1eb13e`](https://github.com/http-party/node-http-proxy/commit/b1eb13eb70b67ea76f5ab720d566894677a53ca2)- [test] Updated node-http-proxy tests [`2f265a2`](https://github.com/http-party/node-http-proxy/commit/2f265a23e4a10971495d0bd7b324b7ba786e5065)- [api] Updated request hashes to use a unique identifier [`c887a75`](https://github.com/http-party/node-http-proxy/commit/c887a757623f5a3d7d1e0fafeb00b96731c89872)- [api] Updated http-proxy to work with vows [`ead7567`](https://github.com/http-party/node-http-proxy/commit/ead7567db8099264a2001fd876cded84bc4f111f)- [dist] Renamed node-proxy to node-http-proxy, updated package.json [`2f49810`](https://github.com/http-party/node-http-proxy/commit/2f49810ef86f49927991f32ae42605f1118b0c25)- updating docs, almost there [`6e651f4`](https://github.com/http-party/node-http-proxy/commit/6e651f420f4d1e15dbbf823a8e3b311e9533c805)- changed api to better reflect nodes api. updated demos, tests, docs [`bde98f4`](https://github.com/http-party/node-http-proxy/commit/bde98f489234fe22f49468011b7e342cd108603f)- updating docs [`341bbd4`](https://github.com/http-party/node-http-proxy/commit/341bbd404f3fd81e65197b3830c3fa9e544bc1e7)- fixed npm package, i think. bumped version 0.1.1 [`fca40da`](https://github.com/http-party/node-http-proxy/commit/fca40da694d8df17ed6140265e374c0ceabd1167)- updated demo [`b622702`](https://github.com/http-party/node-http-proxy/commit/b62270210e7ad3c54fd6b2c86bde9f9942328a67)- added readme [`d6a2f8a`](https://github.com/http-party/node-http-proxy/commit/d6a2f8aa7dae3f6721b9607a702c68b1ad7fc692)- [api] Corrected chain of argument passing [`da55777`](https://github.com/http-party/node-http-proxy/commit/da55777a92d100a5ddb7a8267e56ba26bd8c2270)- updated demo [`e9511ea`](https://github.com/http-party/node-http-proxy/commit/e9511eafdf9ada6a0ce6defb3c5f2299411633b1)- [deploy] Added package.json [`dce80b9`](https://github.com/http-party/node-http-proxy/commit/dce80b9b4546064da1943e0e396e19b41390588a)- updated readme [`76d0649`](https://github.com/http-party/node-http-proxy/commit/76d0649abcafd80509af922503c5544e646bcebb)- update to docs and package.json [`d15bba4`](https://github.com/http-party/node-http-proxy/commit/d15bba4c1d2cbdaf0af27f3adcaa1db9b534d968)- [minor] Removed eyes dependency [`eaeed83`](https://github.com/http-party/node-http-proxy/commit/eaeed8306d6dc6e1b30223cf6d59cda6d5bb76de)- merge [`93505a4`](https://github.com/http-party/node-http-proxy/commit/93505a422c688b7f41fdaf304270c893ef4cf09a)- fixed additional port / server mismatches for new api [`15c18b6`](https://github.com/http-party/node-http-proxy/commit/15c18b612d6cd5a1f3ae46b5590dda1fc586fb35)- [doc] added nodejitsu.com link to ReadMe. http-proxy is used in our front facing load-balancers. look for bugs...try to improve benchmarks.... ^_^ [`6661753`](https://github.com/http-party/node-http-proxy/commit/6661753f07dcf4e5ae684df4d1709f3c238346c9)- removed extra self, updated colors requirement, bumped to version 0.1.3 [`9bc5b6f`](https://github.com/http-party/node-http-proxy/commit/9bc5b6f8621fb2a37e84524c3e5b91aab9b45675)- fixed pathing issue, bumped version 0.1.3 [`ede6490`](https://github.com/http-party/node-http-proxy/commit/ede649037e08b615a8995179f46bc701550354d6)- updated docs [`07d96bb`](https://github.com/http-party/node-http-proxy/commit/07d96bb8887a7880a21a739e0a8f495698e7e79e)- updated docs [`1594367`](https://github.com/http-party/node-http-proxy/commit/15943675edef490d9b8732345a750bc5ab1f5d7e)- updated readme [`fb8c5ab`](https://github.com/http-party/node-http-proxy/commit/fb8c5abd3c2a722c1c18046dcf2fffea4fa7d050)- updated docs [`17b6c69`](https://github.com/http-party/node-http-proxy/commit/17b6c6998544572300fc9d4faa63af1aee4c3d88)- updated docs [`c8dd8c4`](https://github.com/http-party/node-http-proxy/commit/c8dd8c4e28e09f25c161980316b259d81d5a4e91)- updated package.json again [`ddba155`](https://github.com/http-party/node-http-proxy/commit/ddba155377942259554842f37de98c508130fe11)- initial release v0.1.0, sure to have many updates coming. [`6a1baa2`](https://github.com/http-party/node-http-proxy/commit/6a1baa25ccf9fc3a3fc4d1a4764c968993e48cab)- bumped to version 0.1.5 [`b195a16`](https://github.com/http-party/node-http-proxy/commit/b195a16406534912161671448a53d6633a1f2458)- updated readme [`9aa2216`](https://github.com/http-party/node-http-proxy/commit/9aa22162f139ab2fa6df6b11e2a96336ee1d2612)- added spark demo [`d408e39`](https://github.com/http-party/node-http-proxy/commit/d408e39ed6dbd44709d0164a95ad9bc67f76ba13)- bumped to version 0.1.4. improved on api [`82b8228`](https://github.com/http-party/node-http-proxy/commit/82b822827d35a54501068f9880111473e19c72f9)- initial release v0.1.0, sure to have many updates coming. [`1e04552`](https://github.com/http-party/node-http-proxy/commit/1e04552bd8f39e3dcba36bbf7fb36674e5c0c9ff)- updated readme [`0a2eaaa`](https://github.com/http-party/node-http-proxy/commit/0a2eaaa7db690f86aca8c0b952f745e806ad818c)- updating docs [`198000f`](https://github.com/http-party/node-http-proxy/commit/198000feefd525125a2031557b3556978a057bde)- [api] Added createServer api to node-http-proxy [`2e2b55f`](https://github.com/http-party/node-http-proxy/commit/2e2b55f113eb3bc81c43717c0db5de695fb694c1)
package-lock.json binary
{"output": "CHANGELOG.md","template": "keepachangelog","unreleased": true,"commitLimit": false}
{"_from": "he@^1.1.1","_id": "he@1.2.0","_inBundle": false,"_integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==","_location": "/he","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "he@^1.1.1","name": "he","escapedName": "he","rawSpec": "^1.1.1","saveSpec": null,"fetchSpec": "^1.1.1"},"_requiredBy": ["/ecstatic"],"_resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz","_shasum": "84ae65fa7eafb165fddb61566ae14baf05664f0f","_spec": "he@^1.1.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/ecstatic","author": {"name": "Mathias Bynens","url": "https://mathiasbynens.be/"},"bin": {"he": "bin/he"},"bugs": {"url": "https://github.com/mathiasbynens/he/issues"},"bundleDependencies": false,"deprecated": false,"description": "A robust HTML entities encoder/decoder with full Unicode support.","devDependencies": {"codecov.io": "^0.1.6","grunt": "^0.4.5","grunt-cli": "^1.3.1","grunt-shell": "^1.1.1","grunt-template": "^0.2.3","istanbul": "^0.4.2","jsesc": "^1.0.0","lodash": "^4.8.2","qunit-extras": "^1.4.5","qunitjs": "~1.11.0","regenerate": "^1.2.1","regexgen": "^1.3.0","requirejs": "^2.1.22","sort-object": "^3.0.2"},"directories": {"bin": "bin","man": "man","test": "tests"},"files": ["LICENSE-MIT.txt","he.js","bin/","man/"],"homepage": "https://mths.be/he","keywords": ["string","entities","entity","html","encode","decode","unicode"],"license": "MIT","main": "he.js","man": ["/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/he/man/he.1"],"name": "he","repository": {"type": "git","url": "git+https://github.com/mathiasbynens/he.git"},"scripts": {"build": "grunt build","test": "node tests/tests.js"},"version": "1.2.0"}
.Dd April 5, 2016.Dt he 1.Sh NAME.Nm he.Nd encode/decode HTML entities just like a browser would.Sh SYNOPSIS.Nm.Op Fl -escape Ar string.br.Op Fl -encode Ar string.br.Op Fl -encode Fl -use-named-refs Fl -everything Fl -allow-unsafe Ar string.br.Op Fl -decode Ar string.br.Op Fl -decode Fl -attribute Ar string.br.Op Fl -decode Fl -strict Ar string.br.Op Fl v | -version.br.Op Fl h | -help.Sh DESCRIPTION.Nmencodes/decodes HTML entities in strings just like a browser would..Sh OPTIONS.Bl -ohang -offset.It Sy "--escape"Take a string of text and escape it for use in text contexts in XML or HTML documents. Only the following characters are escaped: `&`, `<`, `>`, `"`, and `'`..It Sy "--encode"Take a string of text and encode any symbols that aren't printable ASCII symbols and that can be replaced with character references. For example, it would turn `©` into `©`, but it wouldn't turn `+` into `+` since there is no point in doing so. Additionally, it replaces any remaining non-ASCII symbols with a hexadecimal escape sequence (e.g. `𝌆`). The return value of this function is always valid HTML..It Sy "--encode --use-named-refs"Enable the use of named character references (like `©`) in the output. If compatibility with older browsers is a concern, don't use this option..It Sy "--encode --everything"Encode every symbol in the input string, even safe printable ASCII symbols..It Sy "--encode --allow-unsafe"Encode non-ASCII characters only. This leaves unsafe HTML/XML symbols like `&`, `<`, `>`, `"`, and `'` intact..It Sy "--encode --decimal"Use decimal digits rather than hexadecimal digits for encoded character references, e.g. output `©` instead of `©`..It Sy "--decode"Takes a string of HTML and decode any named and numerical character references in it using the algorithm described in the HTML spec..It Sy "--decode --attribute"Parse the input as if it was an HTML attribute value rather than a string in an HTML text content..It Sy "--decode --strict"Throw an error if an invalid character reference is encountered..It Sy "-v, --version"Print he's version..It Sy "-h, --help"Show the help screen..El.Sh EXIT STATUSThe.Nm heutility exits with one of the following values:.Pp.Bl -tag -width flag -compact.It Li 0.Nmdid what it was instructed to do successfully; either it encoded/decoded the input and printed the result, or it printed the version or usage message..It Li 1.Nmencountered an error..El.Sh EXAMPLES.Bl -ohang -offset.It Sy "he --escape '<script>alert(1)</script>'"Print an escaped version of the given string that is safe for use in HTML text contexts, escaping only `&`, `<`, `>`, `"`, and `'`..It Sy "he --decode '©𝌆'"Print the decoded version of the given HTML string..It Sy "echo\ '©𝌆'\ |\ he --decode"Print the decoded version of the HTML string that gets piped in..El.Sh BUGShe's bug tracker is located at <https://github.com/mathiasbynens/he/issues>..Sh AUTHORMathias Bynens <https://mathiasbynens.be/>.Sh WWW<https://mths.be/he>
/*! https://mths.be/he v1.2.0 by @mathias | MIT license */;(function(root) {// Detect free variables `exports`.var freeExports = typeof exports == 'object' && exports;// Detect free variable `module`.var freeModule = typeof module == 'object' && module &&module.exports == freeExports && module;// Detect free variable `global`, from Node.js or Browserified code,// and use it as `root`.var freeGlobal = typeof global == 'object' && global;if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {root = freeGlobal;}/*--------------------------------------------------------------------------*/// All astral symbols.var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;// All ASCII symbols (not just printable ASCII) except those listed in the// first column of the overrides table.// https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overridesvar regexAsciiWhitelist = /[\x01-\x7F]/g;// All BMP symbols that are not ASCII newlines, printable ASCII symbols, or// code points listed in the first column of the overrides table on// https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides.var regexBmpWhitelist = /[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g;var regexEncodeNonAscii = /<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4\u20D2|\u22B5\u20D2|\u22D8\u0338|\u22D9\u0338|\u22DA\uFE00|\u22DB\uFE00|\u22F5\u0338|\u22F9\u0338|\u2933\u0338|\u29CF\u0338|\u29D0\u0338|\u2A6D\u0338|\u2A70\u0338|\u2A7D\u0338|\u2A7E\u0338|\u2AA1\u0338|\u2AA2\u0338|\u2AAC\uFE00|\u2AAD\uFE00|\u2AAF\u0338|\u2AB0\u0338|\u2AC5\u0338|\u2AC6\u0338|\u2ACB\uFE00|\u2ACC\uFE00|\u2AFD\u20E5|[\xA0-\u0113\u0116-\u0122\u0124-\u012B\u012E-\u014D\u0150-\u017E\u0192\u01B5\u01F5\u0237\u02C6\u02C7\u02D8-\u02DD\u0311\u0391-\u03A1\u03A3-\u03A9\u03B1-\u03C9\u03D1\u03D2\u03D5\u03D6\u03DC\u03DD\u03F0\u03F1\u03F5\u03F6\u0401-\u040C\u040E-\u044F\u0451-\u045C\u045E\u045F\u2002-\u2005\u2007-\u2010\u2013-\u2016\u2018-\u201A\u201C-\u201E\u2020-\u2022\u2025\u2026\u2030-\u2035\u2039\u203A\u203E\u2041\u2043\u2044\u204F\u2057\u205F-\u2063\u20AC\u20DB\u20DC\u2102\u2105\u210A-\u2113\u2115-\u211E\u2122\u2124\u2127-\u2129\u212C\u212D\u212F-\u2131\u2133-\u2138\u2145-\u2148\u2153-\u215E\u2190-\u219B\u219D-\u21A7\u21A9-\u21AE\u21B0-\u21B3\u21B5-\u21B7\u21BA-\u21DB\u21DD\u21E4\u21E5\u21F5\u21FD-\u2205\u2207-\u2209\u220B\u220C\u220F-\u2214\u2216-\u2218\u221A\u221D-\u2238\u223A-\u2257\u2259\u225A\u225C\u225F-\u2262\u2264-\u228B\u228D-\u229B\u229D-\u22A5\u22A7-\u22B0\u22B2-\u22BB\u22BD-\u22DB\u22DE-\u22E3\u22E6-\u22F7\u22F9-\u22FE\u2305\u2306\u2308-\u2310\u2312\u2313\u2315\u2316\u231C-\u231F\u2322\u2323\u232D\u232E\u2336\u233D\u233F\u237C\u23B0\u23B1\u23B4-\u23B6\u23DC-\u23DF\u23E2\u23E7\u2423\u24C8\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2550-\u256C\u2580\u2584\u2588\u2591-\u2593\u25A1\u25AA\u25AB\u25AD\u25AE\u25B1\u25B3-\u25B5\u25B8\u25B9\u25BD-\u25BF\u25C2\u25C3\u25CA\u25CB\u25EC\u25EF\u25F8-\u25FC\u2605\u2606\u260E\u2640\u2642\u2660\u2663\u2665\u2666\u266A\u266D-\u266F\u2713\u2717\u2720\u2736\u2758\u2772\u2773\u27C8\u27C9\u27E6-\u27ED\u27F5-\u27FA\u27FC\u27FF\u2902-\u2905\u290C-\u2913\u2916\u2919-\u2920\u2923-\u292A\u2933\u2935-\u2939\u293C\u293D\u2945\u2948-\u294B\u294E-\u2976\u2978\u2979\u297B-\u297F\u2985\u2986\u298B-\u2996\u299A\u299C\u299D\u29A4-\u29B7\u29B9\u29BB\u29BC\u29BE-\u29C5\u29C9\u29CD-\u29D0\u29DC-\u29DE\u29E3-\u29E5\u29EB\u29F4\u29F6\u2A00-\u2A02\u2A04\u2A06\u2A0C\u2A0D\u2A10-\u2A17\u2A22-\u2A27\u2A29\u2A2A\u2A2D-\u2A31\u2A33-\u2A3C\u2A3F\u2A40\u2A42-\u2A4D\u2A50\u2A53-\u2A58\u2A5A-\u2A5D\u2A5F\u2A66\u2A6A\u2A6D-\u2A75\u2A77-\u2A9A\u2A9D-\u2AA2\u2AA4-\u2AB0\u2AB3-\u2AC8\u2ACB\u2ACC\u2ACF-\u2ADB\u2AE4\u2AE6-\u2AE9\u2AEB-\u2AF3\u2AFD\uFB00-\uFB04]|\uD835[\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDD6B]/g;var encodeMap = {'\xAD':'shy','\u200C':'zwnj','\u200D':'zwj','\u200E':'lrm','\u2063':'ic','\u2062':'it','\u2061':'af','\u200F':'rlm','\u200B':'ZeroWidthSpace','\u2060':'NoBreak','\u0311':'DownBreve','\u20DB':'tdot','\u20DC':'DotDot','\t':'Tab','\n':'NewLine','\u2008':'puncsp','\u205F':'MediumSpace','\u2009':'thinsp','\u200A':'hairsp','\u2004':'emsp13','\u2002':'ensp','\u2005':'emsp14','\u2003':'emsp','\u2007':'numsp','\xA0':'nbsp','\u205F\u200A':'ThickSpace','\u203E':'oline','_':'lowbar','\u2010':'dash','\u2013':'ndash','\u2014':'mdash','\u2015':'horbar',',':'comma',';':'semi','\u204F':'bsemi',':':'colon','\u2A74':'Colone','!':'excl','\xA1':'iexcl','?':'quest','\xBF':'iquest','.':'period','\u2025':'nldr','\u2026':'mldr','\xB7':'middot','\'':'apos','\u2018':'lsquo','\u2019':'rsquo','\u201A':'sbquo','\u2039':'lsaquo','\u203A':'rsaquo','"':'quot','\u201C':'ldquo','\u201D':'rdquo','\u201E':'bdquo','\xAB':'laquo','\xBB':'raquo','(':'lpar',')':'rpar','[':'lsqb',']':'rsqb','{':'lcub','}':'rcub','\u2308':'lceil','\u2309':'rceil','\u230A':'lfloor','\u230B':'rfloor','\u2985':'lopar','\u2986':'ropar','\u298B':'lbrke','\u298C':'rbrke','\u298D':'lbrkslu','\u298E':'rbrksld','\u298F':'lbrksld','\u2990':'rbrkslu','\u2991':'langd','\u2992':'rangd','\u2993':'lparlt','\u2994':'rpargt','\u2995':'gtlPar','\u2996':'ltrPar','\u27E6':'lobrk','\u27E7':'robrk','\u27E8':'lang','\u27E9':'rang','\u27EA':'Lang','\u27EB':'Rang','\u27EC':'loang','\u27ED':'roang','\u2772':'lbbrk','\u2773':'rbbrk','\u2016':'Vert','\xA7':'sect','\xB6':'para','@':'commat','*':'ast','/':'sol','undefined':null,'&':'amp','#':'num','%':'percnt','\u2030':'permil','\u2031':'pertenk','\u2020':'dagger','\u2021':'Dagger','\u2022':'bull','\u2043':'hybull','\u2032':'prime','\u2033':'Prime','\u2034':'tprime','\u2057':'qprime','\u2035':'bprime','\u2041':'caret','`':'grave','\xB4':'acute','\u02DC':'tilde','^':'Hat','\xAF':'macr','\u02D8':'breve','\u02D9':'dot','\xA8':'die','\u02DA':'ring','\u02DD':'dblac','\xB8':'cedil','\u02DB':'ogon','\u02C6':'circ','\u02C7':'caron','\xB0':'deg','\xA9':'copy','\xAE':'reg','\u2117':'copysr','\u2118':'wp','\u211E':'rx','\u2127':'mho','\u2129':'iiota','\u2190':'larr','\u219A':'nlarr','\u2192':'rarr','\u219B':'nrarr','\u2191':'uarr','\u2193':'darr','\u2194':'harr','\u21AE':'nharr','\u2195':'varr','\u2196':'nwarr','\u2197':'nearr','\u2198':'searr','\u2199':'swarr','\u219D':'rarrw','\u219D\u0338':'nrarrw','\u219E':'Larr','\u219F':'Uarr','\u21A0':'Rarr','\u21A1':'Darr','\u21A2':'larrtl','\u21A3':'rarrtl','\u21A4':'mapstoleft','\u21A5':'mapstoup','\u21A6':'map','\u21A7':'mapstodown','\u21A9':'larrhk','\u21AA':'rarrhk','\u21AB':'larrlp','\u21AC':'rarrlp','\u21AD':'harrw','\u21B0':'lsh','\u21B1':'rsh','\u21B2':'ldsh','\u21B3':'rdsh','\u21B5':'crarr','\u21B6':'cularr','\u21B7':'curarr','\u21BA':'olarr','\u21BB':'orarr','\u21BC':'lharu','\u21BD':'lhard','\u21BE':'uharr','\u21BF':'uharl','\u21C0':'rharu','\u21C1':'rhard','\u21C2':'dharr','\u21C3':'dharl','\u21C4':'rlarr','\u21C5':'udarr','\u21C6':'lrarr','\u21C7':'llarr','\u21C8':'uuarr','\u21C9':'rrarr','\u21CA':'ddarr','\u21CB':'lrhar','\u21CC':'rlhar','\u21D0':'lArr','\u21CD':'nlArr','\u21D1':'uArr','\u21D2':'rArr','\u21CF':'nrArr','\u21D3':'dArr','\u21D4':'iff','\u21CE':'nhArr','\u21D5':'vArr','\u21D6':'nwArr','\u21D7':'neArr','\u21D8':'seArr','\u21D9':'swArr','\u21DA':'lAarr','\u21DB':'rAarr','\u21DD':'zigrarr','\u21E4':'larrb','\u21E5':'rarrb','\u21F5':'duarr','\u21FD':'loarr','\u21FE':'roarr','\u21FF':'hoarr','\u2200':'forall','\u2201':'comp','\u2202':'part','\u2202\u0338':'npart','\u2203':'exist','\u2204':'nexist','\u2205':'empty','\u2207':'Del','\u2208':'in','\u2209':'notin','\u220B':'ni','\u220C':'notni','\u03F6':'bepsi','\u220F':'prod','\u2210':'coprod','\u2211':'sum','+':'plus','\xB1':'pm','\xF7':'div','\xD7':'times','<':'lt','\u226E':'nlt','<\u20D2':'nvlt','=':'equals','\u2260':'ne','=\u20E5':'bne','\u2A75':'Equal','>':'gt','\u226F':'ngt','>\u20D2':'nvgt','\xAC':'not','|':'vert','\xA6':'brvbar','\u2212':'minus','\u2213':'mp','\u2214':'plusdo','\u2044':'frasl','\u2216':'setmn','\u2217':'lowast','\u2218':'compfn','\u221A':'Sqrt','\u221D':'prop','\u221E':'infin','\u221F':'angrt','\u2220':'ang','\u2220\u20D2':'nang','\u2221':'angmsd','\u2222':'angsph','\u2223':'mid','\u2224':'nmid','\u2225':'par','\u2226':'npar','\u2227':'and','\u2228':'or','\u2229':'cap','\u2229\uFE00':'caps','\u222A':'cup','\u222A\uFE00':'cups','\u222B':'int','\u222C':'Int','\u222D':'tint','\u2A0C':'qint','\u222E':'oint','\u222F':'Conint','\u2230':'Cconint','\u2231':'cwint','\u2232':'cwconint','\u2233':'awconint','\u2234':'there4','\u2235':'becaus','\u2236':'ratio','\u2237':'Colon','\u2238':'minusd','\u223A':'mDDot','\u223B':'homtht','\u223C':'sim','\u2241':'nsim','\u223C\u20D2':'nvsim','\u223D':'bsim','\u223D\u0331':'race','\u223E':'ac','\u223E\u0333':'acE','\u223F':'acd','\u2240':'wr','\u2242':'esim','\u2242\u0338':'nesim','\u2243':'sime','\u2244':'nsime','\u2245':'cong','\u2247':'ncong','\u2246':'simne','\u2248':'ap','\u2249':'nap','\u224A':'ape','\u224B':'apid','\u224B\u0338':'napid','\u224C':'bcong','\u224D':'CupCap','\u226D':'NotCupCap','\u224D\u20D2':'nvap','\u224E':'bump','\u224E\u0338':'nbump','\u224F':'bumpe','\u224F\u0338':'nbumpe','\u2250':'doteq','\u2250\u0338':'nedot','\u2251':'eDot','\u2252':'efDot','\u2253':'erDot','\u2254':'colone','\u2255':'ecolon','\u2256':'ecir','\u2257':'cire','\u2259':'wedgeq','\u225A':'veeeq','\u225C':'trie','\u225F':'equest','\u2261':'equiv','\u2262':'nequiv','\u2261\u20E5':'bnequiv','\u2264':'le','\u2270':'nle','\u2264\u20D2':'nvle','\u2265':'ge','\u2271':'nge','\u2265\u20D2':'nvge','\u2266':'lE','\u2266\u0338':'nlE','\u2267':'gE','\u2267\u0338':'ngE','\u2268\uFE00':'lvnE','\u2268':'lnE','\u2269':'gnE','\u2269\uFE00':'gvnE','\u226A':'ll','\u226A\u0338':'nLtv','\u226A\u20D2':'nLt','\u226B':'gg','\u226B\u0338':'nGtv','\u226B\u20D2':'nGt','\u226C':'twixt','\u2272':'lsim','\u2274':'nlsim','\u2273':'gsim','\u2275':'ngsim','\u2276':'lg','\u2278':'ntlg','\u2277':'gl','\u2279':'ntgl','\u227A':'pr','\u2280':'npr','\u227B':'sc','\u2281':'nsc','\u227C':'prcue','\u22E0':'nprcue','\u227D':'sccue','\u22E1':'nsccue','\u227E':'prsim','\u227F':'scsim','\u227F\u0338':'NotSucceedsTilde','\u2282':'sub','\u2284':'nsub','\u2282\u20D2':'vnsub','\u2283':'sup','\u2285':'nsup','\u2283\u20D2':'vnsup','\u2286':'sube','\u2288':'nsube','\u2287':'supe','\u2289':'nsupe','\u228A\uFE00':'vsubne','\u228A':'subne','\u228B\uFE00':'vsupne','\u228B':'supne','\u228D':'cupdot','\u228E':'uplus','\u228F':'sqsub','\u228F\u0338':'NotSquareSubset','\u2290':'sqsup','\u2290\u0338':'NotSquareSuperset','\u2291':'sqsube','\u22E2':'nsqsube','\u2292':'sqsupe','\u22E3':'nsqsupe','\u2293':'sqcap','\u2293\uFE00':'sqcaps','\u2294':'sqcup','\u2294\uFE00':'sqcups','\u2295':'oplus','\u2296':'ominus','\u2297':'otimes','\u2298':'osol','\u2299':'odot','\u229A':'ocir','\u229B':'oast','\u229D':'odash','\u229E':'plusb','\u229F':'minusb','\u22A0':'timesb','\u22A1':'sdotb','\u22A2':'vdash','\u22AC':'nvdash','\u22A3':'dashv','\u22A4':'top','\u22A5':'bot','\u22A7':'models','\u22A8':'vDash','\u22AD':'nvDash','\u22A9':'Vdash','\u22AE':'nVdash','\u22AA':'Vvdash','\u22AB':'VDash','\u22AF':'nVDash','\u22B0':'prurel','\u22B2':'vltri','\u22EA':'nltri','\u22B3':'vrtri','\u22EB':'nrtri','\u22B4':'ltrie','\u22EC':'nltrie','\u22B4\u20D2':'nvltrie','\u22B5':'rtrie','\u22ED':'nrtrie','\u22B5\u20D2':'nvrtrie','\u22B6':'origof','\u22B7':'imof','\u22B8':'mumap','\u22B9':'hercon','\u22BA':'intcal','\u22BB':'veebar','\u22BD':'barvee','\u22BE':'angrtvb','\u22BF':'lrtri','\u22C0':'Wedge','\u22C1':'Vee','\u22C2':'xcap','\u22C3':'xcup','\u22C4':'diam','\u22C5':'sdot','\u22C6':'Star','\u22C7':'divonx','\u22C8':'bowtie','\u22C9':'ltimes','\u22CA':'rtimes','\u22CB':'lthree','\u22CC':'rthree','\u22CD':'bsime','\u22CE':'cuvee','\u22CF':'cuwed','\u22D0':'Sub','\u22D1':'Sup','\u22D2':'Cap','\u22D3':'Cup','\u22D4':'fork','\u22D5':'epar','\u22D6':'ltdot','\u22D7':'gtdot','\u22D8':'Ll','\u22D8\u0338':'nLl','\u22D9':'Gg','\u22D9\u0338':'nGg','\u22DA\uFE00':'lesg','\u22DA':'leg','\u22DB':'gel','\u22DB\uFE00':'gesl','\u22DE':'cuepr','\u22DF':'cuesc','\u22E6':'lnsim','\u22E7':'gnsim','\u22E8':'prnsim','\u22E9':'scnsim','\u22EE':'vellip','\u22EF':'ctdot','\u22F0':'utdot','\u22F1':'dtdot','\u22F2':'disin','\u22F3':'isinsv','\u22F4':'isins','\u22F5':'isindot','\u22F5\u0338':'notindot','\u22F6':'notinvc','\u22F7':'notinvb','\u22F9':'isinE','\u22F9\u0338':'notinE','\u22FA':'nisd','\u22FB':'xnis','\u22FC':'nis','\u22FD':'notnivc','\u22FE':'notnivb','\u2305':'barwed','\u2306':'Barwed','\u230C':'drcrop','\u230D':'dlcrop','\u230E':'urcrop','\u230F':'ulcrop','\u2310':'bnot','\u2312':'profline','\u2313':'profsurf','\u2315':'telrec','\u2316':'target','\u231C':'ulcorn','\u231D':'urcorn','\u231E':'dlcorn','\u231F':'drcorn','\u2322':'frown','\u2323':'smile','\u232D':'cylcty','\u232E':'profalar','\u2336':'topbot','\u233D':'ovbar','\u233F':'solbar','\u237C':'angzarr','\u23B0':'lmoust','\u23B1':'rmoust','\u23B4':'tbrk','\u23B5':'bbrk','\u23B6':'bbrktbrk','\u23DC':'OverParenthesis','\u23DD':'UnderParenthesis','\u23DE':'OverBrace','\u23DF':'UnderBrace','\u23E2':'trpezium','\u23E7':'elinters','\u2423':'blank','\u2500':'boxh','\u2502':'boxv','\u250C':'boxdr','\u2510':'boxdl','\u2514':'boxur','\u2518':'boxul','\u251C':'boxvr','\u2524':'boxvl','\u252C':'boxhd','\u2534':'boxhu','\u253C':'boxvh','\u2550':'boxH','\u2551':'boxV','\u2552':'boxdR','\u2553':'boxDr','\u2554':'boxDR','\u2555':'boxdL','\u2556':'boxDl','\u2557':'boxDL','\u2558':'boxuR','\u2559':'boxUr','\u255A':'boxUR','\u255B':'boxuL','\u255C':'boxUl','\u255D':'boxUL','\u255E':'boxvR','\u255F':'boxVr','\u2560':'boxVR','\u2561':'boxvL','\u2562':'boxVl','\u2563':'boxVL','\u2564':'boxHd','\u2565':'boxhD','\u2566':'boxHD','\u2567':'boxHu','\u2568':'boxhU','\u2569':'boxHU','\u256A':'boxvH','\u256B':'boxVh','\u256C':'boxVH','\u2580':'uhblk','\u2584':'lhblk','\u2588':'block','\u2591':'blk14','\u2592':'blk12','\u2593':'blk34','\u25A1':'squ','\u25AA':'squf','\u25AB':'EmptyVerySmallSquare','\u25AD':'rect','\u25AE':'marker','\u25B1':'fltns','\u25B3':'xutri','\u25B4':'utrif','\u25B5':'utri','\u25B8':'rtrif','\u25B9':'rtri','\u25BD':'xdtri','\u25BE':'dtrif','\u25BF':'dtri','\u25C2':'ltrif','\u25C3':'ltri','\u25CA':'loz','\u25CB':'cir','\u25EC':'tridot','\u25EF':'xcirc','\u25F8':'ultri','\u25F9':'urtri','\u25FA':'lltri','\u25FB':'EmptySmallSquare','\u25FC':'FilledSmallSquare','\u2605':'starf','\u2606':'star','\u260E':'phone','\u2640':'female','\u2642':'male','\u2660':'spades','\u2663':'clubs','\u2665':'hearts','\u2666':'diams','\u266A':'sung','\u2713':'check','\u2717':'cross','\u2720':'malt','\u2736':'sext','\u2758':'VerticalSeparator','\u27C8':'bsolhsub','\u27C9':'suphsol','\u27F5':'xlarr','\u27F6':'xrarr','\u27F7':'xharr','\u27F8':'xlArr','\u27F9':'xrArr','\u27FA':'xhArr','\u27FC':'xmap','\u27FF':'dzigrarr','\u2902':'nvlArr','\u2903':'nvrArr','\u2904':'nvHarr','\u2905':'Map','\u290C':'lbarr','\u290D':'rbarr','\u290E':'lBarr','\u290F':'rBarr','\u2910':'RBarr','\u2911':'DDotrahd','\u2912':'UpArrowBar','\u2913':'DownArrowBar','\u2916':'Rarrtl','\u2919':'latail','\u291A':'ratail','\u291B':'lAtail','\u291C':'rAtail','\u291D':'larrfs','\u291E':'rarrfs','\u291F':'larrbfs','\u2920':'rarrbfs','\u2923':'nwarhk','\u2924':'nearhk','\u2925':'searhk','\u2926':'swarhk','\u2927':'nwnear','\u2928':'toea','\u2929':'tosa','\u292A':'swnwar','\u2933':'rarrc','\u2933\u0338':'nrarrc','\u2935':'cudarrr','\u2936':'ldca','\u2937':'rdca','\u2938':'cudarrl','\u2939':'larrpl','\u293C':'curarrm','\u293D':'cularrp','\u2945':'rarrpl','\u2948':'harrcir','\u2949':'Uarrocir','\u294A':'lurdshar','\u294B':'ldrushar','\u294E':'LeftRightVector','\u294F':'RightUpDownVector','\u2950':'DownLeftRightVector','\u2951':'LeftUpDownVector','\u2952':'LeftVectorBar','\u2953':'RightVectorBar','\u2954':'RightUpVectorBar','\u2955':'RightDownVectorBar','\u2956':'DownLeftVectorBar','\u2957':'DownRightVectorBar','\u2958':'LeftUpVectorBar','\u2959':'LeftDownVectorBar','\u295A':'LeftTeeVector','\u295B':'RightTeeVector','\u295C':'RightUpTeeVector','\u295D':'RightDownTeeVector','\u295E':'DownLeftTeeVector','\u295F':'DownRightTeeVector','\u2960':'LeftUpTeeVector','\u2961':'LeftDownTeeVector','\u2962':'lHar','\u2963':'uHar','\u2964':'rHar','\u2965':'dHar','\u2966':'luruhar','\u2967':'ldrdhar','\u2968':'ruluhar','\u2969':'rdldhar','\u296A':'lharul','\u296B':'llhard','\u296C':'rharul','\u296D':'lrhard','\u296E':'udhar','\u296F':'duhar','\u2970':'RoundImplies','\u2971':'erarr','\u2972':'simrarr','\u2973':'larrsim','\u2974':'rarrsim','\u2975':'rarrap','\u2976':'ltlarr','\u2978':'gtrarr','\u2979':'subrarr','\u297B':'suplarr','\u297C':'lfisht','\u297D':'rfisht','\u297E':'ufisht','\u297F':'dfisht','\u299A':'vzigzag','\u299C':'vangrt','\u299D':'angrtvbd','\u29A4':'ange','\u29A5':'range','\u29A6':'dwangle','\u29A7':'uwangle','\u29A8':'angmsdaa','\u29A9':'angmsdab','\u29AA':'angmsdac','\u29AB':'angmsdad','\u29AC':'angmsdae','\u29AD':'angmsdaf','\u29AE':'angmsdag','\u29AF':'angmsdah','\u29B0':'bemptyv','\u29B1':'demptyv','\u29B2':'cemptyv','\u29B3':'raemptyv','\u29B4':'laemptyv','\u29B5':'ohbar','\u29B6':'omid','\u29B7':'opar','\u29B9':'operp','\u29BB':'olcross','\u29BC':'odsold','\u29BE':'olcir','\u29BF':'ofcir','\u29C0':'olt','\u29C1':'ogt','\u29C2':'cirscir','\u29C3':'cirE','\u29C4':'solb','\u29C5':'bsolb','\u29C9':'boxbox','\u29CD':'trisb','\u29CE':'rtriltri','\u29CF':'LeftTriangleBar','\u29CF\u0338':'NotLeftTriangleBar','\u29D0':'RightTriangleBar','\u29D0\u0338':'NotRightTriangleBar','\u29DC':'iinfin','\u29DD':'infintie','\u29DE':'nvinfin','\u29E3':'eparsl','\u29E4':'smeparsl','\u29E5':'eqvparsl','\u29EB':'lozf','\u29F4':'RuleDelayed','\u29F6':'dsol','\u2A00':'xodot','\u2A01':'xoplus','\u2A02':'xotime','\u2A04':'xuplus','\u2A06':'xsqcup','\u2A0D':'fpartint','\u2A10':'cirfnint','\u2A11':'awint','\u2A12':'rppolint','\u2A13':'scpolint','\u2A14':'npolint','\u2A15':'pointint','\u2A16':'quatint','\u2A17':'intlarhk','\u2A22':'pluscir','\u2A23':'plusacir','\u2A24':'simplus','\u2A25':'plusdu','\u2A26':'plussim','\u2A27':'plustwo','\u2A29':'mcomma','\u2A2A':'minusdu','\u2A2D':'loplus','\u2A2E':'roplus','\u2A2F':'Cross','\u2A30':'timesd','\u2A31':'timesbar','\u2A33':'smashp','\u2A34':'lotimes','\u2A35':'rotimes','\u2A36':'otimesas','\u2A37':'Otimes','\u2A38':'odiv','\u2A39':'triplus','\u2A3A':'triminus','\u2A3B':'tritime','\u2A3C':'iprod','\u2A3F':'amalg','\u2A40':'capdot','\u2A42':'ncup','\u2A43':'ncap','\u2A44':'capand','\u2A45':'cupor','\u2A46':'cupcap','\u2A47':'capcup','\u2A48':'cupbrcap','\u2A49':'capbrcup','\u2A4A':'cupcup','\u2A4B':'capcap','\u2A4C':'ccups','\u2A4D':'ccaps','\u2A50':'ccupssm','\u2A53':'And','\u2A54':'Or','\u2A55':'andand','\u2A56':'oror','\u2A57':'orslope','\u2A58':'andslope','\u2A5A':'andv','\u2A5B':'orv','\u2A5C':'andd','\u2A5D':'ord','\u2A5F':'wedbar','\u2A66':'sdote','\u2A6A':'simdot','\u2A6D':'congdot','\u2A6D\u0338':'ncongdot','\u2A6E':'easter','\u2A6F':'apacir','\u2A70':'apE','\u2A70\u0338':'napE','\u2A71':'eplus','\u2A72':'pluse','\u2A73':'Esim','\u2A77':'eDDot','\u2A78':'equivDD','\u2A79':'ltcir','\u2A7A':'gtcir','\u2A7B':'ltquest','\u2A7C':'gtquest','\u2A7D':'les','\u2A7D\u0338':'nles','\u2A7E':'ges','\u2A7E\u0338':'nges','\u2A7F':'lesdot','\u2A80':'gesdot','\u2A81':'lesdoto','\u2A82':'gesdoto','\u2A83':'lesdotor','\u2A84':'gesdotol','\u2A85':'lap','\u2A86':'gap','\u2A87':'lne','\u2A88':'gne','\u2A89':'lnap','\u2A8A':'gnap','\u2A8B':'lEg','\u2A8C':'gEl','\u2A8D':'lsime','\u2A8E':'gsime','\u2A8F':'lsimg','\u2A90':'gsiml','\u2A91':'lgE','\u2A92':'glE','\u2A93':'lesges','\u2A94':'gesles','\u2A95':'els','\u2A96':'egs','\u2A97':'elsdot','\u2A98':'egsdot','\u2A99':'el','\u2A9A':'eg','\u2A9D':'siml','\u2A9E':'simg','\u2A9F':'simlE','\u2AA0':'simgE','\u2AA1':'LessLess','\u2AA1\u0338':'NotNestedLessLess','\u2AA2':'GreaterGreater','\u2AA2\u0338':'NotNestedGreaterGreater','\u2AA4':'glj','\u2AA5':'gla','\u2AA6':'ltcc','\u2AA7':'gtcc','\u2AA8':'lescc','\u2AA9':'gescc','\u2AAA':'smt','\u2AAB':'lat','\u2AAC':'smte','\u2AAC\uFE00':'smtes','\u2AAD':'late','\u2AAD\uFE00':'lates','\u2AAE':'bumpE','\u2AAF':'pre','\u2AAF\u0338':'npre','\u2AB0':'sce','\u2AB0\u0338':'nsce','\u2AB3':'prE','\u2AB4':'scE','\u2AB5':'prnE','\u2AB6':'scnE','\u2AB7':'prap','\u2AB8':'scap','\u2AB9':'prnap','\u2ABA':'scnap','\u2ABB':'Pr','\u2ABC':'Sc','\u2ABD':'subdot','\u2ABE':'supdot','\u2ABF':'subplus','\u2AC0':'supplus','\u2AC1':'submult','\u2AC2':'supmult','\u2AC3':'subedot','\u2AC4':'supedot','\u2AC5':'subE','\u2AC5\u0338':'nsubE','\u2AC6':'supE','\u2AC6\u0338':'nsupE','\u2AC7':'subsim','\u2AC8':'supsim','\u2ACB\uFE00':'vsubnE','\u2ACB':'subnE','\u2ACC\uFE00':'vsupnE','\u2ACC':'supnE','\u2ACF':'csub','\u2AD0':'csup','\u2AD1':'csube','\u2AD2':'csupe','\u2AD3':'subsup','\u2AD4':'supsub','\u2AD5':'subsub','\u2AD6':'supsup','\u2AD7':'suphsub','\u2AD8':'supdsub','\u2AD9':'forkv','\u2ADA':'topfork','\u2ADB':'mlcp','\u2AE4':'Dashv','\u2AE6':'Vdashl','\u2AE7':'Barv','\u2AE8':'vBar','\u2AE9':'vBarv','\u2AEB':'Vbar','\u2AEC':'Not','\u2AED':'bNot','\u2AEE':'rnmid','\u2AEF':'cirmid','\u2AF0':'midcir','\u2AF1':'topcir','\u2AF2':'nhpar','\u2AF3':'parsim','\u2AFD':'parsl','\u2AFD\u20E5':'nparsl','\u266D':'flat','\u266E':'natur','\u266F':'sharp','\xA4':'curren','\xA2':'cent','$':'dollar','\xA3':'pound','\xA5':'yen','\u20AC':'euro','\xB9':'sup1','\xBD':'half','\u2153':'frac13','\xBC':'frac14','\u2155':'frac15','\u2159':'frac16','\u215B':'frac18','\xB2':'sup2','\u2154':'frac23','\u2156':'frac25','\xB3':'sup3','\xBE':'frac34','\u2157':'frac35','\u215C':'frac38','\u2158':'frac45','\u215A':'frac56','\u215D':'frac58','\u215E':'frac78','\uD835\uDCB6':'ascr','\uD835\uDD52':'aopf','\uD835\uDD1E':'afr','\uD835\uDD38':'Aopf','\uD835\uDD04':'Afr','\uD835\uDC9C':'Ascr','\xAA':'ordf','\xE1':'aacute','\xC1':'Aacute','\xE0':'agrave','\xC0':'Agrave','\u0103':'abreve','\u0102':'Abreve','\xE2':'acirc','\xC2':'Acirc','\xE5':'aring','\xC5':'angst','\xE4':'auml','\xC4':'Auml','\xE3':'atilde','\xC3':'Atilde','\u0105':'aogon','\u0104':'Aogon','\u0101':'amacr','\u0100':'Amacr','\xE6':'aelig','\xC6':'AElig','\uD835\uDCB7':'bscr','\uD835\uDD53':'bopf','\uD835\uDD1F':'bfr','\uD835\uDD39':'Bopf','\u212C':'Bscr','\uD835\uDD05':'Bfr','\uD835\uDD20':'cfr','\uD835\uDCB8':'cscr','\uD835\uDD54':'copf','\u212D':'Cfr','\uD835\uDC9E':'Cscr','\u2102':'Copf','\u0107':'cacute','\u0106':'Cacute','\u0109':'ccirc','\u0108':'Ccirc','\u010D':'ccaron','\u010C':'Ccaron','\u010B':'cdot','\u010A':'Cdot','\xE7':'ccedil','\xC7':'Ccedil','\u2105':'incare','\uD835\uDD21':'dfr','\u2146':'dd','\uD835\uDD55':'dopf','\uD835\uDCB9':'dscr','\uD835\uDC9F':'Dscr','\uD835\uDD07':'Dfr','\u2145':'DD','\uD835\uDD3B':'Dopf','\u010F':'dcaron','\u010E':'Dcaron','\u0111':'dstrok','\u0110':'Dstrok','\xF0':'eth','\xD0':'ETH','\u2147':'ee','\u212F':'escr','\uD835\uDD22':'efr','\uD835\uDD56':'eopf','\u2130':'Escr','\uD835\uDD08':'Efr','\uD835\uDD3C':'Eopf','\xE9':'eacute','\xC9':'Eacute','\xE8':'egrave','\xC8':'Egrave','\xEA':'ecirc','\xCA':'Ecirc','\u011B':'ecaron','\u011A':'Ecaron','\xEB':'euml','\xCB':'Euml','\u0117':'edot','\u0116':'Edot','\u0119':'eogon','\u0118':'Eogon','\u0113':'emacr','\u0112':'Emacr','\uD835\uDD23':'ffr','\uD835\uDD57':'fopf','\uD835\uDCBB':'fscr','\uD835\uDD09':'Ffr','\uD835\uDD3D':'Fopf','\u2131':'Fscr','\uFB00':'fflig','\uFB03':'ffilig','\uFB04':'ffllig','\uFB01':'filig','fj':'fjlig','\uFB02':'fllig','\u0192':'fnof','\u210A':'gscr','\uD835\uDD58':'gopf','\uD835\uDD24':'gfr','\uD835\uDCA2':'Gscr','\uD835\uDD3E':'Gopf','\uD835\uDD0A':'Gfr','\u01F5':'gacute','\u011F':'gbreve','\u011E':'Gbreve','\u011D':'gcirc','\u011C':'Gcirc','\u0121':'gdot','\u0120':'Gdot','\u0122':'Gcedil','\uD835\uDD25':'hfr','\u210E':'planckh','\uD835\uDCBD':'hscr','\uD835\uDD59':'hopf','\u210B':'Hscr','\u210C':'Hfr','\u210D':'Hopf','\u0125':'hcirc','\u0124':'Hcirc','\u210F':'hbar','\u0127':'hstrok','\u0126':'Hstrok','\uD835\uDD5A':'iopf','\uD835\uDD26':'ifr','\uD835\uDCBE':'iscr','\u2148':'ii','\uD835\uDD40':'Iopf','\u2110':'Iscr','\u2111':'Im','\xED':'iacute','\xCD':'Iacute','\xEC':'igrave','\xCC':'Igrave','\xEE':'icirc','\xCE':'Icirc','\xEF':'iuml','\xCF':'Iuml','\u0129':'itilde','\u0128':'Itilde','\u0130':'Idot','\u012F':'iogon','\u012E':'Iogon','\u012B':'imacr','\u012A':'Imacr','\u0133':'ijlig','\u0132':'IJlig','\u0131':'imath','\uD835\uDCBF':'jscr','\uD835\uDD5B':'jopf','\uD835\uDD27':'jfr','\uD835\uDCA5':'Jscr','\uD835\uDD0D':'Jfr','\uD835\uDD41':'Jopf','\u0135':'jcirc','\u0134':'Jcirc','\u0237':'jmath','\uD835\uDD5C':'kopf','\uD835\uDCC0':'kscr','\uD835\uDD28':'kfr','\uD835\uDCA6':'Kscr','\uD835\uDD42':'Kopf','\uD835\uDD0E':'Kfr','\u0137':'kcedil','\u0136':'Kcedil','\uD835\uDD29':'lfr','\uD835\uDCC1':'lscr','\u2113':'ell','\uD835\uDD5D':'lopf','\u2112':'Lscr','\uD835\uDD0F':'Lfr','\uD835\uDD43':'Lopf','\u013A':'lacute','\u0139':'Lacute','\u013E':'lcaron','\u013D':'Lcaron','\u013C':'lcedil','\u013B':'Lcedil','\u0142':'lstrok','\u0141':'Lstrok','\u0140':'lmidot','\u013F':'Lmidot','\uD835\uDD2A':'mfr','\uD835\uDD5E':'mopf','\uD835\uDCC2':'mscr','\uD835\uDD10':'Mfr','\uD835\uDD44':'Mopf','\u2133':'Mscr','\uD835\uDD2B':'nfr','\uD835\uDD5F':'nopf','\uD835\uDCC3':'nscr','\u2115':'Nopf','\uD835\uDCA9':'Nscr','\uD835\uDD11':'Nfr','\u0144':'nacute','\u0143':'Nacute','\u0148':'ncaron','\u0147':'Ncaron','\xF1':'ntilde','\xD1':'Ntilde','\u0146':'ncedil','\u0145':'Ncedil','\u2116':'numero','\u014B':'eng','\u014A':'ENG','\uD835\uDD60':'oopf','\uD835\uDD2C':'ofr','\u2134':'oscr','\uD835\uDCAA':'Oscr','\uD835\uDD12':'Ofr','\uD835\uDD46':'Oopf','\xBA':'ordm','\xF3':'oacute','\xD3':'Oacute','\xF2':'ograve','\xD2':'Ograve','\xF4':'ocirc','\xD4':'Ocirc','\xF6':'ouml','\xD6':'Ouml','\u0151':'odblac','\u0150':'Odblac','\xF5':'otilde','\xD5':'Otilde','\xF8':'oslash','\xD8':'Oslash','\u014D':'omacr','\u014C':'Omacr','\u0153':'oelig','\u0152':'OElig','\uD835\uDD2D':'pfr','\uD835\uDCC5':'pscr','\uD835\uDD61':'popf','\u2119':'Popf','\uD835\uDD13':'Pfr','\uD835\uDCAB':'Pscr','\uD835\uDD62':'qopf','\uD835\uDD2E':'qfr','\uD835\uDCC6':'qscr','\uD835\uDCAC':'Qscr','\uD835\uDD14':'Qfr','\u211A':'Qopf','\u0138':'kgreen','\uD835\uDD2F':'rfr','\uD835\uDD63':'ropf','\uD835\uDCC7':'rscr','\u211B':'Rscr','\u211C':'Re','\u211D':'Ropf','\u0155':'racute','\u0154':'Racute','\u0159':'rcaron','\u0158':'Rcaron','\u0157':'rcedil','\u0156':'Rcedil','\uD835\uDD64':'sopf','\uD835\uDCC8':'sscr','\uD835\uDD30':'sfr','\uD835\uDD4A':'Sopf','\uD835\uDD16':'Sfr','\uD835\uDCAE':'Sscr','\u24C8':'oS','\u015B':'sacute','\u015A':'Sacute','\u015D':'scirc','\u015C':'Scirc','\u0161':'scaron','\u0160':'Scaron','\u015F':'scedil','\u015E':'Scedil','\xDF':'szlig','\uD835\uDD31':'tfr','\uD835\uDCC9':'tscr','\uD835\uDD65':'topf','\uD835\uDCAF':'Tscr','\uD835\uDD17':'Tfr','\uD835\uDD4B':'Topf','\u0165':'tcaron','\u0164':'Tcaron','\u0163':'tcedil','\u0162':'Tcedil','\u2122':'trade','\u0167':'tstrok','\u0166':'Tstrok','\uD835\uDCCA':'uscr','\uD835\uDD66':'uopf','\uD835\uDD32':'ufr','\uD835\uDD4C':'Uopf','\uD835\uDD18':'Ufr','\uD835\uDCB0':'Uscr','\xFA':'uacute','\xDA':'Uacute','\xF9':'ugrave','\xD9':'Ugrave','\u016D':'ubreve','\u016C':'Ubreve','\xFB':'ucirc','\xDB':'Ucirc','\u016F':'uring','\u016E':'Uring','\xFC':'uuml','\xDC':'Uuml','\u0171':'udblac','\u0170':'Udblac','\u0169':'utilde','\u0168':'Utilde','\u0173':'uogon','\u0172':'Uogon','\u016B':'umacr','\u016A':'Umacr','\uD835\uDD33':'vfr','\uD835\uDD67':'vopf','\uD835\uDCCB':'vscr','\uD835\uDD19':'Vfr','\uD835\uDD4D':'Vopf','\uD835\uDCB1':'Vscr','\uD835\uDD68':'wopf','\uD835\uDCCC':'wscr','\uD835\uDD34':'wfr','\uD835\uDCB2':'Wscr','\uD835\uDD4E':'Wopf','\uD835\uDD1A':'Wfr','\u0175':'wcirc','\u0174':'Wcirc','\uD835\uDD35':'xfr','\uD835\uDCCD':'xscr','\uD835\uDD69':'xopf','\uD835\uDD4F':'Xopf','\uD835\uDD1B':'Xfr','\uD835\uDCB3':'Xscr','\uD835\uDD36':'yfr','\uD835\uDCCE':'yscr','\uD835\uDD6A':'yopf','\uD835\uDCB4':'Yscr','\uD835\uDD1C':'Yfr','\uD835\uDD50':'Yopf','\xFD':'yacute','\xDD':'Yacute','\u0177':'ycirc','\u0176':'Ycirc','\xFF':'yuml','\u0178':'Yuml','\uD835\uDCCF':'zscr','\uD835\uDD37':'zfr','\uD835\uDD6B':'zopf','\u2128':'Zfr','\u2124':'Zopf','\uD835\uDCB5':'Zscr','\u017A':'zacute','\u0179':'Zacute','\u017E':'zcaron','\u017D':'Zcaron','\u017C':'zdot','\u017B':'Zdot','\u01B5':'imped','\xFE':'thorn','\xDE':'THORN','\u0149':'napos','\u03B1':'alpha','\u0391':'Alpha','\u03B2':'beta','\u0392':'Beta','\u03B3':'gamma','\u0393':'Gamma','\u03B4':'delta','\u0394':'Delta','\u03B5':'epsi','\u03F5':'epsiv','\u0395':'Epsilon','\u03DD':'gammad','\u03DC':'Gammad','\u03B6':'zeta','\u0396':'Zeta','\u03B7':'eta','\u0397':'Eta','\u03B8':'theta','\u03D1':'thetav','\u0398':'Theta','\u03B9':'iota','\u0399':'Iota','\u03BA':'kappa','\u03F0':'kappav','\u039A':'Kappa','\u03BB':'lambda','\u039B':'Lambda','\u03BC':'mu','\xB5':'micro','\u039C':'Mu','\u03BD':'nu','\u039D':'Nu','\u03BE':'xi','\u039E':'Xi','\u03BF':'omicron','\u039F':'Omicron','\u03C0':'pi','\u03D6':'piv','\u03A0':'Pi','\u03C1':'rho','\u03F1':'rhov','\u03A1':'Rho','\u03C3':'sigma','\u03A3':'Sigma','\u03C2':'sigmaf','\u03C4':'tau','\u03A4':'Tau','\u03C5':'upsi','\u03A5':'Upsilon','\u03D2':'Upsi','\u03C6':'phi','\u03D5':'phiv','\u03A6':'Phi','\u03C7':'chi','\u03A7':'Chi','\u03C8':'psi','\u03A8':'Psi','\u03C9':'omega','\u03A9':'ohm','\u0430':'acy','\u0410':'Acy','\u0431':'bcy','\u0411':'Bcy','\u0432':'vcy','\u0412':'Vcy','\u0433':'gcy','\u0413':'Gcy','\u0453':'gjcy','\u0403':'GJcy','\u0434':'dcy','\u0414':'Dcy','\u0452':'djcy','\u0402':'DJcy','\u0435':'iecy','\u0415':'IEcy','\u0451':'iocy','\u0401':'IOcy','\u0454':'jukcy','\u0404':'Jukcy','\u0436':'zhcy','\u0416':'ZHcy','\u0437':'zcy','\u0417':'Zcy','\u0455':'dscy','\u0405':'DScy','\u0438':'icy','\u0418':'Icy','\u0456':'iukcy','\u0406':'Iukcy','\u0457':'yicy','\u0407':'YIcy','\u0439':'jcy','\u0419':'Jcy','\u0458':'jsercy','\u0408':'Jsercy','\u043A':'kcy','\u041A':'Kcy','\u045C':'kjcy','\u040C':'KJcy','\u043B':'lcy','\u041B':'Lcy','\u0459':'ljcy','\u0409':'LJcy','\u043C':'mcy','\u041C':'Mcy','\u043D':'ncy','\u041D':'Ncy','\u045A':'njcy','\u040A':'NJcy','\u043E':'ocy','\u041E':'Ocy','\u043F':'pcy','\u041F':'Pcy','\u0440':'rcy','\u0420':'Rcy','\u0441':'scy','\u0421':'Scy','\u0442':'tcy','\u0422':'Tcy','\u045B':'tshcy','\u040B':'TSHcy','\u0443':'ucy','\u0423':'Ucy','\u045E':'ubrcy','\u040E':'Ubrcy','\u0444':'fcy','\u0424':'Fcy','\u0445':'khcy','\u0425':'KHcy','\u0446':'tscy','\u0426':'TScy','\u0447':'chcy','\u0427':'CHcy','\u045F':'dzcy','\u040F':'DZcy','\u0448':'shcy','\u0428':'SHcy','\u0449':'shchcy','\u0429':'SHCHcy','\u044A':'hardcy','\u042A':'HARDcy','\u044B':'ycy','\u042B':'Ycy','\u044C':'softcy','\u042C':'SOFTcy','\u044D':'ecy','\u042D':'Ecy','\u044E':'yucy','\u042E':'YUcy','\u044F':'yacy','\u042F':'YAcy','\u2135':'aleph','\u2136':'beth','\u2137':'gimel','\u2138':'daleth'};var regexEscape = /["&'<>`]/g;var escapeMap = {'"': '"','&': '&','\'': ''','<': '<',// See https://mathiasbynens.be/notes/ambiguous-ampersands: in HTML, the// following is not strictly necessary unless it’s part of a tag or an// unquoted attribute value. We’re only escaping it to support those// situations, and for XML support.'>': '>',// In Internet Explorer ≤ 8, the backtick character can be used// to break out of (un)quoted attribute values or HTML comments.// See http://html5sec.org/#102, http://html5sec.org/#108, and// http://html5sec.org/#133.'`': '`'};var regexInvalidEntity = /&#(?:[xX][^a-fA-F0-9]|[^0-9xX])/;var regexInvalidRawCodePoint = /[\0-\x08\x0B\x0E-\x1F\x7F-\x9F\uFDD0-\uFDEF\uFFFE\uFFFF]|[\uD83F\uD87F\uD8BF\uD8FF\uD93F\uD97F\uD9BF\uD9FF\uDA3F\uDA7F\uDABF\uDAFF\uDB3F\uDB7F\uDBBF\uDBFF][\uDFFE\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var regexDecode = /&(CounterClockwiseContourIntegral|DoubleLongLeftRightArrow|ClockwiseContourIntegral|NotNestedGreaterGreater|NotSquareSupersetEqual|DiacriticalDoubleAcute|NotRightTriangleEqual|NotSucceedsSlantEqual|NotPrecedesSlantEqual|CloseCurlyDoubleQuote|NegativeVeryThinSpace|DoubleContourIntegral|FilledVerySmallSquare|CapitalDifferentialD|OpenCurlyDoubleQuote|EmptyVerySmallSquare|NestedGreaterGreater|DoubleLongRightArrow|NotLeftTriangleEqual|NotGreaterSlantEqual|ReverseUpEquilibrium|DoubleLeftRightArrow|NotSquareSubsetEqual|NotDoubleVerticalBar|RightArrowLeftArrow|NotGreaterFullEqual|NotRightTriangleBar|SquareSupersetEqual|DownLeftRightVector|DoubleLongLeftArrow|leftrightsquigarrow|LeftArrowRightArrow|NegativeMediumSpace|blacktriangleright|RightDownVectorBar|PrecedesSlantEqual|RightDoubleBracket|SucceedsSlantEqual|NotLeftTriangleBar|RightTriangleEqual|SquareIntersection|RightDownTeeVector|ReverseEquilibrium|NegativeThickSpace|longleftrightarrow|Longleftrightarrow|LongLeftRightArrow|DownRightTeeVector|DownRightVectorBar|GreaterSlantEqual|SquareSubsetEqual|LeftDownVectorBar|LeftDoubleBracket|VerticalSeparator|rightleftharpoons|NotGreaterGreater|NotSquareSuperset|blacktriangleleft|blacktriangledown|NegativeThinSpace|LeftDownTeeVector|NotLessSlantEqual|leftrightharpoons|DoubleUpDownArrow|DoubleVerticalBar|LeftTriangleEqual|FilledSmallSquare|twoheadrightarrow|NotNestedLessLess|DownLeftTeeVector|DownLeftVectorBar|RightAngleBracket|NotTildeFullEqual|NotReverseElement|RightUpDownVector|DiacriticalTilde|NotSucceedsTilde|circlearrowright|NotPrecedesEqual|rightharpoondown|DoubleRightArrow|NotSucceedsEqual|NonBreakingSpace|NotRightTriangle|LessEqualGreater|RightUpTeeVector|LeftAngleBracket|GreaterFullEqual|DownArrowUpArrow|RightUpVectorBar|twoheadleftarrow|GreaterEqualLess|downharpoonright|RightTriangleBar|ntrianglerighteq|NotSupersetEqual|LeftUpDownVector|DiacriticalAcute|rightrightarrows|vartriangleright|UpArrowDownArrow|DiacriticalGrave|UnderParenthesis|EmptySmallSquare|LeftUpVectorBar|leftrightarrows|DownRightVector|downharpoonleft|trianglerighteq|ShortRightArrow|OverParenthesis|DoubleLeftArrow|DoubleDownArrow|NotSquareSubset|bigtriangledown|ntrianglelefteq|UpperRightArrow|curvearrowright|vartriangleleft|NotLeftTriangle|nleftrightarrow|LowerRightArrow|NotHumpDownHump|NotGreaterTilde|rightthreetimes|LeftUpTeeVector|NotGreaterEqual|straightepsilon|LeftTriangleBar|rightsquigarrow|ContourIntegral|rightleftarrows|CloseCurlyQuote|RightDownVector|LeftRightVector|nLeftrightarrow|leftharpoondown|circlearrowleft|SquareSuperset|OpenCurlyQuote|hookrightarrow|HorizontalLine|DiacriticalDot|NotLessGreater|ntriangleright|DoubleRightTee|InvisibleComma|InvisibleTimes|LowerLeftArrow|DownLeftVector|NotSubsetEqual|curvearrowleft|trianglelefteq|NotVerticalBar|TildeFullEqual|downdownarrows|NotGreaterLess|RightTeeVector|ZeroWidthSpace|looparrowright|LongRightArrow|doublebarwedge|ShortLeftArrow|ShortDownArrow|RightVectorBar|GreaterGreater|ReverseElement|rightharpoonup|LessSlantEqual|leftthreetimes|upharpoonright|rightarrowtail|LeftDownVector|Longrightarrow|NestedLessLess|UpperLeftArrow|nshortparallel|leftleftarrows|leftrightarrow|Leftrightarrow|LeftRightArrow|longrightarrow|upharpoonleft|RightArrowBar|ApplyFunction|LeftTeeVector|leftarrowtail|NotEqualTilde|varsubsetneqq|varsupsetneqq|RightTeeArrow|SucceedsEqual|SucceedsTilde|LeftVectorBar|SupersetEqual|hookleftarrow|DifferentialD|VerticalTilde|VeryThinSpace|blacktriangle|bigtriangleup|LessFullEqual|divideontimes|leftharpoonup|UpEquilibrium|ntriangleleft|RightTriangle|measuredangle|shortparallel|longleftarrow|Longleftarrow|LongLeftArrow|DoubleLeftTee|Poincareplane|PrecedesEqual|triangleright|DoubleUpArrow|RightUpVector|fallingdotseq|looparrowleft|PrecedesTilde|NotTildeEqual|NotTildeTilde|smallsetminus|Proportional|triangleleft|triangledown|UnderBracket|NotHumpEqual|exponentiale|ExponentialE|NotLessTilde|HilbertSpace|RightCeiling|blacklozenge|varsupsetneq|HumpDownHump|GreaterEqual|VerticalLine|LeftTeeArrow|NotLessEqual|DownTeeArrow|LeftTriangle|varsubsetneq|Intersection|NotCongruent|DownArrowBar|LeftUpVector|LeftArrowBar|risingdotseq|GreaterTilde|RoundImplies|SquareSubset|ShortUpArrow|NotSuperset|quaternions|precnapprox|backepsilon|preccurlyeq|OverBracket|blacksquare|MediumSpace|VerticalBar|circledcirc|circleddash|CircleMinus|CircleTimes|LessGreater|curlyeqprec|curlyeqsucc|diamondsuit|UpDownArrow|Updownarrow|RuleDelayed|Rrightarrow|updownarrow|RightVector|nRightarrow|nrightarrow|eqslantless|LeftCeiling|Equilibrium|SmallCircle|expectation|NotSucceeds|thickapprox|GreaterLess|SquareUnion|NotPrecedes|NotLessLess|straightphi|succnapprox|succcurlyeq|SubsetEqual|sqsupseteq|Proportion|Laplacetrf|ImaginaryI|supsetneqq|NotGreater|gtreqqless|NotElement|ThickSpace|TildeEqual|TildeTilde|Fouriertrf|rmoustache|EqualTilde|eqslantgtr|UnderBrace|LeftVector|UpArrowBar|nLeftarrow|nsubseteqq|subsetneqq|nsupseteqq|nleftarrow|succapprox|lessapprox|UpTeeArrow|upuparrows|curlywedge|lesseqqgtr|varepsilon|varnothing|RightFloor|complement|CirclePlus|sqsubseteq|Lleftarrow|circledast|RightArrow|Rightarrow|rightarrow|lmoustache|Bernoullis|precapprox|mapstoleft|mapstodown|longmapsto|dotsquare|downarrow|DoubleDot|nsubseteq|supsetneq|leftarrow|nsupseteq|subsetneq|ThinSpace|ngeqslant|subseteqq|HumpEqual|NotSubset|triangleq|NotCupCap|lesseqgtr|heartsuit|TripleDot|Leftarrow|Coproduct|Congruent|varpropto|complexes|gvertneqq|LeftArrow|LessTilde|supseteqq|MinusPlus|CircleDot|nleqslant|NotExists|gtreqless|nparallel|UnionPlus|LeftFloor|checkmark|CenterDot|centerdot|Mellintrf|gtrapprox|bigotimes|OverBrace|spadesuit|therefore|pitchfork|rationals|PlusMinus|Backslash|Therefore|DownBreve|backsimeq|backprime|DownArrow|nshortmid|Downarrow|lvertneqq|eqvparsl|imagline|imagpart|infintie|integers|Integral|intercal|LessLess|Uarrocir|intlarhk|sqsupset|angmsdaf|sqsubset|llcorner|vartheta|cupbrcap|lnapprox|Superset|SuchThat|succnsim|succneqq|angmsdag|biguplus|curlyvee|trpezium|Succeeds|NotTilde|bigwedge|angmsdah|angrtvbd|triminus|cwconint|fpartint|lrcorner|smeparsl|subseteq|urcorner|lurdshar|laemptyv|DDotrahd|approxeq|ldrushar|awconint|mapstoup|backcong|shortmid|triangle|geqslant|gesdotol|timesbar|circledR|circledS|setminus|multimap|naturals|scpolint|ncongdot|RightTee|boxminus|gnapprox|boxtimes|andslope|thicksim|angmsdaa|varsigma|cirfnint|rtriltri|angmsdab|rppolint|angmsdac|barwedge|drbkarow|clubsuit|thetasym|bsolhsub|capbrcup|dzigrarr|doteqdot|DotEqual|dotminus|UnderBar|NotEqual|realpart|otimesas|ulcorner|hksearow|hkswarow|parallel|PartialD|elinters|emptyset|plusacir|bbrktbrk|angmsdad|pointint|bigoplus|angmsdae|Precedes|bigsqcup|varkappa|notindot|supseteq|precneqq|precnsim|profalar|profline|profsurf|leqslant|lesdotor|raemptyv|subplus|notnivb|notnivc|subrarr|zigrarr|vzigzag|submult|subedot|Element|between|cirscir|larrbfs|larrsim|lotimes|lbrksld|lbrkslu|lozenge|ldrdhar|dbkarow|bigcirc|epsilon|simrarr|simplus|ltquest|Epsilon|luruhar|gtquest|maltese|npolint|eqcolon|npreceq|bigodot|ddagger|gtrless|bnequiv|harrcir|ddotseq|equivDD|backsim|demptyv|nsqsube|nsqsupe|Upsilon|nsubset|upsilon|minusdu|nsucceq|swarrow|nsupset|coloneq|searrow|boxplus|napprox|natural|asympeq|alefsym|congdot|nearrow|bigstar|diamond|supplus|tritime|LeftTee|nvinfin|triplus|NewLine|nvltrie|nvrtrie|nwarrow|nexists|Diamond|ruluhar|Implies|supmult|angzarr|suplarr|suphsub|questeq|because|digamma|Because|olcross|bemptyv|omicron|Omicron|rotimes|NoBreak|intprod|angrtvb|orderof|uwangle|suphsol|lesdoto|orslope|DownTee|realine|cudarrl|rdldhar|OverBar|supedot|lessdot|supdsub|topfork|succsim|rbrkslu|rbrksld|pertenk|cudarrr|isindot|planckh|lessgtr|pluscir|gesdoto|plussim|plustwo|lesssim|cularrp|rarrsim|Cayleys|notinva|notinvb|notinvc|UpArrow|Uparrow|uparrow|NotLess|dwangle|precsim|Product|curarrm|Cconint|dotplus|rarrbfs|ccupssm|Cedilla|cemptyv|notniva|quatint|frac35|frac38|frac45|frac56|frac58|frac78|tridot|xoplus|gacute|gammad|Gammad|lfisht|lfloor|bigcup|sqsupe|gbreve|Gbreve|lharul|sqsube|sqcups|Gcedil|apacir|llhard|lmidot|Lmidot|lmoust|andand|sqcaps|approx|Abreve|spades|circeq|tprime|divide|topcir|Assign|topbot|gesdot|divonx|xuplus|timesd|gesles|atilde|solbar|SOFTcy|loplus|timesb|lowast|lowbar|dlcorn|dlcrop|softcy|dollar|lparlt|thksim|lrhard|Atilde|lsaquo|smashp|bigvee|thinsp|wreath|bkarow|lsquor|lstrok|Lstrok|lthree|ltimes|ltlarr|DotDot|simdot|ltrPar|weierp|xsqcup|angmsd|sigmav|sigmaf|zeetrf|Zcaron|zcaron|mapsto|vsupne|thetav|cirmid|marker|mcomma|Zacute|vsubnE|there4|gtlPar|vsubne|bottom|gtrarr|SHCHcy|shchcy|midast|midcir|middot|minusb|minusd|gtrdot|bowtie|sfrown|mnplus|models|colone|seswar|Colone|mstpos|searhk|gtrsim|nacute|Nacute|boxbox|telrec|hairsp|Tcedil|nbumpe|scnsim|ncaron|Ncaron|ncedil|Ncedil|hamilt|Scedil|nearhk|hardcy|HARDcy|tcedil|Tcaron|commat|nequiv|nesear|tcaron|target|hearts|nexist|varrho|scedil|Scaron|scaron|hellip|Sacute|sacute|hercon|swnwar|compfn|rtimes|rthree|rsquor|rsaquo|zacute|wedgeq|homtht|barvee|barwed|Barwed|rpargt|horbar|conint|swarhk|roplus|nltrie|hslash|hstrok|Hstrok|rmoust|Conint|bprime|hybull|hyphen|iacute|Iacute|supsup|supsub|supsim|varphi|coprod|brvbar|agrave|Supset|supset|igrave|Igrave|notinE|Agrave|iiiint|iinfin|copysr|wedbar|Verbar|vangrt|becaus|incare|verbar|inodot|bullet|drcorn|intcal|drcrop|cularr|vellip|Utilde|bumpeq|cupcap|dstrok|Dstrok|CupCap|cupcup|cupdot|eacute|Eacute|supdot|iquest|easter|ecaron|Ecaron|ecolon|isinsv|utilde|itilde|Itilde|curarr|succeq|Bumpeq|cacute|ulcrop|nparsl|Cacute|nprcue|egrave|Egrave|nrarrc|nrarrw|subsup|subsub|nrtrie|jsercy|nsccue|Jsercy|kappav|kcedil|Kcedil|subsim|ulcorn|nsimeq|egsdot|veebar|kgreen|capand|elsdot|Subset|subset|curren|aacute|lacute|Lacute|emptyv|ntilde|Ntilde|lagran|lambda|Lambda|capcap|Ugrave|langle|subdot|emsp13|numero|emsp14|nvdash|nvDash|nVdash|nVDash|ugrave|ufisht|nvHarr|larrfs|nvlArr|larrhk|larrlp|larrpl|nvrArr|Udblac|nwarhk|larrtl|nwnear|oacute|Oacute|latail|lAtail|sstarf|lbrace|odblac|Odblac|lbrack|udblac|odsold|eparsl|lcaron|Lcaron|ograve|Ograve|lcedil|Lcedil|Aacute|ssmile|ssetmn|squarf|ldquor|capcup|ominus|cylcty|rharul|eqcirc|dagger|rfloor|rfisht|Dagger|daleth|equals|origof|capdot|equest|dcaron|Dcaron|rdquor|oslash|Oslash|otilde|Otilde|otimes|Otimes|urcrop|Ubreve|ubreve|Yacute|Uacute|uacute|Rcedil|rcedil|urcorn|parsim|Rcaron|Vdashl|rcaron|Tstrok|percnt|period|permil|Exists|yacute|rbrack|rbrace|phmmat|ccaron|Ccaron|planck|ccedil|plankv|tstrok|female|plusdo|plusdu|ffilig|plusmn|ffllig|Ccedil|rAtail|dfisht|bernou|ratail|Rarrtl|rarrtl|angsph|rarrpl|rarrlp|rarrhk|xwedge|xotime|forall|ForAll|Vvdash|vsupnE|preceq|bigcap|frac12|frac13|frac14|primes|rarrfs|prnsim|frac15|Square|frac16|square|lesdot|frac18|frac23|propto|prurel|rarrap|rangle|puncsp|frac25|Racute|qprime|racute|lesges|frac34|abreve|AElig|eqsim|utdot|setmn|urtri|Equal|Uring|seArr|uring|searr|dashv|Dashv|mumap|nabla|iogon|Iogon|sdote|sdotb|scsim|napid|napos|equiv|natur|Acirc|dblac|erarr|nbump|iprod|erDot|ucirc|awint|esdot|angrt|ncong|isinE|scnap|Scirc|scirc|ndash|isins|Ubrcy|nearr|neArr|isinv|nedot|ubrcy|acute|Ycirc|iukcy|Iukcy|xutri|nesim|caret|jcirc|Jcirc|caron|twixt|ddarr|sccue|exist|jmath|sbquo|ngeqq|angst|ccaps|lceil|ngsim|UpTee|delta|Delta|rtrif|nharr|nhArr|nhpar|rtrie|jukcy|Jukcy|kappa|rsquo|Kappa|nlarr|nlArr|TSHcy|rrarr|aogon|Aogon|fflig|xrarr|tshcy|ccirc|nleqq|filig|upsih|nless|dharl|nlsim|fjlig|ropar|nltri|dharr|robrk|roarr|fllig|fltns|roang|rnmid|subnE|subne|lAarr|trisb|Ccirc|acirc|ccups|blank|VDash|forkv|Vdash|langd|cedil|blk12|blk14|laquo|strns|diams|notin|vDash|larrb|blk34|block|disin|uplus|vdash|vBarv|aelig|starf|Wedge|check|xrArr|lates|lbarr|lBarr|notni|lbbrk|bcong|frasl|lbrke|frown|vrtri|vprop|vnsup|gamma|Gamma|wedge|xodot|bdquo|srarr|doteq|ldquo|boxdl|boxdL|gcirc|Gcirc|boxDl|boxDL|boxdr|boxdR|boxDr|TRADE|trade|rlhar|boxDR|vnsub|npart|vltri|rlarr|boxhd|boxhD|nprec|gescc|nrarr|nrArr|boxHd|boxHD|boxhu|boxhU|nrtri|boxHu|clubs|boxHU|times|colon|Colon|gimel|xlArr|Tilde|nsime|tilde|nsmid|nspar|THORN|thorn|xlarr|nsube|nsubE|thkap|xhArr|comma|nsucc|boxul|boxuL|nsupe|nsupE|gneqq|gnsim|boxUl|boxUL|grave|boxur|boxuR|boxUr|boxUR|lescc|angle|bepsi|boxvh|varpi|boxvH|numsp|Theta|gsime|gsiml|theta|boxVh|boxVH|boxvl|gtcir|gtdot|boxvL|boxVl|boxVL|crarr|cross|Cross|nvsim|boxvr|nwarr|nwArr|sqsup|dtdot|Uogon|lhard|lharu|dtrif|ocirc|Ocirc|lhblk|duarr|odash|sqsub|Hacek|sqcup|llarr|duhar|oelig|OElig|ofcir|boxvR|uogon|lltri|boxVr|csube|uuarr|ohbar|csupe|ctdot|olarr|olcir|harrw|oline|sqcap|omacr|Omacr|omega|Omega|boxVR|aleph|lneqq|lnsim|loang|loarr|rharu|lobrk|hcirc|operp|oplus|rhard|Hcirc|orarr|Union|order|ecirc|Ecirc|cuepr|szlig|cuesc|breve|reals|eDDot|Breve|hoarr|lopar|utrif|rdquo|Umacr|umacr|efDot|swArr|ultri|alpha|rceil|ovbar|swarr|Wcirc|wcirc|smtes|smile|bsemi|lrarr|aring|parsl|lrhar|bsime|uhblk|lrtri|cupor|Aring|uharr|uharl|slarr|rbrke|bsolb|lsime|rbbrk|RBarr|lsimg|phone|rBarr|rbarr|icirc|lsquo|Icirc|emacr|Emacr|ratio|simne|plusb|simlE|simgE|simeq|pluse|ltcir|ltdot|empty|xharr|xdtri|iexcl|Alpha|ltrie|rarrw|pound|ltrif|xcirc|bumpe|prcue|bumpE|asymp|amacr|cuvee|Sigma|sigma|iiint|udhar|iiota|ijlig|IJlig|supnE|imacr|Imacr|prime|Prime|image|prnap|eogon|Eogon|rarrc|mdash|mDDot|cuwed|imath|supne|imped|Amacr|udarr|prsim|micro|rarrb|cwint|raquo|infin|eplus|range|rangd|Ucirc|radic|minus|amalg|veeeq|rAarr|epsiv|ycirc|quest|sharp|quot|zwnj|Qscr|race|qscr|Qopf|qopf|qint|rang|Rang|Zscr|zscr|Zopf|zopf|rarr|rArr|Rarr|Pscr|pscr|prop|prod|prnE|prec|ZHcy|zhcy|prap|Zeta|zeta|Popf|popf|Zdot|plus|zdot|Yuml|yuml|phiv|YUcy|yucy|Yscr|yscr|perp|Yopf|yopf|part|para|YIcy|Ouml|rcub|yicy|YAcy|rdca|ouml|osol|Oscr|rdsh|yacy|real|oscr|xvee|andd|rect|andv|Xscr|oror|ordm|ordf|xscr|ange|aopf|Aopf|rHar|Xopf|opar|Oopf|xopf|xnis|rhov|oopf|omid|xmap|oint|apid|apos|ogon|ascr|Ascr|odot|odiv|xcup|xcap|ocir|oast|nvlt|nvle|nvgt|nvge|nvap|Wscr|wscr|auml|ntlg|ntgl|nsup|nsub|nsim|Nscr|nscr|nsce|Wopf|ring|npre|wopf|npar|Auml|Barv|bbrk|Nopf|nopf|nmid|nLtv|beta|ropf|Ropf|Beta|beth|nles|rpar|nleq|bnot|bNot|nldr|NJcy|rscr|Rscr|Vscr|vscr|rsqb|njcy|bopf|nisd|Bopf|rtri|Vopf|nGtv|ngtr|vopf|boxh|boxH|boxv|nges|ngeq|boxV|bscr|scap|Bscr|bsim|Vert|vert|bsol|bull|bump|caps|cdot|ncup|scnE|ncap|nbsp|napE|Cdot|cent|sdot|Vbar|nang|vBar|chcy|Mscr|mscr|sect|semi|CHcy|Mopf|mopf|sext|circ|cire|mldr|mlcp|cirE|comp|shcy|SHcy|vArr|varr|cong|copf|Copf|copy|COPY|malt|male|macr|lvnE|cscr|ltri|sime|ltcc|simg|Cscr|siml|csub|Uuml|lsqb|lsim|uuml|csup|Lscr|lscr|utri|smid|lpar|cups|smte|lozf|darr|Lopf|Uscr|solb|lopf|sopf|Sopf|lneq|uscr|spar|dArr|lnap|Darr|dash|Sqrt|LJcy|ljcy|lHar|dHar|Upsi|upsi|diam|lesg|djcy|DJcy|leqq|dopf|Dopf|dscr|Dscr|dscy|ldsh|ldca|squf|DScy|sscr|Sscr|dsol|lcub|late|star|Star|Uopf|Larr|lArr|larr|uopf|dtri|dzcy|sube|subE|Lang|lang|Kscr|kscr|Kopf|kopf|KJcy|kjcy|KHcy|khcy|DZcy|ecir|edot|eDot|Jscr|jscr|succ|Jopf|jopf|Edot|uHar|emsp|ensp|Iuml|iuml|eopf|isin|Iscr|iscr|Eopf|epar|sung|epsi|escr|sup1|sup2|sup3|Iota|iota|supe|supE|Iopf|iopf|IOcy|iocy|Escr|esim|Esim|imof|Uarr|QUOT|uArr|uarr|euml|IEcy|iecy|Idot|Euml|euro|excl|Hscr|hscr|Hopf|hopf|TScy|tscy|Tscr|hbar|tscr|flat|tbrk|fnof|hArr|harr|half|fopf|Fopf|tdot|gvnE|fork|trie|gtcc|fscr|Fscr|gdot|gsim|Gscr|gscr|Gopf|gopf|gneq|Gdot|tosa|gnap|Topf|topf|geqq|toea|GJcy|gjcy|tint|gesl|mid|Sfr|ggg|top|ges|gla|glE|glj|geq|gne|gEl|gel|gnE|Gcy|gcy|gap|Tfr|tfr|Tcy|tcy|Hat|Tau|Ffr|tau|Tab|hfr|Hfr|ffr|Fcy|fcy|icy|Icy|iff|ETH|eth|ifr|Ifr|Eta|eta|int|Int|Sup|sup|ucy|Ucy|Sum|sum|jcy|ENG|ufr|Ufr|eng|Jcy|jfr|els|ell|egs|Efr|efr|Jfr|uml|kcy|Kcy|Ecy|ecy|kfr|Kfr|lap|Sub|sub|lat|lcy|Lcy|leg|Dot|dot|lEg|leq|les|squ|div|die|lfr|Lfr|lgE|Dfr|dfr|Del|deg|Dcy|dcy|lne|lnE|sol|loz|smt|Cup|lrm|cup|lsh|Lsh|sim|shy|map|Map|mcy|Mcy|mfr|Mfr|mho|gfr|Gfr|sfr|cir|Chi|chi|nap|Cfr|vcy|Vcy|cfr|Scy|scy|ncy|Ncy|vee|Vee|Cap|cap|nfr|scE|sce|Nfr|nge|ngE|nGg|vfr|Vfr|ngt|bot|nGt|nis|niv|Rsh|rsh|nle|nlE|bne|Bfr|bfr|nLl|nlt|nLt|Bcy|bcy|not|Not|rlm|wfr|Wfr|npr|nsc|num|ocy|ast|Ocy|ofr|xfr|Xfr|Ofr|ogt|ohm|apE|olt|Rho|ape|rho|Rfr|rfr|ord|REG|ang|reg|orv|And|and|AMP|Rcy|amp|Afr|ycy|Ycy|yen|yfr|Yfr|rcy|par|pcy|Pcy|pfr|Pfr|phi|Phi|afr|Acy|acy|zcy|Zcy|piv|acE|acd|zfr|Zfr|pre|prE|psi|Psi|qfr|Qfr|zwj|Or|ge|Gg|gt|gg|el|oS|lt|Lt|LT|Re|lg|gl|eg|ne|Im|it|le|DD|wp|wr|nu|Nu|dd|lE|Sc|sc|pi|Pi|ee|af|ll|Ll|rx|gE|xi|pm|Xi|ic|pr|Pr|in|ni|mp|mu|ac|Mu|or|ap|Gt|GT|ii);|&(Aacute|Agrave|Atilde|Ccedil|Eacute|Egrave|Iacute|Igrave|Ntilde|Oacute|Ograve|Oslash|Otilde|Uacute|Ugrave|Yacute|aacute|agrave|atilde|brvbar|ccedil|curren|divide|eacute|egrave|frac12|frac14|frac34|iacute|igrave|iquest|middot|ntilde|oacute|ograve|oslash|otilde|plusmn|uacute|ugrave|yacute|AElig|Acirc|Aring|Ecirc|Icirc|Ocirc|THORN|Ucirc|acirc|acute|aelig|aring|cedil|ecirc|icirc|iexcl|laquo|micro|ocirc|pound|raquo|szlig|thorn|times|ucirc|Auml|COPY|Euml|Iuml|Ouml|QUOT|Uuml|auml|cent|copy|euml|iuml|macr|nbsp|ordf|ordm|ouml|para|quot|sect|sup1|sup2|sup3|uuml|yuml|AMP|ETH|REG|amp|deg|eth|not|reg|shy|uml|yen|GT|LT|gt|lt)(?!;)([=a-zA-Z0-9]?)|&#([0-9]+)(;?)|&#[xX]([a-fA-F0-9]+)(;?)|&([0-9a-zA-Z]+)/g;var decodeMap = {'aacute':'\xE1','Aacute':'\xC1','abreve':'\u0103','Abreve':'\u0102','ac':'\u223E','acd':'\u223F','acE':'\u223E\u0333','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','acy':'\u0430','Acy':'\u0410','aelig':'\xE6','AElig':'\xC6','af':'\u2061','afr':'\uD835\uDD1E','Afr':'\uD835\uDD04','agrave':'\xE0','Agrave':'\xC0','alefsym':'\u2135','aleph':'\u2135','alpha':'\u03B1','Alpha':'\u0391','amacr':'\u0101','Amacr':'\u0100','amalg':'\u2A3F','amp':'&','AMP':'&','and':'\u2227','And':'\u2A53','andand':'\u2A55','andd':'\u2A5C','andslope':'\u2A58','andv':'\u2A5A','ang':'\u2220','ange':'\u29A4','angle':'\u2220','angmsd':'\u2221','angmsdaa':'\u29A8','angmsdab':'\u29A9','angmsdac':'\u29AA','angmsdad':'\u29AB','angmsdae':'\u29AC','angmsdaf':'\u29AD','angmsdag':'\u29AE','angmsdah':'\u29AF','angrt':'\u221F','angrtvb':'\u22BE','angrtvbd':'\u299D','angsph':'\u2222','angst':'\xC5','angzarr':'\u237C','aogon':'\u0105','Aogon':'\u0104','aopf':'\uD835\uDD52','Aopf':'\uD835\uDD38','ap':'\u2248','apacir':'\u2A6F','ape':'\u224A','apE':'\u2A70','apid':'\u224B','apos':'\'','ApplyFunction':'\u2061','approx':'\u2248','approxeq':'\u224A','aring':'\xE5','Aring':'\xC5','ascr':'\uD835\uDCB6','Ascr':'\uD835\uDC9C','Assign':'\u2254','ast':'*','asymp':'\u2248','asympeq':'\u224D','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','awconint':'\u2233','awint':'\u2A11','backcong':'\u224C','backepsilon':'\u03F6','backprime':'\u2035','backsim':'\u223D','backsimeq':'\u22CD','Backslash':'\u2216','Barv':'\u2AE7','barvee':'\u22BD','barwed':'\u2305','Barwed':'\u2306','barwedge':'\u2305','bbrk':'\u23B5','bbrktbrk':'\u23B6','bcong':'\u224C','bcy':'\u0431','Bcy':'\u0411','bdquo':'\u201E','becaus':'\u2235','because':'\u2235','Because':'\u2235','bemptyv':'\u29B0','bepsi':'\u03F6','bernou':'\u212C','Bernoullis':'\u212C','beta':'\u03B2','Beta':'\u0392','beth':'\u2136','between':'\u226C','bfr':'\uD835\uDD1F','Bfr':'\uD835\uDD05','bigcap':'\u22C2','bigcirc':'\u25EF','bigcup':'\u22C3','bigodot':'\u2A00','bigoplus':'\u2A01','bigotimes':'\u2A02','bigsqcup':'\u2A06','bigstar':'\u2605','bigtriangledown':'\u25BD','bigtriangleup':'\u25B3','biguplus':'\u2A04','bigvee':'\u22C1','bigwedge':'\u22C0','bkarow':'\u290D','blacklozenge':'\u29EB','blacksquare':'\u25AA','blacktriangle':'\u25B4','blacktriangledown':'\u25BE','blacktriangleleft':'\u25C2','blacktriangleright':'\u25B8','blank':'\u2423','blk12':'\u2592','blk14':'\u2591','blk34':'\u2593','block':'\u2588','bne':'=\u20E5','bnequiv':'\u2261\u20E5','bnot':'\u2310','bNot':'\u2AED','bopf':'\uD835\uDD53','Bopf':'\uD835\uDD39','bot':'\u22A5','bottom':'\u22A5','bowtie':'\u22C8','boxbox':'\u29C9','boxdl':'\u2510','boxdL':'\u2555','boxDl':'\u2556','boxDL':'\u2557','boxdr':'\u250C','boxdR':'\u2552','boxDr':'\u2553','boxDR':'\u2554','boxh':'\u2500','boxH':'\u2550','boxhd':'\u252C','boxhD':'\u2565','boxHd':'\u2564','boxHD':'\u2566','boxhu':'\u2534','boxhU':'\u2568','boxHu':'\u2567','boxHU':'\u2569','boxminus':'\u229F','boxplus':'\u229E','boxtimes':'\u22A0','boxul':'\u2518','boxuL':'\u255B','boxUl':'\u255C','boxUL':'\u255D','boxur':'\u2514','boxuR':'\u2558','boxUr':'\u2559','boxUR':'\u255A','boxv':'\u2502','boxV':'\u2551','boxvh':'\u253C','boxvH':'\u256A','boxVh':'\u256B','boxVH':'\u256C','boxvl':'\u2524','boxvL':'\u2561','boxVl':'\u2562','boxVL':'\u2563','boxvr':'\u251C','boxvR':'\u255E','boxVr':'\u255F','boxVR':'\u2560','bprime':'\u2035','breve':'\u02D8','Breve':'\u02D8','brvbar':'\xA6','bscr':'\uD835\uDCB7','Bscr':'\u212C','bsemi':'\u204F','bsim':'\u223D','bsime':'\u22CD','bsol':'\\','bsolb':'\u29C5','bsolhsub':'\u27C8','bull':'\u2022','bullet':'\u2022','bump':'\u224E','bumpe':'\u224F','bumpE':'\u2AAE','bumpeq':'\u224F','Bumpeq':'\u224E','cacute':'\u0107','Cacute':'\u0106','cap':'\u2229','Cap':'\u22D2','capand':'\u2A44','capbrcup':'\u2A49','capcap':'\u2A4B','capcup':'\u2A47','capdot':'\u2A40','CapitalDifferentialD':'\u2145','caps':'\u2229\uFE00','caret':'\u2041','caron':'\u02C7','Cayleys':'\u212D','ccaps':'\u2A4D','ccaron':'\u010D','Ccaron':'\u010C','ccedil':'\xE7','Ccedil':'\xC7','ccirc':'\u0109','Ccirc':'\u0108','Cconint':'\u2230','ccups':'\u2A4C','ccupssm':'\u2A50','cdot':'\u010B','Cdot':'\u010A','cedil':'\xB8','Cedilla':'\xB8','cemptyv':'\u29B2','cent':'\xA2','centerdot':'\xB7','CenterDot':'\xB7','cfr':'\uD835\uDD20','Cfr':'\u212D','chcy':'\u0447','CHcy':'\u0427','check':'\u2713','checkmark':'\u2713','chi':'\u03C7','Chi':'\u03A7','cir':'\u25CB','circ':'\u02C6','circeq':'\u2257','circlearrowleft':'\u21BA','circlearrowright':'\u21BB','circledast':'\u229B','circledcirc':'\u229A','circleddash':'\u229D','CircleDot':'\u2299','circledR':'\xAE','circledS':'\u24C8','CircleMinus':'\u2296','CirclePlus':'\u2295','CircleTimes':'\u2297','cire':'\u2257','cirE':'\u29C3','cirfnint':'\u2A10','cirmid':'\u2AEF','cirscir':'\u29C2','ClockwiseContourIntegral':'\u2232','CloseCurlyDoubleQuote':'\u201D','CloseCurlyQuote':'\u2019','clubs':'\u2663','clubsuit':'\u2663','colon':':','Colon':'\u2237','colone':'\u2254','Colone':'\u2A74','coloneq':'\u2254','comma':',','commat':'@','comp':'\u2201','compfn':'\u2218','complement':'\u2201','complexes':'\u2102','cong':'\u2245','congdot':'\u2A6D','Congruent':'\u2261','conint':'\u222E','Conint':'\u222F','ContourIntegral':'\u222E','copf':'\uD835\uDD54','Copf':'\u2102','coprod':'\u2210','Coproduct':'\u2210','copy':'\xA9','COPY':'\xA9','copysr':'\u2117','CounterClockwiseContourIntegral':'\u2233','crarr':'\u21B5','cross':'\u2717','Cross':'\u2A2F','cscr':'\uD835\uDCB8','Cscr':'\uD835\uDC9E','csub':'\u2ACF','csube':'\u2AD1','csup':'\u2AD0','csupe':'\u2AD2','ctdot':'\u22EF','cudarrl':'\u2938','cudarrr':'\u2935','cuepr':'\u22DE','cuesc':'\u22DF','cularr':'\u21B6','cularrp':'\u293D','cup':'\u222A','Cup':'\u22D3','cupbrcap':'\u2A48','cupcap':'\u2A46','CupCap':'\u224D','cupcup':'\u2A4A','cupdot':'\u228D','cupor':'\u2A45','cups':'\u222A\uFE00','curarr':'\u21B7','curarrm':'\u293C','curlyeqprec':'\u22DE','curlyeqsucc':'\u22DF','curlyvee':'\u22CE','curlywedge':'\u22CF','curren':'\xA4','curvearrowleft':'\u21B6','curvearrowright':'\u21B7','cuvee':'\u22CE','cuwed':'\u22CF','cwconint':'\u2232','cwint':'\u2231','cylcty':'\u232D','dagger':'\u2020','Dagger':'\u2021','daleth':'\u2138','darr':'\u2193','dArr':'\u21D3','Darr':'\u21A1','dash':'\u2010','dashv':'\u22A3','Dashv':'\u2AE4','dbkarow':'\u290F','dblac':'\u02DD','dcaron':'\u010F','Dcaron':'\u010E','dcy':'\u0434','Dcy':'\u0414','dd':'\u2146','DD':'\u2145','ddagger':'\u2021','ddarr':'\u21CA','DDotrahd':'\u2911','ddotseq':'\u2A77','deg':'\xB0','Del':'\u2207','delta':'\u03B4','Delta':'\u0394','demptyv':'\u29B1','dfisht':'\u297F','dfr':'\uD835\uDD21','Dfr':'\uD835\uDD07','dHar':'\u2965','dharl':'\u21C3','dharr':'\u21C2','DiacriticalAcute':'\xB4','DiacriticalDot':'\u02D9','DiacriticalDoubleAcute':'\u02DD','DiacriticalGrave':'`','DiacriticalTilde':'\u02DC','diam':'\u22C4','diamond':'\u22C4','Diamond':'\u22C4','diamondsuit':'\u2666','diams':'\u2666','die':'\xA8','DifferentialD':'\u2146','digamma':'\u03DD','disin':'\u22F2','div':'\xF7','divide':'\xF7','divideontimes':'\u22C7','divonx':'\u22C7','djcy':'\u0452','DJcy':'\u0402','dlcorn':'\u231E','dlcrop':'\u230D','dollar':'$','dopf':'\uD835\uDD55','Dopf':'\uD835\uDD3B','dot':'\u02D9','Dot':'\xA8','DotDot':'\u20DC','doteq':'\u2250','doteqdot':'\u2251','DotEqual':'\u2250','dotminus':'\u2238','dotplus':'\u2214','dotsquare':'\u22A1','doublebarwedge':'\u2306','DoubleContourIntegral':'\u222F','DoubleDot':'\xA8','DoubleDownArrow':'\u21D3','DoubleLeftArrow':'\u21D0','DoubleLeftRightArrow':'\u21D4','DoubleLeftTee':'\u2AE4','DoubleLongLeftArrow':'\u27F8','DoubleLongLeftRightArrow':'\u27FA','DoubleLongRightArrow':'\u27F9','DoubleRightArrow':'\u21D2','DoubleRightTee':'\u22A8','DoubleUpArrow':'\u21D1','DoubleUpDownArrow':'\u21D5','DoubleVerticalBar':'\u2225','downarrow':'\u2193','Downarrow':'\u21D3','DownArrow':'\u2193','DownArrowBar':'\u2913','DownArrowUpArrow':'\u21F5','DownBreve':'\u0311','downdownarrows':'\u21CA','downharpoonleft':'\u21C3','downharpoonright':'\u21C2','DownLeftRightVector':'\u2950','DownLeftTeeVector':'\u295E','DownLeftVector':'\u21BD','DownLeftVectorBar':'\u2956','DownRightTeeVector':'\u295F','DownRightVector':'\u21C1','DownRightVectorBar':'\u2957','DownTee':'\u22A4','DownTeeArrow':'\u21A7','drbkarow':'\u2910','drcorn':'\u231F','drcrop':'\u230C','dscr':'\uD835\uDCB9','Dscr':'\uD835\uDC9F','dscy':'\u0455','DScy':'\u0405','dsol':'\u29F6','dstrok':'\u0111','Dstrok':'\u0110','dtdot':'\u22F1','dtri':'\u25BF','dtrif':'\u25BE','duarr':'\u21F5','duhar':'\u296F','dwangle':'\u29A6','dzcy':'\u045F','DZcy':'\u040F','dzigrarr':'\u27FF','eacute':'\xE9','Eacute':'\xC9','easter':'\u2A6E','ecaron':'\u011B','Ecaron':'\u011A','ecir':'\u2256','ecirc':'\xEA','Ecirc':'\xCA','ecolon':'\u2255','ecy':'\u044D','Ecy':'\u042D','eDDot':'\u2A77','edot':'\u0117','eDot':'\u2251','Edot':'\u0116','ee':'\u2147','efDot':'\u2252','efr':'\uD835\uDD22','Efr':'\uD835\uDD08','eg':'\u2A9A','egrave':'\xE8','Egrave':'\xC8','egs':'\u2A96','egsdot':'\u2A98','el':'\u2A99','Element':'\u2208','elinters':'\u23E7','ell':'\u2113','els':'\u2A95','elsdot':'\u2A97','emacr':'\u0113','Emacr':'\u0112','empty':'\u2205','emptyset':'\u2205','EmptySmallSquare':'\u25FB','emptyv':'\u2205','EmptyVerySmallSquare':'\u25AB','emsp':'\u2003','emsp13':'\u2004','emsp14':'\u2005','eng':'\u014B','ENG':'\u014A','ensp':'\u2002','eogon':'\u0119','Eogon':'\u0118','eopf':'\uD835\uDD56','Eopf':'\uD835\uDD3C','epar':'\u22D5','eparsl':'\u29E3','eplus':'\u2A71','epsi':'\u03B5','epsilon':'\u03B5','Epsilon':'\u0395','epsiv':'\u03F5','eqcirc':'\u2256','eqcolon':'\u2255','eqsim':'\u2242','eqslantgtr':'\u2A96','eqslantless':'\u2A95','Equal':'\u2A75','equals':'=','EqualTilde':'\u2242','equest':'\u225F','Equilibrium':'\u21CC','equiv':'\u2261','equivDD':'\u2A78','eqvparsl':'\u29E5','erarr':'\u2971','erDot':'\u2253','escr':'\u212F','Escr':'\u2130','esdot':'\u2250','esim':'\u2242','Esim':'\u2A73','eta':'\u03B7','Eta':'\u0397','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','euro':'\u20AC','excl':'!','exist':'\u2203','Exists':'\u2203','expectation':'\u2130','exponentiale':'\u2147','ExponentialE':'\u2147','fallingdotseq':'\u2252','fcy':'\u0444','Fcy':'\u0424','female':'\u2640','ffilig':'\uFB03','fflig':'\uFB00','ffllig':'\uFB04','ffr':'\uD835\uDD23','Ffr':'\uD835\uDD09','filig':'\uFB01','FilledSmallSquare':'\u25FC','FilledVerySmallSquare':'\u25AA','fjlig':'fj','flat':'\u266D','fllig':'\uFB02','fltns':'\u25B1','fnof':'\u0192','fopf':'\uD835\uDD57','Fopf':'\uD835\uDD3D','forall':'\u2200','ForAll':'\u2200','fork':'\u22D4','forkv':'\u2AD9','Fouriertrf':'\u2131','fpartint':'\u2A0D','frac12':'\xBD','frac13':'\u2153','frac14':'\xBC','frac15':'\u2155','frac16':'\u2159','frac18':'\u215B','frac23':'\u2154','frac25':'\u2156','frac34':'\xBE','frac35':'\u2157','frac38':'\u215C','frac45':'\u2158','frac56':'\u215A','frac58':'\u215D','frac78':'\u215E','frasl':'\u2044','frown':'\u2322','fscr':'\uD835\uDCBB','Fscr':'\u2131','gacute':'\u01F5','gamma':'\u03B3','Gamma':'\u0393','gammad':'\u03DD','Gammad':'\u03DC','gap':'\u2A86','gbreve':'\u011F','Gbreve':'\u011E','Gcedil':'\u0122','gcirc':'\u011D','Gcirc':'\u011C','gcy':'\u0433','Gcy':'\u0413','gdot':'\u0121','Gdot':'\u0120','ge':'\u2265','gE':'\u2267','gel':'\u22DB','gEl':'\u2A8C','geq':'\u2265','geqq':'\u2267','geqslant':'\u2A7E','ges':'\u2A7E','gescc':'\u2AA9','gesdot':'\u2A80','gesdoto':'\u2A82','gesdotol':'\u2A84','gesl':'\u22DB\uFE00','gesles':'\u2A94','gfr':'\uD835\uDD24','Gfr':'\uD835\uDD0A','gg':'\u226B','Gg':'\u22D9','ggg':'\u22D9','gimel':'\u2137','gjcy':'\u0453','GJcy':'\u0403','gl':'\u2277','gla':'\u2AA5','glE':'\u2A92','glj':'\u2AA4','gnap':'\u2A8A','gnapprox':'\u2A8A','gne':'\u2A88','gnE':'\u2269','gneq':'\u2A88','gneqq':'\u2269','gnsim':'\u22E7','gopf':'\uD835\uDD58','Gopf':'\uD835\uDD3E','grave':'`','GreaterEqual':'\u2265','GreaterEqualLess':'\u22DB','GreaterFullEqual':'\u2267','GreaterGreater':'\u2AA2','GreaterLess':'\u2277','GreaterSlantEqual':'\u2A7E','GreaterTilde':'\u2273','gscr':'\u210A','Gscr':'\uD835\uDCA2','gsim':'\u2273','gsime':'\u2A8E','gsiml':'\u2A90','gt':'>','Gt':'\u226B','GT':'>','gtcc':'\u2AA7','gtcir':'\u2A7A','gtdot':'\u22D7','gtlPar':'\u2995','gtquest':'\u2A7C','gtrapprox':'\u2A86','gtrarr':'\u2978','gtrdot':'\u22D7','gtreqless':'\u22DB','gtreqqless':'\u2A8C','gtrless':'\u2277','gtrsim':'\u2273','gvertneqq':'\u2269\uFE00','gvnE':'\u2269\uFE00','Hacek':'\u02C7','hairsp':'\u200A','half':'\xBD','hamilt':'\u210B','hardcy':'\u044A','HARDcy':'\u042A','harr':'\u2194','hArr':'\u21D4','harrcir':'\u2948','harrw':'\u21AD','Hat':'^','hbar':'\u210F','hcirc':'\u0125','Hcirc':'\u0124','hearts':'\u2665','heartsuit':'\u2665','hellip':'\u2026','hercon':'\u22B9','hfr':'\uD835\uDD25','Hfr':'\u210C','HilbertSpace':'\u210B','hksearow':'\u2925','hkswarow':'\u2926','hoarr':'\u21FF','homtht':'\u223B','hookleftarrow':'\u21A9','hookrightarrow':'\u21AA','hopf':'\uD835\uDD59','Hopf':'\u210D','horbar':'\u2015','HorizontalLine':'\u2500','hscr':'\uD835\uDCBD','Hscr':'\u210B','hslash':'\u210F','hstrok':'\u0127','Hstrok':'\u0126','HumpDownHump':'\u224E','HumpEqual':'\u224F','hybull':'\u2043','hyphen':'\u2010','iacute':'\xED','Iacute':'\xCD','ic':'\u2063','icirc':'\xEE','Icirc':'\xCE','icy':'\u0438','Icy':'\u0418','Idot':'\u0130','iecy':'\u0435','IEcy':'\u0415','iexcl':'\xA1','iff':'\u21D4','ifr':'\uD835\uDD26','Ifr':'\u2111','igrave':'\xEC','Igrave':'\xCC','ii':'\u2148','iiiint':'\u2A0C','iiint':'\u222D','iinfin':'\u29DC','iiota':'\u2129','ijlig':'\u0133','IJlig':'\u0132','Im':'\u2111','imacr':'\u012B','Imacr':'\u012A','image':'\u2111','ImaginaryI':'\u2148','imagline':'\u2110','imagpart':'\u2111','imath':'\u0131','imof':'\u22B7','imped':'\u01B5','Implies':'\u21D2','in':'\u2208','incare':'\u2105','infin':'\u221E','infintie':'\u29DD','inodot':'\u0131','int':'\u222B','Int':'\u222C','intcal':'\u22BA','integers':'\u2124','Integral':'\u222B','intercal':'\u22BA','Intersection':'\u22C2','intlarhk':'\u2A17','intprod':'\u2A3C','InvisibleComma':'\u2063','InvisibleTimes':'\u2062','iocy':'\u0451','IOcy':'\u0401','iogon':'\u012F','Iogon':'\u012E','iopf':'\uD835\uDD5A','Iopf':'\uD835\uDD40','iota':'\u03B9','Iota':'\u0399','iprod':'\u2A3C','iquest':'\xBF','iscr':'\uD835\uDCBE','Iscr':'\u2110','isin':'\u2208','isindot':'\u22F5','isinE':'\u22F9','isins':'\u22F4','isinsv':'\u22F3','isinv':'\u2208','it':'\u2062','itilde':'\u0129','Itilde':'\u0128','iukcy':'\u0456','Iukcy':'\u0406','iuml':'\xEF','Iuml':'\xCF','jcirc':'\u0135','Jcirc':'\u0134','jcy':'\u0439','Jcy':'\u0419','jfr':'\uD835\uDD27','Jfr':'\uD835\uDD0D','jmath':'\u0237','jopf':'\uD835\uDD5B','Jopf':'\uD835\uDD41','jscr':'\uD835\uDCBF','Jscr':'\uD835\uDCA5','jsercy':'\u0458','Jsercy':'\u0408','jukcy':'\u0454','Jukcy':'\u0404','kappa':'\u03BA','Kappa':'\u039A','kappav':'\u03F0','kcedil':'\u0137','Kcedil':'\u0136','kcy':'\u043A','Kcy':'\u041A','kfr':'\uD835\uDD28','Kfr':'\uD835\uDD0E','kgreen':'\u0138','khcy':'\u0445','KHcy':'\u0425','kjcy':'\u045C','KJcy':'\u040C','kopf':'\uD835\uDD5C','Kopf':'\uD835\uDD42','kscr':'\uD835\uDCC0','Kscr':'\uD835\uDCA6','lAarr':'\u21DA','lacute':'\u013A','Lacute':'\u0139','laemptyv':'\u29B4','lagran':'\u2112','lambda':'\u03BB','Lambda':'\u039B','lang':'\u27E8','Lang':'\u27EA','langd':'\u2991','langle':'\u27E8','lap':'\u2A85','Laplacetrf':'\u2112','laquo':'\xAB','larr':'\u2190','lArr':'\u21D0','Larr':'\u219E','larrb':'\u21E4','larrbfs':'\u291F','larrfs':'\u291D','larrhk':'\u21A9','larrlp':'\u21AB','larrpl':'\u2939','larrsim':'\u2973','larrtl':'\u21A2','lat':'\u2AAB','latail':'\u2919','lAtail':'\u291B','late':'\u2AAD','lates':'\u2AAD\uFE00','lbarr':'\u290C','lBarr':'\u290E','lbbrk':'\u2772','lbrace':'{','lbrack':'[','lbrke':'\u298B','lbrksld':'\u298F','lbrkslu':'\u298D','lcaron':'\u013E','Lcaron':'\u013D','lcedil':'\u013C','Lcedil':'\u013B','lceil':'\u2308','lcub':'{','lcy':'\u043B','Lcy':'\u041B','ldca':'\u2936','ldquo':'\u201C','ldquor':'\u201E','ldrdhar':'\u2967','ldrushar':'\u294B','ldsh':'\u21B2','le':'\u2264','lE':'\u2266','LeftAngleBracket':'\u27E8','leftarrow':'\u2190','Leftarrow':'\u21D0','LeftArrow':'\u2190','LeftArrowBar':'\u21E4','LeftArrowRightArrow':'\u21C6','leftarrowtail':'\u21A2','LeftCeiling':'\u2308','LeftDoubleBracket':'\u27E6','LeftDownTeeVector':'\u2961','LeftDownVector':'\u21C3','LeftDownVectorBar':'\u2959','LeftFloor':'\u230A','leftharpoondown':'\u21BD','leftharpoonup':'\u21BC','leftleftarrows':'\u21C7','leftrightarrow':'\u2194','Leftrightarrow':'\u21D4','LeftRightArrow':'\u2194','leftrightarrows':'\u21C6','leftrightharpoons':'\u21CB','leftrightsquigarrow':'\u21AD','LeftRightVector':'\u294E','LeftTee':'\u22A3','LeftTeeArrow':'\u21A4','LeftTeeVector':'\u295A','leftthreetimes':'\u22CB','LeftTriangle':'\u22B2','LeftTriangleBar':'\u29CF','LeftTriangleEqual':'\u22B4','LeftUpDownVector':'\u2951','LeftUpTeeVector':'\u2960','LeftUpVector':'\u21BF','LeftUpVectorBar':'\u2958','LeftVector':'\u21BC','LeftVectorBar':'\u2952','leg':'\u22DA','lEg':'\u2A8B','leq':'\u2264','leqq':'\u2266','leqslant':'\u2A7D','les':'\u2A7D','lescc':'\u2AA8','lesdot':'\u2A7F','lesdoto':'\u2A81','lesdotor':'\u2A83','lesg':'\u22DA\uFE00','lesges':'\u2A93','lessapprox':'\u2A85','lessdot':'\u22D6','lesseqgtr':'\u22DA','lesseqqgtr':'\u2A8B','LessEqualGreater':'\u22DA','LessFullEqual':'\u2266','LessGreater':'\u2276','lessgtr':'\u2276','LessLess':'\u2AA1','lesssim':'\u2272','LessSlantEqual':'\u2A7D','LessTilde':'\u2272','lfisht':'\u297C','lfloor':'\u230A','lfr':'\uD835\uDD29','Lfr':'\uD835\uDD0F','lg':'\u2276','lgE':'\u2A91','lHar':'\u2962','lhard':'\u21BD','lharu':'\u21BC','lharul':'\u296A','lhblk':'\u2584','ljcy':'\u0459','LJcy':'\u0409','ll':'\u226A','Ll':'\u22D8','llarr':'\u21C7','llcorner':'\u231E','Lleftarrow':'\u21DA','llhard':'\u296B','lltri':'\u25FA','lmidot':'\u0140','Lmidot':'\u013F','lmoust':'\u23B0','lmoustache':'\u23B0','lnap':'\u2A89','lnapprox':'\u2A89','lne':'\u2A87','lnE':'\u2268','lneq':'\u2A87','lneqq':'\u2268','lnsim':'\u22E6','loang':'\u27EC','loarr':'\u21FD','lobrk':'\u27E6','longleftarrow':'\u27F5','Longleftarrow':'\u27F8','LongLeftArrow':'\u27F5','longleftrightarrow':'\u27F7','Longleftrightarrow':'\u27FA','LongLeftRightArrow':'\u27F7','longmapsto':'\u27FC','longrightarrow':'\u27F6','Longrightarrow':'\u27F9','LongRightArrow':'\u27F6','looparrowleft':'\u21AB','looparrowright':'\u21AC','lopar':'\u2985','lopf':'\uD835\uDD5D','Lopf':'\uD835\uDD43','loplus':'\u2A2D','lotimes':'\u2A34','lowast':'\u2217','lowbar':'_','LowerLeftArrow':'\u2199','LowerRightArrow':'\u2198','loz':'\u25CA','lozenge':'\u25CA','lozf':'\u29EB','lpar':'(','lparlt':'\u2993','lrarr':'\u21C6','lrcorner':'\u231F','lrhar':'\u21CB','lrhard':'\u296D','lrm':'\u200E','lrtri':'\u22BF','lsaquo':'\u2039','lscr':'\uD835\uDCC1','Lscr':'\u2112','lsh':'\u21B0','Lsh':'\u21B0','lsim':'\u2272','lsime':'\u2A8D','lsimg':'\u2A8F','lsqb':'[','lsquo':'\u2018','lsquor':'\u201A','lstrok':'\u0142','Lstrok':'\u0141','lt':'<','Lt':'\u226A','LT':'<','ltcc':'\u2AA6','ltcir':'\u2A79','ltdot':'\u22D6','lthree':'\u22CB','ltimes':'\u22C9','ltlarr':'\u2976','ltquest':'\u2A7B','ltri':'\u25C3','ltrie':'\u22B4','ltrif':'\u25C2','ltrPar':'\u2996','lurdshar':'\u294A','luruhar':'\u2966','lvertneqq':'\u2268\uFE00','lvnE':'\u2268\uFE00','macr':'\xAF','male':'\u2642','malt':'\u2720','maltese':'\u2720','map':'\u21A6','Map':'\u2905','mapsto':'\u21A6','mapstodown':'\u21A7','mapstoleft':'\u21A4','mapstoup':'\u21A5','marker':'\u25AE','mcomma':'\u2A29','mcy':'\u043C','Mcy':'\u041C','mdash':'\u2014','mDDot':'\u223A','measuredangle':'\u2221','MediumSpace':'\u205F','Mellintrf':'\u2133','mfr':'\uD835\uDD2A','Mfr':'\uD835\uDD10','mho':'\u2127','micro':'\xB5','mid':'\u2223','midast':'*','midcir':'\u2AF0','middot':'\xB7','minus':'\u2212','minusb':'\u229F','minusd':'\u2238','minusdu':'\u2A2A','MinusPlus':'\u2213','mlcp':'\u2ADB','mldr':'\u2026','mnplus':'\u2213','models':'\u22A7','mopf':'\uD835\uDD5E','Mopf':'\uD835\uDD44','mp':'\u2213','mscr':'\uD835\uDCC2','Mscr':'\u2133','mstpos':'\u223E','mu':'\u03BC','Mu':'\u039C','multimap':'\u22B8','mumap':'\u22B8','nabla':'\u2207','nacute':'\u0144','Nacute':'\u0143','nang':'\u2220\u20D2','nap':'\u2249','napE':'\u2A70\u0338','napid':'\u224B\u0338','napos':'\u0149','napprox':'\u2249','natur':'\u266E','natural':'\u266E','naturals':'\u2115','nbsp':'\xA0','nbump':'\u224E\u0338','nbumpe':'\u224F\u0338','ncap':'\u2A43','ncaron':'\u0148','Ncaron':'\u0147','ncedil':'\u0146','Ncedil':'\u0145','ncong':'\u2247','ncongdot':'\u2A6D\u0338','ncup':'\u2A42','ncy':'\u043D','Ncy':'\u041D','ndash':'\u2013','ne':'\u2260','nearhk':'\u2924','nearr':'\u2197','neArr':'\u21D7','nearrow':'\u2197','nedot':'\u2250\u0338','NegativeMediumSpace':'\u200B','NegativeThickSpace':'\u200B','NegativeThinSpace':'\u200B','NegativeVeryThinSpace':'\u200B','nequiv':'\u2262','nesear':'\u2928','nesim':'\u2242\u0338','NestedGreaterGreater':'\u226B','NestedLessLess':'\u226A','NewLine':'\n','nexist':'\u2204','nexists':'\u2204','nfr':'\uD835\uDD2B','Nfr':'\uD835\uDD11','nge':'\u2271','ngE':'\u2267\u0338','ngeq':'\u2271','ngeqq':'\u2267\u0338','ngeqslant':'\u2A7E\u0338','nges':'\u2A7E\u0338','nGg':'\u22D9\u0338','ngsim':'\u2275','ngt':'\u226F','nGt':'\u226B\u20D2','ngtr':'\u226F','nGtv':'\u226B\u0338','nharr':'\u21AE','nhArr':'\u21CE','nhpar':'\u2AF2','ni':'\u220B','nis':'\u22FC','nisd':'\u22FA','niv':'\u220B','njcy':'\u045A','NJcy':'\u040A','nlarr':'\u219A','nlArr':'\u21CD','nldr':'\u2025','nle':'\u2270','nlE':'\u2266\u0338','nleftarrow':'\u219A','nLeftarrow':'\u21CD','nleftrightarrow':'\u21AE','nLeftrightarrow':'\u21CE','nleq':'\u2270','nleqq':'\u2266\u0338','nleqslant':'\u2A7D\u0338','nles':'\u2A7D\u0338','nless':'\u226E','nLl':'\u22D8\u0338','nlsim':'\u2274','nlt':'\u226E','nLt':'\u226A\u20D2','nltri':'\u22EA','nltrie':'\u22EC','nLtv':'\u226A\u0338','nmid':'\u2224','NoBreak':'\u2060','NonBreakingSpace':'\xA0','nopf':'\uD835\uDD5F','Nopf':'\u2115','not':'\xAC','Not':'\u2AEC','NotCongruent':'\u2262','NotCupCap':'\u226D','NotDoubleVerticalBar':'\u2226','NotElement':'\u2209','NotEqual':'\u2260','NotEqualTilde':'\u2242\u0338','NotExists':'\u2204','NotGreater':'\u226F','NotGreaterEqual':'\u2271','NotGreaterFullEqual':'\u2267\u0338','NotGreaterGreater':'\u226B\u0338','NotGreaterLess':'\u2279','NotGreaterSlantEqual':'\u2A7E\u0338','NotGreaterTilde':'\u2275','NotHumpDownHump':'\u224E\u0338','NotHumpEqual':'\u224F\u0338','notin':'\u2209','notindot':'\u22F5\u0338','notinE':'\u22F9\u0338','notinva':'\u2209','notinvb':'\u22F7','notinvc':'\u22F6','NotLeftTriangle':'\u22EA','NotLeftTriangleBar':'\u29CF\u0338','NotLeftTriangleEqual':'\u22EC','NotLess':'\u226E','NotLessEqual':'\u2270','NotLessGreater':'\u2278','NotLessLess':'\u226A\u0338','NotLessSlantEqual':'\u2A7D\u0338','NotLessTilde':'\u2274','NotNestedGreaterGreater':'\u2AA2\u0338','NotNestedLessLess':'\u2AA1\u0338','notni':'\u220C','notniva':'\u220C','notnivb':'\u22FE','notnivc':'\u22FD','NotPrecedes':'\u2280','NotPrecedesEqual':'\u2AAF\u0338','NotPrecedesSlantEqual':'\u22E0','NotReverseElement':'\u220C','NotRightTriangle':'\u22EB','NotRightTriangleBar':'\u29D0\u0338','NotRightTriangleEqual':'\u22ED','NotSquareSubset':'\u228F\u0338','NotSquareSubsetEqual':'\u22E2','NotSquareSuperset':'\u2290\u0338','NotSquareSupersetEqual':'\u22E3','NotSubset':'\u2282\u20D2','NotSubsetEqual':'\u2288','NotSucceeds':'\u2281','NotSucceedsEqual':'\u2AB0\u0338','NotSucceedsSlantEqual':'\u22E1','NotSucceedsTilde':'\u227F\u0338','NotSuperset':'\u2283\u20D2','NotSupersetEqual':'\u2289','NotTilde':'\u2241','NotTildeEqual':'\u2244','NotTildeFullEqual':'\u2247','NotTildeTilde':'\u2249','NotVerticalBar':'\u2224','npar':'\u2226','nparallel':'\u2226','nparsl':'\u2AFD\u20E5','npart':'\u2202\u0338','npolint':'\u2A14','npr':'\u2280','nprcue':'\u22E0','npre':'\u2AAF\u0338','nprec':'\u2280','npreceq':'\u2AAF\u0338','nrarr':'\u219B','nrArr':'\u21CF','nrarrc':'\u2933\u0338','nrarrw':'\u219D\u0338','nrightarrow':'\u219B','nRightarrow':'\u21CF','nrtri':'\u22EB','nrtrie':'\u22ED','nsc':'\u2281','nsccue':'\u22E1','nsce':'\u2AB0\u0338','nscr':'\uD835\uDCC3','Nscr':'\uD835\uDCA9','nshortmid':'\u2224','nshortparallel':'\u2226','nsim':'\u2241','nsime':'\u2244','nsimeq':'\u2244','nsmid':'\u2224','nspar':'\u2226','nsqsube':'\u22E2','nsqsupe':'\u22E3','nsub':'\u2284','nsube':'\u2288','nsubE':'\u2AC5\u0338','nsubset':'\u2282\u20D2','nsubseteq':'\u2288','nsubseteqq':'\u2AC5\u0338','nsucc':'\u2281','nsucceq':'\u2AB0\u0338','nsup':'\u2285','nsupe':'\u2289','nsupE':'\u2AC6\u0338','nsupset':'\u2283\u20D2','nsupseteq':'\u2289','nsupseteqq':'\u2AC6\u0338','ntgl':'\u2279','ntilde':'\xF1','Ntilde':'\xD1','ntlg':'\u2278','ntriangleleft':'\u22EA','ntrianglelefteq':'\u22EC','ntriangleright':'\u22EB','ntrianglerighteq':'\u22ED','nu':'\u03BD','Nu':'\u039D','num':'#','numero':'\u2116','numsp':'\u2007','nvap':'\u224D\u20D2','nvdash':'\u22AC','nvDash':'\u22AD','nVdash':'\u22AE','nVDash':'\u22AF','nvge':'\u2265\u20D2','nvgt':'>\u20D2','nvHarr':'\u2904','nvinfin':'\u29DE','nvlArr':'\u2902','nvle':'\u2264\u20D2','nvlt':'<\u20D2','nvltrie':'\u22B4\u20D2','nvrArr':'\u2903','nvrtrie':'\u22B5\u20D2','nvsim':'\u223C\u20D2','nwarhk':'\u2923','nwarr':'\u2196','nwArr':'\u21D6','nwarrow':'\u2196','nwnear':'\u2927','oacute':'\xF3','Oacute':'\xD3','oast':'\u229B','ocir':'\u229A','ocirc':'\xF4','Ocirc':'\xD4','ocy':'\u043E','Ocy':'\u041E','odash':'\u229D','odblac':'\u0151','Odblac':'\u0150','odiv':'\u2A38','odot':'\u2299','odsold':'\u29BC','oelig':'\u0153','OElig':'\u0152','ofcir':'\u29BF','ofr':'\uD835\uDD2C','Ofr':'\uD835\uDD12','ogon':'\u02DB','ograve':'\xF2','Ograve':'\xD2','ogt':'\u29C1','ohbar':'\u29B5','ohm':'\u03A9','oint':'\u222E','olarr':'\u21BA','olcir':'\u29BE','olcross':'\u29BB','oline':'\u203E','olt':'\u29C0','omacr':'\u014D','Omacr':'\u014C','omega':'\u03C9','Omega':'\u03A9','omicron':'\u03BF','Omicron':'\u039F','omid':'\u29B6','ominus':'\u2296','oopf':'\uD835\uDD60','Oopf':'\uD835\uDD46','opar':'\u29B7','OpenCurlyDoubleQuote':'\u201C','OpenCurlyQuote':'\u2018','operp':'\u29B9','oplus':'\u2295','or':'\u2228','Or':'\u2A54','orarr':'\u21BB','ord':'\u2A5D','order':'\u2134','orderof':'\u2134','ordf':'\xAA','ordm':'\xBA','origof':'\u22B6','oror':'\u2A56','orslope':'\u2A57','orv':'\u2A5B','oS':'\u24C8','oscr':'\u2134','Oscr':'\uD835\uDCAA','oslash':'\xF8','Oslash':'\xD8','osol':'\u2298','otilde':'\xF5','Otilde':'\xD5','otimes':'\u2297','Otimes':'\u2A37','otimesas':'\u2A36','ouml':'\xF6','Ouml':'\xD6','ovbar':'\u233D','OverBar':'\u203E','OverBrace':'\u23DE','OverBracket':'\u23B4','OverParenthesis':'\u23DC','par':'\u2225','para':'\xB6','parallel':'\u2225','parsim':'\u2AF3','parsl':'\u2AFD','part':'\u2202','PartialD':'\u2202','pcy':'\u043F','Pcy':'\u041F','percnt':'%','period':'.','permil':'\u2030','perp':'\u22A5','pertenk':'\u2031','pfr':'\uD835\uDD2D','Pfr':'\uD835\uDD13','phi':'\u03C6','Phi':'\u03A6','phiv':'\u03D5','phmmat':'\u2133','phone':'\u260E','pi':'\u03C0','Pi':'\u03A0','pitchfork':'\u22D4','piv':'\u03D6','planck':'\u210F','planckh':'\u210E','plankv':'\u210F','plus':'+','plusacir':'\u2A23','plusb':'\u229E','pluscir':'\u2A22','plusdo':'\u2214','plusdu':'\u2A25','pluse':'\u2A72','PlusMinus':'\xB1','plusmn':'\xB1','plussim':'\u2A26','plustwo':'\u2A27','pm':'\xB1','Poincareplane':'\u210C','pointint':'\u2A15','popf':'\uD835\uDD61','Popf':'\u2119','pound':'\xA3','pr':'\u227A','Pr':'\u2ABB','prap':'\u2AB7','prcue':'\u227C','pre':'\u2AAF','prE':'\u2AB3','prec':'\u227A','precapprox':'\u2AB7','preccurlyeq':'\u227C','Precedes':'\u227A','PrecedesEqual':'\u2AAF','PrecedesSlantEqual':'\u227C','PrecedesTilde':'\u227E','preceq':'\u2AAF','precnapprox':'\u2AB9','precneqq':'\u2AB5','precnsim':'\u22E8','precsim':'\u227E','prime':'\u2032','Prime':'\u2033','primes':'\u2119','prnap':'\u2AB9','prnE':'\u2AB5','prnsim':'\u22E8','prod':'\u220F','Product':'\u220F','profalar':'\u232E','profline':'\u2312','profsurf':'\u2313','prop':'\u221D','Proportion':'\u2237','Proportional':'\u221D','propto':'\u221D','prsim':'\u227E','prurel':'\u22B0','pscr':'\uD835\uDCC5','Pscr':'\uD835\uDCAB','psi':'\u03C8','Psi':'\u03A8','puncsp':'\u2008','qfr':'\uD835\uDD2E','Qfr':'\uD835\uDD14','qint':'\u2A0C','qopf':'\uD835\uDD62','Qopf':'\u211A','qprime':'\u2057','qscr':'\uD835\uDCC6','Qscr':'\uD835\uDCAC','quaternions':'\u210D','quatint':'\u2A16','quest':'?','questeq':'\u225F','quot':'"','QUOT':'"','rAarr':'\u21DB','race':'\u223D\u0331','racute':'\u0155','Racute':'\u0154','radic':'\u221A','raemptyv':'\u29B3','rang':'\u27E9','Rang':'\u27EB','rangd':'\u2992','range':'\u29A5','rangle':'\u27E9','raquo':'\xBB','rarr':'\u2192','rArr':'\u21D2','Rarr':'\u21A0','rarrap':'\u2975','rarrb':'\u21E5','rarrbfs':'\u2920','rarrc':'\u2933','rarrfs':'\u291E','rarrhk':'\u21AA','rarrlp':'\u21AC','rarrpl':'\u2945','rarrsim':'\u2974','rarrtl':'\u21A3','Rarrtl':'\u2916','rarrw':'\u219D','ratail':'\u291A','rAtail':'\u291C','ratio':'\u2236','rationals':'\u211A','rbarr':'\u290D','rBarr':'\u290F','RBarr':'\u2910','rbbrk':'\u2773','rbrace':'}','rbrack':']','rbrke':'\u298C','rbrksld':'\u298E','rbrkslu':'\u2990','rcaron':'\u0159','Rcaron':'\u0158','rcedil':'\u0157','Rcedil':'\u0156','rceil':'\u2309','rcub':'}','rcy':'\u0440','Rcy':'\u0420','rdca':'\u2937','rdldhar':'\u2969','rdquo':'\u201D','rdquor':'\u201D','rdsh':'\u21B3','Re':'\u211C','real':'\u211C','realine':'\u211B','realpart':'\u211C','reals':'\u211D','rect':'\u25AD','reg':'\xAE','REG':'\xAE','ReverseElement':'\u220B','ReverseEquilibrium':'\u21CB','ReverseUpEquilibrium':'\u296F','rfisht':'\u297D','rfloor':'\u230B','rfr':'\uD835\uDD2F','Rfr':'\u211C','rHar':'\u2964','rhard':'\u21C1','rharu':'\u21C0','rharul':'\u296C','rho':'\u03C1','Rho':'\u03A1','rhov':'\u03F1','RightAngleBracket':'\u27E9','rightarrow':'\u2192','Rightarrow':'\u21D2','RightArrow':'\u2192','RightArrowBar':'\u21E5','RightArrowLeftArrow':'\u21C4','rightarrowtail':'\u21A3','RightCeiling':'\u2309','RightDoubleBracket':'\u27E7','RightDownTeeVector':'\u295D','RightDownVector':'\u21C2','RightDownVectorBar':'\u2955','RightFloor':'\u230B','rightharpoondown':'\u21C1','rightharpoonup':'\u21C0','rightleftarrows':'\u21C4','rightleftharpoons':'\u21CC','rightrightarrows':'\u21C9','rightsquigarrow':'\u219D','RightTee':'\u22A2','RightTeeArrow':'\u21A6','RightTeeVector':'\u295B','rightthreetimes':'\u22CC','RightTriangle':'\u22B3','RightTriangleBar':'\u29D0','RightTriangleEqual':'\u22B5','RightUpDownVector':'\u294F','RightUpTeeVector':'\u295C','RightUpVector':'\u21BE','RightUpVectorBar':'\u2954','RightVector':'\u21C0','RightVectorBar':'\u2953','ring':'\u02DA','risingdotseq':'\u2253','rlarr':'\u21C4','rlhar':'\u21CC','rlm':'\u200F','rmoust':'\u23B1','rmoustache':'\u23B1','rnmid':'\u2AEE','roang':'\u27ED','roarr':'\u21FE','robrk':'\u27E7','ropar':'\u2986','ropf':'\uD835\uDD63','Ropf':'\u211D','roplus':'\u2A2E','rotimes':'\u2A35','RoundImplies':'\u2970','rpar':')','rpargt':'\u2994','rppolint':'\u2A12','rrarr':'\u21C9','Rrightarrow':'\u21DB','rsaquo':'\u203A','rscr':'\uD835\uDCC7','Rscr':'\u211B','rsh':'\u21B1','Rsh':'\u21B1','rsqb':']','rsquo':'\u2019','rsquor':'\u2019','rthree':'\u22CC','rtimes':'\u22CA','rtri':'\u25B9','rtrie':'\u22B5','rtrif':'\u25B8','rtriltri':'\u29CE','RuleDelayed':'\u29F4','ruluhar':'\u2968','rx':'\u211E','sacute':'\u015B','Sacute':'\u015A','sbquo':'\u201A','sc':'\u227B','Sc':'\u2ABC','scap':'\u2AB8','scaron':'\u0161','Scaron':'\u0160','sccue':'\u227D','sce':'\u2AB0','scE':'\u2AB4','scedil':'\u015F','Scedil':'\u015E','scirc':'\u015D','Scirc':'\u015C','scnap':'\u2ABA','scnE':'\u2AB6','scnsim':'\u22E9','scpolint':'\u2A13','scsim':'\u227F','scy':'\u0441','Scy':'\u0421','sdot':'\u22C5','sdotb':'\u22A1','sdote':'\u2A66','searhk':'\u2925','searr':'\u2198','seArr':'\u21D8','searrow':'\u2198','sect':'\xA7','semi':';','seswar':'\u2929','setminus':'\u2216','setmn':'\u2216','sext':'\u2736','sfr':'\uD835\uDD30','Sfr':'\uD835\uDD16','sfrown':'\u2322','sharp':'\u266F','shchcy':'\u0449','SHCHcy':'\u0429','shcy':'\u0448','SHcy':'\u0428','ShortDownArrow':'\u2193','ShortLeftArrow':'\u2190','shortmid':'\u2223','shortparallel':'\u2225','ShortRightArrow':'\u2192','ShortUpArrow':'\u2191','shy':'\xAD','sigma':'\u03C3','Sigma':'\u03A3','sigmaf':'\u03C2','sigmav':'\u03C2','sim':'\u223C','simdot':'\u2A6A','sime':'\u2243','simeq':'\u2243','simg':'\u2A9E','simgE':'\u2AA0','siml':'\u2A9D','simlE':'\u2A9F','simne':'\u2246','simplus':'\u2A24','simrarr':'\u2972','slarr':'\u2190','SmallCircle':'\u2218','smallsetminus':'\u2216','smashp':'\u2A33','smeparsl':'\u29E4','smid':'\u2223','smile':'\u2323','smt':'\u2AAA','smte':'\u2AAC','smtes':'\u2AAC\uFE00','softcy':'\u044C','SOFTcy':'\u042C','sol':'/','solb':'\u29C4','solbar':'\u233F','sopf':'\uD835\uDD64','Sopf':'\uD835\uDD4A','spades':'\u2660','spadesuit':'\u2660','spar':'\u2225','sqcap':'\u2293','sqcaps':'\u2293\uFE00','sqcup':'\u2294','sqcups':'\u2294\uFE00','Sqrt':'\u221A','sqsub':'\u228F','sqsube':'\u2291','sqsubset':'\u228F','sqsubseteq':'\u2291','sqsup':'\u2290','sqsupe':'\u2292','sqsupset':'\u2290','sqsupseteq':'\u2292','squ':'\u25A1','square':'\u25A1','Square':'\u25A1','SquareIntersection':'\u2293','SquareSubset':'\u228F','SquareSubsetEqual':'\u2291','SquareSuperset':'\u2290','SquareSupersetEqual':'\u2292','SquareUnion':'\u2294','squarf':'\u25AA','squf':'\u25AA','srarr':'\u2192','sscr':'\uD835\uDCC8','Sscr':'\uD835\uDCAE','ssetmn':'\u2216','ssmile':'\u2323','sstarf':'\u22C6','star':'\u2606','Star':'\u22C6','starf':'\u2605','straightepsilon':'\u03F5','straightphi':'\u03D5','strns':'\xAF','sub':'\u2282','Sub':'\u22D0','subdot':'\u2ABD','sube':'\u2286','subE':'\u2AC5','subedot':'\u2AC3','submult':'\u2AC1','subne':'\u228A','subnE':'\u2ACB','subplus':'\u2ABF','subrarr':'\u2979','subset':'\u2282','Subset':'\u22D0','subseteq':'\u2286','subseteqq':'\u2AC5','SubsetEqual':'\u2286','subsetneq':'\u228A','subsetneqq':'\u2ACB','subsim':'\u2AC7','subsub':'\u2AD5','subsup':'\u2AD3','succ':'\u227B','succapprox':'\u2AB8','succcurlyeq':'\u227D','Succeeds':'\u227B','SucceedsEqual':'\u2AB0','SucceedsSlantEqual':'\u227D','SucceedsTilde':'\u227F','succeq':'\u2AB0','succnapprox':'\u2ABA','succneqq':'\u2AB6','succnsim':'\u22E9','succsim':'\u227F','SuchThat':'\u220B','sum':'\u2211','Sum':'\u2211','sung':'\u266A','sup':'\u2283','Sup':'\u22D1','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','supdot':'\u2ABE','supdsub':'\u2AD8','supe':'\u2287','supE':'\u2AC6','supedot':'\u2AC4','Superset':'\u2283','SupersetEqual':'\u2287','suphsol':'\u27C9','suphsub':'\u2AD7','suplarr':'\u297B','supmult':'\u2AC2','supne':'\u228B','supnE':'\u2ACC','supplus':'\u2AC0','supset':'\u2283','Supset':'\u22D1','supseteq':'\u2287','supseteqq':'\u2AC6','supsetneq':'\u228B','supsetneqq':'\u2ACC','supsim':'\u2AC8','supsub':'\u2AD4','supsup':'\u2AD6','swarhk':'\u2926','swarr':'\u2199','swArr':'\u21D9','swarrow':'\u2199','swnwar':'\u292A','szlig':'\xDF','Tab':'\t','target':'\u2316','tau':'\u03C4','Tau':'\u03A4','tbrk':'\u23B4','tcaron':'\u0165','Tcaron':'\u0164','tcedil':'\u0163','Tcedil':'\u0162','tcy':'\u0442','Tcy':'\u0422','tdot':'\u20DB','telrec':'\u2315','tfr':'\uD835\uDD31','Tfr':'\uD835\uDD17','there4':'\u2234','therefore':'\u2234','Therefore':'\u2234','theta':'\u03B8','Theta':'\u0398','thetasym':'\u03D1','thetav':'\u03D1','thickapprox':'\u2248','thicksim':'\u223C','ThickSpace':'\u205F\u200A','thinsp':'\u2009','ThinSpace':'\u2009','thkap':'\u2248','thksim':'\u223C','thorn':'\xFE','THORN':'\xDE','tilde':'\u02DC','Tilde':'\u223C','TildeEqual':'\u2243','TildeFullEqual':'\u2245','TildeTilde':'\u2248','times':'\xD7','timesb':'\u22A0','timesbar':'\u2A31','timesd':'\u2A30','tint':'\u222D','toea':'\u2928','top':'\u22A4','topbot':'\u2336','topcir':'\u2AF1','topf':'\uD835\uDD65','Topf':'\uD835\uDD4B','topfork':'\u2ADA','tosa':'\u2929','tprime':'\u2034','trade':'\u2122','TRADE':'\u2122','triangle':'\u25B5','triangledown':'\u25BF','triangleleft':'\u25C3','trianglelefteq':'\u22B4','triangleq':'\u225C','triangleright':'\u25B9','trianglerighteq':'\u22B5','tridot':'\u25EC','trie':'\u225C','triminus':'\u2A3A','TripleDot':'\u20DB','triplus':'\u2A39','trisb':'\u29CD','tritime':'\u2A3B','trpezium':'\u23E2','tscr':'\uD835\uDCC9','Tscr':'\uD835\uDCAF','tscy':'\u0446','TScy':'\u0426','tshcy':'\u045B','TSHcy':'\u040B','tstrok':'\u0167','Tstrok':'\u0166','twixt':'\u226C','twoheadleftarrow':'\u219E','twoheadrightarrow':'\u21A0','uacute':'\xFA','Uacute':'\xDA','uarr':'\u2191','uArr':'\u21D1','Uarr':'\u219F','Uarrocir':'\u2949','ubrcy':'\u045E','Ubrcy':'\u040E','ubreve':'\u016D','Ubreve':'\u016C','ucirc':'\xFB','Ucirc':'\xDB','ucy':'\u0443','Ucy':'\u0423','udarr':'\u21C5','udblac':'\u0171','Udblac':'\u0170','udhar':'\u296E','ufisht':'\u297E','ufr':'\uD835\uDD32','Ufr':'\uD835\uDD18','ugrave':'\xF9','Ugrave':'\xD9','uHar':'\u2963','uharl':'\u21BF','uharr':'\u21BE','uhblk':'\u2580','ulcorn':'\u231C','ulcorner':'\u231C','ulcrop':'\u230F','ultri':'\u25F8','umacr':'\u016B','Umacr':'\u016A','uml':'\xA8','UnderBar':'_','UnderBrace':'\u23DF','UnderBracket':'\u23B5','UnderParenthesis':'\u23DD','Union':'\u22C3','UnionPlus':'\u228E','uogon':'\u0173','Uogon':'\u0172','uopf':'\uD835\uDD66','Uopf':'\uD835\uDD4C','uparrow':'\u2191','Uparrow':'\u21D1','UpArrow':'\u2191','UpArrowBar':'\u2912','UpArrowDownArrow':'\u21C5','updownarrow':'\u2195','Updownarrow':'\u21D5','UpDownArrow':'\u2195','UpEquilibrium':'\u296E','upharpoonleft':'\u21BF','upharpoonright':'\u21BE','uplus':'\u228E','UpperLeftArrow':'\u2196','UpperRightArrow':'\u2197','upsi':'\u03C5','Upsi':'\u03D2','upsih':'\u03D2','upsilon':'\u03C5','Upsilon':'\u03A5','UpTee':'\u22A5','UpTeeArrow':'\u21A5','upuparrows':'\u21C8','urcorn':'\u231D','urcorner':'\u231D','urcrop':'\u230E','uring':'\u016F','Uring':'\u016E','urtri':'\u25F9','uscr':'\uD835\uDCCA','Uscr':'\uD835\uDCB0','utdot':'\u22F0','utilde':'\u0169','Utilde':'\u0168','utri':'\u25B5','utrif':'\u25B4','uuarr':'\u21C8','uuml':'\xFC','Uuml':'\xDC','uwangle':'\u29A7','vangrt':'\u299C','varepsilon':'\u03F5','varkappa':'\u03F0','varnothing':'\u2205','varphi':'\u03D5','varpi':'\u03D6','varpropto':'\u221D','varr':'\u2195','vArr':'\u21D5','varrho':'\u03F1','varsigma':'\u03C2','varsubsetneq':'\u228A\uFE00','varsubsetneqq':'\u2ACB\uFE00','varsupsetneq':'\u228B\uFE00','varsupsetneqq':'\u2ACC\uFE00','vartheta':'\u03D1','vartriangleleft':'\u22B2','vartriangleright':'\u22B3','vBar':'\u2AE8','Vbar':'\u2AEB','vBarv':'\u2AE9','vcy':'\u0432','Vcy':'\u0412','vdash':'\u22A2','vDash':'\u22A8','Vdash':'\u22A9','VDash':'\u22AB','Vdashl':'\u2AE6','vee':'\u2228','Vee':'\u22C1','veebar':'\u22BB','veeeq':'\u225A','vellip':'\u22EE','verbar':'|','Verbar':'\u2016','vert':'|','Vert':'\u2016','VerticalBar':'\u2223','VerticalLine':'|','VerticalSeparator':'\u2758','VerticalTilde':'\u2240','VeryThinSpace':'\u200A','vfr':'\uD835\uDD33','Vfr':'\uD835\uDD19','vltri':'\u22B2','vnsub':'\u2282\u20D2','vnsup':'\u2283\u20D2','vopf':'\uD835\uDD67','Vopf':'\uD835\uDD4D','vprop':'\u221D','vrtri':'\u22B3','vscr':'\uD835\uDCCB','Vscr':'\uD835\uDCB1','vsubne':'\u228A\uFE00','vsubnE':'\u2ACB\uFE00','vsupne':'\u228B\uFE00','vsupnE':'\u2ACC\uFE00','Vvdash':'\u22AA','vzigzag':'\u299A','wcirc':'\u0175','Wcirc':'\u0174','wedbar':'\u2A5F','wedge':'\u2227','Wedge':'\u22C0','wedgeq':'\u2259','weierp':'\u2118','wfr':'\uD835\uDD34','Wfr':'\uD835\uDD1A','wopf':'\uD835\uDD68','Wopf':'\uD835\uDD4E','wp':'\u2118','wr':'\u2240','wreath':'\u2240','wscr':'\uD835\uDCCC','Wscr':'\uD835\uDCB2','xcap':'\u22C2','xcirc':'\u25EF','xcup':'\u22C3','xdtri':'\u25BD','xfr':'\uD835\uDD35','Xfr':'\uD835\uDD1B','xharr':'\u27F7','xhArr':'\u27FA','xi':'\u03BE','Xi':'\u039E','xlarr':'\u27F5','xlArr':'\u27F8','xmap':'\u27FC','xnis':'\u22FB','xodot':'\u2A00','xopf':'\uD835\uDD69','Xopf':'\uD835\uDD4F','xoplus':'\u2A01','xotime':'\u2A02','xrarr':'\u27F6','xrArr':'\u27F9','xscr':'\uD835\uDCCD','Xscr':'\uD835\uDCB3','xsqcup':'\u2A06','xuplus':'\u2A04','xutri':'\u25B3','xvee':'\u22C1','xwedge':'\u22C0','yacute':'\xFD','Yacute':'\xDD','yacy':'\u044F','YAcy':'\u042F','ycirc':'\u0177','Ycirc':'\u0176','ycy':'\u044B','Ycy':'\u042B','yen':'\xA5','yfr':'\uD835\uDD36','Yfr':'\uD835\uDD1C','yicy':'\u0457','YIcy':'\u0407','yopf':'\uD835\uDD6A','Yopf':'\uD835\uDD50','yscr':'\uD835\uDCCE','Yscr':'\uD835\uDCB4','yucy':'\u044E','YUcy':'\u042E','yuml':'\xFF','Yuml':'\u0178','zacute':'\u017A','Zacute':'\u0179','zcaron':'\u017E','Zcaron':'\u017D','zcy':'\u0437','Zcy':'\u0417','zdot':'\u017C','Zdot':'\u017B','zeetrf':'\u2128','ZeroWidthSpace':'\u200B','zeta':'\u03B6','Zeta':'\u0396','zfr':'\uD835\uDD37','Zfr':'\u2128','zhcy':'\u0436','ZHcy':'\u0416','zigrarr':'\u21DD','zopf':'\uD835\uDD6B','Zopf':'\u2124','zscr':'\uD835\uDCCF','Zscr':'\uD835\uDCB5','zwj':'\u200D','zwnj':'\u200C'};var decodeMapLegacy = {'aacute':'\xE1','Aacute':'\xC1','acirc':'\xE2','Acirc':'\xC2','acute':'\xB4','aelig':'\xE6','AElig':'\xC6','agrave':'\xE0','Agrave':'\xC0','amp':'&','AMP':'&','aring':'\xE5','Aring':'\xC5','atilde':'\xE3','Atilde':'\xC3','auml':'\xE4','Auml':'\xC4','brvbar':'\xA6','ccedil':'\xE7','Ccedil':'\xC7','cedil':'\xB8','cent':'\xA2','copy':'\xA9','COPY':'\xA9','curren':'\xA4','deg':'\xB0','divide':'\xF7','eacute':'\xE9','Eacute':'\xC9','ecirc':'\xEA','Ecirc':'\xCA','egrave':'\xE8','Egrave':'\xC8','eth':'\xF0','ETH':'\xD0','euml':'\xEB','Euml':'\xCB','frac12':'\xBD','frac14':'\xBC','frac34':'\xBE','gt':'>','GT':'>','iacute':'\xED','Iacute':'\xCD','icirc':'\xEE','Icirc':'\xCE','iexcl':'\xA1','igrave':'\xEC','Igrave':'\xCC','iquest':'\xBF','iuml':'\xEF','Iuml':'\xCF','laquo':'\xAB','lt':'<','LT':'<','macr':'\xAF','micro':'\xB5','middot':'\xB7','nbsp':'\xA0','not':'\xAC','ntilde':'\xF1','Ntilde':'\xD1','oacute':'\xF3','Oacute':'\xD3','ocirc':'\xF4','Ocirc':'\xD4','ograve':'\xF2','Ograve':'\xD2','ordf':'\xAA','ordm':'\xBA','oslash':'\xF8','Oslash':'\xD8','otilde':'\xF5','Otilde':'\xD5','ouml':'\xF6','Ouml':'\xD6','para':'\xB6','plusmn':'\xB1','pound':'\xA3','quot':'"','QUOT':'"','raquo':'\xBB','reg':'\xAE','REG':'\xAE','sect':'\xA7','shy':'\xAD','sup1':'\xB9','sup2':'\xB2','sup3':'\xB3','szlig':'\xDF','thorn':'\xFE','THORN':'\xDE','times':'\xD7','uacute':'\xFA','Uacute':'\xDA','ucirc':'\xFB','Ucirc':'\xDB','ugrave':'\xF9','Ugrave':'\xD9','uml':'\xA8','uuml':'\xFC','Uuml':'\xDC','yacute':'\xFD','Yacute':'\xDD','yen':'\xA5','yuml':'\xFF'};var decodeMapNumeric = {'0':'\uFFFD','128':'\u20AC','130':'\u201A','131':'\u0192','132':'\u201E','133':'\u2026','134':'\u2020','135':'\u2021','136':'\u02C6','137':'\u2030','138':'\u0160','139':'\u2039','140':'\u0152','142':'\u017D','145':'\u2018','146':'\u2019','147':'\u201C','148':'\u201D','149':'\u2022','150':'\u2013','151':'\u2014','152':'\u02DC','153':'\u2122','154':'\u0161','155':'\u203A','156':'\u0153','158':'\u017E','159':'\u0178'};var invalidReferenceCodePoints = [1,2,3,4,5,6,7,8,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,64976,64977,64978,64979,64980,64981,64982,64983,64984,64985,64986,64987,64988,64989,64990,64991,64992,64993,64994,64995,64996,64997,64998,64999,65000,65001,65002,65003,65004,65005,65006,65007,65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];/*--------------------------------------------------------------------------*/var stringFromCharCode = String.fromCharCode;var object = {};var hasOwnProperty = object.hasOwnProperty;var has = function(object, propertyName) {return hasOwnProperty.call(object, propertyName);};var contains = function(array, value) {var index = -1;var length = array.length;while (++index < length) {if (array[index] == value) {return true;}}return false;};var merge = function(options, defaults) {if (!options) {return defaults;}var result = {};var key;for (key in defaults) {// A `hasOwnProperty` check is not needed here, since only recognized// option names are used anyway. Any others are ignored.result[key] = has(options, key) ? options[key] : defaults[key];}return result;};// Modified version of `ucs2encode`; see https://mths.be/punycode.var codePointToSymbol = function(codePoint, strict) {var output = '';if ((codePoint >= 0xD800 && codePoint <= 0xDFFF) || codePoint > 0x10FFFF) {// See issue #4:// “Otherwise, if the number is in the range 0xD800 to 0xDFFF or is// greater than 0x10FFFF, then this is a parse error. Return a U+FFFD// REPLACEMENT CHARACTER.”if (strict) {parseError('character reference outside the permissible Unicode range');}return '\uFFFD';}if (has(decodeMapNumeric, codePoint)) {if (strict) {parseError('disallowed character reference');}return decodeMapNumeric[codePoint];}if (strict && contains(invalidReferenceCodePoints, codePoint)) {parseError('disallowed character reference');}if (codePoint > 0xFFFF) {codePoint -= 0x10000;output += stringFromCharCode(codePoint >>> 10 & 0x3FF | 0xD800);codePoint = 0xDC00 | codePoint & 0x3FF;}output += stringFromCharCode(codePoint);return output;};var hexEscape = function(codePoint) {return '&#x' + codePoint.toString(16).toUpperCase() + ';';};var decEscape = function(codePoint) {return '&#' + codePoint + ';';};var parseError = function(message) {throw Error('Parse error: ' + message);};/*--------------------------------------------------------------------------*/var encode = function(string, options) {options = merge(options, encode.options);var strict = options.strict;if (strict && regexInvalidRawCodePoint.test(string)) {parseError('forbidden code point');}var encodeEverything = options.encodeEverything;var useNamedReferences = options.useNamedReferences;var allowUnsafeSymbols = options.allowUnsafeSymbols;var escapeCodePoint = options.decimal ? decEscape : hexEscape;var escapeBmpSymbol = function(symbol) {return escapeCodePoint(symbol.charCodeAt(0));};if (encodeEverything) {// Encode ASCII symbols.string = string.replace(regexAsciiWhitelist, function(symbol) {// Use named references if requested & possible.if (useNamedReferences && has(encodeMap, symbol)) {return '&' + encodeMap[symbol] + ';';}return escapeBmpSymbol(symbol);});// Shorten a few escapes that represent two symbols, of which at least one// is within the ASCII range.if (useNamedReferences) {string = string.replace(/>\u20D2/g, '>⃒').replace(/<\u20D2/g, '<⃒').replace(/fj/g, 'fj');}// Encode non-ASCII symbols.if (useNamedReferences) {// Encode non-ASCII symbols that can be replaced with a named reference.string = string.replace(regexEncodeNonAscii, function(string) {// Note: there is no need to check `has(encodeMap, string)` here.return '&' + encodeMap[string] + ';';});}// Note: any remaining non-ASCII symbols are handled outside of the `if`.} else if (useNamedReferences) {// Apply named character references.// Encode `<>"'&` using named character references.if (!allowUnsafeSymbols) {string = string.replace(regexEscape, function(string) {return '&' + encodeMap[string] + ';'; // no need to check `has()` here});}// Shorten escapes that represent two symbols, of which at least one is// `<>"'&`.string = string.replace(/>\u20D2/g, '>⃒').replace(/<\u20D2/g, '<⃒');// Encode non-ASCII symbols that can be replaced with a named reference.string = string.replace(regexEncodeNonAscii, function(string) {// Note: there is no need to check `has(encodeMap, string)` here.return '&' + encodeMap[string] + ';';});} else if (!allowUnsafeSymbols) {// Encode `<>"'&` using hexadecimal escapes, now that they’re not handled// using named character references.string = string.replace(regexEscape, escapeBmpSymbol);}return string// Encode astral symbols..replace(regexAstralSymbols, function($0) {// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulaevar high = $0.charCodeAt(0);var low = $0.charCodeAt(1);var codePoint = (high - 0xD800) * 0x400 + low - 0xDC00 + 0x10000;return escapeCodePoint(codePoint);})// Encode any remaining BMP symbols that are not printable ASCII symbols// using a hexadecimal escape..replace(regexBmpWhitelist, escapeBmpSymbol);};// Expose default options (so they can be overridden globally).encode.options = {'allowUnsafeSymbols': false,'encodeEverything': false,'strict': false,'useNamedReferences': false,'decimal' : false};var decode = function(html, options) {options = merge(options, decode.options);var strict = options.strict;if (strict && regexInvalidEntity.test(html)) {parseError('malformed character reference');}return html.replace(regexDecode, function($0, $1, $2, $3, $4, $5, $6, $7, $8) {var codePoint;var semicolon;var decDigits;var hexDigits;var reference;var next;if ($1) {reference = $1;// Note: there is no need to check `has(decodeMap, reference)`.return decodeMap[reference];}if ($2) {// Decode named character references without trailing `;`, e.g. `&`.// This is only a parse error if it gets converted to `&`, or if it is// followed by `=` in an attribute context.reference = $2;next = $3;if (next && options.isAttributeValue) {if (strict && next == '=') {parseError('`&` did not start a character reference');}return $0;} else {if (strict) {parseError('named character reference was not terminated by a semicolon');}// Note: there is no need to check `has(decodeMapLegacy, reference)`.return decodeMapLegacy[reference] + (next || '');}}if ($4) {// Decode decimal escapes, e.g. `𝌆`.decDigits = $4;semicolon = $5;if (strict && !semicolon) {parseError('character reference was not terminated by a semicolon');}codePoint = parseInt(decDigits, 10);return codePointToSymbol(codePoint, strict);}if ($6) {// Decode hexadecimal escapes, e.g. `𝌆`.hexDigits = $6;semicolon = $7;if (strict && !semicolon) {parseError('character reference was not terminated by a semicolon');}codePoint = parseInt(hexDigits, 16);return codePointToSymbol(codePoint, strict);}// If we’re still here, `if ($7)` is implied; it’s an ambiguous// ampersand for sure. https://mths.be/notes/ambiguous-ampersandsif (strict) {parseError('named character reference was not terminated by a semicolon');}return $0;});};// Expose default options (so they can be overridden globally).decode.options = {'isAttributeValue': false,'strict': false};var escape = function(string) {return string.replace(regexEscape, function($0) {// Note: there is no need to check `has(escapeMap, $0)` here.return escapeMap[$0];});};/*--------------------------------------------------------------------------*/var he = {'version': '1.2.0','encode': encode,'decode': decode,'escape': escape,'unescape': decode};// Some AMD build optimizers, like r.js, check for specific condition patterns// like the following:if (typeof define == 'function' &&typeof define.amd == 'object' &&define.amd) {define(function() {return he;});} else if (freeExports && !freeExports.nodeType) {if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+freeModule.exports = he;} else { // in Narwhal or RingoJS v0.7.0-for (var key in he) {has(he, key) && (freeExports[key] = he[key]);}}} else { // in Rhino or a web browserroot.he = he;}}(this));
#!/usr/bin/env node(function() {var fs = require('fs');var he = require('../he.js');var strings = process.argv.splice(2);var stdin = process.stdin;var data;var timeout;var action;var options = {};var log = console.log;var main = function() {var option = strings[0];var count = 0;if (/^(?:-h|--help|undefined)$/.test(option)) {log('he v%s - https://mths.be/he',he.version);log(['\nUsage:\n','\the [--escape] string','\the [--encode] [--use-named-refs] [--everything] [--allow-unsafe] [--decimal] string','\the [--decode] [--attribute] [--strict] string','\the [-v | --version]','\the [-h | --help]','\nExamples:\n','\the --escape \\<img\\ src\\=\\\'x\\\'\\ onerror\\=\\"prompt\\(1\\)\\"\\>','\techo \'© 𝌆\' | he --decode'].join('\n'));return process.exit(option ? 0 : 1);}if (/^(?:-v|--version)$/.test(option)) {log('v%s', he.version);return process.exit(0);}strings.forEach(function(string) {// Process optionsif (string == '--escape') {action = 'escape';return;}if (string == '--encode') {action = 'encode';return;}if (string == '--use-named-refs') {action = 'encode';options.useNamedReferences = true;return;}if (string == '--everything') {action = 'encode';options.encodeEverything = true;return;}if (string == '--allow-unsafe') {action = 'encode';options.allowUnsafeSymbols = true;return;}if (string == '--decimal') {action = 'encode';options.decimal = true;return;}if (string == '--decode') {action = 'decode';return;}if (string == '--attribute') {action = 'decode';options.isAttributeValue = true;return;}if (string == '--strict') {action = 'decode';options.strict = true;return;}// Process string(s)var result;if (!action) {log('Error: he requires at least one option and a string argument.');log('Try `he --help` for more information.');return process.exit(1);}try {result = he[action](string, options);log(result);count++;} catch(error) {log(error.message + '\n');log('Error: failed to %s.', action);log('If you think this is a bug in he, please report it:');log('https://github.com/mathiasbynens/he/issues/new');log('\nStack trace using he@%s:\n',he.version);log(error.stack);return process.exit(1);}});if (!count) {log('Error: he requires a string argument.');log('Try `he --help` for more information.');return process.exit(1);}// Return with exit status 0 outside of the `forEach` loop, in case// multiple strings were passed in.return process.exit(0);};if (stdin.isTTY) {// handle shell argumentsmain();} else {// Either the script is called from within a non-TTY context, or `stdin`// content is being piped in.if (!process.stdout.isTTY) {// The script was called from a non-TTY context. This is a rather uncommon// use case we don’t actively support. However, we don’t want the script// to wait forever in such cases, so…timeout = setTimeout(function() {// …if no piped data arrived after a whole minute, handle shell// arguments instead.main();}, 60000);}data = '';stdin.on('data', function(chunk) {clearTimeout(timeout);data += chunk;});stdin.on('end', function() {strings.push(data.trim());main();});stdin.resume();}}());
# he [](https://travis-ci.org/mathiasbynens/he) [](https://codecov.io/github/mathiasbynens/he?branch=master) [](https://gemnasium.com/mathiasbynens/he)_he_ (for “HTML entities”) is a robust HTML entity encoder/decoder written in JavaScript. It supports [all standardized named character references as per HTML](https://html.spec.whatwg.org/multipage/syntax.html#named-character-references), handles [ambiguous ampersands](https://mathiasbynens.be/notes/ambiguous-ampersands) and other edge cases [just like a browser would](https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references), has an extensive test suite, and — contrary to many other JavaScript solutions — _he_ handles astral Unicode symbols just fine. [An online demo is available.](https://mothereff.in/html-entities)## InstallationVia [npm](https://www.npmjs.com/):```bashnpm install he```Via [Bower](http://bower.io/):```bashbower install he```Via [Component](https://github.com/component/component):```bashcomponent install mathiasbynens/he```In a browser:```html<script src="he.js"></script>```In [Node.js](https://nodejs.org/), [io.js](https://iojs.org/), [Narwhal](http://narwhaljs.org/), and [RingoJS](http://ringojs.org/):```jsvar he = require('he');```In [Rhino](http://www.mozilla.org/rhino/):```jsload('he.js');```Using an AMD loader like [RequireJS](http://requirejs.org/):```jsrequire({'paths': {'he': 'path/to/he'}},['he'],function(he) {console.log(he);});```## API### `he.version`A string representing the semantic version number.### `he.encode(text, options)`This function takes a string of text and encodes (by default) any symbols that aren’t printable ASCII symbols and `&`, `<`, `>`, `"`, `'`, and `` ` ``, replacing them with character references.```jshe.encode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'```As long as the input string contains [allowed code points](https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream) only, the return value of this function is always valid HTML. Any [(invalid) code points that cannot be represented using a character reference](https://html.spec.whatwg.org/multipage/syntax.html#table-charref-overrides) in the input are not encoded:```jshe.encode('foo \0 bar');// → 'foo \0 bar'```However, enabling [the `strict` option](https://github.com/mathiasbynens/he#strict) causes invalid code points to throw an exception. With `strict` enabled, `he.encode` either throws (if the input contains invalid code points) or returns a string of valid HTML.The `options` object is optional. It recognizes the following properties:#### `useNamedReferences`The default value for the `useNamedReferences` option is `false`. This means that `encode()` will not use any named character references (e.g. `©`) in the output — hexadecimal escapes (e.g. `©`) will be used instead. Set it to `true` to enable the use of named references.**Note that if compatibility with older browsers is a concern, this option should remain disabled.**```js// Using the global default setting (defaults to `false`):he.encode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly disallow named references:he.encode('foo © bar ≠ baz 𝌆 qux', {'useNamedReferences': false});// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly allow named references:he.encode('foo © bar ≠ baz 𝌆 qux', {'useNamedReferences': true});// → 'foo © bar ≠ baz 𝌆 qux'```#### `decimal`The default value for the `decimal` option is `false`. If the option is enabled, `encode` will generally use decimal escapes (e.g. `©`) rather than hexadecimal escapes (e.g. `©`). Beside of this replacement, the basic behavior remains the same when combined with other options. For example: if both options `useNamedReferences` and `decimal` are enabled, named references (e.g. `©`) are used over decimal escapes. HTML entities without a named reference are encoded using decimal escapes.```js// Using the global default setting (defaults to `false`):he.encode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly disable decimal escapes:he.encode('foo © bar ≠ baz 𝌆 qux', {'decimal': false});// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly enable decimal escapes:he.encode('foo © bar ≠ baz 𝌆 qux', {'decimal': true});// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly allow named references and decimal escapes:he.encode('foo © bar ≠ baz 𝌆 qux', {'useNamedReferences': true,'decimal': true});// → 'foo © bar ≠ baz 𝌆 qux'```#### `encodeEverything`The default value for the `encodeEverything` option is `false`. This means that `encode()` will not use any character references for printable ASCII symbols that don’t need escaping. Set it to `true` to encode every symbol in the input string. When set to `true`, this option takes precedence over `allowUnsafeSymbols` (i.e. setting the latter to `true` in such a case has no effect).```js// Using the global default setting (defaults to `false`):he.encode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'// Passing an `options` object to `encode`, to explicitly encode all symbols:he.encode('foo © bar ≠ baz 𝌆 qux', {'encodeEverything': true});// → 'foo © bar ≠ baz 𝌆 qux'// This setting can be combined with the `useNamedReferences` option:he.encode('foo © bar ≠ baz 𝌆 qux', {'encodeEverything': true,'useNamedReferences': true});// → 'foo © bar ≠ baz 𝌆 qux'```#### `strict`The default value for the `strict` option is `false`. This means that `encode()` will encode any HTML text content you feed it, even if it contains any symbols that cause [parse errors](https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream). To throw an error when such invalid HTML is encountered, set the `strict` option to `true`. This option makes it possible to use _he_ as part of HTML parsers and HTML validators.```js// Using the global default setting (defaults to `false`, i.e. error-tolerant mode):he.encode('\x01');// → ''// Passing an `options` object to `encode`, to explicitly enable error-tolerant mode:he.encode('\x01', {'strict': false});// → ''// Passing an `options` object to `encode`, to explicitly enable strict mode:he.encode('\x01', {'strict': true});// → Parse error```#### `allowUnsafeSymbols`The default value for the `allowUnsafeSymbols` option is `false`. This means that characters that are unsafe for use in HTML content (`&`, `<`, `>`, `"`, `'`, and `` ` ``) will be encoded. When set to `true`, only non-ASCII characters will be encoded. If the `encodeEverything` option is set to `true`, this option will be ignored.```jshe.encode('foo © and & ampersand', {'allowUnsafeSymbols': true});// → 'foo © and & ampersand'```#### Overriding default `encode` options globallyThe global default setting can be overridden by modifying the `he.encode.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting.```js// Read the global default setting:he.encode.options.useNamedReferences;// → `false` by default// Override the global default setting:he.encode.options.useNamedReferences = true;// Using the global default setting, which is now `true`:he.encode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'```### `he.decode(html, options)`This function takes a string of HTML and decodes any named and numerical character references in it using [the algorithm described in section 12.2.4.69 of the HTML spec](https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references).```jshe.decode('foo © bar ≠ baz 𝌆 qux');// → 'foo © bar ≠ baz 𝌆 qux'```The `options` object is optional. It recognizes the following properties:#### `isAttributeValue`The default value for the `isAttributeValue` option is `false`. This means that `decode()` will decode the string as if it were used in [a text context in an HTML document](https://html.spec.whatwg.org/multipage/syntax.html#data-state). HTML has different rules for [parsing character references in attribute values](https://html.spec.whatwg.org/multipage/syntax.html#character-reference-in-attribute-value-state) — set this option to `true` to treat the input string as if it were used as an attribute value.```js// Using the global default setting (defaults to `false`, i.e. HTML text context):he.decode('foo&bar');// → 'foo&bar'// Passing an `options` object to `decode`, to explicitly assume an HTML text context:he.decode('foo&bar', {'isAttributeValue': false});// → 'foo&bar'// Passing an `options` object to `decode`, to explicitly assume an HTML attribute value context:he.decode('foo&bar', {'isAttributeValue': true});// → 'foo&bar'```#### `strict`The default value for the `strict` option is `false`. This means that `decode()` will decode any HTML text content you feed it, even if it contains any entities that cause [parse errors](https://html.spec.whatwg.org/multipage/syntax.html#tokenizing-character-references). To throw an error when such invalid HTML is encountered, set the `strict` option to `true`. This option makes it possible to use _he_ as part of HTML parsers and HTML validators.```js// Using the global default setting (defaults to `false`, i.e. error-tolerant mode):he.decode('foo&bar');// → 'foo&bar'// Passing an `options` object to `decode`, to explicitly enable error-tolerant mode:he.decode('foo&bar', {'strict': false});// → 'foo&bar'// Passing an `options` object to `decode`, to explicitly enable strict mode:he.decode('foo&bar', {'strict': true});// → Parse error```#### Overriding default `decode` options globallyThe global default settings for the `decode` function can be overridden by modifying the `he.decode.options` object. This saves you from passing in an `options` object for every call to `decode` if you want to use a non-default setting.```js// Read the global default setting:he.decode.options.isAttributeValue;// → `false` by default// Override the global default setting:he.decode.options.isAttributeValue = true;// Using the global default setting, which is now `true`:he.decode('foo&bar');// → 'foo&bar'```### `he.escape(text)`This function takes a string of text and escapes it for use in text contexts in XML or HTML documents. Only the following characters are escaped: `&`, `<`, `>`, `"`, `'`, and `` ` ``.```jshe.escape('<img src=\'x\' onerror="prompt(1)">');// → '<img src='x' onerror="prompt(1)">'```### `he.unescape(html, options)``he.unescape` is an alias for `he.decode`. It takes a string of HTML and decodes any named and numerical character references in it.### Using the `he` binaryTo use the `he` binary in your shell, simply install _he_ globally using npm:```bashnpm install -g he```After that you will be able to encode/decode HTML entities from the command line:```bash$ he --encode 'föo ♥ bår 𝌆 baz'föo ♥ bår 𝌆 baz$ he --encode --use-named-refs 'föo ♥ bår 𝌆 baz'föo ♥ bår 𝌆 baz$ he --decode 'föo ♥ bår 𝌆 baz'föo ♥ bår 𝌆 baz```Read a local text file, encode it for use in an HTML text context, and save the result to a new file:```bash$ he --encode < foo.txt > foo-escaped.html```Or do the same with an online text file:```bash$ curl -sL "http://git.io/HnfEaw" | he --encode > escaped.html```Or, the opposite — read a local file containing a snippet of HTML in a text context, decode it back to plain text, and save the result to a new file:```bash$ he --decode < foo-escaped.html > foo.txt```Or do the same with an online HTML snippet:```bash$ curl -sL "http://git.io/HnfEaw" | he --decode > decoded.txt```See `he --help` for the full list of options.## Support_he_ has been tested in at least:* Chrome 27-50* Firefox 3-45* Safari 4-9* Opera 10-12, 15–37* IE 6–11* Edge* Narwhal 0.3.2* Node.js v0.10, v0.12, v4, v5* PhantomJS 1.9.0* Rhino 1.7RC4* RingoJS 0.8-0.11## Unit tests & code coverageAfter cloning this repository, run `npm install` to install the dependencies needed for he development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`.To generate the code coverage report, use `grunt cover`.## AcknowledgementsThanks to [Simon Pieters](https://simon.html5.org/) ([@zcorpan](https://twitter.com/zcorpan)) for the many suggestions.## Author| [](https://twitter.com/mathias "Follow @mathias on Twitter") ||---|| [Mathias Bynens](https://mathiasbynens.be/) |## License_he_ is available under the [MIT](https://mths.be/mit) license.
Copyright Mathias Bynens <https://mathiasbynens.be/>Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{"_from": "follow-redirects@^1.0.0","_id": "follow-redirects@1.13.1","_inBundle": false,"_integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==","_location": "/follow-redirects","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "follow-redirects@^1.0.0","name": "follow-redirects","escapedName": "follow-redirects","rawSpec": "^1.0.0","saveSpec": null,"fetchSpec": "^1.0.0"},"_requiredBy": ["/http-proxy"],"_resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz","_shasum": "5f69b813376cee4fd0474a3aba835df04ab763b7","_spec": "follow-redirects@^1.0.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-proxy","author": {"name": "Ruben Verborgh","email": "ruben@verborgh.org","url": "https://ruben.verborgh.org/"},"bugs": {"url": "https://github.com/follow-redirects/follow-redirects/issues"},"bundleDependencies": false,"contributors": [{"name": "Olivier Lalonde","email": "olalonde@gmail.com","url": "http://www.syskall.com"},{"name": "James Talmage","email": "james@talmage.io"}],"deprecated": false,"description": "HTTP and HTTPS modules that follow redirects.","devDependencies": {"concat-stream": "^2.0.0","eslint": "^5.16.0","express": "^4.16.4","lolex": "^3.1.0","mocha": "^6.0.2","nyc": "^14.1.1"},"engines": {"node": ">=4.0"},"files": ["*.js"],"funding": [{"type": "individual","url": "https://github.com/sponsors/RubenVerborgh"}],"homepage": "https://github.com/follow-redirects/follow-redirects","keywords": ["http","https","url","redirect","client","location","utility"],"license": "MIT","main": "index.js","name": "follow-redirects","peerDependenciesMeta": {"debug": {"optional": true}},"repository": {"type": "git","url": "git+ssh://git@github.com/follow-redirects/follow-redirects.git"},"scripts": {"lint": "eslint *.js test","mocha": "nyc mocha","test": "npm run lint && npm run mocha"},"version": "1.13.1"}
var url = require("url");var URL = url.URL;var http = require("http");var https = require("https");var Writable = require("stream").Writable;var assert = require("assert");var debug = require("./debug");// Create handlers that pass events from native requestsvar eventHandlers = Object.create(null);["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) {eventHandlers[event] = function (arg1, arg2, arg3) {this._redirectable.emit(event, arg1, arg2, arg3);};});// Error types with codesvar RedirectionError = createErrorType("ERR_FR_REDIRECTION_FAILURE","");var TooManyRedirectsError = createErrorType("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded");var MaxBodyLengthExceededError = createErrorType("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit");var WriteAfterEndError = createErrorType("ERR_STREAM_WRITE_AFTER_END","write after end");// An HTTP(S) request that can be redirectedfunction RedirectableRequest(options, responseCallback) {// Initialize the requestWritable.call(this);this._sanitizeOptions(options);this._options = options;this._ended = false;this._ending = false;this._redirectCount = 0;this._redirects = [];this._requestBodyLength = 0;this._requestBodyBuffers = [];// Attach a callback if passedif (responseCallback) {this.on("response", responseCallback);}// React to responses of native requestsvar self = this;this._onNativeResponse = function (response) {self._processResponse(response);};// Perform the first requestthis._performRequest();}RedirectableRequest.prototype = Object.create(Writable.prototype);// Writes buffered data to the current native requestRedirectableRequest.prototype.write = function (data, encoding, callback) {// Writing is not allowed if end has been calledif (this._ending) {throw new WriteAfterEndError();}// Validate input and shift parameters if necessaryif (!(typeof data === "string" || typeof data === "object" && ("length" in data))) {throw new TypeError("data should be a string, Buffer or Uint8Array");}if (typeof encoding === "function") {callback = encoding;encoding = null;}// Ignore empty buffers, since writing them doesn't invoke the callback// https://github.com/nodejs/node/issues/22066if (data.length === 0) {if (callback) {callback();}return;}// Only write when we don't exceed the maximum body lengthif (this._requestBodyLength + data.length <= this._options.maxBodyLength) {this._requestBodyLength += data.length;this._requestBodyBuffers.push({ data: data, encoding: encoding });this._currentRequest.write(data, encoding, callback);}// Error when we exceed the maximum body lengthelse {this.emit("error", new MaxBodyLengthExceededError());this.abort();}};// Ends the current native requestRedirectableRequest.prototype.end = function (data, encoding, callback) {// Shift parameters if necessaryif (typeof data === "function") {callback = data;data = encoding = null;}else if (typeof encoding === "function") {callback = encoding;encoding = null;}// Write data if needed and endif (!data) {this._ended = this._ending = true;this._currentRequest.end(null, null, callback);}else {var self = this;var currentRequest = this._currentRequest;this.write(data, encoding, function () {self._ended = true;currentRequest.end(null, null, callback);});this._ending = true;}};// Sets a header value on the current native requestRedirectableRequest.prototype.setHeader = function (name, value) {this._options.headers[name] = value;this._currentRequest.setHeader(name, value);};// Clears a header value on the current native requestRedirectableRequest.prototype.removeHeader = function (name) {delete this._options.headers[name];this._currentRequest.removeHeader(name);};// Global timeout for all underlying requestsRedirectableRequest.prototype.setTimeout = function (msecs, callback) {if (callback) {this.once("timeout", callback);}if (this.socket) {startTimer(this, msecs);}else {var self = this;this._currentRequest.once("socket", function () {startTimer(self, msecs);});}this.once("response", clearTimer);this.once("error", clearTimer);return this;};function startTimer(request, msecs) {clearTimeout(request._timeout);request._timeout = setTimeout(function () {request.emit("timeout");}, msecs);}function clearTimer() {clearTimeout(this._timeout);}// Proxy all other public ClientRequest methods["abort", "flushHeaders", "getHeader","setNoDelay", "setSocketKeepAlive",].forEach(function (method) {RedirectableRequest.prototype[method] = function (a, b) {return this._currentRequest[method](a, b);};});// Proxy all public ClientRequest properties["aborted", "connection", "socket"].forEach(function (property) {Object.defineProperty(RedirectableRequest.prototype, property, {get: function () { return this._currentRequest[property]; },});});RedirectableRequest.prototype._sanitizeOptions = function (options) {// Ensure headers are always presentif (!options.headers) {options.headers = {};}// Since http.request treats host as an alias of hostname,// but the url module interprets host as hostname plus port,// eliminate the host property to avoid confusion.if (options.host) {// Use hostname if set, because it has precedenceif (!options.hostname) {options.hostname = options.host;}delete options.host;}// Complete the URL object when necessaryif (!options.pathname && options.path) {var searchPos = options.path.indexOf("?");if (searchPos < 0) {options.pathname = options.path;}else {options.pathname = options.path.substring(0, searchPos);options.search = options.path.substring(searchPos);}}};// Executes the next native request (initial or redirect)RedirectableRequest.prototype._performRequest = function () {// Load the native protocolvar protocol = this._options.protocol;var nativeProtocol = this._options.nativeProtocols[protocol];if (!nativeProtocol) {this.emit("error", new TypeError("Unsupported protocol " + protocol));return;}// If specified, use the agent corresponding to the protocol// (HTTP and HTTPS use different types of agents)if (this._options.agents) {var scheme = protocol.substr(0, protocol.length - 1);this._options.agent = this._options.agents[scheme];}// Create the native requestvar request = this._currentRequest =nativeProtocol.request(this._options, this._onNativeResponse);this._currentUrl = url.format(this._options);// Set up event handlersrequest._redirectable = this;for (var event in eventHandlers) {/* istanbul ignore else */if (event) {request.on(event, eventHandlers[event]);}}// End a redirected request// (The first request must be ended explicitly with RedirectableRequest#end)if (this._isRedirect) {// Write the request entity and end.var i = 0;var self = this;var buffers = this._requestBodyBuffers;(function writeNext(error) {// Only write if this request has not been redirected yet/* istanbul ignore else */if (request === self._currentRequest) {// Report any write errors/* istanbul ignore if */if (error) {self.emit("error", error);}// Write the next buffer if there are still leftelse if (i < buffers.length) {var buffer = buffers[i++];/* istanbul ignore else */if (!request.finished) {request.write(buffer.data, buffer.encoding, writeNext);}}// End the request if `end` has been called on uselse if (self._ended) {request.end();}}}());}};// Processes a response from the current native requestRedirectableRequest.prototype._processResponse = function (response) {// Store the redirected responsevar statusCode = response.statusCode;if (this._options.trackRedirects) {this._redirects.push({url: this._currentUrl,headers: response.headers,statusCode: statusCode,});}// RFC7231§6.4: The 3xx (Redirection) class of status code indicates// that further action needs to be taken by the user agent in order to// fulfill the request. If a Location header field is provided,// the user agent MAY automatically redirect its request to the URI// referenced by the Location field value,// even if the specific status code is not understood.var location = response.headers.location;if (location && this._options.followRedirects !== false &&statusCode >= 300 && statusCode < 400) {// Abort the current requestthis._currentRequest.removeAllListeners();this._currentRequest.on("error", noop);this._currentRequest.abort();// Discard the remainder of the response to avoid waiting for dataresponse.destroy();// RFC7231§6.4: A client SHOULD detect and intervene// in cyclical redirections (i.e., "infinite" redirection loops).if (++this._redirectCount > this._options.maxRedirects) {this.emit("error", new TooManyRedirectsError());return;}// RFC7231§6.4: Automatic redirection needs to done with// care for methods not known to be safe, […]// RFC7231§6.4.2–3: For historical reasons, a user agent MAY change// the request method from POST to GET for the subsequent request.if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||// RFC7231§6.4.4: The 303 (See Other) status code indicates that// the server is redirecting the user agent to a different resource […]// A user agent can perform a retrieval request targeting that URI// (a GET or HEAD request if using HTTP) […](statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {this._options.method = "GET";// Drop a possible entity and headers related to itthis._requestBodyBuffers = [];removeMatchingHeaders(/^content-/i, this._options.headers);}// Drop the Host header, as the redirect might lead to a different hostvar previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||url.parse(this._currentUrl).hostname;// Create the redirected requestvar redirectUrl = url.resolve(this._currentUrl, location);debug("redirecting to", redirectUrl);this._isRedirect = true;var redirectUrlParts = url.parse(redirectUrl);Object.assign(this._options, redirectUrlParts);// Drop the Authorization header if redirecting to another hostif (redirectUrlParts.hostname !== previousHostName) {removeMatchingHeaders(/^authorization$/i, this._options.headers);}// Evaluate the beforeRedirect callbackif (typeof this._options.beforeRedirect === "function") {var responseDetails = { headers: response.headers };try {this._options.beforeRedirect.call(null, this._options, responseDetails);}catch (err) {this.emit("error", err);return;}this._sanitizeOptions(this._options);}// Perform the redirected requesttry {this._performRequest();}catch (cause) {var error = new RedirectionError("Redirected request failed: " + cause.message);error.cause = cause;this.emit("error", error);}}else {// The response is not a redirect; return it as-isresponse.responseUrl = this._currentUrl;response.redirects = this._redirects;this.emit("response", response);// Clean upthis._requestBodyBuffers = [];}};// Wraps the key/value object of protocols with redirect functionalityfunction wrap(protocols) {// Default settingsvar exports = {maxRedirects: 21,maxBodyLength: 10 * 1024 * 1024,};// Wrap each protocolvar nativeProtocols = {};Object.keys(protocols).forEach(function (scheme) {var protocol = scheme + ":";var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);// Executes a request, following redirectsfunction request(input, options, callback) {// Parse parametersif (typeof input === "string") {var urlStr = input;try {input = urlToOptions(new URL(urlStr));}catch (err) {/* istanbul ignore next */input = url.parse(urlStr);}}else if (URL && (input instanceof URL)) {input = urlToOptions(input);}else {callback = options;options = input;input = { protocol: protocol };}if (typeof options === "function") {callback = options;options = null;}// Set defaultsoptions = Object.assign({maxRedirects: exports.maxRedirects,maxBodyLength: exports.maxBodyLength,}, input, options);options.nativeProtocols = nativeProtocols;assert.equal(options.protocol, protocol, "protocol mismatch");debug("options", options);return new RedirectableRequest(options, callback);}// Executes a GET request, following redirectsfunction get(input, options, callback) {var wrappedRequest = wrappedProtocol.request(input, options, callback);wrappedRequest.end();return wrappedRequest;}// Expose the properties on the wrapped protocolObject.defineProperties(wrappedProtocol, {request: { value: request, configurable: true, enumerable: true, writable: true },get: { value: get, configurable: true, enumerable: true, writable: true },});});return exports;}/* istanbul ignore next */function noop() { /* empty */ }// from https://github.com/nodejs/node/blob/master/lib/internal/url.jsfunction urlToOptions(urlObject) {var options = {protocol: urlObject.protocol,hostname: urlObject.hostname.startsWith("[") ?/* istanbul ignore next */urlObject.hostname.slice(1, -1) :urlObject.hostname,hash: urlObject.hash,search: urlObject.search,pathname: urlObject.pathname,path: urlObject.pathname + urlObject.search,href: urlObject.href,};if (urlObject.port !== "") {options.port = Number(urlObject.port);}return options;}function removeMatchingHeaders(regex, headers) {var lastValue;for (var header in headers) {if (regex.test(header)) {lastValue = headers[header];delete headers[header];}}return lastValue;}function createErrorType(code, defaultMessage) {function CustomError(message) {Error.captureStackTrace(this, this.constructor);this.message = message || defaultMessage;}CustomError.prototype = new Error();CustomError.prototype.constructor = CustomError;CustomError.prototype.name = "Error [" + code + "]";CustomError.prototype.code = code;return CustomError;}// Exportsmodule.exports = wrap({ http: http, https: https });module.exports.wrap = wrap;
module.exports = require("./").https;
module.exports = require("./").http;
var debug;try {/* eslint global-require: off */debug = require("debug")("follow-redirects");}catch (error) {debug = function () { /* */ };}module.exports = debug;
## Follow RedirectsDrop-in replacement for Node's `http` and `https` modules that automatically follows redirects.[](https://www.npmjs.com/package/follow-redirects)[](https://travis-ci.com/follow-redirects/follow-redirects)[](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)[](https://www.npmjs.com/package/follow-redirects)[](https://github.com/sponsors/RubenVerborgh)`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback)methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback)modules, with the exception that they will seamlessly follow redirects.```javascriptconst { http, https } = require('follow-redirects');http.get('http://bit.ly/900913', response => {response.on('data', chunk => {console.log(chunk);});}).on('error', err => {console.error(err);});```You can inspect the final redirected URL through the `responseUrl` property on the `response`.If no redirection happened, `responseUrl` is the original request URL.```javascriptconst request = https.request({host: 'bitly.com',path: '/UHfDGO',}, response => {console.log(response.responseUrl);// 'http://duckduckgo.com/robots.txt'});request.end();```## Options### Global optionsGlobal options are set directly on the `follow-redirects` module:```javascriptconst followRedirects = require('follow-redirects');followRedirects.maxRedirects = 10;followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB```The following global options are supported:- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.### Per-request optionsPer-request options are set by passing an `options` object:```javascriptconst url = require('url');const { http, https } = require('follow-redirects');const options = url.parse('http://bit.ly/900913');options.maxRedirects = 10;options.beforeRedirect = (options, { headers }) => {// Use this to adjust the request options upon redirecting,// to inspect the latest response headers,// or to cancel the request by throwing an errorif (options.hostname === "example.com") {options.auth = "user:password";}};http.request(options);```In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback),the following per-request options are supported:- `followRedirects` (default: `true`) – whether redirects should be followed.- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error.- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }`- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object.### Advanced usageBy default, `follow-redirects` will use the Node.js default implementationsof [`http`](https://nodejs.org/api/http.html)and [`https`](https://nodejs.org/api/https.html).To enable features such as caching and/or intermediate request tracking,you might instead want to wrap `follow-redirects` around custom protocol implementations:```javascriptconst { http, https } = require('follow-redirects').wrap({http: require('your-custom-http'),https: require('your-custom-https'),});```Such custom protocols only need an implementation of the `request` method.## Browser UsageDue to the way the browser works,the `http` and `https` browser equivalents perform redirects by default.By requiring `follow-redirects` this way:```javascriptconst http = require('follow-redirects/http');const https = require('follow-redirects/https');```you can easily tell webpack and friends to replace`follow-redirect` by the built-in versions:```json{"follow-redirects/http" : "http","follow-redirects/https" : "https"}```## ContributingPull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompaniedby tests. You can run the test suite locally with a simple `npm test` command.## Debug Logging`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on loggingset the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the testsuite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well.## Authors- [Ruben Verborgh](https://ruben.verborgh.org/)- [Olivier Lalonde](mailto:olalonde@gmail.com)- [James Talmage](mailto:james@talmage.io)## License[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
Copyright 2014–present Olivier Lalonde <olalonde@gmail.com>, James Talmage <james@talmage.io>, Ruben VerborghPermission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software is furnished to doso, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF ORIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{"version":3,"sources":["umd/eventemitter3.js"],"names":["f","exports","module","define","amd","window","global","self","this","EventEmitter3","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","has","Object","prototype","hasOwnProperty","prefix","Events","EE","fn","context","once","addListener","emitter","event","TypeError","listener","evt","_events","push","_eventsCount","clearEvent","EventEmitter","create","__proto__","eventNames","events","name","names","slice","getOwnPropertySymbols","concat","listeners","handlers","l","ee","Array","listenerCount","emit","a1","a2","a3","a4","a5","args","len","arguments","removeListener","undefined","apply","j","on","removeAllListeners","off","prefixed"],"mappings":"CAAA,SAAUA,GAAuB,iBAAVC,SAAoC,oBAATC,OAAsBA,OAAOD,QAAQD,IAA4B,mBAATG,QAAqBA,OAAOC,IAAKD,OAAO,GAAGH,IAAiC,oBAATK,OAAwBA,OAA+B,oBAATC,OAAwBA,OAA6B,oBAAPC,KAAsBA,KAAYC,MAAOC,cAAgBT,IAAlU,CAAyU,WAAqC,OAAmB,SAASU,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEf,GAAG,IAAIY,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIC,EAAE,mBAAmBC,SAASA,QAAQ,IAAIjB,GAAGgB,EAAE,OAAOA,EAAED,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACd,QAAQ,IAAIU,EAAEI,GAAG,GAAGQ,KAAKD,EAAErB,QAAQ,SAASS,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAErB,QAAQS,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGd,QAAQ,IAAI,IAAIiB,EAAE,mBAAmBD,SAASA,QAAQF,EAAE,EAAEA,EAAEF,EAAEW,OAAOT,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACW,EAAE,CAAC,SAASR,EAAQf,EAAOD,gBAG71B,IAAIyB,EAAMC,OAAOC,UAAUC,eACvBC,EAAS,IASb,SAASC,KA4BT,SAASC,EAAGC,EAAIC,EAASC,GACvB3B,KAAKyB,GAAKA,EACVzB,KAAK0B,QAAUA,EACf1B,KAAK2B,KAAOA,IAAQ,EActB,SAASC,EAAYC,EAASC,EAAOL,EAAIC,EAASC,GAChD,GAAkB,mBAAPF,EACT,MAAM,IAAIM,UAAU,mCAGtB,IAAIC,EAAW,IAAIR,EAAGC,EAAIC,GAAWG,EAASF,GAC1CM,EAAMX,EAASA,EAASQ,EAAQA,EAMpC,OAJKD,EAAQK,QAAQD,GACXJ,EAAQK,QAAQD,GAAKR,GAC1BI,EAAQK,QAAQD,GAAO,CAACJ,EAAQK,QAAQD,GAAMD,GADhBH,EAAQK,QAAQD,GAAKE,KAAKH,IADlCH,EAAQK,QAAQD,GAAOD,EAAUH,EAAQO,gBAI7DP,EAUT,SAASQ,EAAWR,EAASI,GACI,KAAzBJ,EAAQO,aAAoBP,EAAQK,QAAU,IAAIX,SAC5CM,EAAQK,QAAQD,GAU9B,SAASK,IACPtC,KAAKkC,QAAU,IAAIX,EACnBvB,KAAKoC,aAAe,EAxElBjB,OAAOoB,SACThB,EAAOH,UAAYD,OAAOoB,OAAO,OAM5B,IAAIhB,GAASiB,YAAWlB,GAAS,IA2ExCgB,EAAalB,UAAUqB,WAAa,WAClC,IACIC,EACAC,EAFAC,EAAQ,GAIZ,GAA0B,IAAtB5C,KAAKoC,aAAoB,OAAOQ,EAEpC,IAAKD,KAASD,EAAS1C,KAAKkC,QACtBhB,EAAIH,KAAK2B,EAAQC,IAAOC,EAAMT,KAAKb,EAASqB,EAAKE,MAAM,GAAKF,GAGlE,OAAIxB,OAAO2B,sBACFF,EAAMG,OAAO5B,OAAO2B,sBAAsBJ,IAG5CE,GAUTN,EAAalB,UAAU4B,UAAY,SAAmBlB,GACpD,IAAIG,EAAMX,EAASA,EAASQ,EAAQA,EAChCmB,EAAWjD,KAAKkC,QAAQD,GAE5B,IAAKgB,EAAU,MAAO,GACtB,GAAIA,EAASxB,GAAI,MAAO,CAACwB,EAASxB,IAElC,IAAK,IAAIlB,EAAI,EAAG2C,EAAID,EAASjC,OAAQmC,EAAK,IAAIC,MAAMF,GAAI3C,EAAI2C,EAAG3C,IAC7D4C,EAAG5C,GAAK0C,EAAS1C,GAAGkB,GAGtB,OAAO0B,GAUTb,EAAalB,UAAUiC,cAAgB,SAAuBvB,GAC5D,IAAIG,EAAMX,EAASA,EAASQ,EAAQA,EAChCkB,EAAYhD,KAAKkC,QAAQD,GAE7B,OAAKe,EACDA,EAAUvB,GAAW,EAClBuB,EAAUhC,OAFM,GAYzBsB,EAAalB,UAAUkC,KAAO,SAAcxB,EAAOyB,EAAIC,EAAIC,EAAIC,EAAIC,GACjE,IAAI1B,EAAMX,EAASA,EAASQ,EAAQA,EAEpC,IAAK9B,KAAKkC,QAAQD,GAAM,OAAO,EAE/B,IAEI2B,EAFAZ,EAAYhD,KAAKkC,QAAQD,GACzB4B,EAAMC,UAAU9C,OAIpB,GAAIgC,EAAUvB,GAAI,CAGhB,OAFIuB,EAAUrB,MAAM3B,KAAK+D,eAAejC,EAAOkB,EAAUvB,QAAIuC,GAAW,GAEhEH,GACN,KAAK,EAAG,OAAOb,EAAUvB,GAAGV,KAAKiC,EAAUtB,UAAU,EACrD,KAAK,EAAG,OAAOsB,EAAUvB,GAAGV,KAAKiC,EAAUtB,QAAS6B,IAAK,EACzD,KAAK,EAAG,OAAOP,EAAUvB,GAAGV,KAAKiC,EAAUtB,QAAS6B,EAAIC,IAAK,EAC7D,KAAK,EAAG,OAAOR,EAAUvB,GAAGV,KAAKiC,EAAUtB,QAAS6B,EAAIC,EAAIC,IAAK,EACjE,KAAK,EAAG,OAAOT,EAAUvB,GAAGV,KAAKiC,EAAUtB,QAAS6B,EAAIC,EAAIC,EAAIC,IAAK,EACrE,KAAK,EAAG,OAAOV,EAAUvB,GAAGV,KAAKiC,EAAUtB,QAAS6B,EAAIC,EAAIC,EAAIC,EAAIC,IAAK,EAG3E,IAAKpD,EAAI,EAAGqD,EAAO,IAAIR,MAAMS,EAAK,GAAItD,EAAIsD,EAAKtD,IAC7CqD,EAAKrD,EAAI,GAAKuD,UAAUvD,GAG1ByC,EAAUvB,GAAGwC,MAAMjB,EAAUtB,QAASkC,QAKtC,IAHA,IACIM,EADAlD,EAASgC,EAAUhC,OAGlBT,EAAI,EAAGA,EAAIS,EAAQT,IAGtB,OAFIyC,EAAUzC,GAAGoB,MAAM3B,KAAK+D,eAAejC,EAAOkB,EAAUzC,GAAGkB,QAAIuC,GAAW,GAEtEH,GACN,KAAK,EAAGb,EAAUzC,GAAGkB,GAAGV,KAAKiC,EAAUzC,GAAGmB,SAAU,MACpD,KAAK,EAAGsB,EAAUzC,GAAGkB,GAAGV,KAAKiC,EAAUzC,GAAGmB,QAAS6B,GAAK,MACxD,KAAK,EAAGP,EAAUzC,GAAGkB,GAAGV,KAAKiC,EAAUzC,GAAGmB,QAAS6B,EAAIC,GAAK,MAC5D,KAAK,EAAGR,EAAUzC,GAAGkB,GAAGV,KAAKiC,EAAUzC,GAAGmB,QAAS6B,EAAIC,EAAIC,GAAK,MAChE,QACE,IAAKG,EAAM,IAAKM,EAAI,EAAGN,EAAO,IAAIR,MAAMS,EAAK,GAAIK,EAAIL,EAAKK,IACxDN,EAAKM,EAAI,GAAKJ,UAAUI,GAG1BlB,EAAUzC,GAAGkB,GAAGwC,MAAMjB,EAAUzC,GAAGmB,QAASkC,GAKpD,OAAO,GAYTtB,EAAalB,UAAU+C,GAAK,SAAYrC,EAAOL,EAAIC,GACjD,OAAOE,EAAY5B,KAAM8B,EAAOL,EAAIC,GAAS,IAY/CY,EAAalB,UAAUO,KAAO,SAAcG,EAAOL,EAAIC,GACrD,OAAOE,EAAY5B,KAAM8B,EAAOL,EAAIC,GAAS,IAa/CY,EAAalB,UAAU2C,eAAiB,SAAwBjC,EAAOL,EAAIC,EAASC,GAClF,IAAIM,EAAMX,EAASA,EAASQ,EAAQA,EAEpC,IAAK9B,KAAKkC,QAAQD,GAAM,OAAOjC,KAC/B,IAAKyB,EAEH,OADAY,EAAWrC,KAAMiC,GACVjC,KAGT,IAAIgD,EAAYhD,KAAKkC,QAAQD,GAE7B,GAAIe,EAAUvB,GAEVuB,EAAUvB,KAAOA,GACfE,IAAQqB,EAAUrB,MAClBD,GAAWsB,EAAUtB,UAAYA,GAEnCW,EAAWrC,KAAMiC,OAEd,CACL,IAAK,IAAI1B,EAAI,EAAGmC,EAAS,GAAI1B,EAASgC,EAAUhC,OAAQT,EAAIS,EAAQT,KAEhEyC,EAAUzC,GAAGkB,KAAOA,GACnBE,IAASqB,EAAUzC,GAAGoB,MACtBD,GAAWsB,EAAUzC,GAAGmB,UAAYA,IAErCgB,EAAOP,KAAKa,EAAUzC,IAOtBmC,EAAO1B,OAAQhB,KAAKkC,QAAQD,GAAyB,IAAlBS,EAAO1B,OAAe0B,EAAO,GAAKA,EACpEL,EAAWrC,KAAMiC,GAGxB,OAAOjC,MAUTsC,EAAalB,UAAUgD,mBAAqB,SAA4BtC,GACtE,IAAIG,EAUJ,OARIH,GACFG,EAAMX,EAASA,EAASQ,EAAQA,EAC5B9B,KAAKkC,QAAQD,IAAMI,EAAWrC,KAAMiC,KAExCjC,KAAKkC,QAAU,IAAIX,EACnBvB,KAAKoC,aAAe,GAGfpC,MAMTsC,EAAalB,UAAUiD,IAAM/B,EAAalB,UAAU2C,eACpDzB,EAAalB,UAAUQ,YAAcU,EAAalB,UAAU+C,GAK5D7B,EAAagC,SAAWhD,EAKxBgB,EAAaA,aAAeA,OAKxB,IAAuB5C,IACzBA,EAAOD,QAAU6C,IAGjB,KAAK,GAAG,CAAC,GAlV0W,CAkVtW"}
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EventEmitter3=e()}(function(){return function i(s,f,c){function u(t,e){if(!f[t]){if(!s[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(a)return a(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=f[t]={exports:{}};s[t][0].call(o.exports,function(e){return u(s[t][1][e]||e)},o,o.exports,i,s,f,c)}return f[t].exports}for(var a="function"==typeof require&&require,e=0;e<c.length;e++)u(c[e]);return u}({1:[function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,v="~";function o(){}function f(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var i=new f(n,r||e,o),s=v?v+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],i]:e._events[s].push(i):(e._events[s]=i,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function s(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(v=!1)),s.prototype.eventNames=function(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)r.call(e,t)&&n.push(v?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=v?v+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,i=new Array(o);r<o;r++)i[r]=n[r].fn;return i},s.prototype.listenerCount=function(e){var t=v?v+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,r,o,i){var s=v?v+e:e;if(!this._events[s])return!1;var f,c=this._events[s],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,o),!0;case 6:return c.fn.call(c.context,t,n,r,o,i),!0}for(p=1,f=new Array(u-1);p<u;p++)f[p-1]=arguments[p];c.fn.apply(c.context,f)}else for(var a,l=c.length,p=0;p<l;p++)switch(c[p].once&&this.removeListener(e,c[p].fn,void 0,!0),u){case 1:c[p].fn.call(c[p].context);break;case 2:c[p].fn.call(c[p].context,t);break;case 3:c[p].fn.call(c[p].context,t,n);break;case 4:c[p].fn.call(c[p].context,t,n,r);break;default:if(!f)for(a=1,f=new Array(u-1);a<u;a++)f[a-1]=arguments[a];c[p].fn.apply(c[p].context,f)}return!0},s.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,n,r){var o=v?v+e:e;if(!this._events[o])return this;if(!t)return u(this,o),this;var i=this._events[o];if(i.fn)i.fn!==t||r&&!i.once||n&&i.context!==n||u(this,o);else{for(var s=0,f=[],c=i.length;s<c;s++)(i[s].fn!==t||r&&!i[s].once||n&&i[s].context!==n)&&f.push(i[s]);f.length?this._events[o]=1===f.length?f[0]:f:u(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=v?v+e:e,this._events[t]&&u(this,t)):(this._events=new o,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=v,s.EventEmitter=s,void 0!==t&&(t.exports=s)},{}]},{},[1])(1)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.EventEmitter3 = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){'use strict';var has = Object.prototype.hasOwnProperty, prefix = '~';/*** Constructor to create a storage for our `EE` objects.* An `Events` instance is a plain object whose properties are event names.** @constructor* @private*/function Events() {}//// We try to not inherit from `Object.prototype`. In some engines creating an// instance in this way is faster than calling `Object.create(null)` directly.// If `Object.create(null)` is not supported we prefix the event names with a// character to make sure that the built-in object properties are not// overridden or used as an attack vector.//if (Object.create) {Events.prototype = Object.create(null);//// This hack is needed because the `__proto__` property is still inherited in// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.//if (!new Events().__proto__) prefix = false;}/*** Representation of a single event listener.** @param {Function} fn The listener function.* @param {*} context The context to invoke the listener with.* @param {Boolean} [once=false] Specify if the listener is a one-time listener.* @constructor* @private*/function EE(fn, context, once) {this.fn = fn;this.context = context;this.once = once || false;}/*** Add a listener for a given event.** @param {EventEmitter} emitter Reference to the `EventEmitter` instance.* @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} context The context to invoke the listener with.* @param {Boolean} once Specify if the listener is a one-time listener.* @returns {EventEmitter}* @private*/function addListener(emitter, event, fn, context, once) {if (typeof fn !== 'function') {throw new TypeError('The listener must be a function');}var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];return emitter;}/*** Clear event by name.** @param {EventEmitter} emitter Reference to the `EventEmitter` instance.* @param {(String|Symbol)} evt The Event name.* @private*/function clearEvent(emitter, evt) {if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];}/*** Minimal `EventEmitter` interface that is molded against the Node.js* `EventEmitter` interface.** @constructor* @public*/function EventEmitter() {this._events = new Events();this._eventsCount = 0;}/*** Return an array listing the events for which the emitter has registered* listeners.** @returns {Array}* @public*/EventEmitter.prototype.eventNames = function eventNames() {var names = [], events, name;if (this._eventsCount === 0) return names;for (name in (events = this._events)) {if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);}if (Object.getOwnPropertySymbols) {return names.concat(Object.getOwnPropertySymbols(events));}return names;};/*** Return the listeners registered for a given event.** @param {(String|Symbol)} event The event name.* @returns {Array} The registered listeners.* @public*/EventEmitter.prototype.listeners = function listeners(event) {var evt = prefix ? prefix + event : event, handlers = this._events[evt];if (!handlers) return [];if (handlers.fn) return [handlers.fn];for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {ee[i] = handlers[i].fn;}return ee;};/*** Return the number of listeners listening to a given event.** @param {(String|Symbol)} event The event name.* @returns {Number} The number of listeners.* @public*/EventEmitter.prototype.listenerCount = function listenerCount(event) {var evt = prefix ? prefix + event : event, listeners = this._events[evt];if (!listeners) return 0;if (listeners.fn) return 1;return listeners.length;};/*** Calls each of the listeners registered for a given event.** @param {(String|Symbol)} event The event name.* @returns {Boolean} `true` if the event had listeners, else `false`.* @public*/EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {var evt = prefix ? prefix + event : event;if (!this._events[evt]) return false;var listeners = this._events[evt], len = arguments.length, args, i;if (listeners.fn) {if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);switch (len) {case 1: return listeners.fn.call(listeners.context), true;case 2: return listeners.fn.call(listeners.context, a1), true;case 3: return listeners.fn.call(listeners.context, a1, a2), true;case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;}for (i = 1, args = new Array(len -1); i < len; i++) {args[i - 1] = arguments[i];}listeners.fn.apply(listeners.context, args);} else {var length = listeners.length, j;for (i = 0; i < length; i++) {if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);switch (len) {case 1: listeners[i].fn.call(listeners[i].context); break;case 2: listeners[i].fn.call(listeners[i].context, a1); break;case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;default:if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {args[j - 1] = arguments[j];}listeners[i].fn.apply(listeners[i].context, args);}}}return true;};/*** Add a listener for a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} [context=this] The context to invoke the listener with.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.on = function on(event, fn, context) {return addListener(this, event, fn, context, false);};/*** Add a one-time listener for a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} [context=this] The context to invoke the listener with.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.once = function once(event, fn, context) {return addListener(this, event, fn, context, true);};/*** Remove the listeners of a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn Only remove the listeners that match this function.* @param {*} context Only remove the listeners that have this context.* @param {Boolean} once Only remove one-time listeners.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {var evt = prefix ? prefix + event : event;if (!this._events[evt]) return this;if (!fn) {clearEvent(this, evt);return this;}var listeners = this._events[evt];if (listeners.fn) {if (listeners.fn === fn &&(!once || listeners.once) &&(!context || listeners.context === context)) {clearEvent(this, evt);}} else {for (var i = 0, events = [], length = listeners.length; i < length; i++) {if (listeners[i].fn !== fn ||(once && !listeners[i].once) ||(context && listeners[i].context !== context)) {events.push(listeners[i]);}}//// Reset the array, or remove it completely if we have no more listeners.//if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);}return this;};/*** Remove all listeners, or those of the specified event.** @param {(String|Symbol)} [event] The event name.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {var evt;if (event) {evt = prefix ? prefix + event : event;if (this._events[evt]) clearEvent(this, evt);} else {this._events = new Events();this._eventsCount = 0;}return this;};//// Alias methods names because people roll like that.//EventEmitter.prototype.off = EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener = EventEmitter.prototype.on;//// Expose the prefix.//EventEmitter.prefixed = prefix;//// Allow `EventEmitter` to be imported as module namespace.//EventEmitter.EventEmitter = EventEmitter;//// Expose the module.//if ('undefined' !== typeof module) {module.exports = EventEmitter;}},{}]},{},[1])(1)});
{"_from": "eventemitter3@^4.0.0","_id": "eventemitter3@4.0.7","_inBundle": false,"_integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==","_location": "/eventemitter3","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "eventemitter3@^4.0.0","name": "eventemitter3","escapedName": "eventemitter3","rawSpec": "^4.0.0","saveSpec": null,"fetchSpec": "^4.0.0"},"_requiredBy": ["/http-proxy"],"_resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz","_shasum": "2de9b68f6528d5644ef5c59526a1b4a07306169f","_spec": "eventemitter3@^4.0.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-proxy","author": {"name": "Arnout Kazemier"},"bugs": {"url": "https://github.com/primus/eventemitter3/issues"},"bundleDependencies": false,"deprecated": false,"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface.","devDependencies": {"assume": "^2.2.0","browserify": "^16.5.0","mocha": "^8.0.1","nyc": "^15.1.0","pre-commit": "^1.2.0","sauce-browsers": "^2.0.0","sauce-test": "^1.3.3","uglify-js": "^3.9.0"},"files": ["index.js","index.d.ts","umd"],"homepage": "https://github.com/primus/eventemitter3#readme","keywords": ["EventEmitter","EventEmitter2","EventEmitter3","Events","addEventListener","addListener","emit","emits","emitter","event","once","pub/sub","publish","reactor","subscribe"],"license": "MIT","main": "index.js","name": "eventemitter3","repository": {"type": "git","url": "git://github.com/primus/eventemitter3.git"},"scripts": {"benchmark": "find benchmarks/run -name '*.js' -exec benchmarks/start.sh {} \\;","browserify": "rm -rf umd && mkdir umd && browserify index.js -s EventEmitter3 -o umd/eventemitter3.js","minify": "uglifyjs umd/eventemitter3.js --source-map -cm -o umd/eventemitter3.min.js","prepublishOnly": "npm run browserify && npm run minify","test": "nyc --reporter=html --reporter=text mocha test/test.js","test-browser": "node test/browser.js"},"typings": "index.d.ts","version": "4.0.7"}
'use strict';var has = Object.prototype.hasOwnProperty, prefix = '~';/*** Constructor to create a storage for our `EE` objects.* An `Events` instance is a plain object whose properties are event names.** @constructor* @private*/function Events() {}//// We try to not inherit from `Object.prototype`. In some engines creating an// instance in this way is faster than calling `Object.create(null)` directly.// If `Object.create(null)` is not supported we prefix the event names with a// character to make sure that the built-in object properties are not// overridden or used as an attack vector.//if (Object.create) {Events.prototype = Object.create(null);//// This hack is needed because the `__proto__` property is still inherited in// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.//if (!new Events().__proto__) prefix = false;}/*** Representation of a single event listener.** @param {Function} fn The listener function.* @param {*} context The context to invoke the listener with.* @param {Boolean} [once=false] Specify if the listener is a one-time listener.* @constructor* @private*/function EE(fn, context, once) {this.fn = fn;this.context = context;this.once = once || false;}/*** Add a listener for a given event.** @param {EventEmitter} emitter Reference to the `EventEmitter` instance.* @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} context The context to invoke the listener with.* @param {Boolean} once Specify if the listener is a one-time listener.* @returns {EventEmitter}* @private*/function addListener(emitter, event, fn, context, once) {if (typeof fn !== 'function') {throw new TypeError('The listener must be a function');}var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);else emitter._events[evt] = [emitter._events[evt], listener];return emitter;}/*** Clear event by name.** @param {EventEmitter} emitter Reference to the `EventEmitter` instance.* @param {(String|Symbol)} evt The Event name.* @private*/function clearEvent(emitter, evt) {if (--emitter._eventsCount === 0) emitter._events = new Events();else delete emitter._events[evt];}/*** Minimal `EventEmitter` interface that is molded against the Node.js* `EventEmitter` interface.** @constructor* @public*/function EventEmitter() {this._events = new Events();this._eventsCount = 0;}/*** Return an array listing the events for which the emitter has registered* listeners.** @returns {Array}* @public*/EventEmitter.prototype.eventNames = function eventNames() {var names = [], events, name;if (this._eventsCount === 0) return names;for (name in (events = this._events)) {if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);}if (Object.getOwnPropertySymbols) {return names.concat(Object.getOwnPropertySymbols(events));}return names;};/*** Return the listeners registered for a given event.** @param {(String|Symbol)} event The event name.* @returns {Array} The registered listeners.* @public*/EventEmitter.prototype.listeners = function listeners(event) {var evt = prefix ? prefix + event : event, handlers = this._events[evt];if (!handlers) return [];if (handlers.fn) return [handlers.fn];for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {ee[i] = handlers[i].fn;}return ee;};/*** Return the number of listeners listening to a given event.** @param {(String|Symbol)} event The event name.* @returns {Number} The number of listeners.* @public*/EventEmitter.prototype.listenerCount = function listenerCount(event) {var evt = prefix ? prefix + event : event, listeners = this._events[evt];if (!listeners) return 0;if (listeners.fn) return 1;return listeners.length;};/*** Calls each of the listeners registered for a given event.** @param {(String|Symbol)} event The event name.* @returns {Boolean} `true` if the event had listeners, else `false`.* @public*/EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {var evt = prefix ? prefix + event : event;if (!this._events[evt]) return false;var listeners = this._events[evt], len = arguments.length, args, i;if (listeners.fn) {if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);switch (len) {case 1: return listeners.fn.call(listeners.context), true;case 2: return listeners.fn.call(listeners.context, a1), true;case 3: return listeners.fn.call(listeners.context, a1, a2), true;case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;}for (i = 1, args = new Array(len -1); i < len; i++) {args[i - 1] = arguments[i];}listeners.fn.apply(listeners.context, args);} else {var length = listeners.length, j;for (i = 0; i < length; i++) {if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);switch (len) {case 1: listeners[i].fn.call(listeners[i].context); break;case 2: listeners[i].fn.call(listeners[i].context, a1); break;case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;default:if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {args[j - 1] = arguments[j];}listeners[i].fn.apply(listeners[i].context, args);}}}return true;};/*** Add a listener for a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} [context=this] The context to invoke the listener with.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.on = function on(event, fn, context) {return addListener(this, event, fn, context, false);};/*** Add a one-time listener for a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn The listener function.* @param {*} [context=this] The context to invoke the listener with.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.once = function once(event, fn, context) {return addListener(this, event, fn, context, true);};/*** Remove the listeners of a given event.** @param {(String|Symbol)} event The event name.* @param {Function} fn Only remove the listeners that match this function.* @param {*} context Only remove the listeners that have this context.* @param {Boolean} once Only remove one-time listeners.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {var evt = prefix ? prefix + event : event;if (!this._events[evt]) return this;if (!fn) {clearEvent(this, evt);return this;}var listeners = this._events[evt];if (listeners.fn) {if (listeners.fn === fn &&(!once || listeners.once) &&(!context || listeners.context === context)) {clearEvent(this, evt);}} else {for (var i = 0, events = [], length = listeners.length; i < length; i++) {if (listeners[i].fn !== fn ||(once && !listeners[i].once) ||(context && listeners[i].context !== context)) {events.push(listeners[i]);}}//// Reset the array, or remove it completely if we have no more listeners.//if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;else clearEvent(this, evt);}return this;};/*** Remove all listeners, or those of the specified event.** @param {(String|Symbol)} [event] The event name.* @returns {EventEmitter} `this`.* @public*/EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {var evt;if (event) {evt = prefix ? prefix + event : event;if (this._events[evt]) clearEvent(this, evt);} else {this._events = new Events();this._eventsCount = 0;}return this;};//// Alias methods names because people roll like that.//EventEmitter.prototype.off = EventEmitter.prototype.removeListener;EventEmitter.prototype.addListener = EventEmitter.prototype.on;//// Expose the prefix.//EventEmitter.prefixed = prefix;//// Allow `EventEmitter` to be imported as module namespace.//EventEmitter.EventEmitter = EventEmitter;//// Expose the module.//if ('undefined' !== typeof module) {module.exports = EventEmitter;}
/*** Minimal `EventEmitter` interface that is molded against the Node.js* `EventEmitter` interface.*/declare class EventEmitter<EventTypes extends EventEmitter.ValidEventTypes = string | symbol,Context extends any = any> {static prefixed: string | boolean;/*** Return an array listing the events for which the emitter has registered* listeners.*/eventNames(): Array<EventEmitter.EventNames<EventTypes>>;/*** Return the listeners registered for a given event.*/listeners<T extends EventEmitter.EventNames<EventTypes>>(event: T): Array<EventEmitter.EventListener<EventTypes, T>>;/*** Return the number of listeners listening to a given event.*/listenerCount(event: EventEmitter.EventNames<EventTypes>): number;/*** Calls each of the listeners registered for a given event.*/emit<T extends EventEmitter.EventNames<EventTypes>>(event: T,...args: EventEmitter.EventArgs<EventTypes, T>): boolean;/*** Add a listener for a given event.*/on<T extends EventEmitter.EventNames<EventTypes>>(event: T,fn: EventEmitter.EventListener<EventTypes, T>,context?: Context): this;addListener<T extends EventEmitter.EventNames<EventTypes>>(event: T,fn: EventEmitter.EventListener<EventTypes, T>,context?: Context): this;/*** Add a one-time listener for a given event.*/once<T extends EventEmitter.EventNames<EventTypes>>(event: T,fn: EventEmitter.EventListener<EventTypes, T>,context?: Context): this;/*** Remove the listeners of a given event.*/removeListener<T extends EventEmitter.EventNames<EventTypes>>(event: T,fn?: EventEmitter.EventListener<EventTypes, T>,context?: Context,once?: boolean): this;off<T extends EventEmitter.EventNames<EventTypes>>(event: T,fn?: EventEmitter.EventListener<EventTypes, T>,context?: Context,once?: boolean): this;/*** Remove all listeners, or those of the specified event.*/removeAllListeners(event?: EventEmitter.EventNames<EventTypes>): this;}declare namespace EventEmitter {export interface ListenerFn<Args extends any[] = any[]> {(...args: Args): void;}export interface EventEmitterStatic {new <EventTypes extends ValidEventTypes = string | symbol,Context = any>(): EventEmitter<EventTypes, Context>;}/*** `object` should be in either of the following forms:* ```* interface EventTypes {* 'event-with-parameters': any[]* 'event-with-example-handler': (...args: any[]) => void* }* ```*/export type ValidEventTypes = string | symbol | object;export type EventNames<T extends ValidEventTypes> = T extends string | symbol? T: keyof T;export type ArgumentMap<T extends object> = {[K in keyof T]: T[K] extends (...args: any[]) => void? Parameters<T[K]>: T[K] extends any[]? T[K]: any[];};export type EventListener<T extends ValidEventTypes,K extends EventNames<T>> = T extends string | symbol? (...args: any[]) => void: (...args: ArgumentMap<Exclude<T, string | symbol>>[Extract<K, keyof T>]) => void;export type EventArgs<T extends ValidEventTypes,K extends EventNames<T>> = Parameters<EventListener<T, K>>;export const EventEmitter: EventEmitterStatic;}export = EventEmitter;
# EventEmitter3[](https://www.npmjs.com/package/eventemitter3)[](https://travis-ci.org/primus/eventemitter3)[](https://david-dm.org/primus/eventemitter3)[](https://coveralls.io/r/primus/eventemitter3?branch=master)[](https://webchat.freenode.net/?channels=primus)[](https://saucelabs.com/u/eventemitter3)EventEmitter3 is a high performance EventEmitter. It has been micro-optimizedfor various of code paths making this, one of, if not the fastest EventEmitteravailable for Node.js and browsers. The module is API compatible with theEventEmitter that ships by default with Node.js but there are some slightdifferences:- Domain support has been removed.- We do not `throw` an error when you emit an `error` event and nobody islistening.- The `newListener` and `removeListener` events have been removed as theyare useful only in some uncommon use-cases.- The `setMaxListeners`, `getMaxListeners`, `prependListener` and`prependOnceListener` methods are not available.- Support for custom context for events so there is no need to use `fn.bind`.- The `removeListener` method removes all matching listeners, not only thefirst.It's a drop in replacement for existing EventEmitters, but just faster. Freeperformance, who wouldn't want that? The EventEmitter is written in EcmaScript 3so it will work in the oldest browsers and node versions that you need tosupport.## Installation```bash$ npm install --save eventemitter3```## CDNRecommended CDN:```texthttps://unpkg.com/eventemitter3@latest/umd/eventemitter3.min.js```## UsageAfter installation the only thing you need to do is require the module:```jsvar EventEmitter = require('eventemitter3');```And you're ready to create your own EventEmitter instances. For the APIdocumentation, please follow the official Node.js documentation:http://nodejs.org/api/events.html### Contextual emitsWe've upgraded the API of the `EventEmitter.on`, `EventEmitter.once` and`EventEmitter.removeListener` to accept an extra argument which is the `context`or `this` value that should be set for the emitted events. This means you nolonger have the overhead of an event that required `fn.bind` in order to get acustom `this` value.```jsvar EE = new EventEmitter(), context = { foo: 'bar' };function emitted() {console.log(this === context); // true}EE.once('event-name', emitted, context);EE.on('another-event', emitted, context);EE.removeListener('another-event', emitted, context);```### Tests and benchmarksThis module is well tested. You can run:- `npm test` to run the tests under Node.js.- `npm run test-browser` to run the tests in real browsers via Sauce Labs.We also have a set of benchmarks to compare EventEmitter3 with some availablealternatives. To run the benchmarks run `npm run benchmark`.Tests and benchmarks are not included in the npm package. If you want to playwith them you have to clone the GitHub repository.Note that you will have to run an additional `npm i` in the benchmarks folderbefore `npm run benchmark`.## License[MIT](LICENSE)
The MIT License (MIT)Copyright (c) 2014 Arnout KazemierPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
#!/bin/bashrm -rf teambox-iconsgit clone --depth=1 git@github.com:teambox/Free-file-icons.git teambox-icons
var fs = require('fs'),path = require('path');var IMG_SIZE = 16;var iconDir = path.resolve(__dirname, '../teambox-icons/' + IMG_SIZE + 'px');var icons = {};fs.readdirSync(iconDir).forEach(function (filename) {var tuple = filename.split('.');icons[tuple[0]] = fs.readFileSync(path.resolve(iconDir, filename), 'base64');});fs.writeFileSync(path.resolve(__dirname, '../lib/ecstatic/show-dir/icons.json'), JSON.stringify(icons, null, 2), 'utf8');
{"_from": "ecstatic@^3.3.2","_id": "ecstatic@3.3.2","_inBundle": false,"_integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==","_location": "/ecstatic","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "ecstatic@^3.3.2","name": "ecstatic","escapedName": "ecstatic","rawSpec": "^3.3.2","saveSpec": null,"fetchSpec": "^3.3.2"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz","_shasum": "6d1dd49814d00594682c652adb66076a69d46c48","_spec": "ecstatic@^3.3.2","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Joshua Holbrook","email": "josh@nodejitsu.com","url": "http://jesusabdullah.net"},"bin": {"ecstatic": "lib/ecstatic.js"},"bugs": {"url": "https://github.com/jfhbrook/node-ecstatic/issues"},"bundleDependencies": false,"dependencies": {"he": "^1.1.1","mime": "^1.6.0","minimist": "^1.1.0","url-join": "^2.0.5"},"deprecated": false,"description": "A simple static file server middleware","devDependencies": {"eol": "^0.9.1","eslint": "^3.19.0","eslint-config-airbnb-base": "^11.3.2","eslint-plugin-import": "^2.14.0","express": "^4.16.3","mkdirp": "^0.5.0","request": "^2.88.0","tap": "^12.0.1"},"homepage": "https://github.com/jfhbrook/node-ecstatic","keywords": ["static","web","server","files","mime","middleware"],"license": "MIT","main": "./lib/ecstatic.js","name": "ecstatic","repository": {"type": "git","url": "git+ssh://git@github.com/jfhbrook/node-ecstatic.git"},"scripts": {"fix": "eslint --fix ./lib/ ./example/ ./test","posttest": "tap --coverage-report=clover","pretest": "eslint ./lib/ ./example/ ./test","test": "tap --jobs-auto --coverage test/*.js"},"version": "3.3.2"}
#! /usr/bin/env node'use strict';const path = require('path');const fs = require('fs');const url = require('url');const mime = require('mime');const urlJoin = require('url-join');const showDir = require('./ecstatic/show-dir');const version = require('../package.json').version;const status = require('./ecstatic/status-handlers');const generateEtag = require('./ecstatic/etag');const optsParser = require('./ecstatic/opts');let ecstatic = null;// See: https://github.com/jesusabdullah/node-ecstatic/issues/109function decodePathname(pathname) {const pieces = pathname.replace(/\\/g, '/').split('/');return path.normalize(pieces.map((rawPiece) => {const piece = decodeURIComponent(rawPiece);if (process.platform === 'win32' && /\\/.test(piece)) {throw new Error('Invalid forward slash character');}return piece;}).join('/'));}// Check to see if we should try to compress a file with gzip.function shouldCompressGzip(req) {const headers = req.headers;return headers && headers['accept-encoding'] &&headers['accept-encoding'].split(',').some(el => ['*', 'compress', 'gzip', 'deflate'].indexOf(el.trim()) !== -1);}function shouldCompressBrotli(req) {const headers = req.headers;return headers && headers['accept-encoding'] &&headers['accept-encoding'].split(',').some(el => ['*', 'br'].indexOf(el.trim()) !== -1);}function hasGzipId12(gzipped, cb) {const stream = fs.createReadStream(gzipped, { start: 0, end: 1 });let buffer = Buffer('');let hasBeenCalled = false;stream.on('data', (chunk) => {buffer = Buffer.concat([buffer, chunk], 2);});stream.on('error', (err) => {if (hasBeenCalled) {throw err;}hasBeenCalled = true;cb(err);});stream.on('close', () => {if (hasBeenCalled) {return;}hasBeenCalled = true;cb(null, buffer[0] === 31 && buffer[1] === 139);});}module.exports = function createMiddleware(_dir, _options) {let dir;let options;if (typeof _dir === 'string') {dir = _dir;options = _options;} else {options = _dir;dir = options.root;}const root = path.join(path.resolve(dir), '/');const opts = optsParser(options);const cache = opts.cache;const autoIndex = opts.autoIndex;const baseDir = opts.baseDir;let defaultExt = opts.defaultExt;const handleError = opts.handleError;const headers = opts.headers;const serverHeader = opts.serverHeader;const weakEtags = opts.weakEtags;const handleOptionsMethod = opts.handleOptionsMethod;opts.root = dir;if (defaultExt && /^\./.test(defaultExt)) {defaultExt = defaultExt.replace(/^\./, '');}// Support hashes and .types files in mimeTypes @since 0.8if (opts.mimeTypes) {try {// You can pass a JSON blob here---useful for CLI useopts.mimeTypes = JSON.parse(opts.mimeTypes);} catch (e) {// swallow parse errors, treat this as a string mimetype input}if (typeof opts.mimeTypes === 'string') {mime.load(opts.mimeTypes);} else if (typeof opts.mimeTypes === 'object') {mime.define(opts.mimeTypes);}}function shouldReturn304(req, serverLastModified, serverEtag) {if (!req || !req.headers) {return false;}const clientModifiedSince = req.headers['if-modified-since'];const clientEtag = req.headers['if-none-match'];let clientModifiedDate;if (!clientModifiedSince && !clientEtag) {// Client did not provide any conditional caching headersreturn false;}if (clientModifiedSince) {// Catch "illegal access" dates that will crash v8// https://github.com/jfhbrook/node-ecstatic/pull/179try {clientModifiedDate = new Date(Date.parse(clientModifiedSince));} catch (err) {return false;}if (clientModifiedDate.toString() === 'Invalid Date') {return false;}// If the client's copy is older than the server's, don't return 304if (clientModifiedDate < new Date(serverLastModified)) {return false;}}if (clientEtag) {// Do a strong or weak etag comparison based on setting// https://www.ietf.org/rfc/rfc2616.txt Section 13.3.3if (opts.weakCompare && clientEtag !== serverEtag&& clientEtag !== `W/${serverEtag}` && `W/${clientEtag}` !== serverEtag) {return false;} else if (!opts.weakCompare && (clientEtag !== serverEtag || clientEtag.indexOf('W/') === 0)) {return false;}}return true;}return function middleware(req, res, next) {// Figure out the path for the file from the given urlconst parsed = url.parse(req.url);let pathname = null;let file = null;let gzippedFile = null;let brotliFile = null;// Strip any null bytes from the url// This was at one point necessary because of an old bug in url.parse//// See: https://github.com/jfhbrook/node-ecstatic/issues/16#issuecomment-3039914// See: https://github.com/jfhbrook/node-ecstatic/commit/43f7e72a31524f88f47e367c3cc3af710e67c9f4//// But this opens up a regex dos attack vector! D://// Based on some research (ie asking #node-dev if this is still an issue),// it's *probably* not an issue. :)/*while (req.url.indexOf('%00') !== -1) {req.url = req.url.replace(/\%00/g, '');}*/try {decodeURIComponent(req.url); // check validity of urlpathname = decodePathname(parsed.pathname);} catch (err) {status[400](res, next, { error: err });return;}file = path.normalize(path.join(root,path.relative(path.join('/', baseDir), pathname)));// determine compressed forms if they were to existgzippedFile = `${file}.gz`;brotliFile = `${file}.br`;if (serverHeader !== false) {// Set common headers.res.setHeader('server', `ecstatic-${version}`);}Object.keys(headers).forEach((key) => {res.setHeader(key, headers[key]);});if (req.method === 'OPTIONS' && handleOptionsMethod) {res.end();return;}// TODO: This check is broken, which causes the 403 on the// expected 404.if (file.slice(0, root.length) !== root) {status[403](res, next);return;}if (req.method && (req.method !== 'GET' && req.method !== 'HEAD')) {status[405](res, next);return;}function serve(stat) {// Do a MIME lookup, fall back to octet-stream and handle gzip// and brotli special case.const defaultType = opts.contentType || 'application/octet-stream';let contentType = mime.lookup(file, defaultType);let charSet;const range = (req.headers && req.headers.range);const lastModified = (new Date(stat.mtime)).toUTCString();const etag = generateEtag(stat, weakEtags);let cacheControl = cache;let stream = null;if (contentType) {charSet = mime.charsets.lookup(contentType, 'utf-8');if (charSet) {contentType += `; charset=${charSet}`;}}if (file === gzippedFile) { // is .gz picked upres.setHeader('Content-Encoding', 'gzip');// strip gz ending and lookup mime typecontentType = mime.lookup(path.basename(file, '.gz'), defaultType);} else if (file === brotliFile) { // is .br picked upres.setHeader('Content-Encoding', 'br');// strip br ending and lookup mime typecontentType = mime.lookup(path.basename(file, '.br'), defaultType);}if (typeof cacheControl === 'function') {cacheControl = cache(pathname);}if (typeof cacheControl === 'number') {cacheControl = `max-age=${cacheControl}`;}if (range) {const total = stat.size;const parts = range.trim().replace(/bytes=/, '').split('-');const partialstart = parts[0];const partialend = parts[1];const start = parseInt(partialstart, 10);const end = Math.min(total - 1,partialend ? parseInt(partialend, 10) : total - 1);const chunksize = (end - start) + 1;let fstream = null;if (start > end || isNaN(start) || isNaN(end)) {status['416'](res, next);return;}fstream = fs.createReadStream(file, { start, end });fstream.on('error', (err) => {status['500'](res, next, { error: err });});res.on('close', () => {fstream.destroy();});res.writeHead(206, {'Content-Range': `bytes ${start}-${end}/${total}`,'Accept-Ranges': 'bytes','Content-Length': chunksize,'Content-Type': contentType,'cache-control': cacheControl,'last-modified': lastModified,etag,});fstream.pipe(res);return;}// TODO: Helper for this, with default headers.res.setHeader('cache-control', cacheControl);res.setHeader('last-modified', lastModified);res.setHeader('etag', etag);// Return a 304 if necessaryif (shouldReturn304(req, lastModified, etag)) {status[304](res, next);return;}res.setHeader('content-length', stat.size);res.setHeader('content-type', contentType);// set the response statusCode if we have a request statusCode.// This only can happen if we have a 404 with some kind of 404.html// In all other cases where we have a file we serve the 200res.statusCode = req.statusCode || 200;if (req.method === 'HEAD') {res.end();return;}stream = fs.createReadStream(file);stream.pipe(res);stream.on('error', (err) => {status['500'](res, next, { error: err });});}function statFile() {fs.stat(file, (err, stat) => {if (err && (err.code === 'ENOENT' || err.code === 'ENOTDIR')) {if (req.statusCode === 404) {// This means we're already trying ./404.html and can not find it.// So send plain text response with 404 status codestatus[404](res, next);} else if (!path.extname(parsed.pathname).length && defaultExt) {// If there is no file extension in the path and we have a default// extension try filename and default extension combination before rendering 404.html.middleware({url: `${parsed.pathname}.${defaultExt}${(parsed.search) ? parsed.search : ''}`,headers: req.headers,}, res, next);} else {// Try to serve default ./404.htmlmiddleware({url: (handleError ? `/${path.join(baseDir, `404.${defaultExt}`)}` : req.url),headers: req.headers,statusCode: 404,}, res, next);}} else if (err) {status[500](res, next, { error: err });} else if (stat.isDirectory()) {if (!autoIndex && !opts.showDir) {status[404](res, next);return;}// 302 to / if necessaryif (!pathname.match(/\/$/)) {res.statusCode = 302;const q = parsed.query ? `?${parsed.query}` : '';res.setHeader('location', `${parsed.pathname}/${q}`);res.end();return;}if (autoIndex) {middleware({url: urlJoin(encodeURIComponent(pathname),`/index.${defaultExt}`),headers: req.headers,}, res, (autoIndexError) => {if (autoIndexError) {status[500](res, next, { error: autoIndexError });return;}if (opts.showDir) {showDir(opts, stat)(req, res);return;}status[403](res, next);});return;}if (opts.showDir) {showDir(opts, stat)(req, res);}} else {serve(stat);}});}// serve gzip file if exists and is validfunction tryServeWithGzip() {fs.stat(gzippedFile, (err, stat) => {if (!err && stat.isFile()) {hasGzipId12(gzippedFile, (gzipErr, isGzip) => {if (!gzipErr && isGzip) {file = gzippedFile;serve(stat);} else {statFile();}});} else {statFile();}});}// serve brotli file if exists, otherwise try gzipfunction tryServeWithBrotli(shouldTryGzip) {fs.stat(brotliFile, (err, stat) => {if (!err && stat.isFile()) {file = brotliFile;serve(stat);} else if (shouldTryGzip) {tryServeWithGzip();} else {statFile();}});}const shouldTryBrotli = opts.brotli && shouldCompressBrotli(req);const shouldTryGzip = opts.gzip && shouldCompressGzip(req);// always try brotli first, next try gzip, finally serve without compressionif (shouldTryBrotli) {tryServeWithBrotli(shouldTryGzip);} else if (shouldTryGzip) {tryServeWithGzip();} else {statFile();}};};ecstatic = module.exports;ecstatic.version = version;ecstatic.showDir = showDir;if (!module.parent) {/* eslint-disable global-require *//* eslint-disable no-console */const defaults = require('./ecstatic/defaults.json');const http = require('http');const minimist = require('minimist');const aliases = require('./ecstatic/aliases.json');const opts = minimist(process.argv.slice(2), {alias: aliases,default: defaults,boolean: Object.keys(defaults).filter(key => typeof defaults[key] === 'boolean'),});const envPORT = parseInt(process.env.PORT, 10);const port = envPORT > 1024 && envPORT <= 65536 ? envPORT : opts.port || opts.p || 8000;const dir = opts.root || opts._[0] || process.cwd();if (opts.help || opts.h) {console.error('usage: ecstatic [dir] {options} --port PORT');console.error('see https://npm.im/ecstatic for more docs');} else {http.createServer(ecstatic(dir, opts)).listen(port, () => {console.log(`ecstatic serving ${dir} at http://0.0.0.0:${port}`);});}}
'use strict';const he = require('he');// not modifiedexports['304'] = (res) => {res.statusCode = 304;res.end();};// access deniedexports['403'] = (res, next) => {res.statusCode = 403;if (typeof next === 'function') {next();} else if (res.writable) {res.setHeader('content-type', 'text/plain');res.end('ACCESS DENIED');}};// disallowed methodexports['405'] = (res, next, opts) => {res.statusCode = 405;if (typeof next === 'function') {next();} else {res.setHeader('allow', (opts && opts.allow) || 'GET, HEAD');res.end();}};// not foundexports['404'] = (res, next) => {res.statusCode = 404;if (typeof next === 'function') {next();} else if (res.writable) {res.setHeader('content-type', 'text/plain');res.end('File not found. :(');}};exports['416'] = (res, next) => {res.statusCode = 416;if (typeof next === 'function') {next();} else if (res.writable) {res.setHeader('content-type', 'text/plain');res.end('Requested range not satisfiable');}};// flagrant errorexports['500'] = (res, next, opts) => {res.statusCode = 500;res.setHeader('content-type', 'text/html');const error = String(opts.error.stack || opts.error || 'No specified error');const html = `${['<!doctype html>','<html>',' <head>',' <meta charset="utf-8">',' <title>500 Internal Server Error</title>',' </head>',' <body>',' <p>',` ${he.encode(error)}`,' </p>',' </body>','</html>',].join('\n')}\n`;res.end(html);};// bad requestexports['400'] = (res, next, opts) => {res.statusCode = 400;res.setHeader('content-type', 'text/html');const error = opts && opts.error ? String(opts.error) : 'Malformed request.';const html = `${['<!doctype html>','<html>',' <head>',' <meta charset="utf-8">',' <title>400 Bad Request</title>',' </head>',' <body>',' <p>',` ${he.encode(error)}`,' </p>',' </body>','</html>',].join('\n')}\n`;res.end(html);};
'use strict';const icons = require('./icons.json');const IMG_SIZE = 16;let css = `i.icon { display: block; height: ${IMG_SIZE}px; width: ${IMG_SIZE}px; }\n`;css += 'table tr { white-space: nowrap; }\n';css += 'td.perms {}\n';css += 'td.file-size { text-align: right; padding-left: 1em; }\n';css += 'td.display-name { padding-left: 1em; }\n';Object.keys(icons).forEach((key) => {css += `i.icon-${key} {\n`;css += ` background-image: url("data:image/png;base64,${icons[key]}");\n`;css += '}\n\n';});exports.icons = icons;exports.css = css;
'use strict';const fs = require('fs');const path = require('path');module.exports = function sortByIsDirectory(dir, paths, cb) {// take the listing file names in `dir`// returns directory and file array, each entry is// of the array a [name, stat] tuplelet pending = paths.length;const errs = [];const dirs = [];const files = [];if (!pending) {cb(errs, dirs, files);return;}paths.forEach((file) => {fs.stat(path.join(dir, file), (err, s) => {if (err) {errs.push([file, err]);} else if (s.isDirectory()) {dirs.push([file, s]);} else {files.push([file, s]);}pending -= 1;if (pending === 0) {cb(errs, dirs, files);}});});};
'use strict';// given a file's stat, return the size of it in string// humanReadable: (boolean) whether to result is human readable// si: (boolean) whether to use si (1k = 1000), otherwise 1k = 1024// adopted from http://stackoverflow.com/a/14919494/665507module.exports = function sizeToString(stat, humanReadable, si) {if (stat.isDirectory && stat.isDirectory()) {return '';}let bytes = stat.size;const threshold = si ? 1000 : 1024;if (!humanReadable || bytes < threshold) {return `${bytes}B`;}const units = ['k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];let u = -1;do {bytes /= threshold;u += 1;} while (bytes >= threshold);let b = bytes.toFixed(1);if (isNaN(b)) b = '??';return b + units[u];};
'use strict';module.exports = function permsToString(stat) {if (!stat.isDirectory || !stat.mode) {return '???!!!???';}const dir = stat.isDirectory() ? 'd' : '-';const mode = stat.mode.toString(8);return dir + mode.slice(-3).split('').map(n => ['---','--x','-w-','-wx','r--','r-x','rw-','rwx',][parseInt(n, 10)]).join('');};
'use strict';const styles = require('./styles');const permsToString = require('./perms-to-string');const sizeToString = require('./size-to-string');const sortFiles = require('./sort-files');const fs = require('fs');const path = require('path');const he = require('he');const etag = require('../etag');const url = require('url');const status = require('../status-handlers');const supportedIcons = styles.icons;const css = styles.css;module.exports = (opts) => {// opts are parsed by opts.js, defaults already appliedconst cache = opts.cache;const root = path.resolve(opts.root);const baseDir = opts.baseDir;const humanReadable = opts.humanReadable;const hidePermissions = opts.hidePermissions;const handleError = opts.handleError;const showDotfiles = opts.showDotfiles;const si = opts.si;const weakEtags = opts.weakEtags;return function middleware(req, res, next) {// Figure out the path for the file from the given urlconst parsed = url.parse(req.url);const pathname = decodeURIComponent(parsed.pathname);const dir = path.normalize(path.join(root,path.relative(path.join('/', baseDir),pathname)));fs.stat(dir, (statErr, stat) => {if (statErr) {if (handleError) {status[500](res, next, { error: statErr });} else {next();}return;}// files are the listing of dirfs.readdir(dir, (readErr, _files) => {let files = _files;if (readErr) {if (handleError) {status[500](res, next, { error: readErr });} else {next();}return;}// Optionally exclude dotfiles from directory listing.if (!showDotfiles) {files = files.filter(filename => filename.slice(0, 1) !== '.');}res.setHeader('content-type', 'text/html');res.setHeader('etag', etag(stat, weakEtags));res.setHeader('last-modified', (new Date(stat.mtime)).toUTCString());res.setHeader('cache-control', cache);function render(dirs, renderFiles, lolwuts) {// each entry in the array is a [name, stat] tuplelet html = `${['<!doctype html>','<html>',' <head>',' <meta charset="utf-8">',' <meta name="viewport" content="width=device-width">',` <title>Index of ${he.encode(pathname)}</title>`,` <style type="text/css">${css}</style>`,' </head>',' <body>',`<h1>Index of ${he.encode(pathname)}</h1>`,].join('\n')}\n`;html += '<table>';const failed = false;const writeRow = (file) => {// render a row given a [name, stat] tupleconst isDir = file[1].isDirectory && file[1].isDirectory();let href = `${parsed.pathname.replace(/\/$/, '')}/${encodeURIComponent(file[0])}`;// append trailing slash and query for dir entryif (isDir) {href += `/${he.encode((parsed.search) ? parsed.search : '')}`;}const displayName = he.encode(file[0]) + ((isDir) ? '/' : '');const ext = file[0].split('.').pop();const classForNonDir = supportedIcons[ext] ? ext : '_page';const iconClass = `icon-${isDir ? '_blank' : classForNonDir}`;// TODO: use stylessheets?html += `${'<tr>' +'<td><i class="icon '}${iconClass}"></i></td>`;if (!hidePermissions) {html += `<td class="perms"><code>(${permsToString(file[1])})</code></td>`;}html +=`<td class="file-size"><code>${sizeToString(file[1], humanReadable, si)}</code></td>` +`<td class="display-name"><a href="${href}">${displayName}</a></td>` +'</tr>\n';};dirs.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow);renderFiles.sort((a, b) => a.toString().localeCompare(b.toString())).forEach(writeRow);lolwuts.sort((a, b) => a[0].toString().localeCompare(b[0].toString())).forEach(writeRow);html += '</table>\n';html += `<br><address>Node.js ${process.version}/ <a href="https://github.com/jfhbrook/node-ecstatic">ecstatic</a> ` +`server running @ ${he.encode(req.headers.host || '')}</address>\n` +'</body></html>';if (!failed) {res.writeHead(200, { 'Content-Type': 'text/html' });res.end(html);}}sortFiles(dir, files, (lolwuts, dirs, sortedFiles) => {// It's possible to get stat errors for all sorts of reasons here.// Unfortunately, our two choices are to either bail completely,// or just truck along as though everything's cool. In this case,// I decided to just tack them on as "??!?" items along with dirs// and files.//// Whatever.// if it makes sense to, add a .. linkif (path.resolve(dir, '..').slice(0, root.length) === root) {fs.stat(path.join(dir, '..'), (err, s) => {if (err) {if (handleError) {status[500](res, next, { error: err });} else {next();}return;}dirs.unshift(['..', s]);render(dirs, sortedFiles, lolwuts);});} else {render(dirs, sortedFiles, lolwuts);}});});});};};
{"_blank": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWBJREFUeNqEUj1LxEAQnd1MVA4lyIEWx6UIKEGUExGsbC3tLfwJ/hT/g7VlCnubqxXBwg/Q4hQP/LhKL5nZuBsvuGfW5MGyuzM7jzdvVuR5DgYnZ+f99ai7Vt5t9K9unu4HLweI3qWYxI6PDosdy0fhcntxO44CcOBzPA7mfEyuHwf7ntQk4jcnywOxIlfxOCNYaLVgb6cXbkTdhJXq2SIlNMC0xIqhHczDbi8OVzpLSUa0WebRfmigLHqj1EcPZnwf7gbDIrYVRyEinurj6jTBHyI7pqVrFQqEbt6TEmZ9v1NRAJNC1xTYxIQh/MmRUlmFQE3qWOW1nqB2TWk1/3tgJV0waVvkFIEeZbHq4ElyKzAmEXOx6gnEVJuWBzmkRJBRPYGZBDsVaOlpSgVJE2yVaAe/0kx/3azBRO0VsbMFZE3CDSZKweZfYIVg+DZ6v7h9GDVOwZPw/PoxKu/fAgwALbDAXf7DdQkAAAAASUVORK5CYII=","_page": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmhJREFUeNpsUztv01AYPfdhOy/XTZ80VV1VoCqlA2zQqUgwMEErWBALv4GJDfEDmOEHsFTqVCTExAiiSI2QEKJKESVFFBWo04TESRzfy2c7LY/kLtf2d8+555zvM9NaI1ora5svby9OnbUEBxgDlIKiWjXQeLy19/X17sEtcPY2rtHS96/Hu0RvXXLz+cUzM87zShsI29DpHCYt4E6Box4IZzTnbDx7V74GjhOSfwgE0H2638K9h08A3iHGVbjTw7g6YmAyw/BgecHNGGJjvfQhIfmfIFDAXJpjuugi7djIFVI4P0plctgJQ0xnFe5eOO02OwEp2VkhSCnC8WOCdqgwnzFx4/IyppwRVN+XYXsecqZA1pB48ekAnw9/4GZx3L04N/GoTwEjX4cNH5vlPfjtAIYp8cWrQutxrC5Mod3VsXVTMFSqtaE+gl9dhaUxE2tXZiF7nYiiatJ3v5s8R/1yOCNLOuwjkELiTbmC9dJHpIaGASsDkoFQGJQwHWMcHWJYOmUj1OjvQotuytt5nHMLEGkCyx6QU384jwkUAd2sxJbS/QShZtg/8rHzzQOzSaFhxQrA6YgQMQHojCUlgnCAAvKFBoXXaHfArSCZDE0gyWJgFIKmvUFKO4MUNIk2a4+hODtDUVuJ/J732AKS6ZtImdTyAQQB3bZN8l9t75IFh0JMUdVKsohsUPqRgnka0tYgggYpCHkKGTsHI5NOMojB4iTICCepvX53AIEfQta1iUCmoTiBmdEri2RgddKFhuJoqb/af/yw/d3zTNM6UkaOfis62aUgddAbnz+rXuPY+Vnzjt9/CzAAbmLjCrfBiRgAAAAASUVORK5CYII=","aac": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNp0Uk1PE0EYftruVlvAUkhVEPoBcsEoLRJBY01MPHjCs3cvogcT/4qJJN5NvHhoohcOnPw4YEGIkCh+oLGBKm3Z7nZ3dme2vjOhTcjiJJvZzPvOM8/HG2q325Dr3kLp7Y1ibpIxjs4KhQBZfvV6s7K5Vb0bjeof5ZlcGysP1a51mifODybvzE8mzCbrAoTDIThMoGXZiZ4YSiurf+Z1XeuCqJ7Oj+sK3jQcNAmg8xkGQ71mYejcAB49vpmeuzJccl0+dUj6KIAvfHCPg3N+uAv4vg9BOxcCmfEzuP/genpmeqhEMgude10Jwm+DuUIyUdTlqu2byoMfX/dRermBeExHsTiWNi3+lMpzRwDki8zxCIATmzbevfmClukiP5NFhJgwkjeRTeLShdOoVJqnAgwkgCAZ6+UdLC9twjQZ8pdzioFkZBHY3q6B3l4dJEEEPOCeD4cYVH7Xsf15F+FImC775INAJBJSkVoWo0QY9YqgiR4ZZzRaGBkdwK3bFxGLRZUfB3Rm2x4x9CGtsUxH9QYkKICDFuLxKAozGZwdTqBRs2FbLlXbiPdECMCHadj/AaDXZNFqedCIvnRcS4UpRo7+hC5zUmw8Ope9wUFinvpmZ7NKt2RTmB4hKZo6n8qP4Oq1HBkKlVYAQBrUlziB0XQSif4YmQhksgNIJk9iaLhPaV9b/Um+uJSCdzyDbGZQRSkvjo+n4JNxubGUSsCj+ZCpODYjkGMAND2k7exUsfhkCd+29yguB88Wl7FW/o6tT7/gcXqAgGv7hhx1LWBireHVn79YP6ChQ3njb/eFlfWqGqT3H3ZlGIhGI2i2UO/U/wkwAAmoalcxlNA1AAAAAElFTkSuQmCC","ai": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAk5JREFUeNpsU01vElEUPTPzZqBAQaSFQiJYUmlKYhoTF41L3Tbu/Q/+AvsX3Bp/gPsuWLrqyqQ7TUxMtAvF1tYGoXwNw7wv7zwYgtKX3Lw379575p5z77O01ohW+/DVh8zj7aYKhflGdG9ZsGwLNydffgVfr19YHvsEa+Zu/nxndob5StQK+dyzvZzyw/gKlmMj7IygFM+xvNcanp4/t5dAomXHBy2UUBOO2MAl/B9/cPb6PULuoHx0WM0e3GvpUOxD3wZAJWutZqYUYmqpSg5OMgH3YQObL59W0/ullpryR3HegkKEqiWBSGV4R3vQ7sIhScTZFTpHx3A215B5sluVY/WWMg7+ATB/lcLsKpTonHzD+OMFEuTz8ikkt9Kwt9YJZB38cpBdoQAZJdLvCGByfoPB6Xdk90pYy6Xg3c/DaWwArg09DaG5lCsUFN0pckZAojdC8m4auBqaALuSgez7VB1RtDSUWOQvUaBLFUzJBMJ2DwmPgd1Jwm0WoSgJfjDvrTKxtwAIyEkAOQ5hU//Zdg5uowDlUNMnwZLW0sSuUuACYhwQRwFvJxupCjEYUUccOkoaKmdOlZnY1TkgAcXAhxhOwLsDsHoN3u4O5JTDfVCH6I9nfjId3gIgSUATFJk/hVevGtOMwS0XwQ3AzB/FrlKg8Q27I2javVoZrFgwD4qVipAEyMlnaFArzaj/D0DiMXlJAFQyK2r8fnMMRZp4lQ1MaSL5tU/1kqAkMCh2tYI+7+kh70cjPbr4bEZ51jZr8TJnB9PJXpz3V4ABAPOQVJn2Q60GAAAAAElFTkSuQmCC","aiff": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAohJREFUeNpkU9tqE1EUXZmZpE3aTBLbJFPTtFURtSCthr7UCyKKFJ/9An3og6Ag/oXfoUj7og9asCBYKT6UIPHaWtpq7NU2aZK5z5wZ9xxMpMwZDuewz9prr32ZiO/7CNaDx3OLt6fOjBqGg/aKRCIInp8+KzfKH7fudnVF58nE16el+/yU2mBFSWZKpWJKVc0OgUBo02K4NDmU6o75Mx+Wdu9IUXFeiOA/pn1xHeYaugVDdzpbp91qGlAKGTx8dC19/Wpxhjnsxj/RRwk85hGJC9d1O6fneWAuoztDYSSLe9OT6SuXB2ccx73Z9uukwDwfls1g0xZIY/Ad/Gnyt/XVfbyYrSDRE8PExHB6/8B6QuaxIwRBFMt0iIAiMx+LCys8jfGJEUik2WpZOD2SQf9oDtVqQwopCAiY66FS/om3b75CVS2MlU7AJ2WiJBCZjZ2dJuRkDJZFwFAR7UCBja3fNfxY2YEoCtRCj9em3Tpds6FpJseGCBxS0GgYGBzqw62p84gnYnAI2CSbSbPhEpFAaE2zODaUAlWWwDoS5DheGqbWpVE/0CmqCY9qkEyINBceb2uADRNQ8bSWAVVzIFKomCQim+0luS4yKYlsHlRyZo7EsSEC23K5vAsXh/H92zZkuRvxeBS5nEx2yp2KqhxPoV5TYS/8CtdApylM9sZQKKSQzyeRTseRV2QoAzIYY8jme5DN9fI0dQoUIjANGydP9VM7PZw9p/AiBpNYrdbw/t0yTJqRtdU9UrfJCUMpSJIgbWzsYe51BcViHzLHeqCRqhZ1YX1tFwNfZBxS9O3NWkAcHqR606k/n/3coKAoV/Y7vQ/OYCZevlrmv3c0GsFh06u3/f4KMABvSWfDHmbK2gAAAABJRU5ErkJggg==","avi": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAm1JREFUeNpsU8tu00AUPXZcN0nzTpq2KQ3pAwkIAnWHqCoeexBb+AQ+ABZ8A2s+AIkdm266QUJIFWKBkHg1KpRHi5omJGkbJ3bGHj+4M1EQrTvSyGPPueeec++1EgQBxHp+/9mbyuriRZdxjJaiKBD3W+u1+p9a856max+gDO8ebT+WT20Ezi9NZi/crqadvn2MQBAGfpCOpqNru2937vxPIpY6Onjccx3Twck9MBiSU0ncfHirXFmZX3Md9wqCUwiEVN/zaQfHt0vfbBe5uQyuPVgpl5Zn11ybL4/i/lkICOw5niQRGQShoiqI6Bo43W2ub8n3hRtLZT7gTynk6gkCX9gAOxpAnxhHZDwC1/aI1EViJolu/QhKRMHZ1UX0Gr1USIEn5FPWHy+/wTokkrQOq2vBaHZBN4hmY9Jwfr4An/teiEB45ZZDwDiMhoExT0N+sYDCuUkkplLIlXP4/XEXdo+RUhdhBSSfUwtVTUG8MIHK9QVqI7D/uY6vr2pwmCPrkz+Tk9gwARWQ9WxppbXZhNnpw+ya4A5HZi6L4lIR8WyCcL6sTZiAWjWgAmpxkn5+kqTamK6WkCwmERmLDLvjB0ML9ikWXPLFuozYOap3L8HYN6DHdbS/d5CeTVBndBz87FCBLYkNTyIjBQemnIEsSY5lYrK1+UoWcToLMjEHAyIQ2BCBSx/NVh+ZUhrqmEqBebS3WyhdLg0zt/ugAaIklsSGLHCLa6zDMGhZ2HjyGsnpFPqNHnY2fmHv3R5SMymYbROszSQ2ROAY9qHiofvlxSc5xsKKqqnY3diRE9h4X5d/pzg7lnM4ivsrwADe9Wg/CQJgFAAAAABJRU5ErkJggg==","bmp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmZJREFUeNp0U+1rUlEY/13v9YV0vq2wttI5CdpL9aEGBZUDv0df668I6n+or0UQ/RuuD0EgVDAZrsKF4AR1a6COKW5qXvXec27PuVeda3bgcF6e8/ye5/d7niMZhgExnK9fbTrm5pbBGMZDkgCyq+VyhTUaT6Eo2ZHJePPWXJXRhez3B1yxmM/QdctXUSCgtV4Py4CvY3cky4e1x5DlLCaGbbzjXDcousG5OQe5HPRSCQPK4PpsEM/XH4WvhS4noeu3JwHGGRiULhsMoKZS4I0GtEIB9mgULJGA0+9DPBpBT7sffvf1W/Lg6OgJufw8C0CRGEXWazUwiiyFQjA8bsjVKjaJzovMD/Q5gxyJhG2cvyeXe2cAuADQNGBmBvLaGuTFRaDfh31lBTWi9pumjbK0B4JQul3vOQpM8JdskOLrdCvDcDjAsjtg5TIkoiKLaokMNR2cnZbqNAMycqG7XbHKR2fMzwO/dsxSwu0BiBJsNsv2LwAJAJCI5ux2gXYbqNetcz5PoORI1cDS0n8AxGW7A+zvEYBKZ2ZlcsEtJLbedMjePBaCTQMghx45ulyWkzxMVUQ2RMQhLfFO16YAqCrixPnm6iqKrRb2W23EfF4cUNSrHg90cr7hDyB33MTnSmUKALVs4uIlROjxg+AsPhGVl3fuIl2tIOB0Ya91gkOi9mxhAal0ekork1ic/kGLBORMxy2K1qS9V1ZQbNThIj2EGh+2tsyOnSai8r1UxMNIBB+LRTTULr4Uds0K1tU/uOLxIrmbNz8XXSrnASSpubG9fbKRyVh1n/zSw29t9oC1b47MfwUYAAUsLiWr4QUJAAAAAElFTkSuQmCC","c": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAcxJREFUeNqEUk1rE0EYfmZnkgoJCaGNCehuJTalhJZSUZB66a0HwXsP/Qn+FM+9+hty0LNYCr2I7UVLIW0Fc0hpQpSS7O7MrO9MspuvVV8YMnk/nn2e5x0WRRFMvP/w6WSz5jbi/9NxfP693Wp3DrJCnMW5d28P7a+IE15lufR8o1ZEStwPhkWHsWbrZ+eNEPxsuubEF6m0TBv2Q4liPofXuzveulttSqW2UwH+GjqC0horpSL2njU89+FyMwjlTlxOJMTa9ZQHzDQIjgwdom9zLzfXPc75kbnOAswBJTlC2XrqQRMLxhi442DgB4UFBhgPpm3B5pgBHNUUxQKAHs8pHf3TEuFMetM9IKr/i2mWMwC0SnuSFTG2YKyppwKYVdGO7TFhzBqGIenVeLCUtfURgErucx5ECKREKBU4d3B718PHz6cICGT/1Qs8qpQtGOdyhtGEARWDQFqQJSeDL98u4VbLaKw9IRAJPwjtoJGlVAoDQ800+fRFTTYXcjlcXN2g++s36p5Lzzlve1iEROa8BGH1EbrSAeqrjxEqicHQt8/YSDHMpaNs7wJAp9vvfb287idboAVkRAa5fBYXP9rxO4Mgf0xvPPdHgAEA8OoGd40i1j0AAAAASUVORK5CYII=","cpp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfJJREFUeNqEUs9PE0EU/mZ2WgqpXX+QIDFdalVslh8NlAOQaOKFAwfvHvwT/FM8e/U/MOnBmwcj8WD0ACEGghIkbU0baaEthe3OTJ0ZWV26q37JZt68ee/b9733yGAwgMbL12/fz+azbnAPY2Nrt7Zfqz9JMrYZ+J4/e2pOFjiciRvXlgp5GzHonXk2o6S8V6k/TjBrM/xGA4MLyeOSPZ8jkx7D+uqCU3Amy1yIYizB36AlCSkwfjWDR4uu40yMl/s+XwjeWThQQ4Z6QNSnSkYykcDXasP4lmfvOZTSF9q8TDBEFPbN5bOqCglCCCxK0TvvZyIV4CIxbgpC+4gm/PUmFCIE8iJPyME/e8Lon9j4HvyHYLjKSwRCSEUgf9+15mFbx8QS6CZJMzJ9SlBCwX3fJDLG4PX7ykcwkmQmJtpEhWa7g1dvNlSwjwelebz7tAXLolh0p/Fxe9fErK2WDFGEgKjxfNjegX0lDTc/heNuF99/HGEslcKXwyoazWNDdlCr6+DoJgrBzdI0T9rYO6yg2zszMlaKM3Dv5OBzbuyZuzm1B16U4Nzz2f3cFOx0Gq12F9cztpExncsqYoaHpSIKtx0zJdVIFpHQ6py29muNk1uTN829o/6SHEnh80HFaE6NjmLnWxUJy1LyTltB3k8BBgBeEeQTiWRskAAAAABJRU5ErkJggg==","css": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAk1JREFUeNpsUktvUlEQ/u5DoCLl/RAKKKUvWmIxjYntQtcu3LvwJ/hTXLt16coFC2PsojEaMKZtCqFaTdGmjbS0CG3By+vei3OOBSGXSU7uzNyZ78z3zRF6vR6YvXzzPrMUCyf68bB9zO+VfpROn5hkOdfPPX/2lH/lfiLidztX5mN2jLGG0rKLENIE8liWpdzwP7HvqJqujmvudFU4bFY8Wk1FZsOBtKppd8YCDNu77CZevd3gflfTUFcUhP0ePLibiIR9rjSBpgwAfe4dVcV6dhtep4PH5msylGYLrzeybErcT85FYiH/CyPAf74gObC2vMhzsiRhPhpC6eQUM+EA1pJzILEnjRSuJsju7MJqsUCSRei6Dp3yXqcdGlHZ/rLPazQWGCn8+6YW4pAkEW0SjzUzanWlCa/LgcR0lNfovTEi6lcIkzesnM/R8RlN0INGp3h4DHoDsE5YRvQyiKiRSMzikRAOS2WoqoZWu41K7RwzlOOAVDMMMHhIGvFlRxJFrKYW0ep0IYgC3SDh4b1lTJjNfENsrazOAMAw680mPuW+8lFno1P4XDigRhOiwQAyJK7TbsNS/PaA7giAIAhYz2yRgBIfsVA8wIetPG6FAqhdNrC5u0f+TUyHgyMTDDToEt/ftQsEvW4EPG5OZcrvw0mlimarTXkPfpXPcNlQoGtjACgpryQXsPNtH/nvRXqBJpoKHMzGNkNB0Odls7LNyAYKpUq1dt1iuvB7fRDp9kr9D1xOFwkpoksXusmXaZWFn0coV89r/b6/AgwAkUENaQaRxswAAAAASUVORK5CYII=","dat": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfVJREFUeNqMU01PE1EUPe/Na0uptmlASg3MoiZgCA3hQ8PHAjbqwsS9C3+CP8W1W/+BSReyYUPwI4QAVkAgUEgIbVIg1FZb2pl5b3zv2cHBjsaTTOa+e989OffcGeK6LhTevFv+OJoZHPHOfrz/sl86KpWfhxnLe7lXL1/oN/MSZqonOXU/k0AA6lfNhEFIrlAsP2PMyPtr1AscLpyg5pbtIHErhqez4+awmc45nI8FEvwNaiQuBHqTcSxMjJhmX0/Osp1xr878FxWEzwMinxAzEA4xFIpnOjedHTKpYbxW4U2CP4j8uWxmUKsghMCgFI2mFe9QgHZj0Ba4yhFF+KvGJToIRLuPC/efnjD6+26wB1Lq/xgbSCBXKeWJG/OTdky8cWTdT3C9RmWSGk2XCLlWo4xTNbfN5qh7PpXM72GjZeHt0gpq9QbmH4whGb+NpU/reDQ7hcWVVXxvXOHxzCQopQEKXKEbL6o1ZIcy+LC5g62DY2zsHeC0fA4zndIrHOjvg2XbAQRSfsuy9XxC2qzi/H5B6/68W0AsGkW0KyJPBLbDO0fg3JX/CUM81i0bD6WKe6j9qOPJ3EMcF0tSNsFA6g6alqW+VtZBUL78Vtk+Oqne7U9rs5qOQCjSheJFBeFIFOfVujSUYu3rIc4uqxWv76cAAwCwbvRb3SgYxQAAAABJRU5ErkJggg==","dmg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAn9JREFUeNpsU01rE1EUPe9lkk47yWTStCmtNhFSWxos2EXVhSsRcasuxYV05V8Qf4DgD/AvCK5EV1oFI7iUBqmCNdDvppq2mWSSzEzy3vPOpFFq+uDNfR/3nnvueXeYUgrBWH1/9/NE7k5BKRnuRcfF2qdnmJq9DeF9tQ+2isuMsxXGWHh/a1mEVsPJSI5fSU3OPEj291IIlN49RXz0KqzEQjIeZS/L5Y/3wPGhDxIM/i/A7fZWgVG0t5EaG0ZUa0JGM8gvPrZmLt58QYwv91mfAqCIE0sAqgumBFITGQzpUYhuF0KfRa7waDyXXXolpVrsh/0tgSLDr5I+wUZo1UHCSkAficPzY6juFSmbRPrC/azjq+fkcO00gAqoU7B0ETKkfWbuCTjTYeq5oESAauexcTScX+ZACWFm0YQSLZKhHdr67+/wW0e0dgjYo3sCEXXybYtBDVSHLp2es3IpsILS24c42lkBg6DzRjgRzCDZ/xr0GNRJwwYiWgzt+hYMawleu0V3wbkT+kUirOc7IGJAz68R/Qak1BAlx3hqASPGBJRXpXOv58dkz3eAgQoOm4hyj57NgZm0MHvpBmK6QdUdg/DAg9cRkhicBSDaKJdeo1bdxmR2DtWDDUxl51HZ+QHTysD3XdQO95Gfv06aeGcAdBrY3Chi8lwO3768QWX7J5q1XWyVSxgajiOXLyBG2hzurRKV9lmt7ISNkkjo6HhNyjoK+2gXRsKE57ZIE2ot10Z1fz0Ue4ABVw3NMjnW14rInh8jTYywoTg3EOFpOM4mXNfH9PQUfGlrAwBOs3I8ljbtuMWhRWzIIPrkn+GcYcgIWEowbZ+0qB334/4IMADESjqbnHbH0gAAAABJRU5ErkJggg==","doc": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAppJREFUeNpsU79PFEEU/mZ39vZu77g7DokcP04BBSUmiEKCSCxs7Ei00JAYO2NlTKyMrX+CJhaGwopSQ0dMtFEsbDRBgiZEQIF4IHcg+2t2Z8eZ5QDlnM1mZ9+8973vfe8NEUJArfSNhzPG0VIfeIiDRSDkw1cWVt3N8rhG6SdSO2Gvn8dfuueqZwuNZqk3Jxg7iNcIfBbgXD6ZC8u5qffzX8eoYeyDxC77uygKhcouovgVUQj1H4YB2ovNuD9+tTTU0zMVBmG/+C8AIYh8F361DL/yE5HnADKYlVdg6MDAmW7cuz5WGuw+PsWDYGAvbL8ECFUt4K7/AHd/I9c7BLaxinD2Ld5Zo7g78RLuRhlBS2cpWbGfStfhfwCEpK0nUjCbWuGsLciSOELPhkq/YgdY3l6HsLfRcLYf+pHNbH0JigEPkLAyMsiEJ7NrqQzM1i7wyhoMZqOhvQs6Z0ovXgdAJACRoulEg5HOwrOroKk0zOY2BDtVpTF0CU6kLkQJXa+BNEoG0lMSsBBKQXWNQktmoGcaYeSaQCIVWOvUYQAiWZFQtk5mSMoSzEILtBrTfEcviC5bwVwQmoh96wA0ic5dB57ngeoaTIPCdb34zDITYNLOOIeVSsW+dQC+7+NSWx6jJ4tY/rWNV7PfcGv0tBoPTM7M4eKJVgx2FTE9u4QPS6x+kHzfw/mOAjarW2hJG3hy8zIceweuY+PRtREMdzbjzcd5WBqPB6xeRGUMGRzHjWvMmxQ7tiOF1JBN6FiTd6Sy9RuFbHpX7MMMqOD088Ii+op5OUAO7jyeRGfBwrF8Cg8mXuDL4neMXzgFwhwZz+hf7a9d5yu3Z6DTPjVQIY9k7erO7Y63Lvc8ErEeyq6JaM6efjai4v4IMABI0DEPqPKkigAAAABJRU5ErkJggg==","dotx": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAndJREFUeNpsU01rE1EUPTPzJk0y+WhMStW2qdVWxUVEQUF0I+4ELQiC7lz4N9z0T+hG9wrdZKUgLqulhrbSag1CKpT0g7RpYjqZmffle5NEKdMHlzfvvXvPPffcO4aUEno9f3Vt4dTp+BXOe+fB0u/NbVpv7h89NU1j1TCM8H7+xY9wJwPHZMbOjRadLAvE/2gToJTiTPx89k+OlVd/LT+0TPIPpO/SzyQk40xCMxBSZ9Z3CoAx5DOjeHT7SbE0XSpzwa8OWB9jINELolQg8AR0EgUKn1PIlIWpkUt4cPNxkTOU12trs8p95RiAXpqaztqou8q6SKQJJmZSqGwsodFsIJk1kcyLYv7IeafcLx4HUNkFF4jFTExMZ0B9DrfD4HUEusYhWs4GPEJg5wly/tBYRIOeDhpEwlS34xcyajdQr3UwOT2MlJOEBRuGNHWp9AQRVXDfQiFV/U5GBSiQ5p6ngBEa5z3fiIhC6g6IMDBwOdoHPkYnHPVyhN0tF7E4QSpr94CEOKELffq+y9Bq+DCJ7rWBoQQBVbPR2O6G4OlsLASJMtCZfQqm0NP5IVWnamdAkUxbyuIYtD7wWegb0YAzAVMkkI6NwPM9xEwHloyDGAmk7AKS9rAS0FKOdugbYeAHPu7OPEM+MY7q3hIKqTFQHmC3XcONc/fxdfMDrk/ew/edzyhvvTmBAddocVRqH3Frahau56qpZDho7+PnTgXffi/gbHYmLEvPSIQBp5JU62sYz13G609zKBXvoOMdYn2zgm7Xg2MVML/4Eu3uPgxhk2gXmNl8v/i2pcXTP8tKdTEcbWLZqDQXwu/l6pfwbEnSGsT9FWAA4mdHv2/9YJ4AAAAASUVORK5CYII=","dwg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAoFJREFUeNpsU0tPE2EUPfOg006hD4rQh8WgbCSwkKgbF2owujaCiQsXxpX+D6MmbtXEsHCLmIAbE6NLo8YlGIxREIshIqVl+mQ6j8/zFVCb4UtuZua795577rl3FCEE5Bl79vPd5LHYiOP7cH1AUWi85ytmvlas1bJ9E5ryBntH3BpuP/X9i7ovkluuiE8N9SDepaLpCcRCCqa/VDCaMuIjSWP25Upl6n+QDoCz6Yh7KKzh3sI2LuUimPtRRyaqodj0MDloYiITSTi+mH29Wu0AUf9CsZPJoW5czJl48LmCc5kIKo5Al67B9gUGYxrun+5NnMlFZ+GKiQADj2a7AquseLIvjMv5KMaSBu4sWVir+3i8VIVKYSby0UTdFU8Znu8AYBHQgVOJEN5uOXi4UsdawwU0FSf6TaSoyw6DRvukPkgGWpDKy4F8a3jImCrqFDFn6rhKPR4VGnhvOTAY3WLcjifcQAsqRfhUc/Gq1MKNbBh9nIAMDjEppocxs9HCMktfGTCwP/oOBkUKNk/qF3pDYC6Ktk8RfWzyaaoKrqdDaBDwya8W1m0/CPCR3kFy7CcnmWQRUJqcRJFUKtTnPCeR71LwoeYF92CYyVnCFZpCTrRtCv5to2St8SOrKxiPqEEA4fkYT+mI0rdoeUiH1XZVuQPpsIKqw2QmfifTsnOABiWySlH9uU0Hh2MqjsZV5LtpPSoGeN9rKnhBX7ehoOSLIIPfnGONXGMMWN7xUfVldYDbjM3mrh5HCDgS17DhHgDQcIU+XbBxnDTn1x1UuQcJ9iv7l5Q5e1zLGri92EDJFnoAgHtcfr6wbbVXUqq193+0z97n3UJt1+d51n7aHwEGAAHXJoAuZNlzAAAAAElFTkSuQmCC","dxf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAo5JREFUeNpsU0trE1EYPfNMmtdoH2kDNmJbaVFcaBVFpAsREQpFwY0bu3HjQnTj1mVd+ANcuC3qQixmry6E0kWFVIQ+bKy2tbFJm3emyXTujGca+4DkwsedfLnn3POd77uS67rw1vC79ek7fZEzpu3AYUqS9tKQGZPLpa3VXP0uFCmJ/8t9OLC3q/uJbcs5bkIybvdHoMsSbLKENRmvU2WcNnTjRFD7ML1WGSPJHI6sA4KRWMAWVDPxLYex3iCmfpuIh1QsFSyMxQO4GvXHHwOJ6XWSyIck8v6HQsnjAxFc7vTj2VwBg4aG78VdBHQFCk+dbVcxMdwev9gTSEC455sIBOu2KLsoJFzqasP9vjCeDBlYqzn4VXXwarGKZN7Crd5QfLDT/7KpBM84c9fFUFjFp2wdk6smflRsKKqMa7EgfJJ3Ac2OKlit2pEmBTQfngdpnupoU7BUtRGiiTe7fXiRqmK+KuDn6TpvYogmBRJcrOwIJLIWxmM+dOsyLKryQAaJpjJ1/AxrGO3SqdZt7kKZJrzJWBg5piHENuY8vV6e0UOye1TyftvC5l+gZB8SHJTwpSx4q4JeTUKaxhXoR57h7Rn+3iFolJ3xvPhab6HgJG/pJ7jsNP4sUX+jZiCgEsWd/DjH5IrSYpBUAr0yHpzSoXKOP25a6OBhndh0zcX1qIYM2RIbu6i0KiHD5B/GTMHG03kTGpEL7H80wHFOWwhqDZ+SpkBOtCDYJDhZE4gRcKNbYynAqbCMbXpwpVPFbEng0aKJGbYzK1p4wIegLlcEPmdt+DjXbzcsxFlCynRwwVAwW6hjqeg0Zt521SYCWCJvbe0Un29UDx7Hgrs3IEitHXkw3jOv2fl92D8BBgAJeyqBh90ENQAAAABJRU5ErkJggg==","eps": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNp0U01vElEUPfMFCEVArdoSqEA0KV246UJdUJM2Lo2JK/9FjXu3utJqTNz4D9worrsQExbFpAFT0TYp0CZ8pIAiyMfMvBnvm2Foa9uX3Lw7c98979x77hNM0wRf7ufPsq7Z2SQYw2QJAkDxQalUZa3WI8hy3gmZr15bu+z8kILBkCeRCJi6bufKMji0NhwiCQR6iitdatTvQ5LyOLLEiWcYukm3m4Zhmbq1BX13FyoxuH7xAlbvpqKRK1fT0PWbRwEmDEyiy1QVg/V1GO02tO1tKLEY2PIy3KEAlmJRDLXb0TeZL+n9g4MHlLJ5HIBuYnSzXq+DlcsQLk/D9Hoh1WrIUjlPcpsYGQzS3LWoaBhvKeXWMQCDA1D9pt8PaXERUjwOjEZQFhZQp9L2yERiqYRCkPt/z58ogTGqHQLE1BLgUmC6XGD5AlipBIFKkbhanKHGYLBDqQ4ZED0OAbfLlo8OIxwGvhVgyTHlA3xkomjH/gegBgDURMv6faDbBZpN+/tHkUApkdTA/PwZAPxntwdUyjYA/+ZMqJHjLgM9iv/6zRt2GgMaIE21aVIjnSm0DGPfmhzyde0UAE2Dj+p7urKCPvkZku9eJILOSMUnkvVhIo7GYIB3xSKYdhoA1erXGVKXpvFxZwdBonnD68PQ7YEwM4O4xwMPxc8RYE87g4FIcz+kvfmnA0YzIJIy77/m0OCqsTkkCTysKPjJG3viLei63Gm3kCO6UWqcMejjxecMPmxsoFKtYop6UNirYL9Wtc5OHqzznIXHq1na7OfMJROcK8a6O7MjW7nfzZdrd7jzT4ABACh3NGsh3GcdAAAAAElFTkSuQmCC","exe": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAo1JREFUeNp0k8tPE1EUxr+ZzvRJO62lUAQaKIQ0FVJFjBBdoIkrDDHuXJi4NnHtX+HCjW408Q/QmHTRaCRRohIJifgiiBICTQu29mHfnc7MHc+MlECKdxZz595zf+c737nD6boOYzxJLC6Nhwej7e/24HkO779s7G6mMjcEwfKZ21+/d+em+RbagaFev28qEpZwzKg3ZckqCPH1nfS8hScIdyhBe6JqTG3PfyTTeLrwFhvbKdy9/xi5QglXL0yGJsKDccZY7LDIAwWHpSferWBh+RN8ni4UylVER8MY6PHj0uSpUK0hxzfTmWsUtnoEwO3rer64jEyxim6/Hy67DXaHExvJX3jw7CX8XjfORUdDlOohhU4fAVjILCPbm9V1yIqK2FgYt+ZmsZcv4lH8Nb5upXD7+hVMjIRQa8qeDg8UTYPU5cTcxSk4nS709XTD53ZhpD+IYMAPj+TBz93fZiz5oHV4AP1fGdlyHZIkIZkrI7GyhnK9CZXy+Aig6p1+HQAY003AcF8AVtGGfLWG9XTO4MLZ5cL0WAixoT4zVmPHADSiMo3hzHA/xgeDWFjbNg8H3A7kKnX0koEcPdTu/ylgRGZgOjNv38zoSXC8BZJDRKOlwGEV0VJVGM0y4joAPO1spXbx6sNHeD1uRIYGUCxVSRlDt1fC8rfvcDnsmJ+dOaLgoAs6AVLZPJJ7WdhEkUyT8GJpBflSBcVKDTvpDBw2GzQqQT1OgaZqUOhtFQUTUKnVTVWNpgy51YLVKph7sqKYkA4A1ScEfT66vm5kC3+ofh6Xz59FQ5bpkvE4QW3M5Apoyorhl9ABIKnFgNdTOh2NkJG6WSf9eRBJtmFwLDJmriUzeaOkYvvcXwEGAIVNH6cDA1DkAAAAAElFTkSuQmCC","flv": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmtJREFUeNpsUl1PE0EUPbssLYUCXdpaC9gWoSTgAyFigiRGY+KjvuuTr/4A44MP/gx/gMYfwIsan0RjIjGiJIZgSIGFIoXSD0t3Z3dnd70zpITazuZmJzP3nnvumaMEQQCx3jx69SV3a3KWMxetpSgKxP3m242Do43SQy2k/YRydvds67n8a63k+FRSn7l/bdg5tdsAuM3he/5weDC8vLdqPLgIIpba2niux52mg//DqlsYSg3iztO7mczN3DJ3+ByCLgCBH4hOFEF7cDpzPCRyOpaeLGXSc2PL3HbnW3XaRQCPEgWI2MsRVAVqrwbX9bHxbhOKpiJ/bzpDOr2k68V2BtRNzMtqDEqPejY/4zSGjb54BM0mQ8k4xsDoIMauXxnqYOD7PmwScP31d0SS/eAuh1lrolFpIBQNQw2pqJdqsAlIceB1AJCIkkE/FZskXDQVRXw6IYHiE0nBEcaPXSSvJnGwWkQXAE4acAhbxPMJpOdHweoMhc9b2F8zwKizbdlyPLVH7QLg+JKBYzoorxzjz3oRzUoToaEw9KyO8XQW5AE5jrFT6AbAYVVNxCZ0Ka3So+DSTAoDiej5ywTySbls1OEDobhFlMcXxrHw+AbINEjNXgb7y6BndLhk8cRkHHbD7g4gEhiJFxsdhrDqaamBaDKKerGGSKwPI9kR9EZCaNA5ubE7A5s8IFhsrxQkgJhZoa/06xC5xRz2v+3BOjFlbqcGlquxsondT9vY+2pAJdeZR6fI355CgQCN2A4O1w7gkQ7cdLUOAKdhV6uFSv3kd/n8mT68eC8dKWLnY4FsfeZQh7nVVt0/AQYAsf5g+SvepeQAAAAASUVORK5CYII=","gif": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmVJREFUeNp0U0tPE1EU/trplAqlL0laiw40xASByEJIZFGVnSvj1j+gWxNXJq7VrbrwF7h10cSNhMRHojEuACVBKmH6SJQyJeXRxzzv9dyZPiCtN5lMe8853znf953xcc4hztDzZ1+C6fQMHAfd4/MBFG+p6h/n4OAeAoGNToi/eOm+A50LKRaLh6amoty2vVpZdotNXccMEK3LwZxa2bsDSdrAqePv/mLM5tSdMwYBYqyvw9zdhUn/L59P4OGtG8qlZCoH254/DdCdQBCxqZu+ugqnWoW9swN5ehp2NotgIo6bGQWGtaS8+vQ5V9a0u5S+1gfABEilAqdUgm98HDwUQkDT8JXoPPq+BoM5kCYmFT9jryn1+hkAt7heBx8dhbSwACmTAUwTgdlZ/CVKJaLnI1GD8TikZiPSR8Gxib8chH95mZTxgwWHwH7+gFMswqcokIRbjMO2HDCnZ1VvArpjEmnKZc8+cZJJYGsLsMiZ8AgwEqaY6Mb6RQR33JFhGECzCRyfAFXNu9v+RVNRZWIMuDJNuYMAaDycUFGhCOgtuAtFVDA83G5A8TrFDw+F5QMAxAKJJxz2xnW3RPJGbm+rCyjotZetH4DGzaSSeDA3h4Zl4R0JOEZWTpIzF4n/m995bNdqZwB6m0gFft3Ak6vz+KYWwFsGlqIxXItEcDt1ARMEtKdVgZb+fwA0G2C2hXM0ZTZNRcSf0b1pmXi7uYnjI+Lfanm5fRQsK8BIxKcrK7i/uIgP+Tw+FlREqHN5fx/vyU4uHBE6UO4gDWqk/JFaLuMxcXeFk6TuJ90V0HOk1in7J8AAjmgkPfjU+isAAAAASUVORK5CYII=","h": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAbRJREFUeNqMUk1Lw0AQnf0woK0ttVqp0hwqVCl+UBERT94F7x78Cf4Uz179DT14F8WbYHtRkBYRLNqDtdaPZLObuLs1NGlXcWDJZGbey+x7QUEQgIqT07PL5WKhHL5H46J+22q22vsWpbWwdnR4oJ80LNiz2czGUjENhvj4ctIE4Wrj8XmPUlKL9nCYcOFzE9j1OKSTCdjdrtiLdr7KhVgzEvwW6krC92E6k4Kd9bJt57JV5vFK2KfRQRV+RAMkzxglYI1RaDy2dW1rpWRjQo5VGicYIorWVooFvQVCCAjG8Omw1MgG8AM0uSBUDSnCfk/IGCHwf3DCD/7UhOLBrFkDuep/hDUSSCv1iYo4rIfqGwmUSNJjfYbBcQKhZw0aBMA4B48LwBhBt/cON80HmM9NQ6fXg/Wlku4TwmNWDzaQqzHG+0PSKod5cH5Vh2RiAhYKc8DlV1UPSyuFMGygVlMg1/P6BC6DqXQK8jNZDXAYA1f21V34wMXYFaiyVw0rJyzLgs3VMkxOjGtix/V0XWChZ0cI2i/dzvXdfTd0Qf91BMPrhyNzgKfOmxaWypqaDXHfAgwAtCL8XOfF47gAAAAASUVORK5CYII=","hpp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAehJREFUeNqEUk1v00AUHK/XKf1yZdESVRBXjRSRFqMQVBA5Ic5I3DnwE/gpnLnyG3LgXglx4UDDLZS0RWkDLiRxSusk9u6GXSembmLgWZbX7+2bnZl92mg0goo3b3ffO/ncdvyfjHef6q2Dlvs8Q2ktzr16+SL60jhhZ69bO8X8ClLC7w9XdKJVG8fuM0r1WrJG4gXjgqU1D0MGc2kBTytl+7a9XmWcl1IB/hZKEhccq5aJJ/e3bTu7Wg1CVo7rNLlRhUh4oMnXoDoyhoHGyWmUe+QUbELIa7W8CjAFlMzdzeckCwFN06ATAn8QmDMMMGlMuwWucpoCHNe4jBkAMenjYvRPTyi53JvuwX8AplleAeBcRFrH6rXIxLim9I/pi3QA1RhKaYxdjkN8IwalCMIwWs9ljMkh0wzk+9M7w179C3LZNXxve2h+c3Hu91HeKmD/6zHOLnw83ilB1/V0CeqU3Q81LC/O41b2Btx2N2JVP2riR8eTUxmi0TzBwrKZMsqMoz8MsDh/DWuWhUBKURLKxQIeOMWoptYPnS1c+INZBkwISomOSsmBZS7B+3WOzZvrKGzkMAiGqNy7g+LmRkRfekBnANy2163PZXrSbrQ6vch19Xz8fPDHyL39QzkHBKedXjfu+y3AAGU37INBJto1AAAAAElFTkSuQmCC","html": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmBJREFUeNqEUktPE1EU/mY605a+hhZTBNKRDApNrWIRA4nEBUZdmCgLNi4MK5f+FNdu3bFv1J1EXODCR1JJSMTwpqUP6NiCpe10Zjz3hj5Mm3iSybl37jnf+c53jmDbNpi9eb+6Ftcisea909bWNzNb6dwzSXKkhIt/r14+515qBqmDA8HpqKagh53XaopblpIbe+knDpFAhPab2Dw0TKvRK7lmNODzePBgZlK9oUWSpmVNdpIU8T+jaMsyMaD4MDcZVa+NhJMN00w0n6V2nN3yQgdHWZag+LzYPTomIAtT0THVtPGanmb/BbjwLFkvn2IttYGYplKyDzsHh7gdmyAWfh5zVq0Guhg4RAHFUhmfvq3j134aXo8bd+ITnMFOOovU5jbGRoZwNxFn1cxuAIcDW/sZDjA/c4u+BNxOJyxqaenpI3z88gMfPn9Hv98HQZS6RazW6kjExvFi8TGdDSy/W0Emf4LS6R8sv11BmfzSwkPcm74Jo9Ei0GZgmkw8QCOao8OXcaz/5vSZnPdnp3ApqBBLkWJE0Ci7ASzbIhCLLQ1E0iOkBDh9NpUgiUejo8oNuJwyn0YPABtn51UYFFivG3yBGCNZkuDtc/MW+ZQI3OrYpBaARCKufk3B5XIiWyhiL5ODp8+FfFHH+KiKSqWKUL8fC/NznGlPBmz+24dZjKnD0CJDcMoyW0SqXuMtHBFw7rhIAD1ErNUNafxKBNevapwu65NpEQ4FqXIA+RMd6VwBP3cPSERb6gLIFIq61+UqGWaFdcrVt/lmAuWjAi2aiMFwmOYuIJ/N6M28vwIMAMoNDyg4rcU9AAAAAElFTkSuQmCC","ics": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhRJREFUeNqEUkFPE0EU/mZ2dra7bLNpi2AxQFKalkJrohICiYkXPagXrx78Df4K48GDBzmQePLMhUODNxQ5ciEkJVqDtJGmMWrCATRbd2ecoS5u3aovmezsvu9973vfPiKlhI4XL7c2r5YL81LIELEghLA3u/udxmHnPmfGW/Wuv+LpwwdneRYBx7PeWK0wOYYhcXxyckGV1fdbnbuMsXcklqPRJQxFMKz4RxDCtVO4s3xlRjWoB0FYjlQPEEBieChwKCRGMx5uLtaKs1P5ei8IKlGa/YkXMXYtlTEDlsnw/mMXhBJcqxSK6vlcpa4PEpCooUyIqs5M6hG1o2CUwqA091cFcYLf/sjzcX75EiQIojI9779CTYR4jwTBf+r7GAwh0AxCiL6JMT/04vQ79u8aI2O/7Jzg69o6Go8ewycUahtBpADhHKLnK/eVbkMdtROWIv80NQ2sPhncA9Htwn+9hZG0rY6DzFwJl+7dhs0ZstUy8rduwPS/wd/ehmi3kwq4zTHiWUgXp+EuL8FvNvFl5Rn4xAS86iyI2kY3n0Mv48ByrOQmancdi8I0Kcj3U5iuA29xAelKCUHrEIayzltagG2E4IwkFaQgSC6lYI09iN0d8It5uNV5nG5sgJdKYC0G8WoTOZvBISFNEBxnsuzD3GX4vfDsszzqAu0jkJQDedCGbB6AWg54pYbPo+NGVPdTgAEAqQq70PytIL0AAAAASUVORK5CYII=","iso": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjlJREFUeNp0kstrU0EUxr/k5qbJzdPYpGkpsUJoA2q1oLjTdiGiIC5cuXHlxv9BEOrStTvBnQvRrSAIsejCrlqpsURq2hCJNQ+TNLm5uc/x3MmzJh34mDNnvvnNzOE4GGOwx8+t9XQkfn0VE0Y5/7Z+kHm+dvOhtd3P9c/xwNZh7nWaMYtNUmX/Fct/vlN7/8J5aRRgyzm8xzpRDjGE2aVH4VTqdnoUYg/XkEhmy+Cx3DhA5tMzdFolvg5Mx3Fx9SmH0JIg79Zo3j4GADMIokJTKtjbfAKXU4Y/2NvSfyH75TFOxa9Cmr0XnlPFl5ReOQ6wNMDsoFX6AElqQlNV1KsOuNwS/AGFjEUIDhmn5+/DMM16/9igBowAzFKIswPJr6MjlxFP3sV04gaP7RzMPe6xvWM1gNUBM2UKYlBau3QghGphg29J3gDlLLilWNdD3gkvIIDRhD9yGe2mCV0V4HFXuCxT5Dlv8Dz3sIkAs03FalDxBMQSt9BRBMhNncuO7dyU28c9tnf8C/Q0ZtR4GImeQSj8APLRH772BWcgiFODffCv/t8H9tO0v3RjV7VqkeeXLlzDfvYjj88uXhl4JwIsrYxmLY/M1gYclIvGE9jZfNPrSCD3/QgLyeWTADV6wW9AryIcCkB0u1Aq/oCPumlufoF72vIheaLDr4wCLIOqrYnULA14PSoqpSJEAUilZrD77Sv3LK+cI0+Be8cAbbmAOrob0agtD491LYfkoqvnyZLsWRkA/gkwABL4S3L78XYyAAAAAElFTkSuQmCC","java": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjxJREFUeNp8U01v00AUnNiOEyepQyhQobRBSlVIoRCBEPTAjQsSEneE+An8FM5cuXLNoQduIAE3qopKNJAIIppA2jrOR93aa6/N8yZuUxyxkrXr3ffmzczbTQRBgHC83nj3ca28dD36nx6fvnzrNNrdp4oibyUmey9fPBezEgWVFuYLdyvlPGaMY4fl1aRS+9pqP5ElAkmcnknRwuO+Nyt5u/ETYfyj9WrpZnmpxn2/Ok1Swn/GvtnH5k4TLue4kNfxoFoprRQv1TzOb8cAIu3+ZD7oD/Hm7XuxzqRUNDtdkuLiTmW5tFxceBXlnXgQTAORSMt2oGezUJJJrK9dFWdEH7Ik4dB29LiESeUEJXd7/dAT3L+1ivlCHr8NEzutXTBvbJPPSdO/AH5wysChwM/1HzCGlmAzOrKxu2eCud6Z2Jke2MwThpUXL6Nn2ZAVFTlNw70bK0iRnGAq9qwHtOmTRpsx1NsHyKRVnNPnoMoK9kc2BjbD4vk5JGV5NkBoEPM4FFnCteJFWOS4ntHEfphQyKaFTWFLw704AJ26ZFx/ZEEi3YyY0O1Dmr4EKTUHA8hUnS6siI0DEHLYog+b28RCRuNXR/iQUpPUEQ+NVht6Lodnjx+GXYgDSFRnq97Ed2pXSlXhUSeGhxYc5sKlNXM5DGLR2TMwfZVPAIi+otGNWy1fEZUKeo4qc4ysI+F8VksLIJfYcD9QYgB/DNPMptWBlsnBIS86xmDMTBo/PWd0LB6VZfdEbJT3V4ABAA5HIzlv9dtdAAAAAElFTkSuQmCC","jpg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU8luUlEY/s4dmMpkWxRopGJNNbiwhk1tItbGtXHr0hcwmvgOdWld6Bu4coXumtREE3ZKu8FgOlC1kIoXtC3jPfdc/8PUIpzkBM7wf+f/hsts24YczuerGUc0moBlYTAYA+i8sbdXtAzjITRtq39kr73s/Gr9DTUYPOeamwvYnHdrdR0SnDebuCbswJGqpX+Uf92Hqm7hzFAG/4TgNr1uCwEJ0trcBC8U0Kb1/PQkHt9JxSLnL6TB+Y2zAIMOJBGLXmtsbEAYBsx8HnqCGKVScAX8uHf5EpqmGXv18VO6VDEe0PXsKABN8+AAgiabmYFNNJTDQ2RUFc8+Z9G0OPR4PKYwvKari0MAgiY/OQGCAajhMNR4nDZMaInrKBGl70SPMScck1NQG3X/CAWLE3/dAWV5hRRVIJxOWNksrP19sFgMqqAebUGYHMI6teq0A9oTVAhqu2sfbYYjsL7lCZ3683gA70T3TK7/B4BNoO020GwB9TpwfAz8LgMtWn/NkV8EHgoB81c7nYwCyBZlEVkHcqMTKFnkmehJTOPvEfCnKi0fAyADJKfXC/h83TaZTJjaa5lANLpOFqAXtlEAorAwO9u5syT5UxLfU0e3o1FMu1x4u7ODYq02BKAMAVSrSNLrK1MhLPj8mNF0vFm+C1ZvwKBwXXE4AGn1WAASazESwUW3BzUSMeJ2o1Aq4sPurvQYSRLwlhRR6mSaYyi0WlpAJrFRx3ouh5/lMt5lv8BLwXp0M4lSpYL17e2uK5wP6lj/c2ZPn2RI+YT8fDvqoyegVLyfG5kBKaQQOfvF2pLc+ifAABiQH3PEc1i/AAAAAElFTkSuQmCC","js": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RUQ5ODY5Q0NGMTE4MTFFMTlDRjlDN0VBQTY3QTk0MTEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RUQ5ODY5Q0RGMTE4MTFFMTlDRjlDN0VBQTY3QTk0MTEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpFRDk4NjlDQUYxMTgxMUUxOUNGOUM3RUFBNjdBOTQxMSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpFRDk4NjlDQkYxMTgxMUUxOUNGOUM3RUFBNjdBOTQxMSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoT8zQ8AAAJdSURBVHjadFNbTxNREP52t7S0bktbKFAvTUVaw60YqkExUTD6oD74qC/yD/wp/gh885XEEI0RAyYQUiMpIBGMkYR6o23abi+73e2uc04v1LROMtnZPTPffvPNHMGyLDB7sbJ2ciUSli3U35smkK9t7x9v7n2dD/g8KUkUwWqeP3vKz23NxJGzgwOx0RC6mSgIo+WKuvP56MeUzy2nJEk8PWsGJVVTuhWbpgmHw47FB7d98Wg4mVWK52o1sxOg3Va3PmFp+Q2PdUquaFUM9/vw+O6cP3bxwm46Xwh1ALR3/vL1e+hGjcc9koScUsTSq3coVDQsXJ3wzo5HEs3clgZNMTVdx1T0Ep7cn6//QRQwMhzA6uZHLD5cIFEFSKIU+G8LK+tb0KsGZKcTJoEyP08AbpcLy6sbPKdQrigdAGaDwWxsDH1uGbliCYIgcM8WFPg8Mq5Pjzdyu4jYbCE44EepXMHuwXe+A8x3KKYxYsjvbUzmlPGpBmYdgI1oYjSMbL4Ao1YXMkcM2Dd2xnbAamPQAqg1GORLZdycmYTdJqFKk2DPR3fmwI4zBDrg9RADqxPAbPBif2WTSB584/3/TGegEOit+DRcvQ4OZJi1LgwIQKVCg2i6nb1I7H3Br3QWqT9pBAP9uDY5xjdSM3RqxeoUkfVnEOW8UkLykERTNXjkM7h3Iw6NNvHw6JjuhAhVrba0+QeALozcI9nQR0VvNxJc/ZmxCNGvIBQcpDG6udA22kyW29HC72wu8yG579ZoiSYuR/ly2+y9CA4NceWLmo717T1i5ULqJNtapL8CDACskxPFZRxLwQAAAABJRU5ErkJggg==","key": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlZJREFUeNpsU11PE0EUPbM7u/2AtJUWU6qiiSYYo5EmmPDCD9AH46sx8cEnja/+CB989z+Y+MKPgMiDsYQACcbaWBBogYD92t2Zud7ZlQZsbzKZ3bl3zj3n3IwgItjYeDO3MlWme0bjUth8e8/fO2tHzx3XqUEk50uft+Ndnhdmc3SlfNPkVZT8Cy600DoIISvVfKYtlvfX1p66XmoIYsMZdjJQWvEFbbsC/S5g2QhSkKUK7rx6OzvzqLpsovAhaAxA3DUBQn2TUFsl7KwTfm4Z9DoO5LW7uPXi9Wxpfn7ZKF09vyPxX2iWcNRkKGZz0mQWKoNs8AVB6x1yRY2pYnc2LLofuXTxMgAlmlXIfngCxNxEzM+DPv6NQa2BygLgZyX6JT83ngHTN5GAL0WSoUQkSQnXkyBh/k0GegTAaldM20sTKvet+yyhIZApECamL0jUSe3oFChx3TopM4TeEQP2gc6BgGIwb4KGNXRhCkMGxgg2kJeybRiZM45D8W61qEAknSmpHStBhywu0nFVupSCTAcM4ECwqapv+NQ6LS9JGALoMIIoPYDjZiEL1xHtbyO39AQUDaA7R1AH23DSeSA4hv5RG/VAhxomPYP8sw9A4TaC9iHkjUWmrtGvbyC18BLe3GP0m3WW4I5hEBEnPIStXzyuFIxb4EkMEJ79Qa/xHbKxCdM7xeCwzUZOjgEwnuzt7qLz6T3cySmQP43uzjeIiTJM6io6W19B/NLCKMVGCzkCoLR/0lrfOI2fNy/huKC1FTsK/rbGNeMRC8dHpHByfu+vAAMAL/0jvAVZQl0AAAAASUVORK5CYII=","less": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjZERjZENTJGMTE4MTFFMUIwOEVERjQ5MTZEMkVBREUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjZERjZENTNGMTE4MTFFMUIwOEVERjQ5MTZEMkVBREUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGNkRGNkQ1MEYxMTgxMUUxQjA4RURGNDkxNkQyRUFERSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNkRGNkQ1MUYxMTgxMUUxQjA4RURGNDkxNkQyRUFERSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl1w97IAAAJhSURBVHjahJNLbxJRFMf/wPAIMIxMkUI7tS0VYqlGDLGhjdKkqyZ24cJFN925de+XcONHaHRj4k7TND6SGo1VWwmp2kSLhlqMDbQ87gzPYcY7k4GgoJ6bmdw598zvnvM/95pUVYVma+svcovx8yMnFZHAMJPJBJfDzq5vpX6+/vD5qo/z7DOMBdo/d26t6jFMJ3iY51jBz4M+LP6wxEw40Gy23qYzB3HO7fpmpZCOmfEfa7Xb4NxOrC4lvbPToe2yKE3K1PdPwNOtHdx79ESfq4qKkijB5/XgevIyHxEC24USmewDqD2ABxubaLRkfW6zMqjWGlh7/ByyAtxYnOPnL0Q2+gGGmKRaw8zUBJaTiS5QOO1FJnuIAM8hciaIWHgi8NcSNt+loVDY8JBXh2ojJAR1HbTSNFMUpV8Dxcjg0nSYBrtBxdLbqI1iheCUh9XXNGurAwCdEkb9QyBSFam9TDfoPZ1LUg1BH28IiwEARTVAQOzcFKRaHZpLoa9avY6L1Gfs0c32t4PU6W2lWsV8LAorw0Cs1nXftYWE3qZGqwWHzYp2zzlgetuolVFvtiDLbRRKFTAWCxx2G/KlMtXFhWPqOzsWHJwBx7rxKv2R7mwFz3lw9/5DLC/M4Us2RwV0g3U58XJnF7dvrsBOoX0Abbej/DFKRMKI30fTVGC32WA2m5H9cQQvhYi0vE/7Wdgczn6ARA9QPBrBszcp/XvpyqxebzQ0Tlsq6llxLhe9bD4cFMr9XdjLHpLv+SLGBYHAYiVu1kNOpAaRTWbCejgiw0zGhFGSK1aw+zXbvfK/BBgAPwADAs5GpGsAAAAASUVORK5CYII=","mid": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNpsU01PE1EUPdOZKWUotKUKFLEWkQ1EASGGxGBi4sIVrt27IixN/Cn+CxfVnQsXJiz8IAoqRBGEaMUUWzofnXkz781436QDkjKTyXuZe96595x3rxJFEeTzaKW6dmdpfIoxjuRRFECGn7/4Utvarj/syWgflU5s891qvGoJePJasfBgeSpnW+yEIJVS4DEBx3FzGT2qfvh0tJxOE4mCU0yy8X3BLdODRQTJZ5oMzYaD0UuDePzkbnnx1mjV9/lMp+izBKEIwQMOzvnJGoYhhBDgFKtMjmBl9XZ54WapSjLnknMnEkQYgflCVhKXLt+/dRMy2d5OHdVnPoxeHUtLV8u2w5/S78UzBJwLMC8gAsosIqy9/ga37WNmvgKVKmEkb7JSwI3pIdRq1kBXBZJAUKkb6wd49fIzbJthdn6cIhE0XUWbyP4cmshmdZAE0eUBD6gCN0DtZwM7Xw+RUlVEJCui7CmyPaS94zC06ZMedREERNA6djBWHsS9+9fRS3p9AraOXbhELMlUQju2G2O7JAQENk0XhpHG3MIVlEZzaDbdOKO8jWy/TraGsMmL4L8KTgnIfcfy4JBWeQNp0j10MQtB4EJOg6qFMI/bEH3pGNtF4LOAjHMxO1dGvW4jXzDi7Iw60TB0jJRyONhv4MdunbDneMA6BMPDA6iMFzExcQH9AxkUiwby+QzevtnF2OU8lBT1i8fOa2UO1/FwdGTHE2STHM/14+vlPOz0RxibKPfn9AHXZHBzYx866ZdTKkuVndhHuqenS1h/v4ffvxqyvbUuAtPizZ0Dp7X1fTs+FA9cMnWd4ZG90NOjomVFzeTcPwEGACDGeYddZX86AAAAAElFTkSuQmCC","mp3": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNp0U89PE0EU/ra7XWxpSsFYIbVQf9REFBHkYBRIPJh4wrN3DsZ4MPGP8b/wUCIHEw5EY0w04o9ILcREGmwVgaXbbXdnd2bXNxPahGyczebtzrz3ve99740WRRHkWn5cebu4cH6SMY7e0jRAHr9c3WxsVvcemmbys9yT6+uHJ8oaPefypdPDD5Ymh5w26wMkEho8JtDtuEOZFCrvN/4uJZNGH0T59D58X/C27aFNAL3Xthmsww5GCyN4+uzu+OLtQsUPxPQx6ZMAoQjBAw7O+bEVCMMQgqygs+LFs1h+dGd8bna0QmXO9OL6JYgwAvOFZKKoy3V44CgNfv7Yx8oLH+lUEgvzF8Ydhz+n41snAGRG5gUEwClzhHdvttFxfNyYK0EnJozKK5eGcf1qHo1GOxtjwI+pfvm4g/W1qtJgerYE2SXJSIL9+W0jk0mCShAxDXgQKgbNXxZq35vQKCiKQkSUXdc1+gcch1FHGPmKuIgBCdc66qJQHMG9+1NIpUylxxHtuW6gEiTIu+N4yjdWgty0yTmdNjFzcwKjY0MU7MLt+IjoSad16FoIx3b/A0DZ7FYXnsdpAjUMDOjI5zPgfoBsRodhhGhZHfBBU/nGAGRtxWIOg5lT2NtrI5dL0SB5KJzLodloqXaOEatPGztKq5gG3S5DNjuAK5NjKJfPYKI0okBkSdemCiSgS/rkQNLSePtxBj4LSCwfFtE0krqqX7ZVMnu9XlMXy2l7ME0dzA3iANQyY6vWxC61UY41zTyNcYh6/QCNXQvzi5dR39nHVq1BUyuMGAARsF6tbbe4iKD1r7Om5iFBdmW1SsDflLiuB6sX90+AAQDHAW7dW0YnzgAAAABJRU5ErkJggg==","mp4": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnBJREFUeNpsk99r01AUx79psrTrujVtbceabnZs4DYRHSoMh6Dgq77rn+AfoA/+If4Bok+C0CfxVRDBh+I2NqZzrpS1DVvbtU3SJPcm8SSlsJlecsn9dT73nO85V/B9H0H78OLdt/LDlQ1uMYybIAgI9n99OWxoe83nkiz9hDDae330JvxL48O51Xxm/enNtKPbVwAh0Ec6kYpXat9Pnl2GBC02HrjM5Y7h4P8+7FtIFVJ49OrxUnl7ucIdfhv+BIDv+fBcj7p/tXMPrs2RXVTw4OX2UnFTrXCbbY7tpMsA13FDSDAOQ4gJEGUJLs0PPh9CkESsPrmxxEz2lra3rnpAt3G6adgdQhBpmeLkFodNmsjpOPoXBrQTDcmFFNS7i3MRDzzPCw/vva8ikU+COQxm14BBhvJcHLGpGPTOAJxxeLbrRgAkYujBdH4G5oWJWXUW19YL4XqunAMFhnq1BqWYgaY1MAHASQOiU96zKzkU76mwehaOvx6h9uMv7KFN3RopL4oTAI4HRh4wSl399xla+00YbR3yrIzM9SzSqgJJnoKcklGrH08CcJjnBtLLCsSEGGpSWJvHtDKNoFippsJ0ulIsDDUCCATMlBQkNuahEyiZTcLsmFBKaQxaOk53TlHeKkM70AjAooCghBOk9sKtIvqtPqS4FBaRnJSRX8tj2DOh3lFB5Qw2ZNFK5LRo6w4sKt2ggAzywidAMN/9uIPSZglBLDO5FF3mRD3wHE9qVRvoHrUpfn+UEQK0/7ShtwboHJ6jdH8RZxSC57hSVETb7e5/2u0FxqPHJow+8iZ4lYY2QGu3idhIxO7Y7p8AAwALCGZKEPBGCgAAAABJRU5ErkJggg==","mpg": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNpsU0tPE1EU/ubRdlqmnUBboa0UeUQDiUGCC1+JmrhxoXt/gBvXJi74If4AV0Y3sNKF0YUaICqoIfjgVShEiGF4tDOdO/fOeOaSKtie5GZu7pzz3e/c7ztKGIaI4vn9p+/P3h4e4a6Pv6EoQBDiy7P5rc1P1Xt6XP8M5ejXo6UJ+dWbuemeTGdpvNdiNe9YvQLe4Bi4PmTpRmyq8m71rp74BxKF2twIHvAo+f/l1T2Yp0zceHizfOZa/xRnfBRhG4CQqAYioBWeXDyA8Di6ei1ceXC1XBwrTXHPH2vW6ccBBBMI6BsSUEQzakGL6xB0tvjyBxRNxdCtc2Xf8R9TyaWTDOg2TjfVdw6hqIoE9B2GxkEDWlLH7s4ette2kSp0oDRezrQwCIIA3oGHr0/mKMmE53qo23W4+w5S+Q5ohob9X3tgHgO8ULQACC7gMx9mKQP30EW6mEHpYi8xcJEdzMucjfkKcrTfmqmiFYBxCF/Id+gayKJwoQjHdrA5v4HK7Cq44KjZNWpagaqp7QACks0H9znW365ia24DzoEDozOJbH8eVtGShXHTwNracnsG7q6LzsEuaAlNPm9h7DSSVjLyCMkppDI+GS2StQWA1RlKo0X56n2X+6QHkmkDakxF9WMVqWyK+s/BrthYfvWz1Ug+zUDcjMPMm0h3pxEjFma3CbIuCud7oMc0LL1ZgmElpGJtW3B+15HIGNITrMYIlOH7i0U41NrInREylYbu4R5qQbQBaAh95fVKZCnpQCnb9DrWZyrRERS6NDeUw+yHaXh7rt4C4B8y+9vkwn7kwKNRpDoa9aiFKBYnF+RcREqQ2e1m3R8BBgAy9kz9ysCE6QAAAABJRU5ErkJggg==","odf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAi5JREFUeNp0UktrU0EU/mbu3FfE1KRRUpWYheALNBURUVy7cy9UkO6KW/+Lbt0IPsFui4gLBbUqFaUuXETUKCYa0jS5yZ2ZO557b5MmTXpgmDPnfOc7jznMGINYPi0de5UvmpORxpjE/kbNqW005DVu8TWw1H758ZfkFgNgJmtyxSPRjJIj0QTW/RDiYGXGb7Dl32/eXrVsd0gSCx9miqC0ooCdp69g5Q/h6OLN0ty5ynIkwzMwUwh2FwMdcbDiCZQXlkqFCpEoPT/wih1YjLInANcD+/Ua9bu3wJlGvrBZCmet2+S6ME5g4oGlZ9A/I70XCDhhDexPNTFmswJBwcnuXkF86VSNZxVu0ukLSGnBcqlnN4HoCQIaIuIv7LUooMOgQ7q75LAAb59B9gCBHSKgqemRr94mMKmD24CfM8nb7THYGQNLpAkUkcb66JyGBFFEWRVL57gFEH5qj8Lxwca2qS3EZaugmzAw24dR/XQgwtsCSBjPIdWbUoE2UJLBnV8Ac/ciWHsK9/glWLnD6K2vgPszsOdOQdfeQ1c/ThKoTgDn9A3KUED/52d45xchZsvorD6Bf/Z60riV3Q9Z/0bbGU1uopYGkfERSQ3VbsMwl0qlqoIARmSoPYXWy0dor79LfBMEEd8jGs/uQ3Yl7PJFNFbuEXiV2riCf88fovXhBbo/vqP3t02/ZYmJFqTkzY160Go9uEMbFK8hR/NrdXtFuUVmnmySVGgO4v4LMAAjRgmO+SJJiQAAAABJRU5ErkJggg==","ods": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAetJREFUeNqMUj1IHEEU/i7u7Z23e8tGgneGQPw3hZDkkhQiSuwMQREba4uUgpVlCrvEQhurkCoWqcQQ0oTAaYKNqJygGEwgHCSB6Knn7eXcdX/GmdHVPWYFP3gw78173/vmvYkQQsAwNvckq96UnyIEh7/d4t7uUd/8y+85P+bXSX4grkhI6nJYPW7LrXpBK2YxiSoShhu4Buq1NPofDeqdrZ3Z4cl7D4J3UtA5VyVAlmJoru9Af2ZAp1lcCQ3nqgiuKmbY3l/BH+MnHM9GVLP0Ww3KNA33CQoQQnL834Fj74PUGkANEIkCSSsa8gQqgYTIcB0PVsXB318GInRiCVWCkpRFAs+j5gKlA4t29Ggh4d0t04FKt9PQqF4UFgumSEA8ApeaElilWbYRVy/lsns/N1QBkxtENF4jxPxcgcB1CZVOrvMteK5IQDtJJIGh++PcX9iYwWjXK37+vP0WdYk0Ht99jtX8JywWFkQChw4tc+cZcvlF7rMze+ubbxN40fMalRMDP/6twaiUeK7wlZ0TD0a5hLTWxo2d45KKprqHKJslTsy209s2wnMFBTYNZjc/oLt9gPvLOx+hxVJIKS2YW5pCbSyJTGMK775O8VyBwDJd2LTDl/X5i8v3S7NVw9vJb51tITDEUwEGANCx2/rXEEFFAAAAAElFTkSuQmCC","odt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAepJREFUeNqMkz1II1EQx/+7Ca6JkqyYiJ8cKEpAQbBQFDm0sVOsFBS9wt5KOTgEG5twxVlZ+XEnKNiIghYKxx5nwEpIIXaiSAgKGmMi0d23u8+3T7OaZJEMLG9mmPnN/w1vBUopLPNNhRWXHOyDg0nx82TiJtZPlPVoNpftc2cTotcHtxx06kdXpSQ/BvzKESZzIDmAz6y+NojOjpDMZiqRPIgNoFyWM8DrKUV7axO+gcp4g7AzmquAdVNqOgL2z2I4id1B0wgeygOyt/rLL5buLwAIDgA9dY+L+DkuDQOCrkMgBsRglcMOqAGwIstMg8AkGsuZMNUMRMkLqE+QGloglvlA7uIOAKvZajR0qJkUj/XHe0BTIclVKKlrfKsj9qA8gA6wqSJzPaXlr7ky//tdLEUfawsBjExUFGVWbT7AxSa42H2LMfODmvd3wKb7RAMLYwM8nts8xJ/pEe7/3PmP2eGv3D+9usb35W0bINoA7RmjXSHsH0f5Z/mUSZ0Ir2JmsBtD80s8/rGyzWsLFTD5yUQCbfUBHl9d38LvkdDTXIuHVBo0k+bbt06qO+yAPGXwe/cA4wO9PN44jKDG70GougIzi2tQ00ms7/3lpwnBBgjZ37Kkd1Shht5XzBIFl/ufFtniT/lFgAEAU//g6kvdGBMAAAAASUVORK5CYII=","otp": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAcJJREFUeNqMkssvA1EUxr+ZjkdbrfFKVD12ErYSRELY2fkH+BMsLcQaSwsrSzZi47EjJEQkEhYkFlhYSVtFpdqOqpk717l3jKZmiC+5mZlzv/s795wzCuccQncz3YeRBj4KHz0/RrOZe2NsZPP20o255zQ3EAxzEAC+6uzTw13G4TFQAakA/CWtIYbY0KBOrx7IvwDQqlHV1o3YxKTOvyAUvfQCfqmA3e4ikyS/zRAKvOot7eoSHEgZIHrCfQAfBqBaKQQDKScQAExd8emBANg+2U2CvNMkkgSqBmrCxFB8mujeoJBWwEqARcssKTAJEGrmaGrjqK1zvNknH4BtyxKl2VUpRxmj5W+x73q9AEaZrR/ND1EJluIpS3i9JQiA+a+hSq8HwJjTsLrRaWitPTCOlhEZn5N75sM1qigmlN+dB3u++Qao5W4TtbEXXIsiszGL4PA00itTsu6XnQWo0TjMTAJqfMDx/ryBJcaVzSNSH4fW0Q+rkIf5rsjRiid7yyN7uoXS3Zn0egE0NiORAN9bQ017D1Lri7CLlP2EDr3Rf7C/itzV2bfXA/igLDaRixfngFhSCooH2xVPCWBlwKcAAwBX1suA6te+hAAAAABJRU5ErkJggg==","ots": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAfZJREFUeNqMUk1rE1EUPS8zmabJdDKB2glEwY9ExJYiBUEQpV25qgtBXfgbpEtXuujKf+AfEKRddOdOGHClbYVCvyKWaijT2mhjphk7Sd7Me76ZONp0EsiBYWbOvfe88+69hHOOAE9f3zTVnDKNHvhlsfqPw/rM0ovyWsRFdXJEpDIyRnSlVz0KSkmvabaJeXSJBEhgAJzTDNybmtUnS5Pmg/lrN07H5NM/f13FoMgpXDSuhiIiK3Qi6LUugX7FAbaPPsJqfIHHKCStqRsXVFPQuZgD9BBxjikSiRq41AAkgCQBzVf0+BWEBX7GBm0xgHHUqk1UbBuEcIydzyCZlOI9YEGuDxwduCCitS3Xh3viCZ4jrcq4PJ6DLHd67tjtuAAXib54dCPVEfQ5XIcik/0/2iDeOYz3ceCxrisMi904y0XiMQFfkB7lg6xFHwFxEqUMV0anUNBLWKm8xd3i4zBWOzmASx0UsiW831mA59Xjm+h7HCOygduXHqJatzA7Poey9QnXjTuoVD/j/sRcmDOWLgqnLC5A2wwST+Pn8T629lahSCo291bwu9XA7vcy3m2+gTaUR14thrk9BXasbdiOjSe3nmPpwys0xSi/HpbDd3bIQC6dx/q3ZbRb/j8BEi3Po5cTJpHI9CBNDEa++GyDBN9/BBgAwfDlCVUQaNAAAAAASUVORK5CYII=","ott": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdFJREFUeNqMU89r02AYfpJ0iVm7EqhVOxw7dDBEdpiCE1RoEZRddvUgbIex/Rs7eehppyF4LOzQu4MxwYp0HgShIuwwUVSCVtl0s13afl+SzzcpyZYmyF74eN583/s+PO+PSEIIeJZdrtQVI19Cgmk/Ph39bpllXq82g7sgLxVcyKNZpIx8Uj5u5zSjc9Gov8ZihCRC8D+7On4JczevGeTGSEIC4ctKJtB1DTPXi1iCCEkIm1EFlC2Em0iwtWfinXkIzjiO0jljtDC5TtflGIGUQMB+mfja/oPv2Rx9MMjpMdJxOXyXTwkcwIkewfqQ1QtQNB385zcI14FrtQexsSb6SRysZ4Fbf+F6eHwATc9gJGNAm5iCTL5n/LCVRGADNoeaGoHqyaXj5gqQlTODovcwNk5Aj6wXqV8eCo7EDhMonEHpW+dZC7gUG98D3geo7vkb01h9cAvPdt76OGy1xntUd3bjUxAk3+l2sHJ/FgtrT0MUJNfDSm0bjQ/72Hzxxo+NK+h3B7XRNO4UrwymQtMIkdTBU0m+sBOayLsn8Ka78mQDjx/e87HXPkb1+UsfP37+AmZ1fP/suknBb6nefVQXjl06TxMlJfWKNWr+Kv8TYAAkUueexJF47QAAAABJRU5ErkJggg==","pdf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmhJREFUeNp0U0trU0EYPTP35qYxaW6TlDapNKWGbgo2FkF8rARB6rboXusf0F/hyq2U4krFqugqSBeuAyL4SERBstHa0iR9JKZJ7mvu+M0tqZGkH3x8987jzDnnm2FSSqh4ns0VU1ybFzj674Wa3uWiWbfsFQb+jrGj8Xvbm0HlvYVRxhJprpmTlGmum+OMm5uNPZNbtjk3l82ey8++8oW4Jv/H/wdA456g2kvH99FyHNiuAz2dwflbN8YW8zMK5Go/CMfQkAhpGsyQgRCtlpE4jIULyC9fHzu7MPPEl/5ib6WOE0JJNRiHHg6j86mMjw/2gG4bkbY4PW4Yj2j64skA5FTHdaEMPiAJszt1sK0d4suJmY4k0+IDDGRfqmh0u5gejQc+fG8eYCIahRQCEfgQnIuhEkgtONE+dGxYxEDj1DhiEycZ+1YXdUpHCqTMJIYyEES5aXXQsi2kYlGEia5GtHVKn+amPBeCutPgfLALPuVu+xDVPw2EQyFEjHDghbpYNm1yKVVnYjTOerepn4E6XQmLGSPkPkOXWATMSDcjQEkAaqOu6+i/rccALtFL53LI3r0Nq1ZD4/MXZJaWYFer+PXiJc6s3IEgY3+uPYZHTAcAHM+DTE8gnM1CSyaCulv+GrRy8uYyElcu4XfhLVpkpNtn/DGA5Uu0abFH36WnzzCayWAkmYJvWeCkfb9SwY+NDbSoOx4bYqJF8rZqVRRXV/HhzWtUSmWwmWl0RmN4v76OUqGASrmMOkntSHF8MOs954dT08W248wzYsJDOujRBAaqqikTpRo/qqd0/dv97c3Lat9fAQYA4z8bX9nTsb8AAAAASUVORK5CYII=","php": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAhNJREFUeNqMkltrE0EUx//ZbDaXNrvZzdIkbYOXGgxYQlCK2IIY6EufxGdB8Av44AdR8AP44JOPBR+Ego0PClUKTTXQSmkTYtOkmubSJrQ1e3H2yJSEJNIDs3PmP+f89pyZcdm2DcdWvn7LzkxFHmCIra7nm9ulg8yLZ09yXON55Dgjt1PM2iPs0+aW/frdh8bzV2/SvQBnCLiEqcFxLKSSodlrU9leiGPihWePBkgeEZO6ShC2dCAZNuf6ADb+ldQ5PUPx4BCFcgXfdwq4Ph1Dtd5CZi4Nw7SQiMdCXkl6yVIy/QBWgcU+yx/XsLK2cdHndqlK/lZxH/OpJO7fnsWY3z/YAq+g0TmHpoUH2vB5PXi8RD9Fo10aAmDJTgWyIuOupmK38rsPcOvqJO33XWEvwLJsmKxHRVEwf/MKWl/yUMf8mIloWN8rw+sP0D6PHQmYuzGNgCRiMZVA17IQV4OIaTI8buH/AJMFd02Tkp05PO4jnWvc57EDAINt7u1X8Pb9KgI+Lxbv3cFR8xjx6AQ+b+Txs/qL9KePlih2CMBCq92hg2qzt1AoV7H5YxdhdqhHzRbgcpFeqdUplpvQW4FhmAixZ/sws4BoWCM/qmsE5XqE3dDQCrqGAYWdejqZgK6GUD8+IV9VghBFN1RZJv3sT5diBwC15gncggCPJKF0WCPN8dun55jQdVpz3Ynl9leAAQAJhiGatD9AOgAAAABJRU5ErkJggg==","png": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmtJREFUeNpsU9tOE1EUXXPp0CAUWmJbC04xBANNTF+kKhG8fID6aqL/gPEj9E0lIf6Dj30HL03wxQtVIC0QKrWxNG1Dk9Z2Oj1zxn1m0oIZTnIyZ8/ee+211z5Hsm0bYg29fLGpxWIJWBYGS5IA8ncKhT9Wvf4Yqprtu+w3q85X7f9QxseD/pmZMZsxN9fnc5JNw0ACGGv6tPSvyvEDKEoWZ5Y8OHHObKpucw4B0t3agnl4CJPs2YkQVu4s61ORaBqMJc8CDBiIRhhVM9bXYdVqYAcH8M3NgS0tQQsFcfdKHEbvlr6WyaR/V6uPKPy7B4DT7lUq4MUipMlJ2MPDUKtVfKZ2nn/5BoNbkONxXeb8LYXe/A9AJLNWCxgdhZJagDI9DZg9qIkEytRSkdqTSFQtGILSbgc8LViM+tc0yPfukzIyOJ359k9YR0eQdB2KmBbpwXoM3Dod1SkD+scpEapCI5DdpsJhIJcjajQZagcjI+5oLe4VkeQnyiZgdIH2X6BJ7dSqQLfrggjw0AQwP+/GegCIHppNoFAgEMO1RZKo7BQgRi3yN05cnwdA0BQMAgF3C6pnbuNg92M9AFT1diSCh6kb+FGvo2MxnBB9ocZxp4Mns1cde213B81e7xwAcl4jkaa0IUSjUdLJwkL0Ej6VSvArCt7l81iku6GrKnYEU89VJlSJRmR0Dax+fI9suYxSo4HlWIw6M3FBlnD9YhiXabyOsOeIqG7TzDeIYo6EDGp+ZPb2kKKqH8h+mkxiI5/D1/19J3bwYPvPWXq2skkiJVxesqt0XzghpKM8nRVV2Lv2q9eLIvSfAAMAaacnllcFBmYAAAAASUVORK5CYII=","ppt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAkhJREFUeNpsU11rE0EUPTM7ySZpmzT9DNamWAtFfSiCigr+AxF9zKtv/hvf/Aki+FEi6ov4ItWHPGiwiBUKoUqqTUJImmR3M7Mz3t0kNe1m4LIwc+65595zlxljEJzdR5uf5nLmsvZx6gSvtd9W9bjhF7jg5dH9nRc/wq8YXaTSJptb0xklx7IZoKUEz1zJ2DUU69/37vFYrDxegJ9U0lC+AoIIVGg9CL+vIObP48KDQn7x0sWiVnJrnEDg7KGk+i/Ac4iUM/R7BsmrSSxtXMfa3X7el8+Kjf3KfUJ+iRJQw4w0Tc8BRyWGRAZY3rBR/VlC+XED2ayDhZyXl03+hNA3TxNQshlGLAnE44zCIL1goXZwiMNvB1i6zbC0KuAsxNITWwgNMYPeLVJiFEO9ArjHAivrAjNzBr4f4vwIgdGD4YUACsZCE8AtYGWT5jCsGQw5wEYJzP/pj5RwYTA1b07eQmfZ8P0sgdaM2FlYwWkMgMpl6NQAO33GKM0wsQWflkh1uqGVmVWblsiDkQyqxwfag35SqcktaEWTUTHYNx4iGU/C29+BvX4Lpu/C7zYgFjegSY63WySsHyXwpYHU00ieu0bAOuJbBTArBkiXKiaAmTzcvRJUV9E8rOgqBwqlY8ASs/AadbRLb8CzeTjVClqft6FdB17tL7yeCbFRBYoLr6vR/PiSEl5BZJaBD0/R2nkOZqfQ2fsKt+0SEQ+GLSIEUvJm+6jbah2+pS2aon+4g/afd4SYJVuA7vvXdC/IHQtSoTnK+yfAAIEaId1m+vudAAAAAElFTkSuQmCC","psd": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAqxJREFUeNpsU01ME0EYfbtdKKWGtoItRWgJHApCBE2I0YuoiSaaeDJeOJh41YN3TfTixcRwMfEk8eDJGA+Eg0YTTRRMg02KKFooCBbTlkJLS7f7P+u3K9Xo8iWT3Zn55s173/uGM00TVlwZfzJztD92iKO5ouvQGQPHcQDN380vlDPr65fdLj4Oa41i9sFt+ytgN7o7woGOrqgvvpLBaF8vWj1NUAwGTVNRM3mf5vU/zaU+XySQuTqIFXz9hxmGLkoS7r+YxvVnrzGzlgXPDOzUZPT4m3Dt/KlIuH9oUjXYEHZZ/wOgGQZi4TZcGI5hLb+FO++TSOSKcLtcMA0dI0EPrp4+HtnfG5skiUecDGwQE2MjAwiGWlFVNDz+tIyCokJhPKYSX7Gdz2I01hOJdnY9rJ/7UwPGTEiqjtbmJtw4MYx78S/4Wa3h5UoOYwPdIOp2Xi/t18rlFgcDw6o+ydiWVRwOBnCpL0oOAMmNEhLZIgSeoxwGSWcERon/M9DoBknTIdNQNAMnO4PIVGpIFXcwndlA2OtGc4MAxml27p4AIulWSIa9QVadiYSoJxhqBJivKgh5ad3k9gaw6JdlDaqq7q5wINY4F22HaLHSDZQkBW72O9cBYFEviBIURQH7a7MN0uDisUW12ZZcaGlmdq4DwCqeTo1zNtZuW7hUqGIw7MNqSUS2ImNsKEpSdEwt5lGhfQdAkQBEoub3NNrDJfAIeBuRrcrY5xGQ2RFJAjl00I8PCckJUCB9q1URBnk38XEJEuk41tmGwZAf66s1VOh2keqwoUnYpFxHH4iKIixkN3HzVQKP3iQR/5GDKMuYmE3h+fx3MHqh1sMafztHLuiCg0FAk0uFdLqcpGY5QEXbTC/j7mIaVjc18DxufUtBJ/vcggs+3ijVz/0SYABsJHPUtu/OYwAAAABJRU5ErkJggg==","py": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAlVJREFUeNpsUktvEmEUPTPzTUFmgJK2UqXQFG3pA6OBLrQxamJcaYwuu3Dp0l9iXLvVtRuDpgt3JIYaTVSaxtRHsJq2xEJBHgXmifebMhECXzKZme+ee+65516h2+2Cn2cb2VwyHl12//vP2/zOQaF4uD7GWN69e/LogfNm7kUsPBFaXYwHMeK0OlpQEJApHJTuykzK98dE98O0bLM/UNgr4v32Dj1fwSQRt9dSsfmZcMa0rIv9ODaqYrPVxuPnL1Cu1aEbJu7fvIZUIo4bqeVYRzcyv/8c3SPYpwECt/dmu4ON3Ed4TymI+hQc1ZqoE+F+uQLDsnHlwkKMscJTgl4eJOi9fxZLePNhGx6ZQRRFqH4VjZaGSv0Y6cQcJLpra0ZguIWegqDiw7lYBBZV6xiGk9DQDLzK5bEyF4Hi9VLMsoYI7J6Es5PjeHjnOl5ubqHaaJGBEkzbxplQAKIgDmBHekDTgI+qKKqKLvNApgmEgyquLs1CoFn2Y4cIeLJpkjoCLkWnUSIF3JxISIUsCjAoxhWNJLBIJs3YeXj/08oYZkOKY65HllE/bkMmY504YUd40HUq2JSSyW6iVPmLiXE/ZMYQCU+hXK3h1toqdNN0sEObyKtqtDQ6kXDwcadDS2TBryp4nX2HxXjsJK6bDnZIAZem6Tp5YMMmicn5OC4lztNWtvB9cg+hQABtWjKL2jH/T3GgBcYDXEE6mcDM6SlaJAGMWkivLBC54ZgniZaDHSI4rNSqn7/t1vgkGJPwZXffSeCjk2iUWz9+nSTQN8e6ef8EGAClUi/qoiOc3wAAAABJRU5ErkJggg==","qt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnVJREFUeNpsU8tu00AUPU5sp41NkzRxpfSZqi0VIIQqEEJUZYXECvbwCWxYsuBD+ABUFrDrCnWBQEJdIWigBSr6pqRJ1ebhxrE9M7aZmSrQ4o505fHMnXPPPWdGiaIIYrx89GKpNDdxmXkU3aEoCsT+z8W1Sm21+jCpJctQTvaerj+TX7WbnJ+0cpfuX8mQtn8GgJ4AZtIFY2Hz3foDVRcgyt+cRHcS0IARh+D/8G0PpmVi7smd0dLs+AIjwTVEiANEYYQwCHlEZyJgIQKfoX84g9uPZ0cHZ4YWmE9nuufU0wABCSSImMsWEgqSuoqA/39/swZFTWLy7vQo7dDnfPvWWQa8GuOV3IYLJXmyzDzG2/ChZ3pwbHdQ267BKJoYuj7SF2MQhiF8LuDK/Gf0DKTBKINz1IbTbEMzU1ANDW7LAfEIQKIgBsBFlAx6LYOz6MAcvoDCtAVGGPKlAiIu/F55F33FDA6W93EOAOMaMOl7biKPwRtD8Foetj5sYPfTDtxjl1f3Ubo5jkQieQ4ACSUD2iE4XDpAdbUiW9D7UsiN9WNkZgxajwbd0LGzt3keAJPUc1N5SVeENT0Ao2BKV6QzwlZeRBSKAYhe3aYHcZWn7l1EfjyPypcK9LQGa8qCvW9j9+MvaasQOHaRhGWdhsNLR8hwodYWf6B4tYjDjSOovRqq32rSYq/lytw4A77o1V2ERiAtzY5kkUrrsH+3QF2KY87ArTtQuQ6nAf4x6FCV1D001+vYersBM2vA4y1Rm2D7/Rac/TZIw4d/6MrcGAPf9htN0miJh7Lyuoyvr8rQeP9iVJcrSKgJ+TrFcyYebXTP/RFgAFQobmIOBxbsAAAAAElFTkSuQmCC","rar": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnpJREFUeNpsUktPE1EU/u68OgylZXi0hZACQU1LEKKCMcat7jTRnQsXxsQtv4E/4M74P1iriUaNCw1FgxpjCJQKKAU60+m8mJnrmSll4XCTc8+959zz3e88GOcc8aq9evChOHl/lvMoubvWX/z4+BwTlbvw7bXdg8b7h6LE1gGW+O88CRMt4XTlR6/rYxce5Xv3jlHH19fPkBu+gWy5mlcFb3Wn/umeKOEMJF5C7xCFbtA9dRXjFoYKGiTRAlPGUV1aKU9O3VwNQ74A8DQAIZxqAuAhBPIMFYpQVAVB4CPSZjEzv1weH5tbDQN+JQ2Abu488mnzIbAAA3o/VK2PwDJo7r5Fy7ZRuvi4PFS6+qIXdVYD8Jg6BUcuOD8BozSLlRWyicgVKkTMQWwUlFF0Ooe5FIPk57BD7G0SiywyjD8bCDyHsOkeeeR3SUxEkROmU6BfQYFJMHfhWXV8efkUrb13VPMTsrcTQSzxZ/+n0GVA6EGbSGdgG9vo15fg2nFgbO8k70SRdd+mahDT81vUxTZRlJBRMsjq89C0EXCvSf7TIBZ136YZUJEiE7LgJ2dN01BZuE0dkIhxE7KcQTK1QUj+cwAEyrPZ+IydzRoyah+mLy2isbWBweESJEnB9q+1RM9Ub9GQOWkABg8HjRr2d9Yh0hTlBlRsfn+D4vg0BvUC9rZqECUJuk7Tzr1zahCYlB6HJAREPwfbbMBzLBzsbUKVI0qBgQkc+SxgWUYaIAqOpKwKXJ6bgGlaaDV/YvHaFNrtDsKTfVSrJeqIg/bRNwjclFIALeP3saybhu8SC4VBHwnhBXXIKocYRXD9QzBi4Xgchmkd9+L+CTAAMqwy+ZzluBgAAAAASUVORK5CYII=","rb": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAixJREFUeNqEUktvElEU/mag5f2yJhXLwxIt0kiqsVEXujP+A925cu1Pce3WtXVtYuJCF7KtTY0NrVQIpRVKeXTkMcO9F8+9ZVooJJ5kcmbmfOe733fO1YbDIWS8+/g1dycVX7W/xyO3vdsuVKqvnE7HZ230783rlyo7bVBicSGyfjsVwozomVbIPe/c+FmsPHfoRKJd1HT7hXHBZjVbA4aA14NnD9bC2VR8gwuxPi5Sx39Cp+M0XUP0ahhP1jLhW7HFD4zze3b93ILtXYyyVKlR8/5hFbnvO9gtlrGSjOF+OpXkYviWyo8mCS4R6bqO4p86vm3v4fC4DrPfw4unj1XN6JvBaQtjChzUXK43sVU4wNFJA43Tv/B73edQwTmfIhAjCVL6UdPAj1IVFSKhCdAcAI9rnjBiAjtBYEu3GEeh1sKJ0YXR68sVIujzIhzwY8DEBHZqiLRKkicQDfvABxaiQTc4Y/C65pCOXwcjcmlvJgHtlwi4epYifiQWgmoLZwPW6HQG07LgcOgKO0UglAKOTt/E+09fwAiUWU7QAE9xUK3jbvomsispZVHMVEDSZdHo9rCZ/4VIMKAu0XGjpU7d2S8hk0pCELHEzrjKnCQOYJoD+Dxu1RyiwUm5LaMDo9NFt2cqDLvY4oQFp/QpfT/MrmI5FkWebt+NpWto0j2QmQkOjZ9hpwhqjXZzM/+7LU+cc7lRrjXh8/lVLRK5ovLWXglOsiOxdt8/AQYAzv8qbmu6vgEAAAAASUVORK5CYII=","rtf": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAe5JREFUeNqEU01PE0EYfnZmd5FSvgLYFuwWt9EgHyEaox68eDJevHvwJ/hTPHv1N/QgZ2NC4g3kUAQKFKGhjVKqRrvbnRlnht262FHfy+y8877PPM8z71pCCKh4/ebt+rJfXEz26Vjf2mnsN5rPKKWbVpx7+eK5Xu2kyMtNTd5d8MdhiJ9BOO7atFI9ajy1UyAqSPIRMR6ZmoNehNHMMB7fX/UWvEKFMbYKE8DfQnAhwRmmJkbx6M6S5+WmK2Evup2c9yUk2nnKA0XVcSiGXAe1k5beP1i+4RFCXqnPywB/AKVzK34RjHNYlgVKCH50w7EBBogbTa/AVM5SgBdn0gc2AMDjPsbFPz2xye9asweS6n+NTbG8BCCfUtLjff2WoVnVpAH6z6hMUtJE3EykYfpF4vUiL3QNS7FMeSAQRBHW3r1Hq91B+VoBQRji4+ExFsvz6Hz7jm7Yw5OH92AcJKW9G4SoHhzhy/lXbB98Qmm2oCXN5WawsV2TACEoJXqwTKOsb3BtR2ucmZxANpPB8JUhyPnHWDaDpfJ1eZFALzJJ4MKO5MEtv4TSXB7V/br8iQLMz+almRZWbvoo5q9qRlxwewCgeXbe3qrVO5ZkUD/9jJGRLPaOm6COi92TU1DbxYe9umRD0DrrtJO+XwIMABWp9nS+FgaoAAAAAElFTkSuQmCC","sass": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDNDMTBBM0JGMTE5MTFFMTg3N0NFOTIyMTQ2QzhBNkQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDNDMTBBM0NGMTE5MTFFMTg3N0NFOTIyMTQ2QzhBNkQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowM0MxMEEzOUYxMTkxMUUxODc3Q0U5MjIxNDZDOEE2RCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowM0MxMEEzQUYxMTkxMUUxODc3Q0U5MjIxNDZDOEE2RCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po72XUcAAAJcSURBVHjahFJdTxNBFD1bykc/ttvdtttWGgI0bYrUgDZoNYqRJ014kMRXHvwB/hQTH/wFhMREJfFBQxBjhMRIFEQSCAlQxKYGggiU3e3HbnfX2bFt1EU9k9m9mblz5p4zlzFNExYmpue/jmTSZw5PZAl1MAwDT0c7O72wvPdudeNakPNtOZ0tsM7cvzdOc5yN5LDAsTFRAJks/kC2PxFRVe39Si6f4byez62EpAEH/gNN18F53Ri/Ocxf7OtdLMpKT42s/ZPg1cISJp/P0tg0TBzLCoK8D7eHh4RkLLJ4cCz12AjMXwgez8yhqtVo3NbqRKlcxcSL16gZwJ2Ry8KVc8kZO0HdTKlURn+8G6PD2SZhLMQj96WAiMAh2RXFYKI78lcJcx9WYBCycICnpNbojUWpD5Y0C4Zh2D0w6hWc70uQZC+IWfQZrXF0IsHvY+meBd08haAhoVMMQFJKWF7PNZM+klhRyogGhbqxOIXAMOtEwGAqDqVcgbVkkE+5UsEAWavf0az2t0ZqvK2qabh6IU3joizDwTgwej1LdVfJXkdbK8mt2QkayO99A0/0trQ46I1lVcX+UREhnsP34yLp1AD1xibBMuntpzU8mJyi3Tc1O4+l9U06n7x8Q/8PHz1DrrALt8tlr0CrkbJMHTop9Sk5sLa1g8L+ARJdnShKClY3tunN69t5iGLYTlCtakjFY7gxNABdN3B37BaqqoYT8pyX0in4ORbRkIA46YlDRbUTbBZ2Jb/Pw4qiKFnapcpPo9pdbrg8DjAOBsFgELJmsGs7eWkkc5bu/xBgAHkWC6UPADTOAAAAAElFTkSuQmCC","scss": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RkM4QjYyNDVGMTE4MTFFMTlBREZCNDNEM0ExMTk0MUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RkM4QjYyNDZGMTE4MTFFMTlBREZCNDNEM0ExMTk0MUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpGQzhCNjI0M0YxMTgxMUUxOUFERkI0M0QzQTExOTQxQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGQzhCNjI0NEYxMTgxMUUxOUFERkI0M0QzQTExOTQxQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pkf1yeMAAAJbSURBVHjahFNdTxNBFD0tLULpB91uodVWPmorUIxo0VSiNSExMYYHE33l0Ud/in+C+OSjYgjRGDBRCKJIUkIEWi0WKlja0ul22+5219lJ26gLeiezuXvn7rnnnrlrUFUVms3Mvd2bjIyezRVLBA0zGAzo6jhjm1te+7EU37rFO+w7JlMbtG+ePJ5mOaZmci/nsPl6ONBtw18WDQc9tZq0sp7YjTisXV/NFKRpRvzHpHodDqsF03djzuvDg6vHJWFAprF/Arxe/oins6+YryoqCiUBvNOO+7FrXMjnWc0WyIAOQP0N4Nn8IqqSzPx2swllsYqZl28gK8DDyRvcxKXQvB6gISYpiwgH+jEVi7YAfW4nEqk0PJwDofNejAX7Pae2sPhhHQoF63U5Gai2Bn1epoPWmmaKoug1UBoMrgwHabIVVCx2jdrKFwm67TZ2plldPQGg2cK5HheIUMbaZqKV9In6giDCy3MNYXECgKI2gICxoQAEsQItpNCHWKngMo01arTY/jFIzbutShJuXh1Fm9FImYiM7tTtKOtbO+toN9Nc+fQ5SGUOIVYl7HzPIH2YRZ0y2KZ+sVzBHn2v1mpMGx0DTaR3nzfwfGEJdybGkdo/wEigDyvxLzg4yiESvojZhfd49OAeLJ2degaSLIPOO6vwgiYaaRErTRREEdn8MeJbSVZ5M7nLdNExqFLaQwEfFfACQn1+HBWKSKb3MT4Sgstuh9vVDa+bQ4DORE6o6RlspzMk9TOPfr+fiLJCLFYr3TZSKNcI7+aJwWQmPM+TkqRg49tu65f/JcAAMwMas6WUKd8AAAAASUVORK5CYII=","sql": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAh5JREFUeNp8kctrE1EUxr+ZyXMkoa1NBROaSkpTBE23PhZ25cql2y5duvAPUdGFS1FxIRRBXZlFQ9GVdDENIhGJxkDsw2mneZnM83ruNZlOmNoDhzlzz3d/9zv3Sowx8Ch/qlYK2XM3cEJsbH0+qjV/rd6/u6aN18b7RMFT+9aosP/Ex+0ae/puw7j36PlKEMAzctKJ3aGFamMHjV0d+wcGitkMrpWWp6hVIciEk2MAOwbUWjosx0UiFoWqJpGMx5DNzODq5aIPoa82AWBg/lyKLMH1PMp/a9XvLXLzG1cuFlBaWpiKxaIPSLY6CaC93ggQjyiQZRkeQSzLRovGaPciWLt5faSWEBoh6KBvOhiaNga0+Y9pwaFxvu7rfp8F5pWDt+qNMp2IijHGwddWCvN+33/CoAOP5nVdT9SdoQ1JkggiQ6Yvr7V60+9z7akA2gfH9cRF8hO5F5Ve4lQAF9uuK+qFsylkzsQxrcaQm04hdWkR83Mzfp9rQ3fAFzu9Ph6+WMfjl6/pGBdb2jbKmx8QlRjWy5vkyhUZBPgOeGNHN9AbDLGUz6He2hVj3Ll9C8/evsdgaMK0HV8bcmDTU0UUBYXcedR+NLGnH0I3jvDk1Rsy46FP4C/1BtrdntCGHNiOAzWZgEKQ5Qt5lIqLojbaXSQTcRy2OwT4SZqk0IYAOgkVWUE+lxX/zb0DpFNpkTzmZmfFtzewhHYcfwUYAMZmVaZQlLFHAAAAAElFTkSuQmCC","tga": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnxJREFUeNp0U89PE0EU/ra725K22ILRGipb22pMG6JcSEQTbUIwnozxpBcvepeEP0KPogcT/wlNT17kIKbEmChFUYKGVtL0R2gLtNCl3Z1Z3+zSAlonmezOe/O+973vvZEsy4JYnqdPMu6RkSQYQ29JEkB+PZcrslrtPhQl23VZc8/tr9I1yMHg0EA8HrBM04lVFAhoY38fSSDQVN3pfKV8G7KcxZHl6v1xblqU3eLc3p2VFZjr6+gQgwsnhzGTuq6Nhs6kYZqXjwL0GFhEl3U60OfnwWs1GGtrUKNRsKkpeIIBpKIRtI1J7cX7hXRhc/MOhXw5DkCZGG2zXAajzFIoBMvng1ypIKOqmP30GW3OIEcimovzlxRy5RgAFwDEAIODkCcmIMdiQLsNdWwMZdJlg8pzEUt1aBhKq3XinxKYqF9yQbqRIqsMy+0Gyy47bKgUWXSLtDENE5wdtuqQATm50F1VnPbRGeEw8HXZbiV8fsDvI9ldju9vADAyihLEbrWAZhOoVp3z6iqBUiB1A4nEfwCEsbkL/M4TgE5n5jDx+oTEzp1d8m9tC8H6MaAB0imzx0NU/WKUYE+loEyawDBo2ui6TGfT6ANAxrvx87gYCGCxXEKVJvCWFsG3eh1vN/J4OD6Od4UC8o0G3TX7TGLHwI9iEQmvF9X6Fh7F4/iYy+GcLOMSlfEgGsP0qdNOmX0BiGKpVkV1bw/1nW2b/gCpf1PTcI+Y7eg6ps+G4bG4PR99SjAVo9HE4q+fKNE0vl5awuSohjeijbRefVjAtUgEQRK7Yhi9OKn7nKWZxxlSPWl3QwgnaIrW8QMhD542vUbx/W49m7sq4v4IMABOqi3Ej7bAEAAAAABJRU5ErkJggg==","tgz": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAnhJREFUeNpsU1trE0EYPbMzSTfdtInFtkkpiaXVWou2FRUEn/so6JugL/oH/Af+B1988if40jcFERQURNBSQdDWlLQN2lsue8neZsZvc7FoOrDszM75znfOmVmmtUYyvry++36yfOeS1qqzDtvH2P76ApPlW3Drb2sHex/uccHWAdbZX30kO2+B3siN3zhTnHuQ66+95i423jzFzOVljBdKOZNHazvVT7e5wF+SZBj9iZJ+3J11mbW2kR8T4LwFli5i4fqTUvnczTUp9RLtDhKgJx0q4dEwWAxrREKICHEsoYYXMXvlcWmquLgmY71yCkG/c0AkARgLMZpnMDMpGNzEYe0dGp6HwvmHpbHC1Wf9MnFCkHQOyYEPzSJwQ2B65Tm5NZG3Fshim6wbMNJn4bpHowMKtIqo2COgR2IcAptwjvcgo6i77igjEmVDqbY8xQJ1VwRULhiBI6+G9Zf3cbTziuzIDkmHSNqECTFgQScEcYuc2NA8TcdYwXD+GkK/TYVN+u72WrIudiAD8o6oAR2RRCmQMjis3CIy1iSpPySCXhFTXeyAgh4BR+JVw8pauLi0Cp4yCX9A90FQhnSBYtnF/k+Q+HYam9itfIZB3QvT8zj8XSW5EhNTs9ivbSLwPUzPLNPJBIMEKnaQYg6aB9+RGR5F5VsNgnNKXMI1NdJGG5WfHzFVLJ7k8c8xUngpVodlDSGbFYj8Y4yMpOG09lHf3yIFPzA3fwHZTAQVtU4JUTeFDrdgDdlI8wAz5Qy2KxswReI7QODZcOr0ZH3q2hIDBI7zq16tuk3FNPxAI4wN+pkoccYoE4YJU5EdUtM4Qst26v26PwIMAKj3P/2YUKgYAAAAAElFTkSuQmCC","tiff": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmRJREFUeNp0UktPE1EU/qYzHWstlrYJNcWUElyUJsaNGh9B0g1Lo0v9Ey78EbrVxBhXuHShm25YGBJRQpAYBDEWpaEPEhksdVpbyjzveO4MfZDCTWbauefc736PIziOA77OPH2yJCcSGdg2uksQAKofFou/7VrtASRpvVNynj13f6XOhjg8HAlMTIQdy/LO+v3uYUPTkAHCTb+cK+0pdyGK6+hbvu4/xiyHbncYAwfR19ZgbG/DoO9LsSgeTd9JXoxfyMG2rvQDdBlwIZauQ5ufh12twioU4E+nYU1NIRCNIDs+Bt28mXzx8VNuZ796j9q/DgAwomwqClilAmF0FE4wCInAlkjO4y+r0JgNX2os6XPYS2q/cQyAcQatFjA0BPH6NYipccAwIGUy2CVJFZInkKlyJAqx3T4/IMGmJkeWIWSz5KgI5pdhb3yDXS5DSCYh8rTID8s0wexeVD0GtMd85KkkefFxUfE47M1NokbJkByEQl6tL+ouAI+MUwbFhnYbaJKc/Sqg0x4H4eDRGDA56fUOABA9/GsCpaIHwr8FOhQ823O5RfW66tUGADhNy3RNRDjcN41HLxdQ8J6jYTsOQLfOJBK4f+s2/uoathoNGKT1MtFeVHZxdWTEZfEq/wMKl3rCJOIzTV6ADs2R5ulYDDNkYjp0DhrF+zCVgkw31+v1UxjQZkNV0SADd2o1MIuc9gmY+/kLxb0/UFoHePd9A1qzeUoKpilx9xcLWzgg+u/zeVfuQqkM9bCN1ysrWKXxdtPgvScwUAm58XZ52W16QyPtifRUzi588GbEi1ztHPsvwAC4uC9qhnsZvwAAAABJRU5ErkJggg==","txt": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAeJJREFUeNp8UrtOG1EQPfsyXiyzBguIJSyChZBBEFCKpKHLo6egpErNn8CHgH8gkZIiTSIXLhJAWCgkoMgRMSiRBSK29z4y9+I1d/HCrFb3MTPnnjkzlpQSynY+fP70fGF2gQuByCz6lfdd9Uurfvrrjes6762eb3tzQ69uFJwPsqOPC+MBEmxxphi4tlU5OGmsOzaBWLc+O9oIIVhScidkyGZ8vH62nHtSKlaI4cse6TjAfSaFBBcco0EWqyvzubmpyQrj/FXk75cQaSEMeMXU8xykPA/Hjd/6/LRcyjEpt2i7HAe4A2TeLZWKUOJaVLxj27j813EHGKCXaAJExu/4BOdiAED08riQD2riOrexyRoYc3CvsAbLGAAjZga7vgZG23WMCdBvoxKJc36TRBlMiaa2JByjNqqD8qkYc1pjDK7abey+/YhrWlfKswhpiCR96aEU9o5+QE3g2ovVWDm2Sc22bBQm8vrVpbkS9r+doPr1EOWZaQ0yFoxg2PcREosEAI4uvZhJpzFMP+cSXRbq+043RManez+tNWKMI6GN0g0Z04HFR+NoNC/0yx717efZOSbzY3AcR4Op2AGA5p/W31r9e0vNgSrh9OwCrpeCkqvZuqTybnpRqx/r2CjvvwADAJC/7lzAzQmwAAAAAElFTkSuQmCC","wav": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAApFJREFUeNpsU1tPE0EYPXtpKbX0wqUQKVQMFdIXQBNCQBs06KP+B8ODGh+Mf4b/4IsGE54kxhcMBrkp7YOQgBRvSKG73fvsrt8Otoask0xmd+b7zpxzvm8E3/cRjPkniyulW0NFy2JoDkEAguOlpXJ9p3L8MBqVl4O9YHxae8pXuRlcGO7KPLhfTDVUqwUgigJMy4Whm6lEXHjxYf3XnByRN0QB/2KaH7btMlUxoRJAcyqKhdOaht7+DJ49n+2cvTnwynXcsb+kLwJ4rgfmMDDGWqvneXCZS9ND7mov5h9ND85M9y86Dpto5rUkuJ4Py3YDJpy6QGJPayqB+Njf+43XL220t0cwOZkfrNXsBUqZugDA6CbLdAiAwaek1ZU9LmP8Rh6S78GsGxjOp9FdzKJaVZIhBgGASzK21w/wbrnCk8euX+EMAjaaZuPHdwUdHVFYluuGPGCORwwYjg5rqOwccRk+3Ux0IEvntmsNG4ZmUayL/wAwKHUNfZfTKN0ZRaw9Cof8qJ/pMAyHy5KkAMTksSEJtnMenM7EMVMawbejMzJRh67bXEYiIXEAVTW50SEAhzqwfqrBcXx4VOhYm4RsNgHbsJFOyZTsQ1MN+hcohoUlkFiMT+TQFpMwXOjGpXgE+XwGk1N5pFJtKNCequgYGupCRBbCDOp0KBJc4VoP3dyBONW8uydBgBHUThqQKCk3mEZ/LoUG+RBioJO7VarAwEAntjYPiUUW9Hh4b2R7k9j98hN37xWx8fGAt3eIAdVMLn+uUv+b2KReSCZjZJiB9bV9jIz2ofr1BKvvd7G9dRC80lae0HzOt+cWVnrSKDrMJykifwNBpCgE/UAllEXufmDu8Zlffvvm8XSQ90eAAQA0pF7c08o4PAAAAABJRU5ErkJggg==","xls": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmxJREFUeNpsU0trFEEQ/mamZ3Y2+0zIC2MmITEkUYgERFQErx5E8KTi1b/h79A/4SW3nCNeYggBYZVEMU/y3N3Z7M7OTD/G6lk2ruw20zRdU/XV91VVG0mSQK/3n1a/jky6d6Xs3G8WXS+Pw5N6LXjLLGuna/78oZKerGsYKtrDE16uJGL1L9gEOOcYd2dL1fNwrbL//aXN7J1efPMmkUqEFAk0A0VZNbFEaQCBscIkXj975y3NLq9xye8PBkAniHOFph+j2eC4rsdoB4LsFubGl/Hq8RtvYWpxTQi52o1jvWiGYaRZL0/auDgOkC/Z8BYL2Pqxidp1FZkhoDxpeaXA/Ujuj/4HoOxKKjiOiek7RUShRNQWaNYFQuMafrYCxiw4ozZKfqbYJ0EvRdl1DQyyTs8XCNTA6UELMwvDyLpZWIZNNlNLlQOK2LMJRJ+5AkuZ1S7CFFzJzk56GnUjQWlYkqCoBWFbonEVYcLLA4dNnB624GQsDBWIgfZJEgxkoChzSFWvn4VpQemDm2VwXQsXJwF1h6c+gxlQ5jgSiEUEt0wdIe7tMES+nEG2aCLiJMOIIWIr9e0DEELAMUrwRuchVAyTKimUwO75Jm6VF3Bv7imOaj+xd7UFKVS/BPJF1b/E4tgTrE49J60O5kceoNqowiuuYKa8ghHXA48U9MT2AQgyRvTThE30bQiaSGa4yLMJNFo+Dq/2cHt4CYlwyFf2S6BHwwrMw/avDbR5C1k7h1YQ4KH3Amf+AcZyEbZPv9CItzQD1l9EbtYOjv74v/d3O9RMPTDrsEwGIWN8q2yk7XNYRs9JrRv3V4ABADSGR6eQ0/NQAAAAAElFTkSuQmCC","xlsx": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU8tqFEEUPVXdPY/ueWZIoiYZiSYKYhJc6EbduHOhgijo3t/wH1z6B0JAhOyMILhxo4kJGk1ASTAxwWF0Mpp5dHc9vFUzYwidaoqmq+8959xzbzGtNcx69PTS26ETmQtS9r4Hy/xv7MW7jV+th5yzVcaYPX/++It9u4NAv+CVR6tBUUTqMJsDcRzjZOZM8W9ZLKx+/XDb4e5/kH5In0lpIYWGUaC0YTZnBCAEKoVR3L36oDo7NbsglZwbqD6iQKOXFMcKUVfBkBAoQhlD5xxMDp/HrSv3q1JgYW3z0x0KXzkCYJaRZljru23aHWTzLiamAyytv0O9UYdf5PArqlppBfMUfu4oALErqZBKcUxMFRCHEp0DgW5Lo4N9NIN1dF0XXsVFOUyPJTzo+WBANDidjp8tgHGG3c0DnJ4uIRf4cOCBaW5KjY8xkZL72xpJ9QcFz5bVqHUJGHZL2YtNmKi06YCyiVFb4s/vEKMTAf1p4edOG6mMi1zR6wEpdUwX+vLDtkCzHoK7ptcM6ayLmGajvtex4PliyoIkFRjmUEASelB2rXQRSfjUCT9PlWpmW21iTGzCAyEkUixPRqXhe2V4zKczbdmybgkpJ0cGOuA6Y2MTCsKoi5HsNK7N3MN+uwYaWbxYfoLLkzdxcew6lrYWaZhm8PHHG3zffp1UwJSHz9vvkU8PodbcQYYYS5lxYkxTkGdVDQdV1Js1qPgYD6JIuIE7gsXVefIhIuM05k7dwMbeMmh87a18ufIMaVYyprrJLgje2Nr+1tzYXANnDnr3zRhHj37Vvy2wpXHtNAd5/wQYAD6WMuT2CwoVAAAAAElFTkSuQmCC","xml": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAilJREFUeNqMks1PE0EYxh+g3W2t1G0sEqyISynUFJsSOShNwCamiYZED3LgIkcuxoN/iCZePZiYGD2aGD+i0F5KMChxlVaakAK2ykcAt+WzdLu7zkxo3WZL4pu8mXfmeeY3885ug67roPFh5nvc62m9hjoR+5LMp7MrkYf370qVtco+VtCUFpbj+jGR+JbWn76OyQ8ePwsZATQb8R/hanZgINgj9IqeuBFCw1Kt9OMBnNWCs24XwkG/QKYUEiGjVAPQof/rq0783pShET3ULQo8xz0iS5FaANmrHQH2DoqY+DSLSz6RzecWlnD9ymU47LYjd4O5BXqDTG4FM3NpTEkpdJ5rw0AowLRMbhUfp58gTOaD/UHmNQPI6YmvKWRX1zESHUJ/oBs2nmPa+Mgw0ZIM3tZyGoJwygzQNB2jNyJIZX7iB0lpPoM70UGmPX8zCU+rG8NDVxHwdiC5mKsPUFUN/gvtLLf39sFzVqaN3YrC6TjBauqhXhNA1TQoqloV7Da+pjZq1FsXUCamF29j6LvYhf3iISamZ3Fv9DZevouhRzzPfOG+3hpA9U9UyioOlTJ7pFeTCQS6RGzIebyf+oz5pSzWtmSW1EO9phvQ00slBRt/8qR3DoWdXbiczUiTzd52D+tdLmyTB14mx1rMAKVcRpEATjrsuElee/HXGmnFRyBOGD30C/nEDjNgs7CDpsYmnHG3YPegBCvHs9oYfm8nG9dJa5X4K8AAQzQX4KSN3wcAAAAASUVORK5CYII=","yml": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdxJREFUeNqMUl1rE0EUPbM7m5Y0Zptu21AwWwhYpfSDFh+kvvRd8N0Hf4I/xWdf/Q158F0QoQ+CVsFKaLSQpt/dpmvztTOzzky6cetOpWcZZvbO3MO5514SxzEU3r57/3GpWllM/tP4sL3TarROXuSo/SWJvX71Uu80Cfhlr/T4UdWFAVfdnmsTUtvdP35OUyQKVnJgXDBTcj9icAsTeLax7j/052qM81UjwW1QJXEhMF0qYnN90fdnvdogYmvJPU0/VBApD4hcDrWRcyikfB17srzgW7b9Rh1vEvxDlI4tVytaBSEEtmWh0xsUMwpwnWjqAlcxogiHd1wiQyCu87iI/+sJtf6+NXsgpd7FWCMB50KvkYMGMbLdZgLlfj+K9K4+FnFQ2x7WntIs50AbmiGwLILt+k+EvzvSNIHzdigdJ/AmXQRhiHv5POSwYmG+cqPVo0HqDxj8uTK2vn1Hfa+JmdIkvtZ/4fOPXU3WPDpFeNWVyUKryCiIGMN4zsH98gym3CIcOTwT+XHdXrdQQHAZotE8kBPpSqPNHtBOr48HUmLOcXRJT9dWNMGYJFby91pHOAvaykSaITg+bwefdhrteDRTMSwyrFCgI88E056Hy+4Ah2cXQZL3R4ABALUe7fqXWFN6AAAAAElFTkSuQmCC","zip": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAm9JREFUeNpsk0tv00AUhc+MY6dOmgeFJg1FoVVpUWlFC0s2IFF1jxBbhKj4BSxYdscPYcEmQmIDq0gsERIViy4TpD7VFzF1Ho5je2a4thOqNhlp5Mz4zudzzp0wpRTC8fPrk0/TC6+fDtYicLH97T1Kc2vQDcs+rH3eUAxVznn0fn1DRM8E+iOdv5ct3XmZG6yVlNj6solUbgVTt0q5FGtX6vXqC6VklTE+KAO/OODHSIQPRQpsXC+kkEz2ELA0ystv84tLzyucsbWByisAGf+QAS2CCDRRLMJMmxC+i8C4jdLCm/zM7OOKFGptcO6/BTpJ0yeQB0Y+mfKQuZZG0jQgeRbW8Xdomobs9LN8scc+UPHNy4Dwq8IljotIIQEm59/RoSyM1CKkXKZNBm7kIVgyM6wgAnSgRK9vqQfHPiMFDHqyFVsLR9Cm0o4YzoAASrSjCelQfRPb1Vc4qn0EY5L2W9GEaBLcxQgFHpGbkMIDJ69e+wjJ8VXqRgKid0r7ftQdxkRs9SqA2kgAm14SSIQh9uhuLGPMnKJs/5KquL1x0N0RCsizigoDaLqBdHoMiyvrlBsHVx1wphD4BCewoqxGKKDwAgtOy8JufYuk+5golGGaGZwc1sIGoDz3AOPZSVLaHgVwydoJDM1H4DbQODughB3YpOD44HfoHgnu4e7So0uAi0stHLJ3Aud8B9bpHu6vPoSu9TtDl6tUuoFiIYOgu0+158MKmOxomtyD3Qi/3MTR7i8K0EDG1GHO5DE3X4DvNahZlJOwEkOATvdPc2//hx3mXJ5lFJaF8K8bStd0YGfnOJbMGex21x6c+yfAAOlIPDJzr7cLAAAAAElFTkSuQmCC"}
'use strict';// This is so you can have options aliasing and defaults in one place.const defaults = require('./defaults.json');const aliases = require('./aliases.json');module.exports = (opts) => {let autoIndex = defaults.autoIndex;let showDir = defaults.showDir;let showDotfiles = defaults.showDotfiles;let humanReadable = defaults.humanReadable;let hidePermissions = defaults.hidePermissions;let si = defaults.si;let cache = defaults.cache;let gzip = defaults.gzip;let brotli = defaults.brotli;let defaultExt = defaults.defaultExt;let handleError = defaults.handleError;const headers = {};let serverHeader = defaults.serverHeader;let contentType = defaults.contentType;let mimeTypes;let weakEtags = defaults.weakEtags;let weakCompare = defaults.weakCompare;let handleOptionsMethod = defaults.handleOptionsMethod;function isDeclared(k) {return typeof opts[k] !== 'undefined' && opts[k] !== null;}function setHeader(str) {const m = /^(.+?)\s*:\s*(.*)$/.exec(str);if (!m) {headers[str] = true;} else {headers[m[1]] = m[2];}}if (opts) {aliases.autoIndex.some((k) => {if (isDeclared(k)) {autoIndex = opts[k];return true;}return false;});aliases.showDir.some((k) => {if (isDeclared(k)) {showDir = opts[k];return true;}return false;});aliases.showDotfiles.some((k) => {if (isDeclared(k)) {showDotfiles = opts[k];return true;}return false;});aliases.humanReadable.some((k) => {if (isDeclared(k)) {humanReadable = opts[k];return true;}return false;});aliases.hidePermissions.some((k) => {if (isDeclared(k)) {hidePermissions = opts[k];return true;}return false;});aliases.si.some((k) => {if (isDeclared(k)) {si = opts[k];return true;}return false;});if (opts.defaultExt && typeof opts.defaultExt === 'string') {defaultExt = opts.defaultExt;}if (typeof opts.cache !== 'undefined' && opts.cache !== null) {if (typeof opts.cache === 'string') {cache = opts.cache;} else if (typeof opts.cache === 'number') {cache = `max-age=${opts.cache}`;} else if (typeof opts.cache === 'function') {cache = opts.cache;}}if (typeof opts.gzip !== 'undefined' && opts.gzip !== null) {gzip = opts.gzip;}if (typeof opts.brotli !== 'undefined' && opts.brotli !== null) {brotli = opts.brotli;}aliases.handleError.some((k) => {if (isDeclared(k)) {handleError = opts[k];return true;}return false;});aliases.cors.forEach((k) => {if (isDeclared(k) && k) {handleOptionsMethod = true;headers['Access-Control-Allow-Origin'] = '*';headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since';}});aliases.headers.forEach((k) => {if (isDeclared(k)) {if (Array.isArray(opts[k])) {opts[k].forEach(setHeader);} else if (opts[k] && typeof opts[k] === 'object') {Object.keys(opts[k]).forEach((key) => {headers[key] = opts[k][key];});} else {setHeader(opts[k]);}}});aliases.serverHeader.some((k) => {if (isDeclared(k)) {serverHeader = opts[k];return true;}return false;});aliases.contentType.some((k) => {if (isDeclared(k)) {contentType = opts[k];return true;}return false;});aliases.mimeType.some((k) => {if (isDeclared(k)) {mimeTypes = opts[k];return true;}return false;});aliases.weakEtags.some((k) => {if (isDeclared(k)) {weakEtags = opts[k];return true;}return false;});aliases.weakCompare.some((k) => {if (isDeclared(k)) {weakCompare = opts[k];return true;}return false;});aliases.handleOptionsMethod.some((k) => {if (isDeclared(k)) {handleOptionsMethod = handleOptionsMethod || opts[k];return true;}return false;});}return {cache,autoIndex,showDir,showDotfiles,humanReadable,hidePermissions,si,defaultExt,baseDir: (opts && opts.baseDir) || '/',gzip,brotli,handleError,headers,serverHeader,contentType,mimeTypes,weakEtags,weakCompare,handleOptionsMethod,};};
'use strict';module.exports = (stat, weakEtag) => {let etag = `"${[stat.ino, stat.size, stat.mtime.toISOString()].join('-')}"`;if (weakEtag) {etag = `W/${etag}`;}return etag;};
{"autoIndex": true,"showDir": true,"showDotfiles": true,"humanReadable": true,"hidePermissions": false,"si": false,"cache": "max-age=3600","cors": false,"gzip": true,"brotli": false,"defaultExt": ".html","handleError": true,"serverHeader": true,"contentType": "application/octet-stream","weakEtags": true,"weakCompare": true,"handleOptionsMethod": false}
{"autoIndex": [ "autoIndex", "autoindex" ],"showDir": [ "showDir", "showdir" ],"showDotfiles": ["showDotfiles", "showdotfiles"],"humanReadable": [ "humanReadable", "humanreadable", "human-readable" ],"hidePermissions": ["hidePermissions", "hidepermissions", "hide-permissions"],"si": [ "si", "index" ],"handleError": [ "handleError", "handleerror" ],"cors": [ "cors", "CORS" ],"headers": [ "H", "header", "headers" ],"serverHeader": [ "serverHeader", "serverheader", "server-header" ],"contentType": [ "contentType", "contenttype", "content-type" ],"mimeType": ["mimetype","mimetypes","mimeType","mimeTypes","mime-type","mime-types","mime-Type","mime-Types"],"weakEtags": [ "weakEtags", "weaketags", "weak-etags" ],"weakCompare": ["weakcompare","weakCompare","weak-compare","weak-Compare"],"handleOptionsMethod": ["handleOptionsMethod","handleoptionsmethod","handle-options-method"]}
hello cruel world!
Hello world!
<b>boop!</b>
'use strict';const express = require('express');const ecstatic = require('../lib/ecstatic');const http = require('http');const app = express();app.use(ecstatic({root: `${__dirname}/public`,showdir: true,}));http.createServer(app).listen(8080);console.log('Listening on :8080');
'use strict';const http = require('http');const ecstatic = require('../lib/ecstatic')({root: `${__dirname}/public`,showDir: true,autoIndex: true,});http.createServer(ecstatic).listen(8080);console.log('Listening on :8080');
#!/bin/bash../lib/ecstatic.js ./public --port 8080
# Ecstatic [](http://travis-ci.org/jfhbrook/node-ecstatic) [](https://codecov.io/github/jfhbrook/node-ecstatic?branch=master)A simple static file server middleware. Use it with a raw http server,express/connect or on the CLI!# Examples:## express 4.x``` js'use strict';const express = require('express');const ecstatic = require('../lib/ecstatic');const http = require('http');const app = express();app.use(ecstatic({root: `${__dirname}/public`,showdir: true,}));http.createServer(app).listen(8080);console.log('Listening on :8080');```## stock http server``` js'use strict';const http = require('http');const ecstatic = require('../lib/ecstatic')({root: `${__dirname}/public`,showDir: true,autoIndex: true,});http.createServer(ecstatic).listen(8080);console.log('Listening on :8080');```### fall throughTo allow fall through to your custom routes:```jsecstatic({ root: __dirname + '/public', handleError: false })```## CLI```shecstatic ./public --port 8080```# Install:For using ecstatic as a library, just npm install it into your project:```shnpm install --save ecstatic```For using ecstatic as a cli tool, either npm install it globally:```shnpm install ecstatic -g```or install it locally and use npm runscripts to add it to your $PATH, orreference it directly with `./node_modules/.bin/ecstatic`.# API:## ecstatic(opts);## $ ecstatic [dir?] {options} --port PORTIn node, pass ecstatic an options hash, and it will return your middleware!```jsconst opts = {root: path.join(__dirname, 'public'),baseDir: '/',autoIndex: true,showDir: true,showDotfiles: true,humanReadable: true,hidePermissions: false,si: false,cache: 'max-age=3600',cors: false,gzip: true,brotli: false,defaultExt: 'html',handleError: true,serverHeader: true,contentType: 'application/octet-stream',weakEtags: true,weakCompare: true,handleOptionsMethod: false,}```If `opts` is a string, the string is assigned to the root folder and all otheroptions are set to their defaults.When running in CLI mode, all options work as above, passed in[optimist](https://github.com/substack/node-optimist) style. `port` defaults to`8000`. If a `dir` or `--root dir` argument is not passed, ecsatic willserve the current dir. Ecstatic also respects the PORT environment variable.### `opts.root`### `--root {root}``opts.root` is the directory you want to serve up.### `opts.port`### `--port {port}`In CLI mode, `opts.port` is the port you want ecstatic to listen to. Defaultsto 8000. This can be overridden with the `--port` flag or with the PORTenvironment variable.### `opts.baseDir`### `--baseDir {dir}``opts.baseDir` is `/` by default, but can be changed to allow your static filesto be served off a specific route. For example, if `opts.baseDir === "blog"`and `opts.root = "./public"`, requests for `localhost:8080/blog/index.html` willresolve to `./public/index.html`.### `opts.cache`### `--cache {value}`Customize cache control with `opts.cache` , if it is a number then it will set max-age in seconds.Other wise it will pass through directly to cache-control. Time defaults to 3600 s (ie, 1 hour).If it is a function, it will be executed on every request, and passed the pathname. Whatever it returns, string or number, will be used as the cache control header like above.### `opts.showDir`### `--no-showDir`Turn **off** directory listings with `opts.showDir === false`. Defaults to **true**.### `opts.showDotfiles`### `--no-showDotfiles`Exclude dotfiles from directory listings with `opts.showDotfiles === false`. Defaults to **true**.### `opts.humanReadable`### `--no-human-readable`If showDir is enabled, add human-readable file sizes. Defaults to **true**.Aliases are `humanreadable` and `human-readable`.### `opts.hidePermissions`### `--hide-permissions`If hidePermissions is enabled, file permissions will not be displayed. Defaults to **false**.Aliases are `hidepermissions` and `hide-permissions`.### `opts.headers`### `--H {HeaderA: valA} [--H {HeaderB: valB}]`Set headers on every response. `opts.headers` can be an object mapping stringheader names to string header values, a colon (:) separated string, or an arrayof colon separated strings.`opts.H` and `opts.header` are aliased to `opts.headers` so that you can use`-H` and `--header` options to set headers on the command-line like curl:``` sh$ ecstatic ./public -p 5000 -H 'Access-Control-Allow-Origin: *'```### `opts.si`### `--si`If showDir and humanReadable are enabled, print file sizes with base 1000 insteadof base 1024. Name is inferred from cli options for `ls`. Aliased to `index`, theequivalent option in Apache.### `opts.autoIndex`### `--no-autoindex`Serve `/path/index.html` when `/path/` is requested.Turn **off** autoIndexing with `opts.autoIndex === false`. Defaults to **true**.### `opts.defaultExt`### `--defaultExt {ext}`Turn on default file extensions with `opts.defaultExt`. If `opts.defaultExt` istrue, it will default to `html`. For example if you want a request to `/a-file`to resolve to `./public/a-file.html`, set this to `true`. If you want`/a-file` to resolve to `./public/a-file.json` instead, set `opts.defaultExt` to`json`.### `opts.gzip`### `--no-gzip`By default, ecstatic will serve `./public/some-file.js.gz` in place of`./public/some-file.js` when the gzipped version exists and ecstatic determinesthat the behavior is appropriate. If `./public/some-file.js.gz` is not validgzip, this will fall back to `./public/some-file.js`. You can turn this offwith `opts.gzip === false`.### `opts.brotli`### `--brotli`Serve `./public/some-file.js.br` in place of `./public/some-file.js` when the[brotli encoded](https://github.com/google/brotli) version exists and ecstaticdetermines that the behavior is appropriate. If the request does not contain`br` in the HTTP `accept-encoding` header, ecstatic will instead attempt toserve a gzipped version (if `opts.gzip` is `true`), or fall back to`./public.some-file.js`. Defaults to **false**.### `opts.serverHeader`### `--no-server-header`Set `opts.serverHeader` to false in order to turn off setting the `Server`header on all responses served by ecstatic.### `opts.contentType`### `--content-type {type}`Set `opts.contentType` in order to change default Content-Type header value.Defaults to **application/octet-stream**.### `opts.mimeTypes`### `--mime-types {filename}`Add new or override one or more mime-types. This affects the HTTP Content-Typeheader. Can either be a path to a[`.types`](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)file or an object hash of type(s).ecstatic({ mimeTypes: { 'mime-type': ['file_extension', 'file_extension'] } })### `opts.handleError`Turn **off** handleErrors to allow fall-through with`opts.handleError === false`, Defaults to **true**.### `opts.weakEtags`### `--no-weak-etags`Set `opts.weakEtags` to false in order to generate strong etags instead ofweak etags. Defaults to **true**. See `opts.weakCompare` as well.### `opts.weakCompare`### `--no-weak-compare`Turn off weakCompare to disable the weak comparison function for etagvalidation. Defaults to **true**. Seehttps://www.ietf.org/rfc/rfc2616.txt Section 13.3.3 for more details.### `opts.handleOptionsMethod`### `--handle-options-method`Set handleOptionsMethod to true in order to respond to 'OPTIONS' calls with any standard/set headers. Defaults to **false**. Useful for hacking up CORS support.### `opts.cors`### `--cors`This is a **convenience** setting which turns on `handleOptionsMethod` and sets the headers **Access-Control-Allow-Origin: \*** and **Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since**. This *should* be enough to quickly make cross-origin resource sharing work between development APIs. More advanced usage can come either from overriding these headers with the headers argument, or by using the `handleOptionsMethod` flag and then setting headers "manually." Alternately, just do it in your app using separate middlewares/abstractions.Defaults to **false**.## middleware(req, res, next);This works more or less as you'd expect.### ecstatic.showDir(folder);This returns another middleware which will attempt to show a directory view. Turning on auto-indexing is roughly equivalent to adding this middleware after an ecstatic middleware with autoindexing disabled.# Tests:Ecstatic has a fairly extensive test suite. You can run it with:```sh$ npm test```# Contribute:Without outside contributions, ecstatic would wither and die! Beforecontributing, take a quick look at the contributing guidelines in[./CONTRIBUTING.md](./CONTRIBUTING.md) . They're relatively painless, I promise.# License:MIT. See LICENSE.txt. For contributors, see CONTRIBUTORS.md
The MIT License (MIT)Copyright (c) 2013-2015 Joshua Holbrook and contributorsPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
General format is: contributor, github handle, email. In some cases, thecontributor field is an organization instead of an actual person---this is forcases where the work was done on behalf of the organization, ie as part oftheir job. In others, no contributor field and/or email is shown---this isbecause this list was partially (mostly) reconstructed from github commitinformation and the person's real life name and email are unknown.Listed in no particular order:* Joshua Holbrook @jfhbrook <josh.holbrook@gmail.com>* Jon Ege Ronnenberg @dotnetCarpenter <jon.ronnenberg@gmail.com>* James Halliday @substack <substack@gmail.com>* Jonah Ruiz @jonahoffline <jonah@pixelhipsters.com>* Jacob Burden @jekrb <Jacob.JW.Burden@gmail.com>* @leesei* @SirAnthony* Frank Mecklenburg @yfr <mecklenburg@ubilabs.net>* @curimit <curimit@gmail.com>* Dominic Tarr @dominictarr* Chew Choon Keat @choonkeat <choonkeat@gmail.com>* Lars Kappert @webpro <lars@webpro.nl>* Alan Reyes @KuttKatrea <kutt@katrea.net>* Colin Fallon @colinf* Charlie Robbins @indexzero* Ville Salonen @VilleSalonen* Tom Steele @tomsteele <thomasjsteele@gmail.com>* Maciej Małecki @mmalecki <me@mmalecki.com>* Chris Bannister @Zariel <c.bannister@gmail.com>* Shinnosuke Watanabe @shinnn <snnskwtnb@gmail.com>* Adam Brady @SomeoneWeird <adam@boxxen.org>* Christian Howe @coderarity* Arnaud @amelon* Gilad Peleg @pgilad <giladp007@gmail.com>* Brad Dunbar @braddunbar <dunbarb2@gmail.com>* Google Inc. via Jeremy Banks @jre-g <jre@google.com>* @sundippatel* Arjan van Wijk @ThaNarie <thanarie@gmail.com>* Mathias Buus @mafintosh <mathiasbuus@gmail.com>* Farrin Reid @blakmatrix <blakmatrix@gmail.com>* Tõnis Tiigi @tonistiigi <tonistiigi@gmail.com>* Maksim Lin @maks <maks@manichord.com>* Jan Nicklas @jantimon* David Cox @losttime <losttime.shuffle@gmail.com>* Bill Ticehurst @billti <billti@hotmail.com>* Vincent Voyer @vvo <vincent.voyer@gmail.com>* @helloyou2012 <helloyou2012@gmail.com>* Domenic Denicola @domenic <d@domenic.me>* Maxim Ivanov @redbaron <ivanov.maxim@gmail.com>* Oliver Joseph Ash @OliverJAsh <oliverjash@gmail.com>* Benjamin Tan @d10 <demoneaux@gmail.com>* D Scott Boyce @scobo* Zach Bruggerman @remixz <mail@bruggie.com>* Mathias Bynens @mathiasbynens* Chris Lee @clee <clee@mg8.org>* Josh Duff @TehShrike* Cam Wiegert @camwiegert <cam@camwiegert.com>* Josh Gillies @joshgillies <github@joshgilli.es>* Jesse Tane @jessetane <jesse.tane@gmail.com>* Simon Sturmer @sstur <sstur@me.com>* Drew Harwell @fenwick67* Vamsi Krishna Avula @avamsi* @wood1986* Mahdi Hasheminejad @mahdi-ninja* Bradley Farias @bmeck <bradley.meck@gmail.com>* David Refoua @DRSDavidSoft <david@refoua.me>* @mmmm1998 <warquark@gmail.com>* Victor Didenko @victordidenko* Zong Jhe Wu @s25g5d4* Jade Michael Thornton @thornjad <jade@jmthorton.net>
# Contributing Guidelines## Code of ConductThis is probably way overkill, but this is by far my most active project interms of contributions, and somewhere along the way I was convinced that itwas a good idea to have this in place sooner rather than later:I want to provide a safe, healthy environment for all contributors/participantsregardless of gender, sexual orientation, disability, race, religion, etc.As such, I don't tolerate harassment of participants in any form. In particularthis applies to my issues tracker, but also to any other means of communicationassociated with this project that might come up. Anyone who violates thesebasic rules may be sanctioned/banned/have-their-comments-deleted/etc by mydiscretion.Glad we cleared that up.## BranchingBefore working on your fix/feature/whatever, you should create a new branch towork on. Do something like:```sh$ git checkout -b 'my-sweet-new-pull-request'```## Please Please Please Start With A Testecstatic has some pretty gnarly branching/logic underneath. Tests are extremelyimportant because they (a) prove that your feature/fix works, and (b) avoidregressions in the future. Even if your patch is problematic enough to not bemerged, a test will still be very helpful for confirming any future fix.I won't reject your patch outright if it's missing new tests, but it surehelps!## Code StyleEcstatic lints using a number of modifications on top of airbnb. If you think"airbnb except it doesn't need to be transpiled for targeted platforms" you'repretty close.Linting is executed as part of pretest. Your code should pass linting beforebeing merged.## A Few Other Minor Guidelines1. Keep your pull requests on-topic. A pull request purporting to tackle Ashouldn't also have commits changing B and C. Feel free to make separate pullrequests. For instance: A pull request should generally only updatedependencies when doing so is required to add the feature or fix the bug. Thisfeature can, of course, consist of updating dependencies.2. I prefer maintaining the changelog and package.json version myself. This isbecause I try to make a single commit for a tagged release contain allchangelog additions and the version bump, and this breaks down when there areinterstitial commits making updates to either.3. In case you were wondering about dependencies, you may find this helpful:[](https://david-dm.org/jfhbrook/node-ecstatic)4. Please add yourself to CONTRIBUTORS.md if you haven't done so! Fill in asmuch as makes you comfortable.## Pull RequestMake a pull request against master with your new branch. Explain briefly whatthe patch does to the code, along with any concerns.(If you don't have a description, it's hard for me to put the changes incontext. That makes it more difficult for me to merge!)## Keep It MovingI don't always notice new PRs, and sometimes I will forget to follow up onthem. If this happens to you, you can bump the PR thread or find me onIRC or twitter.## LAST RULEHAVE FUN :v :v
2019/05/03 Version 3.3.2- Backport redirects bugfix2019/02/10 Version 3.3.1- Publish via linux to hopefully fix #2382018/09/01 Version 3.3.0- Updated dependencies- Added support for brotli encoding in addition to existing gzip support2018/08/28 Version 3.2.2- Patchfix for improved accuracy when checking to see if gzip responses are allowed- Updated tap and package-lock.json2018/07/06 Version 3.2.1- Update package.json project description- Move tools folder to scripts folder- Linting now passes on windows if git converts newlines to CRLFs- No longer return a 416 when input range header has extra untrimmed whitespace- Remove extra double quotes in ETAGs2018/02/03 Version 3.2.0- Add hidePermissions flag to hide file permissions from directory listings2017/12/16 Version 3.1.1- Requires version of node-mime that patches regexp dos vulnerability2017/12/09 Version 3.1.0- Minor tweaks/fixes to directory view- Add a mess of dotfiles to .npmignore2017/08/28 Version 3.0.0- Lint ./lib/ ./example and ./test against airbnb modified to support node 4.xand a few quirky hard-to-fix idioms- Change gzip behavior to default- Change weak etags and weak etag comparisons to be on by default- Remove support for 0.12.0- Remove union examples and test harnesses (support should have been removedlong ago)- Fix icon styles in directory listing for small screens- Update mime to ^v1.4.0 - This changes gzip responses to always have application/gzip as their content-type2017/06/06 Version 2.2.1- Fix version number in CHANGELOG.md2017/06/06 Version 2.2.0- Will now properly serve gzip files when defaulting the extension- Will fall back to serving non-gzip files if file with .gz extension ismissing the magic bytes- Updated he, url-join- Updated devDependencies- Added .npmrc- Added package-lock.json- Much improved documentation for the cli component2016/08/10 Version 2.1.0- New, prettier showDir pages with icons!2016/08/09 Version 2.0.0- No longer strip null bytes from uris before parsing. This avoids a regexp dosattack. The stripping was to avoid a bug regarding c++ null terminatedstrings shenanigans in some versions of node, but it *appears* fixed in LTSversions of node.- When both showDir and autoIndex are turned off, do not redirect from /foo to/foo/.- Add code coverage reports and codecov.io2015/05/10 Version 1.4.1- Compare if-modified-since header against server-generated last-modifiedheader rather than raw mtime2015/12/22 Version 1.4.0- Add ability to specify custom mimetypes via a JSON blob (on the CLI)- Started test suite around CLI options parsing- Workaround for egregious v8 bug around date parsing throwing duringmodified-since checks2015/11/15 Version 1.3.1- Add recent contributors to CONTRIBUTORS.md- Document showDotFiles in main options example2015/11/14 Version 1.3.0- opts.showDotFiles allows hiding dot files2015/11/03 Version 1.2.0- opts.cache supports function argument2015/10/03 Version 1.1.3- Add CORS=false to defaults2015/10/02 Version 1.1.2- Properly handle defaults in CLI args2015/10/02 Version 1.1.1- Properly handle boolean CLI args2015/10/01 Version 1.1.0- Adds support for responding to OPTIONS headers- Adds support for setting custom headers- Adds cors convenience setting2015/09/22 Version 1.0.1- Use encodeURIComponent when creating links in showdir2015/09/14 Version 1.0.0- Optional support for weak Etags and weak Etag *comparison*, useful for caseswhere one is running ecstatic with gzip behind an nginx proxy (these willlikely be turned ON by default in a following major version)- As a bin, respects process.env.PORT when binding to a port- Directory listings encode pathnames, etc- Default status pages return html instead of text/plain- Contributors are listed in CONTRIBUTORS.md, referenced by LICENSE.txt2015/05/22 Version 0.8.0- Add ability to define custom mime-types, inline or with Apache .types file- Test against express ^4.12.3 and union ^0.4.4- Run tests with tap ^1.0.3- Fix newline asserts to work with windows- Add license attribute to package.json- Elaborate contribution guidelines2015/05/09 Version 0.7.6- Fix double encoding in directory listings2015/05/07 Version 0.7.5- Fix HTML reflection vulnerability in certain error handlers2015/04/17 Version 0.7.4- Fix sort ordering in directory listings2015/04/13 Version 0.7.3- Close fstream if/when res closes, fixes potential fd leak2015/04/05 Version 0.7.2- Correctly handle req.statusCode in recursive calls; do not inherit upstream res.statusCode2015/03/27 Version 0.7.1- Treat ENOTDIR as 404 (same as ENOENT)2015/03/18 Version 0.7.0- Add support for specifying default content-type (as an alternative to application/octet-stream)- Use url-join for autoIndex route, fixes windows problems2015/03/01 Version 0.6.1- Fix handleError fall-through with directory listings2015/02/16 Version 0.6.0- Fix for pathname decoding in windows- Fix for hrefs in directory listings- Add ability to turn off setting of Server header- Remove extraneous call to res.end (handled by stream pipe)- Remove tests from npm package due to jenkins bug- Start a ChangeLog.md
"use strict";/*** Module dependencies.*/var tty = require('tty');var util = require('util');/*** This is the Node.js implementation of `debug()`.*/exports.init = init;exports.log = log;exports.formatArgs = formatArgs;exports.save = save;exports.load = load;exports.useColors = useColors;/*** Colors.*/exports.colors = [6, 2, 3, 4, 5, 1];try {// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)// eslint-disable-next-line import/no-extraneous-dependenciesvar supportsColor = require('supports-color');if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];}} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be./*** Build up the default `inspectOpts` object from the environment variables.** $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js*/exports.inspectOpts = Object.keys(process.env).filter(function (key) {return /^debug_/i.test(key);}).reduce(function (obj, key) {// Camel-casevar prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {return k.toUpperCase();}); // Coerce string value into JS valuevar val = process.env[key];if (/^(yes|on|true|enabled)$/i.test(val)) {val = true;} else if (/^(no|off|false|disabled)$/i.test(val)) {val = false;} else if (val === 'null') {val = null;} else {val = Number(val);}obj[prop] = val;return obj;}, {});/*** Is stdout a TTY? Colored output is enabled when `true`.*/function useColors() {return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);}/*** Adds ANSI color escape codes if enabled.** @api public*/function formatArgs(args) {var name = this.namespace,useColors = this.useColors;if (useColors) {var c = this.color;var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c);var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m");args[0] = prefix + args[0].split('\n').join('\n' + prefix);args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m");} else {args[0] = getDate() + name + ' ' + args[0];}}function getDate() {if (exports.inspectOpts.hideDate) {return '';}return new Date().toISOString() + ' ';}/*** Invokes `util.format()` with the specified arguments and writes to stderr.*/function log() {return process.stderr.write(util.format.apply(util, arguments) + '\n');}/*** Save `namespaces`.** @param {String} namespaces* @api private*/function save(namespaces) {if (namespaces) {process.env.DEBUG = namespaces;} else {// If you set a process.env field to null or undefined, it gets cast to the// string 'null' or 'undefined'. Just delete instead.delete process.env.DEBUG;}}/*** Load `namespaces`.** @return {String} returns the previously persisted debug modes* @api private*/function load() {return process.env.DEBUG;}/*** Init logic for `debug` instances.** Create a new `inspectOpts` object in case `useColors` is set* differently for a particular `debug` instance.*/function init(debug) {debug.inspectOpts = {};var keys = Object.keys(exports.inspectOpts);for (var i = 0; i < keys.length; i++) {debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];}}module.exports = require('./common')(exports);var formatters = module.exports.formatters;/*** Map %o to `util.inspect()`, all on a single line.*/formatters.o = function (v) {this.inspectOpts.colors = this.useColors;return util.inspect(v, this.inspectOpts).split('\n').map(function (str) { return str.trim(); }).join(' ');};/*** Map %O to `util.inspect()`, allowing multiple lines if needed.*/formatters.O = function (v) {this.inspectOpts.colors = this.useColors;return util.inspect(v, this.inspectOpts);};
"use strict";/*** Detect Electron renderer / nwjs process, which is node, but we should* treat as a browser.*/if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {module.exports = require('./browser.js');} else {module.exports = require('./node.js');}
"use strict";/*** This is the common logic for both the Node.js and web browser* implementations of `debug()`.*/function setup(env) {createDebug.debug = createDebug;createDebug.default = createDebug;createDebug.coerce = coerce;createDebug.disable = disable;createDebug.enable = enable;createDebug.enabled = enabled;createDebug.humanize = require('ms');Object.keys(env).forEach(function (key) {createDebug[key] = env[key];});/*** Active `debug` instances.*/createDebug.instances = [];/*** The currently active debug mode names, and names to skip.*/createDebug.names = [];createDebug.skips = [];/*** Map of special "%n" handling functions, for the debug "format" argument.** Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".*/createDebug.formatters = {};/*** Selects a color for a debug namespace* @param {String} namespace The namespace string for the for the debug instance to be colored* @return {Number|String} An ANSI color code for the given namespace* @api private*/function selectColor(namespace) {var hash = 0;for (var i = 0; i < namespace.length; i++) {hash = (hash << 5) - hash + namespace.charCodeAt(i);hash |= 0; // Convert to 32bit integer}return createDebug.colors[Math.abs(hash) % createDebug.colors.length];}createDebug.selectColor = selectColor;/*** Create a debugger with the given `namespace`.** @param {String} namespace* @return {Function}* @api public*/function createDebug(namespace) {var prevTime;function debug() {// Disabled?if (!debug.enabled) {return;}for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}var self = debug; // Set `diff` timestampvar curr = Number(new Date());var ms = curr - (prevTime || curr);self.diff = ms;self.prev = prevTime;self.curr = curr;prevTime = curr;args[0] = createDebug.coerce(args[0]);if (typeof args[0] !== 'string') {// Anything else let's inspect with %Oargs.unshift('%O');} // Apply any `formatters` transformationsvar index = 0;args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {// If we encounter an escaped % then don't increase the array indexif (match === '%%') {return match;}index++;var formatter = createDebug.formatters[format];if (typeof formatter === 'function') {var val = args[index];match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`args.splice(index, 1);index--;}return match;}); // Apply env-specific formatting (colors, etc.)createDebug.formatArgs.call(self, args);var logFn = self.log || createDebug.log;logFn.apply(self, args);}debug.namespace = namespace;debug.enabled = createDebug.enabled(namespace);debug.useColors = createDebug.useColors();debug.color = selectColor(namespace);debug.destroy = destroy;debug.extend = extend; // Debug.formatArgs = formatArgs;// debug.rawLog = rawLog;// env-specific initialization logic for debug instancesif (typeof createDebug.init === 'function') {createDebug.init(debug);}createDebug.instances.push(debug);return debug;}function destroy() {var index = createDebug.instances.indexOf(this);if (index !== -1) {createDebug.instances.splice(index, 1);return true;}return false;}function extend(namespace, delimiter) {return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);}/*** Enables a debug mode by namespaces. This can include modes* separated by a colon and wildcards.** @param {String} namespaces* @api public*/function enable(namespaces) {createDebug.save(namespaces);createDebug.names = [];createDebug.skips = [];var i;var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);var len = split.length;for (i = 0; i < len; i++) {if (!split[i]) {// ignore empty stringscontinue;}namespaces = split[i].replace(/\*/g, '.*?');if (namespaces[0] === '-') {createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));} else {createDebug.names.push(new RegExp('^' + namespaces + '$'));}}for (i = 0; i < createDebug.instances.length; i++) {var instance = createDebug.instances[i];instance.enabled = createDebug.enabled(instance.namespace);}}/*** Disable debug output.** @api public*/function disable() {createDebug.enable('');}/*** Returns true if the given mode name is enabled, false otherwise.** @param {String} name* @return {Boolean}* @api public*/function enabled(name) {if (name[name.length - 1] === '*') {return true;}var i;var len;for (i = 0, len = createDebug.skips.length; i < len; i++) {if (createDebug.skips[i].test(name)) {return false;}}for (i = 0, len = createDebug.names.length; i < len; i++) {if (createDebug.names[i].test(name)) {return true;}}return false;}/*** Coerce `val`.** @param {Mixed} val* @return {Mixed}* @api private*/function coerce(val) {if (val instanceof Error) {return val.stack || val.message;}return val;}createDebug.enable(createDebug.load());return createDebug;}module.exports = setup;
"use strict";function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }/* eslint-env browser *//*** This is the web browser implementation of `debug()`.*/exports.log = log;exports.formatArgs = formatArgs;exports.save = save;exports.load = load;exports.useColors = useColors;exports.storage = localstorage();/*** Colors.*/exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];/*** Currently only WebKit-based Web Inspectors, Firefox >= v31,* and the Firebug extension (any Firefox version) are known* to support "%c" CSS customizations.** TODO: add a `localStorage` variable to explicitly enable/disable colors*/// eslint-disable-next-line complexityfunction useColors() {// NB: In an Electron preload script, document will be defined but not fully// initialized. Since we know we're in Chrome, we'll just detect this case// explicitlyif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {return true;} // Internet Explorer and Edge do not support colors.if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {return false;} // Is webkit? http://stackoverflow.com/a/16459606/376773// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messagestypeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a workertypeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);}/*** Colorize log arguments if enabled.** @api public*/function formatArgs(args) {args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);if (!this.useColors) {return;}var c = 'color: ' + this.color;args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other// arguments passed either before or after the %c, so we need to// figure out the correct index to insert the CSS intovar index = 0;var lastC = 0;args[0].replace(/%[a-zA-Z%]/g, function (match) {if (match === '%%') {return;}index++;if (match === '%c') {// We only are interested in the *last* %c// (the user may have provided their own)lastC = index;}});args.splice(lastC, 0, c);}/*** Invokes `console.log()` when available.* No-op when `console.log` is not a "function".** @api public*/function log() {var _console;// This hackery is required for IE8/9, where// the `console.log` function doesn't have 'apply'return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);}/*** Save `namespaces`.** @param {String} namespaces* @api private*/function save(namespaces) {try {if (namespaces) {exports.storage.setItem('debug', namespaces);} else {exports.storage.removeItem('debug');}} catch (error) {// Swallow// XXX (@Qix-) should we be logging these?}}/*** Load `namespaces`.** @return {String} returns the previously persisted debug modes* @api private*/function load() {var r;try {r = exports.storage.getItem('debug');} catch (error) {} // Swallow// XXX (@Qix-) should we be logging these?// If debug isn't set in LS, and we're in Electron, try to load $DEBUGif (!r && typeof process !== 'undefined' && 'env' in process) {r = process.env.DEBUG;}return r;}/*** Localstorage attempts to return the localstorage.** This is necessary because safari throws* when a user disables cookies/localstorage* and you attempt to access it.** @return {LocalStorage}* @api private*/function localstorage() {try {// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context// The Browser also has localStorage in the global context.return localStorage;} catch (error) {// Swallow// XXX (@Qix-) should we be logging these?}}module.exports = require('./common')(exports);var formatters = module.exports.formatters;/*** Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.*/formatters.j = function (v) {try {return JSON.stringify(v);} catch (error) {return '[UnexpectedJSONParseError]: ' + error.message;}};
{"_from": "debug@^3.1.1","_id": "debug@3.2.7","_inBundle": false,"_integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==","_location": "/debug","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "debug@^3.1.1","name": "debug","escapedName": "debug","rawSpec": "^3.1.1","saveSpec": null,"fetchSpec": "^3.1.1"},"_requiredBy": ["/portfinder"],"_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz","_shasum": "72580b7e9145fb39b6676f9c5e5fb100b934179a","_spec": "debug@^3.1.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/portfinder","author": {"name": "TJ Holowaychuk","email": "tj@vision-media.ca"},"browser": "./src/browser.js","bugs": {"url": "https://github.com/visionmedia/debug/issues"},"bundleDependencies": false,"contributors": [{"name": "Nathan Rajlich","email": "nathan@tootallnate.net","url": "http://n8.io"},{"name": "Andrew Rhyne","email": "rhyneandrew@gmail.com"}],"dependencies": {"ms": "^2.1.1"},"deprecated": false,"description": "small debugging utility","devDependencies": {"@babel/cli": "^7.0.0","@babel/core": "^7.0.0","@babel/preset-env": "^7.0.0","browserify": "14.4.0","chai": "^3.5.0","concurrently": "^3.1.0","coveralls": "^3.0.2","istanbul": "^0.4.5","karma": "^3.0.0","karma-chai": "^0.1.0","karma-mocha": "^1.3.0","karma-phantomjs-launcher": "^1.0.2","mocha": "^5.2.0","mocha-lcov-reporter": "^1.2.0","rimraf": "^2.5.4","xo": "^0.23.0"},"files": ["src","node.js","dist/debug.js","LICENSE","README.md"],"homepage": "https://github.com/visionmedia/debug#readme","keywords": ["debug","log","debugger"],"license": "MIT","main": "./src/index.js","name": "debug","repository": {"type": "git","url": "git://github.com/visionmedia/debug.git"},"unpkg": "./dist/debug.js","version": "3.2.7"}
module.exports = require('./src/node');
# debug[](https://travis-ci.org/visionmedia/debug) [](https://coveralls.io/github/visionmedia/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers)[](#sponsors)<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">A tiny JavaScript debugging utility modelled after Node.js core's debuggingtechnique. Works in Node.js and web browsers.## Installation```bash$ npm install debug```## Usage`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.Example [_app.js_](./examples/node/app.js):```jsvar debug = require('debug')('http'), http = require('http'), name = 'My App';// fake appdebug('booting %o', name);http.createServer(function(req, res){debug(req.method + ' ' + req.url);res.end('hello\n');}).listen(3000, function(){debug('listening');});// fake worker of some kindrequire('./worker');```Example [_worker.js_](./examples/node/worker.js):```jsvar a = require('debug')('worker:a'), b = require('debug')('worker:b');function work() {a('doing lots of uninteresting work');setTimeout(work, Math.random() * 1000);}work();function workb() {b('doing some work');setTimeout(workb, Math.random() * 2000);}workb();```The `DEBUG` environment variable is then used to enable these based on space orcomma-delimited names.Here are some examples:<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png"><img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png"><img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">#### Windows command prompt notes##### CMDOn Windows the environment variable is set using the `set` command.```cmdset DEBUG=*,-not_this```Example:```cmdset DEBUG=* & node app.js```##### PowerShell (VS Code default)PowerShell uses different syntax to set environment variables.```cmd$env:DEBUG = "*,-not_this"```Example:```cmd$env:DEBUG='app';node app.js```Then, run the program to be debugged as usual.npm script example:```js"windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",```## Namespace ColorsEvery debug instance has a color generated for it based on its namespace name.This helps when visually parsing the debug output to identify which debug instancea debug line belongs to.#### Node.jsIn Node.js, colors are enabled when stderr is a TTY. You also _should_ installthe [`supports-color`](https://npmjs.org/supports-color) module alongside debug,otherwise debug will only use a small handful of basic colors.<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">#### Web BrowserColors are also enabled on "Web Inspectors" that understand the `%c` formattingoption. These are WebKit web inspectors, Firefox ([since version31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))and the Firebug plugin for Firefox (any version).<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">## Millisecond diffWhen actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">## ConventionsIf you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.## WildcardsThe `*` character may be used as a wildcard. Suppose for example your library hasdebuggers named "connect:bodyParser", "connect:compress", "connect:session",instead of listing all three with`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.You can also exclude specific debuggers by prefixing them with a "-" character.For example, `DEBUG=*,-connect:*` would include all debuggers except thosestarting with "connect:".## Environment VariablesWhen running through Node.js, you can set a few environment variables that willchange the behavior of the debug logging:| Name | Purpose ||-----------|-------------------------------------------------|| `DEBUG` | Enables/disables specific debugging namespaces. || `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). || `DEBUG_COLORS`| Whether or not to use colors in the debug output. || `DEBUG_DEPTH` | Object inspection depth. || `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |__Note:__ The environment variables beginning with `DEBUG_` end up beingconverted into an Options object that gets used with `%o`/`%O` formatters.See the Node.js documentation for[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)for the complete list.## FormattersDebug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.Below are the officially supported formatters:| Formatter | Representation ||-----------|----------------|| `%O` | Pretty-print an Object on multiple lines. || `%o` | Pretty-print an Object all on a single line. || `%s` | String. || `%d` | Number (both integer and float). || `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. || `%%` | Single percent sign ('%'). This does not consume an argument. |### Custom formattersYou can add custom formatters by extending the `debug.formatters` object.For example, if you wanted to add support for rendering a Buffer as hex with`%h`, you could do something like:```jsconst createDebug = require('debug')createDebug.formatters.h = (v) => {return v.toString('hex')}// …elsewhereconst debug = createDebug('foo')debug('this is hex: %h', new Buffer('hello world'))// foo this is hex: 68656c6c6f20776f726c6421 +0ms```## Browser SupportYou can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),if you don't want to build it yourself.Debug's enable state is currently persisted by `localStorage`.Consider the situation shown below where you have `worker:a` and `worker:b`,and wish to debug both. You can enable this using `localStorage.debug`:```jslocalStorage.debug = 'worker:*'```And then refresh the page.```jsa = debug('worker:a');b = debug('worker:b');setInterval(function(){a('doing some work');}, 1000);setInterval(function(){b('doing some work');}, 1200);```## Output streamsBy default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:Example [_stdout.js_](./examples/node/stdout.js):```jsvar debug = require('debug');var error = debug('app:error');// by default stderr is usederror('goes to stderr!');var log = debug('app:log');// set this namespace to log via console.loglog.log = console.log.bind(console); // don't forget to bind to console!log('goes to stdout');error('still goes to stderr!');// set all output to go via console.info// overrides all per-namespace log settingsdebug.log = console.info.bind(console);error('now goes to stdout via console.info');log('still goes to stdout, but via console.info now');```## ExtendYou can simply extend debugger```jsconst log = require('debug')('auth');//creates new debug instance with extended namespaceconst logSign = log.extend('sign');const logLogin = log.extend('login');log('hello'); // auth hellologSign('hello'); //auth:sign hellologLogin('hello'); //auth:login hello```## Set dynamicallyYou can also enable debug dynamically by calling the `enable()` method :```jslet debug = require('debug');console.log(1, debug.enabled('test'));debug.enable('test');console.log(2, debug.enabled('test'));debug.disable();console.log(3, debug.enabled('test'));```print :```1 false2 true3 false```Usage :`enable(namespaces)``namespaces` can include modes separated by a colon and wildcards.Note that calling `enable()` completely overrides previously set DEBUG variable :```$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'=> false```## Checking whether a debug target is enabledAfter you've created a debug instance, you can determine whether or not it isenabled by checking the `enabled` property:```javascriptconst debug = require('debug')('http');if (debug.enabled) {// do stuff...}```You can also manually toggle this property to force the debug instance to beenabled or disabled.## Authors- TJ Holowaychuk- Nathan Rajlich- Andrew Rhyne## BackersSupport us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a><a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a><a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a><a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a><a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a><a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a><a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a><a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a><a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a><a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a><a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a><a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a><a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a><a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a><a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a><a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a><a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a><a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a><a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a><a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a><a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a><a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a><a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a><a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a><a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a><a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a><a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a><a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a><a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a><a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>## SponsorsBecome a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a><a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>## License(The MIT License)Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the'Software'), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(The MIT License)Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>Permission is hereby granted, free of charge, to any person obtaining a copy of this softwareand associated documentation files (the 'Software'), to deal in the Software without restriction,including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantialportions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOTLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3.1.0 / 2017-09-26==================* Add `DEBUG_HIDE_DATE` env var (#486)* Remove ReDoS regexp in %o formatter (#504)* Remove "component" from package.json* Remove `component.json`* Ignore package-lock.json* Examples: fix colors printout* Fix: browser detection* Fix: spelling mistake (#496, @EdwardBetts)3.0.1 / 2017-08-24==================* Fix: Disable colors in Edge and Internet Explorer (#489)3.0.0 / 2017-08-08==================* Breaking: Remove DEBUG_FD (#406)* Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418)* Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408)* Addition: document `enabled` flag (#465)* Addition: add 256 colors mode (#481)* Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440)* Update: component: update "ms" to v2.0.0* Update: separate the Node and Browser tests in Travis-CI* Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots* Update: separate Node.js and web browser examples for organization* Update: update "browserify" to v14.4.0* Fix: fix Readme typo (#473)2.6.9 / 2017-09-22==================* remove ReDoS regexp in %o formatter (#504)2.6.8 / 2017-05-18==================* Fix: Check for undefined on browser globals (#462, @marbemac)2.6.7 / 2017-05-16==================* Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)* Fix: Inline extend function in node implementation (#452, @dougwilson)* Docs: Fix typo (#455, @msasad)2.6.5 / 2017-04-27==================* Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)* Misc: clean up browser reference checks (#447, @thebigredgeek)* Misc: add npm-debug.log to .gitignore (@thebigredgeek)2.6.4 / 2017-04-20==================* Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)* Chore: ignore bower.json in npm installations. (#437, @joaovieira)* Misc: update "ms" to v0.7.3 (@tootallnate)2.6.3 / 2017-03-13==================* Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)* Docs: Changelog fix (@thebigredgeek)2.6.2 / 2017-03-10==================* Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)* Docs: Add backers and sponsors from Open Collective (#422, @piamancini)* Docs: Add Slackin invite badge (@tootallnate)2.6.1 / 2017-02-10==================* Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error* Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)* Fix: IE8 "Expected identifier" error (#414, @vgoma)* Fix: Namespaces would not disable once enabled (#409, @musikov)2.6.0 / 2016-12-28==================* Fix: added better null pointer checks for browser useColors (@thebigredgeek)* Improvement: removed explicit `window.debug` export (#404, @tootallnate)* Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)2.5.2 / 2016-12-25==================* Fix: reference error on window within webworkers (#393, @KlausTrainer)* Docs: fixed README typo (#391, @lurch)* Docs: added notice about v3 api discussion (@thebigredgeek)2.5.1 / 2016-12-20==================* Fix: babel-core compatibility2.5.0 / 2016-12-20==================* Fix: wrong reference in bower file (@thebigredgeek)* Fix: webworker compatibility (@thebigredgeek)* Fix: output formatting issue (#388, @kribblo)* Fix: babel-loader compatibility (#383, @escwald)* Misc: removed built asset from repo and publications (@thebigredgeek)* Misc: moved source files to /src (#378, @yamikuronue)* Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)* Test: coveralls integration (#378, @yamikuronue)* Docs: simplified language in the opening paragraph (#373, @yamikuronue)2.4.5 / 2016-12-17==================* Fix: `navigator` undefined in Rhino (#376, @jochenberger)* Fix: custom log function (#379, @hsiliev)* Improvement: bit of cleanup + linting fixes (@thebigredgeek)* Improvement: rm non-maintainted `dist/` dir (#375, @freewil)* Docs: simplified language in the opening paragraph. (#373, @yamikuronue)2.4.4 / 2016-12-14==================* Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)2.4.3 / 2016-12-14==================* Fix: navigation.userAgent error for react native (#364, @escwald)2.4.2 / 2016-12-14==================* Fix: browser colors (#367, @tootallnate)* Misc: travis ci integration (@thebigredgeek)* Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)2.4.1 / 2016-12-13==================* Fix: typo that broke the package (#356)2.4.0 / 2016-12-13==================* Fix: bower.json references unbuilt src entry point (#342, @justmatt)* Fix: revert "handle regex special characters" (@tootallnate)* Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)* Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)* Improvement: allow colors in workers (#335, @botverse)* Improvement: use same color for same namespace. (#338, @lchenay)2.3.3 / 2016-11-09==================* Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)* Fix: Returning `localStorage` saved values (#331, Levi Thomason)* Improvement: Don't create an empty object when no `process` (Nathan Rajlich)2.3.2 / 2016-11-09==================* Fix: be super-safe in index.js as well (@TooTallNate)* Fix: should check whether process exists (Tom Newby)2.3.1 / 2016-11-09==================* Fix: Added electron compatibility (#324, @paulcbetts)* Improvement: Added performance optimizations (@tootallnate)* Readme: Corrected PowerShell environment variable example (#252, @gimre)* Misc: Removed yarn lock file from source control (#321, @fengmk2)2.3.0 / 2016-11-07==================* Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)* Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)* Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)* Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)* Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)* Package: Update "ms" to 0.7.2 (#315, @DevSide)* Package: removed superfluous version property from bower.json (#207 @kkirsche)* Readme: fix USE_COLORS to DEBUG_COLORS* Readme: Doc fixes for format string sugar (#269, @mlucool)* Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)* Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)* Readme: better docs for browser support (#224, @matthewmueller)* Tooling: Added yarn integration for development (#317, @thebigredgeek)* Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)* Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)* Misc: Updated contributors (@thebigredgeek)2.2.0 / 2015-05-09==================* package: update "ms" to v0.7.1 (#202, @dougwilson)* README: add logging to file example (#193, @DanielOchoa)* README: fixed a typo (#191, @amir-s)* browser: expose `storage` (#190, @stephenmathieson)* Makefile: add a `distclean` target (#189, @stephenmathieson)2.1.3 / 2015-03-13==================* Updated stdout/stderr example (#186)* Updated example/stdout.js to match debug current behaviour* Renamed example/stderr.js to stdout.js* Update Readme.md (#184)* replace high intensity foreground color for bold (#182, #183)2.1.2 / 2015-03-01==================* dist: recompile* update "ms" to v0.7.0* package: update "browserify" to v9.0.3* component: fix "ms.js" repo location* changed bower package name* updated documentation about using debug in a browser* fix: security error on safari (#167, #168, @yields)2.1.1 / 2014-12-29==================* browser: use `typeof` to check for `console` existence* browser: check for `console.log` truthiness (fix IE 8/9)* browser: add support for Chrome apps* Readme: added Windows usage remarks* Add `bower.json` to properly support bower install2.1.0 / 2014-10-15==================* node: implement `DEBUG_FD` env variable support* package: update "browserify" to v6.1.0* package: add "license" field to package.json (#135, @panuhorsmalahti)2.0.0 / 2014-09-01==================* package: update "browserify" to v5.11.0* node: use stderr rather than stdout for logging (#29, @stephenmathieson)1.0.4 / 2014-07-15==================* dist: recompile* example: remove `console.info()` log usage* example: add "Content-Type" UTF-8 header to browser example* browser: place %c marker after the space character* browser: reset the "content" color via `color: inherit`* browser: add colors support for Firefox >= v31* debug: prefer an instance `log()` function over the global one (#119)* Readme: update documentation about styled console logs for FF v31 (#116, @wryk)1.0.3 / 2014-07-09==================* Add support for multiple wildcards in namespaces (#122, @seegno)* browser: fix lint1.0.2 / 2014-06-10==================* browser: update color palette (#113, @gscottolson)* common: make console logging function configurable (#108, @timoxley)* node: fix %o colors on old node <= 0.8.x* Makefile: find node path using shell/which (#109, @timoxley)1.0.1 / 2014-06-06==================* browser: use `removeItem()` to clear localStorage* browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)* package: add "contributors" section* node: fix comment typo* README: list authors1.0.0 / 2014-06-04==================* make ms diff be global, not be scope* debug: ignore empty strings in enable()* node: make DEBUG_COLORS able to disable coloring* *: export the `colors` array* npmignore: don't publish the `dist` dir* Makefile: refactor to use browserify* package: add "browserify" as a dev dependency* Readme: add Web Inspector Colors section* node: reset terminal color for the debug content* node: map "%o" to `util.inspect()`* browser: map "%j" to `JSON.stringify()`* debug: add custom "formatters"* debug: use "ms" module for humanizing the diff* Readme: add "bash" syntax highlighting* browser: add Firebug color support* browser: add colors for WebKit browsers* node: apply log to `console`* rewrite: abstract common logic for Node & browsers* add .jshintrc file0.8.1 / 2014-04-14==================* package: re-add the "component" section0.8.0 / 2014-03-30==================* add `enable()` method for nodejs. Closes #27* change from stderr to stdout* remove unnecessary index.js file0.7.4 / 2013-11-13==================* remove "browserify" key from package.json (fixes something in browserify)0.7.3 / 2013-10-30==================* fix: catch localStorage security error when cookies are blocked (Chrome)* add debug(err) support. Closes #46* add .browser prop to package.json. Closes #420.7.2 / 2013-02-06==================* fix package.json* fix: Mobile Safari (private mode) is broken with debug* fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript0.7.1 / 2013-02-05==================* add repository URL to package.json* add DEBUG_COLORED to force colored output* add browserify support* fix component. Closes #240.7.0 / 2012-05-04==================* Added .component to package.json* Added debug.component.js build0.6.0 / 2012-03-16==================* Added support for "-" prefix in DEBUG [Vinay Pulim]* Added `.enabled` flag to the node version [TooTallNate]0.5.0 / 2012-02-02==================* Added: humanize diffs. Closes #8* Added `debug.disable()` to the CS variant* Removed padding. Closes #10* Fixed: persist client-side variant again. Closes #90.4.0 / 2012-02-01==================* Added browser variant support for older browsers [TooTallNate]* Added `debug.enable('project:*')` to browser variant [TooTallNate]* Added padding to diff (moved it to the right)0.3.0 / 2012-01-26==================* Added millisecond diff when isatty, otherwise UTC string0.2.0 / 2012-01-22==================* Added wildcard support0.1.0 / 2011-12-02==================* Added: remove colors unless stderr isatty [TooTallNate]0.0.1 / 2010-01-03==================* Initial release
{"_from": "corser@^2.0.1","_id": "corser@2.0.1","_inBundle": false,"_integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=","_location": "/corser","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "corser@^2.0.1","name": "corser","escapedName": "corser","rawSpec": "^2.0.1","saveSpec": null,"fetchSpec": "^2.0.1"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz","_shasum": "8eda252ecaab5840dcd975ceb90d9370c819ff87","_spec": "corser@^2.0.1","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Alexander Grüneberg","email": "alexander.grueneberg@googlemail.com"},"bugs": {"url": "https://github.com/agrueneberg/Corser/issues"},"bundleDependencies": false,"deprecated": false,"description": "A highly configurable, middleware compatible implementation of CORS.","devDependencies": {"expect.js": "0.1.x","mocha": "1.3.x"},"engines": {"node": ">= 0.4.0"},"homepage": "https://github.com/agrueneberg/Corser#readme","keywords": ["cors","cross-origin resource sharing","connect","express","middleware"],"license": "MIT","main": "./lib/corser.js","name": "corser","repository": {"type": "git","url": "git+https://github.com/agrueneberg/Corser.git"},"scripts": {"test": "mocha"},"version": "2.0.1"}
/*** Specification: http://www.w3.org/TR/2012/WD-cors-20120403/* W3C Working Draft 3 April 2012*/"use strict";/*jshint node:true */var simpleMethods, simpleRequestHeaders, simpleResponseHeaders, toLowerCase, checkOriginMatch;// A method is said to be a simple method if it is a case-sensitive match for one of the following:Object.defineProperty(exports, "simpleMethods", {get: function () {return ["GET","HEAD","POST"];}});simpleMethods = exports.simpleMethods;// A header is said to be a simple header if the header field name is an ASCII case-insensitive match for one of// the following:Object.defineProperty(exports, "simpleRequestHeaders", {get: function () {return ["accept","accept-language","content-language","content-type"];}});simpleRequestHeaders = exports.simpleRequestHeaders;// A header is said to be a simple response header if the header field name is an ASCII case-insensitive// match for one of the following:Object.defineProperty(exports, "simpleResponseHeaders", {get: function () {return ["cache-control","content-language","content-type","expires","last-modified","pragma"];}});simpleResponseHeaders = exports.simpleResponseHeaders;toLowerCase = function (array) {return array.map(function (el) {return el.toLowerCase();});};checkOriginMatch = function (originHeader, origins, callback) {if (typeof origins === "function") {origins(originHeader, function (err, allow) {callback(err, allow);});} else if (origins.length > 0) {callback(null, origins.some(function (origin) {return origin === originHeader;}));} else {// Always matching is acceptable since the list of origins can be unbounded.callback(null, true);}};exports.create = function (options) {options = options || {};options.origins = options.origins || [];options.methods = options.methods || simpleMethods;if (options.hasOwnProperty("requestHeaders") === true) {options.requestHeaders = toLowerCase(options.requestHeaders);} else {options.requestHeaders = simpleRequestHeaders;}if (options.hasOwnProperty("responseHeaders") === true) {options.responseHeaders = toLowerCase(options.responseHeaders);} else {options.responseHeaders = simpleResponseHeaders;}options.maxAge = options.maxAge || null;options.supportsCredentials = options.supportsCredentials || false;if (options.hasOwnProperty("endPreflightRequests") === false) {options.endPreflightRequests = true;}return function (req, res, next) {var methodMatches, headersMatch, requestMethod, requestHeaders, exposedHeaders, endPreflight;// If the Origin header is not present terminate this set of steps.if (!req.headers.hasOwnProperty("origin")) {// The request is outside the scope of the CORS specification. If there is no Origin header,// it could be a same-origin request. Let's let the user-agent handle this situation.next();} else {// If the value of the Origin header is not a case-sensitive match for any of the values in// list of origins, do not set any additional headers and terminate this set of steps.checkOriginMatch(req.headers.origin, options.origins, function (err, originMatches) {if (err !== null) {next(err);} else {if (typeof originMatches !== "boolean" || originMatches === false) {next();} else {// Respond to preflight request.if (req.method === "OPTIONS") {endPreflight = function () {if (options.endPreflightRequests === true) {res.writeHead(204);res.end();} else {next();}};// If there is no Access-Control-Request-Method header or if parsing failed, do not set// any additional headers and terminate this set of steps.if (!req.headers.hasOwnProperty("access-control-request-method")) {endPreflight();} else {requestMethod = req.headers["access-control-request-method"];// If there are no Access-Control-Request-Headers headers let header field-names be the// empty list. If parsing failed do not set any additional headers and terminate this set// of steps.// Checking for an empty header is a workaround for a bug Chrome 52:// https://bugs.chromium.org/p/chromium/issues/detail?id=633729if (req.headers.hasOwnProperty("access-control-request-headers") && req.headers["access-control-request-headers"] !== "") {requestHeaders = toLowerCase(req.headers["access-control-request-headers"].split(/,\s*/));} else {requestHeaders = [];}// If method is not a case-sensitive match for any of the values in list of methods do not// set any additional headers and terminate this set of steps.methodMatches = options.methods.indexOf(requestMethod) !== -1;if (methodMatches === false) {endPreflight();} else {// If any of the header field-names is not a ASCII case-insensitive match for any of// the values in list of headers do not set any additional headers and terminate this// set of steps.headersMatch = requestHeaders.every(function (requestHeader) {// Browsers automatically add Origin to Access-Control-Request-Headers. However,// Origin is not one of the simple request headers. Therefore, the header is// accepted even if it is not in the list of request headers because CORS would// not work without it.if (requestHeader === "origin") {return true;} else {if (options.requestHeaders.indexOf(requestHeader) !== -1) {return true;} else {return false;}}});if (headersMatch === false) {endPreflight();} else {if (options.supportsCredentials === true) {// If the resource supports credentials add a single Access-Control-Allow-Origin// header, with the value of the Origin header as value, and add a single// Access-Control-Allow-Credentials header with the literal string "true"// as value.res.setHeader("Access-Control-Allow-Origin", req.headers.origin);res.setHeader("Access-Control-Allow-Credentials", "true");} else {// Otherwise, add a single Access-Control-Allow-Origin header, with either the// value of the Origin header or the string "*" as value.if (options.origins.length > 0 || typeof options.origins === "function") {res.setHeader("Access-Control-Allow-Origin", req.headers.origin);} else {res.setHeader("Access-Control-Allow-Origin", "*");}}// Optionally add a single Access-Control-Max-Age header with as value the amount// of seconds the user agent is allowed to cache the result of the request.if (options.maxAge !== null) {res.setHeader("Access-Control-Max-Age", options.maxAge);}// Add one or more Access-Control-Allow-Methods headers consisting of (a subset// of) the list of methods.res.setHeader("Access-Control-Allow-Methods", options.methods.join(","));// Add one or more Access-Control-Allow-Headers headers consisting of (a subset// of) the list of headers.res.setHeader("Access-Control-Allow-Headers", options.requestHeaders.join(","));// And out.endPreflight();}}}} else {if (options.supportsCredentials === true) {// If the resource supports credentials add a single Access-Control-Allow-Origin header,// with the value of the Origin header as value, and add a single// Access-Control-Allow-Credentials header with the literal string "true" as value.res.setHeader("Access-Control-Allow-Origin", req.headers.origin);res.setHeader("Access-Control-Allow-Credentials", "true");} else {// Otherwise, add a single Access-Control-Allow-Origin header, with either the value of// the Origin header or the literal string "*" as value.// If the list of origins is empty, use "*" as value.if (options.origins.length > 0 || typeof options.origins === "function") {res.setHeader("Access-Control-Allow-Origin", req.headers.origin);} else {res.setHeader("Access-Control-Allow-Origin", "*");}}// If the list of exposed headers is not empty add one or more Access-Control-Expose-Headers// headers, with as values the header field names given in the list of exposed headers.exposedHeaders = options.responseHeaders.filter(function (optionsResponseHeader) {return simpleResponseHeaders.indexOf(optionsResponseHeader) === -1;});if (exposedHeaders.length > 0) {res.setHeader("Access-Control-Expose-Headers", exposedHeaders.join(","));}// And out.next();}}}});}};};
Corser=======[](http://www.repostatus.org/#active)[](http://travis-ci.org/agrueneberg/Corser)A highly configurable, middleware compatible implementation of [CORS](http://www.w3.org/TR/cors/) for [Node.js](http://nodejs.org/).Changelog---------### 2.0.1 (August 16, 2016)* Add workaround for [Chrome 52 sending empty `Access-Control-Request-Headers` header](https://bugs.chromium.org/p/chromium/issues/detail?id=633729).### 2.0.0 (March 22, 2014)* Preflight requests are automatically closed. If there is a need for handling `OPTIONS` requests, check the `endPreflightRequests` option.* The parameters of the callback function in dynamic origin checking are now `(err, matches)` instead of just `(matches)`.Examples--------### How to use Corser as a middleware in ExpressSee `example/express/` for a working example.var express, corser, app;express = require("express");corser = require("corser");app = express();app.use(corser.create());app.get("/", function (req, res) {res.writeHead(200);res.end("Nice weather today, huh?");});app.listen(1337);### How to use Corser as a middleware in ConnectSee `example/connect/` for a working example.var connect, corser, app;connect = require("connect");corser = require("corser");app = connect();app.use(corser.create());app.use(function (req, res) {res.writeHead(200);res.end("Nice weather today, huh?");});app.listen(1337);### How to use Corser with plain `http`var http, corser, corserRequestListener;http = require("http");corser = require("corser");// Create Corser request listener.corserRequestListener = corser.create();http.createServer(function (req, res) {// Route req and res through the request listener.corserRequestListener(req, res, function () {res.writeHead(200);res.end("Nice weather today, huh?");});}).listen(1337);API---### Creating a Corser request listenerCreating a Corser request listener that generates the appropriate response headers to enable CORS is as simple as:corser.create()This is the equivalent of setting a response header of `Access-Control-Allow-Origin: *`. If you want to restrict the origins, or allow more sophisticated request or response headers, you have to pass a configuration object to `corser.create`.Corser will automatically end preflight requests for you. A preflight request is a special `OPTIONS` request that the browser sends under certain conditions to negotiate with the server what methods, request headers and response headers are allowed for a CORS request. If you need to use the `OPTIONS` method for other stuff, just set `endPreflightRequests` to `false` and terminate those requests yourself:var corserRequestListener;corserRequestListener = corser.create({endPreflightRequests: false});corserRequestListener(req, res, function () {if (req.method === "OPTIONS") {// End CORS preflight request.res.writeHead(204);res.end();} else {// Implement other HTTP methods.}});#### Configuration ObjectA configuration object with the following properties can be passed to `corser.create`.##### `origins`A case-sensitive whitelist of origins. Unless unbound, if the request comes from an origin that is not in this list, it will not be handled by CORS.To allow for dynamic origin checking, a function `(origin, callback)` can be passed instead of an array. `origin` is the Origin header, `callback` is a function `(err, matches)`, where `matches` is a boolean flag that indicates whether the given Origin header matches or not.Default: unbound, i.e. every origin is accepted.##### `methods`An uppercase whitelist of methods. If the request uses a method that is not in this list, it will not be handled by CORS.Setting a value here will overwrite the list of default simple methods. To not lose them, concat the methods you want to add with `corser.simpleMethods`: `corser.simpleMethods.concat(["PUT", "DELETE"])`.Default: simple methods (`GET`, `HEAD`, `POST`).##### `requestHeaders`A case-insensitive whitelist of request headers. If the request uses a request header that is not in this list, it will not be handled by CORS.Setting a value here will overwrite the list of default simple request headers. To not lose them, concat the request headers you want to add with `corser.simpleRequestHeaders`: `corser.simpleRequestHeaders.concat(["Authorization"])`.Default: simple request headers (`Accept`, `Accept-Language`, `Content-Language`, `Content-Type`, `Last-Event-ID`).##### `responseHeaders`A case-insensitive whitelist of response headers. Any response header that is not in this list will be filtered out by the user-agent (the browser).Setting a value here will overwrite the list of default simple response headers. To not lose them, concat the response headers you want to add with `corser.simpleResponseHeaders`: `corser.simpleResponseHeaders.concat(["ETag"])`.Default: simple response headers (`Cache-Control`, `Content-Language`, `Content-Type`, `Expires`, `Last-Modified`, `Pragma`).##### `supportsCredentials`A boolean that indicates if cookie credentials can be transferred as part of a CORS request. Currently, only a few HTML5 elements can benefit from this setting.Default: `false`.##### `maxAge`An integer that indicates the maximum amount of time in seconds that a preflight request is kept in the client-side preflight result cache.Default: not set.##### `endPreflightRequests`A boolean that indicates if CORS preflight requests should be automatically closed.Default: `true`.FAQ---### Ajax call returns `Origin X is not allowed by Access-Control-Allow-Origin`Check if the `Origin` header of your request matches one of the origins provided in the `origins` property of the configuration object. If you didn't set any `origins` property, jump to the next question.### Ajax call still returns `Origin X is not allowed by Access-Control-Allow-Origin`Your request might use a non-simple method or one or more non-simple headers. According to the specification, the set of simple methods is `GET`, `HEAD`, and `POST`, and the set of simple request headers is `Accept`, `Accept-Language`, `Content-Language`, `Content-Type`, and `Last-Event-ID`. If your request uses **any** other method or header, you have to explicitly list them in the `methods` or `requestHeaders` property of the configuration object.#### ExampleYou want to allow requests that use an `X-Requested-With` header. Pass the following configuration object to `corser.create`:corser.create({requestHeaders: corser.simpleRequestHeaders.concat(["X-Requested-With"])});### Getting a response header returns `Refused to get unsafe header "X"`Your browser blocks every non-simple response headers that was not explicitly allowed in the preflight request. The set of simple response headers is `Cache-Control`, `Content-Language`, `Content-Type`, `Expires`, `Last-Modified`, `Pragma`. If you want to access **any** other response header, you have to explicitly list them in the `responseHeaders` property of the configuration object.#### ExampleYou want to allow clients to read the `ETag` header of a response. Pass the following configuration object to `corser.create`:corser.create({responseHeaders: corser.simpleResponseHeaders.concat(["ETag"])});
Copyright (C) 2012 Alexander GrünebergPermission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software is furnished to doso, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
language: node_jsnode_js:- "node"sudo: false
example/test/
module['exports'] = {silly: 'rainbow',input: 'grey',verbose: 'cyan',prompt: 'grey',info: 'green',data: 'grey',help: 'cyan',warn: 'yellow',debug: 'blue',error: 'red',};
//// Remark: Requiring this file will use the "safe" colors API,// which will not touch String.prototype.//// var colors = require('colors/safe');// colors.red("foo")////var colors = require('./lib/colors');module['exports'] = colors;
// Type definitions for Colors.js 1.2// Project: https://github.com/Marak/colors.js// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>// Definitions: https://github.com/Marak/colors.jsexport const enabled: boolean;export function enable(): void;export function disable(): void;export function setTheme(theme: any): void;export function strip(str: string): string;export function stripColors(str: string): string;export function black(str: string): string;export function red(str: string): string;export function green(str: string): string;export function yellow(str: string): string;export function blue(str: string): string;export function magenta(str: string): string;export function cyan(str: string): string;export function white(str: string): string;export function gray(str: string): string;export function grey(str: string): string;export function bgBlack(str: string): string;export function bgRed(str: string): string;export function bgGreen(str: string): string;export function bgYellow(str: string): string;export function bgBlue(str: string): string;export function bgMagenta(str: string): string;export function bgCyan(str: string): string;export function bgWhite(str: string): string;export function reset(str: string): string;export function bold(str: string): string;export function dim(str: string): string;export function italic(str: string): string;export function underline(str: string): string;export function inverse(str: string): string;export function hidden(str: string): string;export function strikethrough(str: string): string;export function rainbow(str: string): string;export function zebra(str: string): string;export function america(str: string): string;export function trap(str: string): string;export function random(str: string): string;export function zalgo(str: string): string;
{"_from": "colors@^1.4.0","_id": "colors@1.4.0","_inBundle": false,"_integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==","_location": "/colors","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "colors@^1.4.0","name": "colors","escapedName": "colors","rawSpec": "^1.4.0","saveSpec": null,"fetchSpec": "^1.4.0"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz","_shasum": "c50491479d4c1bdaed2c9ced32cf7c7dc2360f78","_spec": "colors@^1.4.0","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","author": {"name": "Marak Squires"},"bugs": {"url": "https://github.com/Marak/colors.js/issues"},"bundleDependencies": false,"contributors": [{"name": "DABH","url": "https://github.com/DABH"}],"deprecated": false,"description": "get colors in your node.js console","devDependencies": {"eslint": "^5.2.0","eslint-config-google": "^0.11.0"},"engines": {"node": ">=0.1.90"},"files": ["examples","lib","LICENSE","safe.js","themes","index.d.ts","safe.d.ts"],"homepage": "https://github.com/Marak/colors.js","keywords": ["ansi","terminal","colors"],"license": "MIT","main": "lib/index.js","name": "colors","repository": {"type": "git","url": "git+ssh://git@github.com/Marak/colors.js.git"},"scripts": {"lint": "eslint . --fix","test": "node tests/basic-test.js && node tests/safe-test.js"},"version": "1.4.0"}
/*The MIT License (MIT)Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*/'use strict';var os = require('os');var hasFlag = require('./has-flag.js');var env = process.env;var forceColor = void 0;if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {forceColor = false;} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')|| hasFlag('color=always')) {forceColor = true;}if ('FORCE_COLOR' in env) {forceColor = env.FORCE_COLOR.length === 0|| parseInt(env.FORCE_COLOR, 10) !== 0;}function translateLevel(level) {if (level === 0) {return false;}return {level: level,hasBasic: true,has256: level >= 2,has16m: level >= 3,};}function supportsColor(stream) {if (forceColor === false) {return 0;}if (hasFlag('color=16m') || hasFlag('color=full')|| hasFlag('color=truecolor')) {return 3;}if (hasFlag('color=256')) {return 2;}if (stream && !stream.isTTY && forceColor !== true) {return 0;}var min = forceColor ? 1 : 0;if (process.platform === 'win32') {// Node.js 7.5.0 is the first version of Node.js to include a patch to// libuv that enables 256 color output on Windows. Anything earlier and it// won't work. However, here we target Node.js 8 at minimum as it is an LTS// release, and Node.js 7 is not. Windows 10 build 10586 is the first// Windows release that supports 256 colors. Windows 10 build 14931 is the// first release that supports 16m/TrueColor.var osRelease = os.release().split('.');if (Number(process.versions.node.split('.')[0]) >= 8&& Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {return Number(osRelease[2]) >= 14931 ? 3 : 2;}return 1;}if ('CI' in env) {if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {return sign in env;}) || env.CI_NAME === 'codeship') {return 1;}return min;}if ('TEAMCITY_VERSION' in env) {return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0);}if ('TERM_PROGRAM' in env) {var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);switch (env.TERM_PROGRAM) {case 'iTerm.app':return version >= 3 ? 3 : 2;case 'Hyper':return 3;case 'Apple_Terminal':return 2;// No default}}if (/-256(color)?$/i.test(env.TERM)) {return 2;}if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {return 1;}if ('COLORTERM' in env) {return 1;}if (env.TERM === 'dumb') {return min;}return min;}function getSupportLevel(stream) {var level = supportsColor(stream);return translateLevel(level);}module.exports = {supportsColor: getSupportLevel,stdout: getSupportLevel(process.stdout),stderr: getSupportLevel(process.stderr),};
/*MIT LicenseCopyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copiesof the Software, and to permit persons to whom the Software is furnished to doso, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.*/'use strict';module.exports = function(flag, argv) {argv = argv || process.argv;var terminatorPos = argv.indexOf('--');var prefix = /^-{1,2}/.test(flag) ? '' : '--';var pos = argv.indexOf(prefix + flag);return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);};
/*The MIT License (MIT)Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*/var styles = {};module['exports'] = styles;var codes = {reset: [0, 0],bold: [1, 22],dim: [2, 22],italic: [3, 23],underline: [4, 24],inverse: [7, 27],hidden: [8, 28],strikethrough: [9, 29],black: [30, 39],red: [31, 39],green: [32, 39],yellow: [33, 39],blue: [34, 39],magenta: [35, 39],cyan: [36, 39],white: [37, 39],gray: [90, 39],grey: [90, 39],brightRed: [91, 39],brightGreen: [92, 39],brightYellow: [93, 39],brightBlue: [94, 39],brightMagenta: [95, 39],brightCyan: [96, 39],brightWhite: [97, 39],bgBlack: [40, 49],bgRed: [41, 49],bgGreen: [42, 49],bgYellow: [43, 49],bgBlue: [44, 49],bgMagenta: [45, 49],bgCyan: [46, 49],bgWhite: [47, 49],bgGray: [100, 49],bgGrey: [100, 49],bgBrightRed: [101, 49],bgBrightGreen: [102, 49],bgBrightYellow: [103, 49],bgBrightBlue: [104, 49],bgBrightMagenta: [105, 49],bgBrightCyan: [106, 49],bgBrightWhite: [107, 49],// legacy styles for colors pre v1.0.0blackBG: [40, 49],redBG: [41, 49],greenBG: [42, 49],yellowBG: [43, 49],blueBG: [44, 49],magentaBG: [45, 49],cyanBG: [46, 49],whiteBG: [47, 49],};Object.keys(codes).forEach(function(key) {var val = codes[key];var style = styles[key] = [];style.open = '\u001b[' + val[0] + 'm';style.close = '\u001b[' + val[1] + 'm';});
module['exports'] = function(colors) {return function(letter, i, exploded) {return i % 2 === 0 ? letter : colors.inverse(letter);};};
module['exports'] = function(colors) {var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green','blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed','brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];return function(letter, i, exploded) {return letter === ' ' ? letter :colors[available[Math.round(Math.random() * (available.length - 2))]](letter);};};
module['exports'] = function(colors) {// RoY G BiVvar rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];return function(letter, i, exploded) {if (letter === ' ') {return letter;} else {return colors[rainbowColors[i++ % rainbowColors.length]](letter);}};};
module['exports'] = function(colors) {return function(letter, i, exploded) {if (letter === ' ') return letter;switch (i%3) {case 0: return colors.red(letter);case 1: return colors.white(letter);case 2: return colors.blue(letter);}};};
var colors = require('./colors');module['exports'] = colors;// Remark: By default, colors will add style properties to String.prototype.//// If you don't wish to extend String.prototype, you can do this instead and// native String will not be touched://// var colors = require('colors/safe);// colors.red("foo")////require('./extendStringPrototype')();
var colors = require('./colors');module['exports'] = function() {//// Extends prototype of native string object to allow for "foo".red syntax//var addProperty = function(color, func) {String.prototype.__defineGetter__(color, func);};addProperty('strip', function() {return colors.strip(this);});addProperty('stripColors', function() {return colors.strip(this);});addProperty('trap', function() {return colors.trap(this);});addProperty('zalgo', function() {return colors.zalgo(this);});addProperty('zebra', function() {return colors.zebra(this);});addProperty('rainbow', function() {return colors.rainbow(this);});addProperty('random', function() {return colors.random(this);});addProperty('america', function() {return colors.america(this);});//// Iterate through all default styles and colors//var x = Object.keys(colors.styles);x.forEach(function(style) {addProperty(style, function() {return colors.stylize(this, style);});});function applyTheme(theme) {//// Remark: This is a list of methods that exist// on String that you should not overwrite.//var stringPrototypeBlacklist = ['__defineGetter__', '__defineSetter__', '__lookupGetter__','__lookupSetter__', 'charAt', 'constructor', 'hasOwnProperty','isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString','valueOf', 'charCodeAt', 'indexOf', 'lastIndexOf', 'length','localeCompare', 'match', 'repeat', 'replace', 'search', 'slice','split', 'substring', 'toLocaleLowerCase', 'toLocaleUpperCase','toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight',];Object.keys(theme).forEach(function(prop) {if (stringPrototypeBlacklist.indexOf(prop) !== -1) {console.log('warn: '.red + ('String.prototype' + prop).magenta +' is probably something you don\'t want to override. ' +'Ignoring style name');} else {if (typeof(theme[prop]) === 'string') {colors[prop] = colors[theme[prop]];addProperty(prop, function() {return colors[prop](this);});} else {var themePropApplicator = function(str) {var ret = str || this;for (var t = 0; t < theme[prop].length; t++) {ret = colors[theme[prop][t]](ret);}return ret;};addProperty(prop, themePropApplicator);colors[prop] = function(str) {return themePropApplicator(str);};}}});}colors.setTheme = function(theme) {if (typeof theme === 'string') {console.log('colors.setTheme now only accepts an object, not a string. ' +'If you are trying to set a theme from a file, it is now your (the ' +'caller\'s) responsibility to require the file. The old syntax ' +'looked like colors.setTheme(__dirname + ' +'\'/../themes/generic-logging.js\'); The new syntax looks like '+'colors.setTheme(require(__dirname + ' +'\'/../themes/generic-logging.js\'));');return;} else {applyTheme(theme);}};};
// please nomodule['exports'] = function zalgo(text, options) {text = text || ' he is here ';var soul = {'up': ['̍', '̎', '̄', '̅','̿', '̑', '̆', '̐','͒', '͗', '͑', '̇','̈', '̊', '͂', '̓','̈', '͊', '͋', '͌','̃', '̂', '̌', '͐','̀', '́', '̋', '̏','̒', '̓', '̔', '̽','̉', 'ͣ', 'ͤ', 'ͥ','ͦ', 'ͧ', 'ͨ', 'ͩ','ͪ', 'ͫ', 'ͬ', 'ͭ','ͮ', 'ͯ', '̾', '͛','͆', '̚',],'down': ['̖', '̗', '̘', '̙','̜', '̝', '̞', '̟','̠', '̤', '̥', '̦','̩', '̪', '̫', '̬','̭', '̮', '̯', '̰','̱', '̲', '̳', '̹','̺', '̻', '̼', 'ͅ','͇', '͈', '͉', '͍','͎', '͓', '͔', '͕','͖', '͙', '͚', '̣',],'mid': ['̕', '̛', '̀', '́','͘', '̡', '̢', '̧','̨', '̴', '̵', '̶','͜', '͝', '͞','͟', '͠', '͢', '̸','̷', '͡', ' ҉',],};var all = [].concat(soul.up, soul.down, soul.mid);function randomNumber(range) {var r = Math.floor(Math.random() * range);return r;}function isChar(character) {var bool = false;all.filter(function(i) {bool = (i === character);});return bool;}function heComes(text, options) {var result = '';var counts;var l;options = options || {};options['up'] =typeof options['up'] !== 'undefined' ? options['up'] : true;options['mid'] =typeof options['mid'] !== 'undefined' ? options['mid'] : true;options['down'] =typeof options['down'] !== 'undefined' ? options['down'] : true;options['size'] =typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';text = text.split('');for (l in text) {if (isChar(l)) {continue;}result = result + text[l];counts = {'up': 0, 'down': 0, 'mid': 0};switch (options.size) {case 'mini':counts.up = randomNumber(8);counts.mid = randomNumber(2);counts.down = randomNumber(8);break;case 'maxi':counts.up = randomNumber(16) + 3;counts.mid = randomNumber(4) + 1;counts.down = randomNumber(64) + 3;break;default:counts.up = randomNumber(8) + 1;counts.mid = randomNumber(6) / 2;counts.down = randomNumber(8) + 1;break;}var arr = ['up', 'mid', 'down'];for (var d in arr) {var index = arr[d];for (var i = 0; i <= counts[index]; i++) {if (options[index]) {result = result + soul[index][randomNumber(soul[index].length)];}}}}return result;}// don't summon himreturn heComes(text, options);};
module['exports'] = function runTheTrap(text, options) {var result = '';text = text || 'Run the trap, drop the bass';text = text.split('');var trap = {a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],c: ['\u00a9', '\u023b', '\u03fe'],d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc','\u0a6c'],f: ['\u04fa'],g: ['\u0262'],h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],i: ['\u0f0f'],j: ['\u0134'],k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],l: ['\u0139'],m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd','\u06dd', '\u0e4f'],p: ['\u01f7', '\u048e'],q: ['\u09cd'],r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],t: ['\u0141', '\u0166', '\u0373'],u: ['\u01b1', '\u054d'],v: ['\u05d8'],w: ['\u0428', '\u0460', '\u047c', '\u0d70'],x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],y: ['\u00a5', '\u04b0', '\u04cb'],z: ['\u01b5', '\u0240'],};text.forEach(function(c) {c = c.toLowerCase();var chars = trap[c] || [' '];var rand = Math.floor(Math.random() * chars.length);if (typeof trap[c] !== 'undefined') {result += trap[c][rand];} else {result += c;}});return result;};
/*The MIT License (MIT)Original Library- Copyright (c) Marak SquiresAdditional functionality- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.*/var colors = {};module['exports'] = colors;colors.themes = {};var util = require('util');var ansiStyles = colors.styles = require('./styles');var defineProps = Object.defineProperties;var newLineRegex = new RegExp(/[\r\n]+/g);colors.supportsColor = require('./system/supports-colors').supportsColor;if (typeof colors.enabled === 'undefined') {colors.enabled = colors.supportsColor() !== false;}colors.enable = function() {colors.enabled = true;};colors.disable = function() {colors.enabled = false;};colors.stripColors = colors.strip = function(str) {return ('' + str).replace(/\x1B\[\d+m/g, '');};// eslint-disable-next-line no-unused-varsvar stylize = colors.stylize = function stylize(str, style) {if (!colors.enabled) {return str+'';}var styleMap = ansiStyles[style];// Stylize should work for non-ANSI styles, tooif(!styleMap && style in colors){// Style maps like trap operate as functions on strings;// they don't have properties like open or close.return colors[style](str);}return styleMap.open + str + styleMap.close;};var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;var escapeStringRegexp = function(str) {if (typeof str !== 'string') {throw new TypeError('Expected a string');}return str.replace(matchOperatorsRe, '\\$&');};function build(_styles) {var builder = function builder() {return applyStyle.apply(builder, arguments);};builder._styles = _styles;// __proto__ is used because we must return a function, but there is// no way to create a function with a different prototype.builder.__proto__ = proto;return builder;}var styles = (function() {var ret = {};ansiStyles.grey = ansiStyles.gray;Object.keys(ansiStyles).forEach(function(key) {ansiStyles[key].closeRe =new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');ret[key] = {get: function() {return build(this._styles.concat(key));},};});return ret;})();var proto = defineProps(function colors() {}, styles);function applyStyle() {var args = Array.prototype.slice.call(arguments);var str = args.map(function(arg) {// Use weak equality check so we can colorize null/undefined in safe modeif (arg != null && arg.constructor === String) {return arg;} else {return util.inspect(arg);}}).join(' ');if (!colors.enabled || !str) {return str;}var newLinesPresent = str.indexOf('\n') != -1;var nestedStyles = this._styles;var i = nestedStyles.length;while (i--) {var code = ansiStyles[nestedStyles[i]];str = code.open + str.replace(code.closeRe, code.open) + code.close;if (newLinesPresent) {str = str.replace(newLineRegex, function(match) {return code.close + match + code.open;});}}return str;}colors.setTheme = function(theme) {if (typeof theme === 'string') {console.log('colors.setTheme now only accepts an object, not a string. ' +'If you are trying to set a theme from a file, it is now your (the ' +'caller\'s) responsibility to require the file. The old syntax ' +'looked like colors.setTheme(__dirname + ' +'\'/../themes/generic-logging.js\'); The new syntax looks like '+'colors.setTheme(require(__dirname + ' +'\'/../themes/generic-logging.js\'));');return;}for (var style in theme) {(function(style) {colors[style] = function(str) {if (typeof theme[style] === 'object') {var out = str;for (var i in theme[style]) {out = colors[theme[style][i]](out);}return out;}return colors[theme[style]](str);};})(style);}};function init() {var ret = {};Object.keys(styles).forEach(function(name) {ret[name] = {get: function() {return build([name]);},};});return ret;}var sequencer = function sequencer(map, str) {var exploded = str.split('');exploded = exploded.map(map);return exploded.join('');};// custom formatter methodscolors.trap = require('./custom/trap');colors.zalgo = require('./custom/zalgo');// mapscolors.maps = {};colors.maps.america = require('./maps/america')(colors);colors.maps.zebra = require('./maps/zebra')(colors);colors.maps.rainbow = require('./maps/rainbow')(colors);colors.maps.random = require('./maps/random')(colors);for (var map in colors.maps) {(function(map) {colors[map] = function(str) {return sequencer(colors.maps[map], str);};})(map);}defineProps(colors, init());
// Type definitions for Colors.js 1.2// Project: https://github.com/Marak/colors.js// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>// Definitions: https://github.com/Marak/colors.jsexport interface Color {(text: string): string;strip: Color;stripColors: Color;black: Color;red: Color;green: Color;yellow: Color;blue: Color;magenta: Color;cyan: Color;white: Color;gray: Color;grey: Color;bgBlack: Color;bgRed: Color;bgGreen: Color;bgYellow: Color;bgBlue: Color;bgMagenta: Color;bgCyan: Color;bgWhite: Color;reset: Color;bold: Color;dim: Color;italic: Color;underline: Color;inverse: Color;hidden: Color;strikethrough: Color;rainbow: Color;zebra: Color;america: Color;trap: Color;random: Color;zalgo: Color;}export function enable(): void;export function disable(): void;export function setTheme(theme: any): void;export let enabled: boolean;export const strip: Color;export const stripColors: Color;export const black: Color;export const red: Color;export const green: Color;export const yellow: Color;export const blue: Color;export const magenta: Color;export const cyan: Color;export const white: Color;export const gray: Color;export const grey: Color;export const bgBlack: Color;export const bgRed: Color;export const bgGreen: Color;export const bgYellow: Color;export const bgBlue: Color;export const bgMagenta: Color;export const bgCyan: Color;export const bgWhite: Color;export const reset: Color;export const bold: Color;export const dim: Color;export const italic: Color;export const underline: Color;export const inverse: Color;export const hidden: Color;export const strikethrough: Color;export const rainbow: Color;export const zebra: Color;export const america: Color;export const trap: Color;export const random: Color;export const zalgo: Color;declare global {interface String {strip: string;stripColors: string;black: string;red: string;green: string;yellow: string;blue: string;magenta: string;cyan: string;white: string;gray: string;grey: string;bgBlack: string;bgRed: string;bgGreen: string;bgYellow: string;bgBlue: string;bgMagenta: string;bgCyan: string;bgWhite: string;reset: string;// @ts-ignorebold: string;dim: string;italic: string;underline: string;inverse: string;hidden: string;strikethrough: string;rainbow: string;zebra: string;america: string;trap: string;random: string;zalgo: string;}}
var colors = require('../safe');console.log(colors.yellow('First some yellow text'));console.log(colors.yellow.underline('Underline that text'));console.log(colors.red.bold('Make it bold and red'));console.log(colors.rainbow('Double Raindows All Day Long'));console.log(colors.trap('Drop the bass'));console.log(colors.rainbow(colors.trap('DROP THE RAINBOW BASS')));// styles not widely supportedconsole.log(colors.bold.italic.underline.red('Chains are also cool.'));// styles not widely supportedconsole.log(colors.green('So ') + colors.underline('are') + ' '+ colors.inverse('inverse') + colors.yellow.bold(' styles! '));console.log(colors.zebra('Zebras are so fun!'));console.log('This is ' + colors.strikethrough('not') + ' fun.');console.log(colors.black.bgWhite('Background color attack!'));console.log(colors.random('Use random styles on everything!'));console.log(colors.america('America, Heck Yeah!'));console.log(colors.brightCyan('Blindingly ') + colors.brightRed('bright? ') + colors.brightYellow('Why ') + colors.brightGreen('not?!'));console.log('Setting themes is useful');//// Custom themes//// console.log('Generic logging theme as JSON'.green.bold.underline);// Load theme with JSON literalcolors.setTheme({silly: 'rainbow',input: 'blue',verbose: 'cyan',prompt: 'grey',info: 'green',data: 'grey',help: 'cyan',warn: 'yellow',debug: 'blue',error: 'red',});// outputs red textconsole.log(colors.error('this is an error'));// outputs yellow textconsole.log(colors.warn('this is a warning'));// outputs blue textconsole.log(colors.input('this is an input'));// console.log('Generic logging theme as file'.green.bold.underline);// Load a theme from filecolors.setTheme(require(__dirname + '/../themes/generic-logging.js'));// outputs red textconsole.log(colors.error('this is an error'));// outputs yellow textconsole.log(colors.warn('this is a warning'));// outputs grey textconsole.log(colors.input('this is an input'));// console.log(colors.zalgo("Don't summon him"))
var colors = require('../lib/index');console.log('First some yellow text'.yellow);console.log('Underline that text'.yellow.underline);console.log('Make it bold and red'.red.bold);console.log(('Double Raindows All Day Long').rainbow);console.log('Drop the bass'.trap);console.log('DROP THE RAINBOW BASS'.trap.rainbow);// styles not widely supportedconsole.log('Chains are also cool.'.bold.italic.underline.red);// styles not widely supportedconsole.log('So '.green + 'are'.underline + ' ' + 'inverse'.inverse+ ' styles! '.yellow.bold);console.log('Zebras are so fun!'.zebra);//// Remark: .strikethrough may not work with Mac OS Terminal App//console.log('This is ' + 'not'.strikethrough + ' fun.');console.log('Background color attack!'.black.bgWhite);console.log('Use random styles on everything!'.random);console.log('America, Heck Yeah!'.america);console.log('Blindingly '.brightCyan + 'bright? '.brightRed + 'Why '.brightYellow + 'not?!'.brightGreen);console.log('Setting themes is useful');//// Custom themes//console.log('Generic logging theme as JSON'.green.bold.underline);// Load theme with JSON literalcolors.setTheme({silly: 'rainbow',input: 'grey',verbose: 'cyan',prompt: 'grey',info: 'green',data: 'grey',help: 'cyan',warn: 'yellow',debug: 'blue',error: 'red',});// outputs red textconsole.log('this is an error'.error);// outputs yellow textconsole.log('this is a warning'.warn);// outputs grey textconsole.log('this is an input'.input);console.log('Generic logging theme as file'.green.bold.underline);// Load a theme from filetry {colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));} catch (err) {console.log(err);}// outputs red textconsole.log('this is an error'.error);// outputs yellow textconsole.log('this is a warning'.warn);// outputs grey textconsole.log('this is an input'.input);// console.log("Don't summon".zalgo)
# colors.js[](https://travis-ci.org/Marak/colors.js)[](https://www.npmjs.org/package/colors)[](https://david-dm.org/Marak/colors.js)[](https://david-dm.org/Marak/colors.js#info=devDependencies)Please check out the [roadmap](ROADMAP.md) for upcoming features and releases. Please open Issues to provide feedback, and check the `develop` branch for the latest bleeding-edge updates.## get color and style in your node.js console## Installationnpm install colors## colors and styles!### text colors- black- red- green- yellow- blue- magenta- cyan- white- gray- grey### bright text colors- brightRed- brightGreen- brightYellow- brightBlue- brightMagenta- brightCyan- brightWhite### background colors- bgBlack- bgRed- bgGreen- bgYellow- bgBlue- bgMagenta- bgCyan- bgWhite- bgGray- bgGrey### bright background colors- bgBrightRed- bgBrightGreen- bgBrightYellow- bgBrightBlue- bgBrightMagenta- bgBrightCyan- bgBrightWhite### styles- reset- bold- dim- italic- underline- inverse- hidden- strikethrough### extras- rainbow- zebra- america- trap- random## UsageBy popular demand, `colors` now ships with two types of usages!The super nifty way```jsvar colors = require('colors');console.log('hello'.green); // outputs green textconsole.log('i like cake and pies'.underline.red) // outputs red underlined textconsole.log('inverse the color'.inverse); // inverses the colorconsole.log('OMG Rainbows!'.rainbow); // rainbowconsole.log('Run the trap'.trap); // Drops the bass```or a slightly less nifty way which doesn't extend `String.prototype````jsvar colors = require('colors/safe');console.log(colors.green('hello')); // outputs green textconsole.log(colors.red.underline('i like cake and pies')) // outputs red underlined textconsole.log(colors.inverse('inverse the color')); // inverses the colorconsole.log(colors.rainbow('OMG Rainbows!')); // rainbowconsole.log(colors.trap('Run the trap')); // Drops the bass```I prefer the first way. Some people seem to be afraid of extending `String.prototype` and prefer the second way.If you are writing good code you will never have an issue with the first approach. If you really don't want to touch `String.prototype`, the second usage will not touch `String` native object.## Enabling/Disabling ColorsThe package will auto-detect whether your terminal can use colors and enable/disable accordingly. When colors are disabled, the color functions do nothing. You can override this with a command-line flag:```bashnode myapp.js --no-colornode myapp.js --color=falsenode myapp.js --colornode myapp.js --color=truenode myapp.js --color=alwaysFORCE_COLOR=1 node myapp.js```Or in code:```javascriptvar colors = require('colors');colors.enable();colors.disable();```## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)```jsvar name = 'Marak';console.log(colors.green('Hello %s'), name);// outputs -> 'Hello Marak'```## Custom themes### Using standard API```jsvar colors = require('colors');colors.setTheme({silly: 'rainbow',input: 'grey',verbose: 'cyan',prompt: 'grey',info: 'green',data: 'grey',help: 'cyan',warn: 'yellow',debug: 'blue',error: 'red'});// outputs red textconsole.log("this is an error".error);// outputs yellow textconsole.log("this is a warning".warn);```### Using string safe API```jsvar colors = require('colors/safe');// set single propertyvar error = colors.red;error('this is red');// set themecolors.setTheme({silly: 'rainbow',input: 'grey',verbose: 'cyan',prompt: 'grey',info: 'green',data: 'grey',help: 'cyan',warn: 'yellow',debug: 'blue',error: 'red'});// outputs red textconsole.log(colors.error("this is an error"));// outputs yellow textconsole.log(colors.warn("this is a warning"));```### Combining Colors```javascriptvar colors = require('colors');colors.setTheme({custom: ['red', 'underline']});console.log('test'.custom);```*Protip: There is a secret undocumented style in `colors`. If you find the style you can summon him.*
MIT LicenseOriginal Library- Copyright (c) Marak SquiresAdditional Functionality- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
{"_from": "basic-auth@^1.0.3","_id": "basic-auth@1.1.0","_inBundle": false,"_integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=","_location": "/basic-auth","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "basic-auth@^1.0.3","name": "basic-auth","escapedName": "basic-auth","rawSpec": "^1.0.3","saveSpec": null,"fetchSpec": "^1.0.3"},"_requiredBy": ["/http-server"],"_resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz","_shasum": "45221ee429f7ee1e5035be3f51533f1cdfd29884","_spec": "basic-auth@^1.0.3","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/http-server","bugs": {"url": "https://github.com/jshttp/basic-auth/issues"},"bundleDependencies": false,"deprecated": false,"description": "node.js basic auth parser","devDependencies": {"eslint": "3.10.2","eslint-config-standard": "6.2.1","eslint-plugin-markdown": "1.0.0-beta.3","eslint-plugin-promise": "3.4.0","eslint-plugin-standard": "2.0.1","istanbul": "0.4.5","mocha": "1.21.5"},"engines": {"node": ">= 0.6"},"files": ["HISTORY.md","LICENSE","index.js"],"homepage": "https://github.com/jshttp/basic-auth#readme","keywords": ["basic","auth","authorization","basicauth"],"license": "MIT","name": "basic-auth","repository": {"type": "git","url": "git+https://github.com/jshttp/basic-auth.git"},"scripts": {"lint": "eslint --plugin markdown --ext js,md .","test": "mocha --check-leaks --reporter spec --bail","test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"version": "1.1.0"}
/*!* basic-auth* Copyright(c) 2013 TJ Holowaychuk* Copyright(c) 2014 Jonathan Ong* Copyright(c) 2015-2016 Douglas Christopher Wilson* MIT Licensed*/'use strict'/*** Module exports.* @public*/module.exports = authmodule.exports.parse = parse/*** RegExp for basic auth credentials** credentials = auth-scheme 1*SP token68* auth-scheme = "Basic" ; case insensitive* token68 = 1*( ALPHA / DIGIT / "-" / "." / "_" / "~" / "+" / "/" ) *"="* @private*/var CREDENTIALS_REGEXP = /^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$//*** RegExp for basic auth user/pass** user-pass = userid ":" password* userid = *<TEXT excluding ":">* password = *TEXT* @private*/var USER_PASS_REGEXP = /^([^:]*):(.*)$//*** Parse the Authorization header field of a request.** @param {object} req* @return {object} with .name and .pass* @public*/function auth (req) {if (!req) {throw new TypeError('argument req is required')}if (typeof req !== 'object') {throw new TypeError('argument req is required to be an object')}// get headervar header = getAuthorization(req.req || req)// parse headerreturn parse(header)}/*** Decode base64 string.* @private*/function decodeBase64 (str) {return new Buffer(str, 'base64').toString()}/*** Get the Authorization header from request object.* @private*/function getAuthorization (req) {if (!req.headers || typeof req.headers !== 'object') {throw new TypeError('argument req is required to have headers property')}return req.headers.authorization}/*** Parse basic auth to object.** @param {string} string* @return {object}* @public*/function parse (string) {if (typeof string !== 'string') {return undefined}// parse headervar match = CREDENTIALS_REGEXP.exec(string)if (!match) {return undefined}// decode user passvar userPass = USER_PASS_REGEXP.exec(decodeBase64(match[1]))if (!userPass) {return undefined}// return credentials objectreturn new Credentials(userPass[1], userPass[2])}/*** Object to represent user credentials.* @private*/function Credentials (name, pass) {this.name = namethis.pass = pass}
# basic-auth[![NPM Version][npm-image]][npm-url][![NPM Downloads][downloads-image]][downloads-url][![Node.js Version][node-version-image]][node-version-url][![Build Status][travis-image]][travis-url][![Test Coverage][coveralls-image]][coveralls-url]Generic basic auth Authorization header field parser for whatever.## InstallationThis is a [Node.js](https://nodejs.org/en/) module available through the[npm registry](https://www.npmjs.com/). Installation is done using the[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):```$ npm install basic-auth```## API<!-- eslint-disable no-unused-vars -->```jsvar auth = require('basic-auth')```### auth(req)Get the basic auth credentials from the given request. The `Authorization`header is parsed and if the header is invalid, `undefined` is returned,otherwise an object with `name` and `pass` properties.### auth.parse(string)Parse a basic auth authorization header string. This will return an objectwith `name` and `pass` properties, or `undefined` if the string is invalid.## ExamplePass a node request or koa Context object to the module exported. Ifparsing fails `undefined` is returned, otherwise an object with`.name` and `.pass`.<!-- eslint-disable no-unused-vars, no-undef -->```jsvar auth = require('basic-auth')var user = auth(req)// => { name: 'something', pass: 'whatever' }```A header string from any other location can also be parsed with`auth.parse`, for example a `Proxy-Authorization` header:<!-- eslint-disable no-unused-vars, no-undef -->```jsvar auth = require('basic-auth')var user = auth.parse(req.getHeader('Proxy-Authorization'))```### With vanilla node.js http server```jsvar http = require('http')var auth = require('basic-auth')// Create servervar server = http.createServer(function (req, res) {var credentials = auth(req)if (!credentials || credentials.name !== 'john' || credentials.pass !== 'secret') {res.statusCode = 401res.setHeader('WWW-Authenticate', 'Basic realm="example"')res.end('Access denied')} else {res.end('Access granted')}})// Listenserver.listen(3000)```# License[MIT](LICENSE)[npm-image]: https://img.shields.io/npm/v/basic-auth.svg[npm-url]: https://npmjs.org/package/basic-auth[node-version-image]: https://img.shields.io/node/v/basic-auth.svg[node-version-url]: https://nodejs.org/en/download[travis-image]: https://img.shields.io/travis/jshttp/basic-auth/master.svg[travis-url]: https://travis-ci.org/jshttp/basic-auth[coveralls-image]: https://img.shields.io/coveralls/jshttp/basic-auth/master.svg[coveralls-url]: https://coveralls.io/r/jshttp/basic-auth?branch=master[downloads-image]: https://img.shields.io/npm/dm/basic-auth.svg[downloads-url]: https://npmjs.org/package/basic-auth
(The MIT License)Copyright (c) 2013 TJ HolowaychukCopyright (c) 2014 Jonathan Ong <me@jongleberry.com>Copyright (c) 2015-2016 Douglas Christopher Wilson <doug@somethingdoug.com>Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the'Software'), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1.1.0 / 2016-11-18==================* Add `auth.parse` for low-level string parsing1.0.4 / 2016-05-10==================* Improve error message when `req` argument is not an object* Improve error message when `req` missing `headers` property1.0.3 / 2015-07-01==================* Fix regression accepting a Koa context1.0.2 / 2015-06-12==================* Improve error message when `req` argument missing* perf: enable strict mode* perf: hoist regular expression* perf: parse with regular expressions* perf: remove argument reassignment1.0.1 / 2015-05-04==================* Update readme1.0.0 / 2014-07-01==================* Support empty password* Support empty username0.0.1 / 2013-11-30==================* Initial release
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = asyncify;var _isObject = require('lodash/isObject');var _isObject2 = _interopRequireDefault(_isObject);var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _setImmediate = require('./internal/setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Take a sync function and make it async, passing its return value to a* callback. This is useful for plugging sync functions into a waterfall,* series, or other async functions. Any arguments passed to the generated* function will be passed to the wrapped function (except for the final* callback argument). Errors thrown will be passed to the callback.** If the function passed to `asyncify` returns a Promise, that promises's* resolved/rejected state will be used to call the callback, rather than simply* the synchronous return value.** This also means you can asyncify ES2017 `async` functions.** @name asyncify* @static* @memberOf module:Utils* @method* @alias wrapSync* @category Util* @param {Function} func - The synchronous function, or Promise-returning* function to convert to an {@link AsyncFunction}.* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be* invoked with `(args..., callback)`.* @example** // passing a regular synchronous function* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(JSON.parse),* function (data, next) {* // data is the result of parsing the text.* // If there was a parsing error, it would have been caught.* }* ], callback);** // passing a function returning a promise* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(function (contents) {* return db.model.create(contents);* }),* function (model, next) {* // `model` is the instantiated model object.* // If there was an error, this function would be skipped.* }* ], callback);** // es2017 example, though `asyncify` is not needed if your JS environment* // supports async functions out of the box* var q = async.queue(async.asyncify(async function(file) {* var intermediateStep = await processFile(file);* return await somePromise(intermediateStep)* }));** q.push(files);*/function asyncify(func) {return (0, _initialParams2.default)(function (args, callback) {var result;try {result = func.apply(this, args);} catch (e) {return callback(e);}// if result is Promise objectif ((0, _isObject2.default)(result) && typeof result.then === 'function') {result.then(function (value) {invokeCallback(callback, null, value);}, function (err) {invokeCallback(callback, err.message ? err : new Error(err));});} else {callback(null, result);}});}function invokeCallback(callback, error, value) {try {callback(error, value);} catch (e) {(0, _setImmediate2.default)(rethrow, e);}}function rethrow(error) {throw error;}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = whilst;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when* stopped, or an error occurs.** @name whilst* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Function} test - synchronous truth test to perform before each* execution of `iteratee`. Invoked with ().* @param {AsyncFunction} iteratee - An async function which is called each time* `test` passes. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);* @returns undefined* @example** var count = 0;* async.whilst(* function() { return count < 5; },* function(callback) {* count++;* setTimeout(function() {* callback(null, count);* }, 1000);* },* function (err, n) {* // 5 seconds have passed, n = 5* }* );*/function whilst(test, iteratee, callback) {callback = (0, _onlyOnce2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);if (!test()) return callback(null);var next = function (err /*, ...args*/) {if (err) return callback(err);if (test()) return _iteratee(next);var args = (0, _slice2.default)(arguments, 1);callback.apply(null, [null].concat(args));};_iteratee(next);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (tasks, callback) {callback = (0, _once2.default)(callback || _noop2.default);if (!(0, _isArray2.default)(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));if (!tasks.length) return callback();var taskIndex = 0;function nextTask(args) {var task = (0, _wrapAsync2.default)(tasks[taskIndex++]);args.push((0, _onlyOnce2.default)(next));task.apply(null, args);}function next(err /*, ...args*/) {if (err || taskIndex === tasks.length) {return callback.apply(null, arguments);}nextTask((0, _slice2.default)(arguments, 1));}nextTask([]);};var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];/*** Runs the `tasks` array of functions in series, each passing their results to* the next in the array. However, if any of the `tasks` pass an error to their* own callback, the next function is not executed, and the main `callback` is* immediately called with the error.** @name waterfall* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array} tasks - An array of [async functions]{@link AsyncFunction}* to run.* Each function should complete with any number of `result` values.* The `result` values will be passed as arguments, in order, to the next task.* @param {Function} [callback] - An optional callback to run once all the* functions have completed. This will be passed the results of the last task's* callback. Invoked with (err, [results]).* @returns undefined* @example** async.waterfall([* function(callback) {* callback(null, 'one', 'two');* },* function(arg1, arg2, callback) {* // arg1 now equals 'one' and arg2 now equals 'two'* callback(null, 'three');* },* function(arg1, callback) {* // arg1 now equals 'three'* callback(null, 'done');* }* ], function (err, result) {* // result now equals 'done'* });** // Or, with named functions:* async.waterfall([* myFirstFunction,* mySecondFunction,* myLastFunction,* ], function (err, result) {* // result now equals 'done'* });* function myFirstFunction(callback) {* callback(null, 'one', 'two');* }* function mySecondFunction(arg1, arg2, callback) {* // arg1 now equals 'one' and arg2 now equals 'two'* callback(null, 'three');* }* function myLastFunction(arg1, callback) {* // arg1 now equals 'three'* callback(null, 'done');* }*/
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = until;var _whilst = require('./whilst');var _whilst2 = _interopRequireDefault(_whilst);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when* stopped, or an error occurs. `callback` will be passed an error and any* arguments passed to the final `iteratee`'s callback.** The inverse of [whilst]{@link module:ControlFlow.whilst}.** @name until* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {Function} test - synchronous truth test to perform before each* execution of `iteratee`. Invoked with ().* @param {AsyncFunction} iteratee - An async function which is called each time* `test` fails. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has passed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);*/function until(test, iteratee, callback) {(0, _whilst2.default)(function () {return !test.apply(this, arguments);}, iteratee, callback);}module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = unmemoize;/*** Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,* unmemoized form. Handy for testing.** @name unmemoize* @static* @memberOf module:Utils* @method* @see [async.memoize]{@link module:Utils.memoize}* @category Util* @param {AsyncFunction} fn - the memoized function* @returns {AsyncFunction} a function that calls the original unmemoized function*/function unmemoize(fn) {return function () {return (fn.unmemoized || fn).apply(null, arguments);};}module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = tryEach;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _eachSeries = require('./eachSeries');var _eachSeries2 = _interopRequireDefault(_eachSeries);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** It runs each task in series but stops whenever any of the functions were* successful. If one of the tasks were successful, the `callback` will be* passed the result of the successful task. If all tasks fail, the callback* will be passed the error and result (if any) of the final attempt.** @name tryEach* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection containing functions to* run, each function is passed a `callback(err, result)` it must call on* completion with an error `err` (which can be `null`) and an optional `result`* value.* @param {Function} [callback] - An optional callback which is called when one* of the tasks has succeeded, or all have failed. It receives the `err` and* `result` arguments of the last attempt at completing the `task`. Invoked with* (err, results).* @example* async.tryEach([* function getDataFromFirstWebsite(callback) {* // Try getting the data from the first website* callback(err, data);* },* function getDataFromSecondWebsite(callback) {* // First website failed,* // Try getting the data from the backup website* callback(err, data);* }* ],* // optional callback* function(err, results) {* Now do something with the data.* });**/function tryEach(tasks, callback) {var error = null;var result;callback = callback || _noop2.default;(0, _eachSeries2.default)(tasks, function (task, callback) {(0, _wrapAsync2.default)(task)(function (err, res /*, ...args*/) {if (arguments.length > 2) {result = (0, _slice2.default)(arguments, 1);} else {result = res;}error = err;callback(!err);});}, function () {callback(error, result);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = transform;var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _eachOf = require('./eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** A relative of `reduce`. Takes an Object or Array, and iterates over each* element in series, each step potentially mutating an `accumulator` value.* The type of the accumulator defaults to the type of collection passed in.** @name transform* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} [accumulator] - The initial state of the transform. If omitted,* it will default to an empty Object or Array, depending on the type of `coll`* @param {AsyncFunction} iteratee - A function applied to each item in the* collection that potentially modifies the accumulator.* Invoked with (accumulator, item, key, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the transformed accumulator.* Invoked with (err, result).* @example** async.transform([1,2,3], function(acc, item, index, callback) {* // pointless async:* process.nextTick(function() {* acc.push(item * 2)* callback(null)* });* }, function(err, result) {* // result is now equal to [2, 4, 6]* });** @example** async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {* setImmediate(function () {* obj[key] = val * 2;* callback();* })* }, function (err, result) {* // result is equal to {a: 2, b: 4, c: 6}* })*/function transform(coll, accumulator, iteratee, callback) {if (arguments.length <= 3) {callback = iteratee;iteratee = accumulator;accumulator = (0, _isArray2.default)(coll) ? [] : {};}callback = (0, _once2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _eachOf2.default)(coll, function (v, k, cb) {_iteratee(accumulator, v, k, cb);}, function (err) {callback(err, accumulator);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _timesLimit = require('./timesLimit');var _timesLimit2 = _interopRequireDefault(_timesLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.** @name timesSeries* @static* @memberOf module:ControlFlow* @method* @see [async.times]{@link module:ControlFlow.times}* @category Control Flow* @param {number} n - The number of times to run the function.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see {@link module:Collections.map}.*/exports.default = (0, _doLimit2.default)(_timesLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = timeLimit;var _mapLimit = require('./mapLimit');var _mapLimit2 = _interopRequireDefault(_mapLimit);var _baseRange = require('lodash/_baseRange');var _baseRange2 = _interopRequireDefault(_baseRange);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a* time.** @name timesLimit* @static* @memberOf module:ControlFlow* @method* @see [async.times]{@link module:ControlFlow.times}* @category Control Flow* @param {number} count - The number of times to run the function.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see [async.map]{@link module:Collections.map}.*/function timeLimit(count, limit, iteratee, callback) {var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _mapLimit2.default)((0, _baseRange2.default)(0, count, 1), limit, _iteratee, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _timesLimit = require('./timesLimit');var _timesLimit2 = _interopRequireDefault(_timesLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Calls the `iteratee` function `n` times, and accumulates results in the same* manner you would use with [map]{@link module:Collections.map}.** @name times* @static* @memberOf module:ControlFlow* @method* @see [async.map]{@link module:Collections.map}* @category Control Flow* @param {number} n - The number of times to run the function.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see {@link module:Collections.map}.* @example** // Pretend this is some complicated async factory* var createUser = function(id, callback) {* callback(null, {* id: 'user' + id* });* };** // generate 5 users* async.times(5, function(n, next) {* createUser(n, function(err, user) {* next(err, user);* });* }, function(err, users) {* // we should now have 5 users* });*/exports.default = (0, _doLimit2.default)(_timesLimit2.default, Infinity);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = timeout;var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Sets a time limit on an asynchronous function. If the function does not call* its callback within the specified milliseconds, it will be called with a* timeout error. The code property for the error object will be `'ETIMEDOUT'`.** @name timeout* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} asyncFn - The async function to limit in time.* @param {number} milliseconds - The specified time limit.* @param {*} [info] - Any variable you want attached (`string`, `object`, etc)* to timeout Error for more information..* @returns {AsyncFunction} Returns a wrapped function that can be used with any* of the control flow functions.* Invoke this function with the same parameters as you would `asyncFunc`.* @example** function myFunction(foo, callback) {* doAsyncTask(foo, function(err, data) {* // handle errors* if (err) return callback(err);** // do some stuff ...** // return processed data* return callback(null, data);* });* }** var wrapped = async.timeout(myFunction, 1000);** // call `wrapped` as you would `myFunction`* wrapped({ bar: 'bar' }, function(err, data) {* // if `myFunction` takes < 1000 ms to execute, `err`* // and `data` will have their expected values** // else `err` will be an Error with the code 'ETIMEDOUT'* });*/function timeout(asyncFn, milliseconds, info) {var fn = (0, _wrapAsync2.default)(asyncFn);return (0, _initialParams2.default)(function (args, callback) {var timedOut = false;var timer;function timeoutCallback() {var name = asyncFn.name || 'anonymous';var error = new Error('Callback function "' + name + '" timed out.');error.code = 'ETIMEDOUT';if (info) {error.info = info;}timedOut = true;callback(error);}args.push(function () {if (!timedOut) {callback.apply(null, arguments);clearTimeout(timer);}});// setup timer and call original functiontimer = setTimeout(timeoutCallback, milliseconds);fn.apply(null, args);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = sortBy;var _arrayMap = require('lodash/_arrayMap');var _arrayMap2 = _interopRequireDefault(_arrayMap);var _baseProperty = require('lodash/_baseProperty');var _baseProperty2 = _interopRequireDefault(_baseProperty);var _map = require('./map');var _map2 = _interopRequireDefault(_map);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Sorts a list by the results of running each `coll` value through an async* `iteratee`.** @name sortBy* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a value to use as the sort criteria as* its `result`.* Invoked with (item, callback).* @param {Function} callback - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is the items* from the original `coll` sorted by the values returned by the `iteratee`* calls. Invoked with (err, results).* @example** async.sortBy(['file1','file2','file3'], function(file, callback) {* fs.stat(file, function(err, stats) {* callback(err, stats.mtime);* });* }, function(err, results) {* // results is now the original array of files sorted by* // modified date* });** // By modifying the callback parameter the* // sorting order can be influenced:** // ascending order* async.sortBy([1,9,3,5], function(x, callback) {* callback(null, x);* }, function(err,result) {* // result callback* });** // descending order* async.sortBy([1,9,3,5], function(x, callback) {* callback(null, x*-1); //<- x*-1 instead of x, turns the order around* }, function(err,result) {* // result callback* });*/function sortBy(coll, iteratee, callback) {var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _map2.default)(coll, function (x, callback) {_iteratee(x, function (err, criteria) {if (err) return callback(err);callback(null, { value: x, criteria: criteria });});}, function (err, results) {if (err) return callback(err);callback(null, (0, _arrayMap2.default)(results.sort(comparator), (0, _baseProperty2.default)('value')));});function comparator(left, right) {var a = left.criteria,b = right.criteria;return a < b ? -1 : a > b ? 1 : 0;}}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _someLimit = require('./someLimit');var _someLimit2 = _interopRequireDefault(_someLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.** @name someSeries* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anySeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in series.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.** @name someLimit* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anyLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns `true` if at least one element in the `coll` satisfies an async test.* If any iteratee call returns `true`, the main `callback` is immediately* called.** @name some* @static* @memberOf module:Collections* @method* @alias any* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).* @example** async.some(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then at least one of the files exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _setImmediate = require('./internal/setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Calls `callback` on a later loop around the event loop. In Node.js this just* calls `setImmediate`. In the browser it will use `setImmediate` if* available, otherwise `setTimeout(callback, 0)`, which means other higher* priority events may precede the execution of `callback`.** This is used internally for browser-compatibility purposes.** @name setImmediate* @static* @memberOf module:Utils* @method* @see [async.nextTick]{@link module:Utils.nextTick}* @category Util* @param {Function} callback - The function to call on a later loop around* the event loop. Invoked with (args...).* @param {...*} args... - any number of additional arguments to pass to the* callback on the next tick.* @example** var call_order = [];* async.nextTick(function() {* call_order.push('two');* // call_order now equals ['one','two']* });* call_order.push('one');** async.setImmediate(function (a, b, c) {* // a, b, and c equal 1, 2, and 3* }, 1, 2, 3);*/exports.default = _setImmediate2.default;module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = series;var _parallel = require('./internal/parallel');var _parallel2 = _interopRequireDefault(_parallel);var _eachOfSeries = require('./eachOfSeries');var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Run the functions in the `tasks` collection in series, each one running once* the previous function has completed. If any functions in the series pass an* error to its callback, no more functions are run, and `callback` is* immediately called with the value of the error. Otherwise, `callback`* receives an array of results when `tasks` have completed.** It is also possible to use an object instead of an array. Each property will* be run as a function, and the results will be passed to the final `callback`* as an object instead of an array. This can be a more readable way of handling* results from {@link async.series}.** **Note** that while many implementations preserve the order of object* properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)* explicitly states that** > The mechanics and order of enumerating the properties is not specified.** So if you rely on the order in which your series of functions are executed,* and want this to work on all platforms, consider using an array.** @name series* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection containing* [async functions]{@link AsyncFunction} to run in series.* Each function can complete with any number of optional `result` values.* @param {Function} [callback] - An optional callback to run once all the* functions have completed. This function gets a results array (or object)* containing all the result arguments passed to the `task` callbacks. Invoked* with (err, result).* @example* async.series([* function(callback) {* // do some stuff ...* callback(null, 'one');* },* function(callback) {* // do some more stuff ...* callback(null, 'two');* }* ],* // optional callback* function(err, results) {* // results is now equal to ['one', 'two']* });** async.series({* one: function(callback) {* setTimeout(function() {* callback(null, 1);* }, 200);* },* two: function(callback){* setTimeout(function() {* callback(null, 2);* }, 100);* }* }, function(err, results) {* // results is now equal to: {one: 1, two: 2}* });*/function series(tasks, callback) {(0, _parallel2.default)(_eachOfSeries2.default, tasks, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = seq;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _reduce = require('./reduce');var _reduce2 = _interopRequireDefault(_reduce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);var _arrayMap = require('lodash/_arrayMap');var _arrayMap2 = _interopRequireDefault(_arrayMap);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Version of the compose function that is more natural to read. Each function* consumes the return value of the previous function. It is the equivalent of* [compose]{@link module:ControlFlow.compose} with the arguments reversed.** Each function is executed with the `this` binding of the composed function.** @name seq* @static* @memberOf module:ControlFlow* @method* @see [async.compose]{@link module:ControlFlow.compose}* @category Control Flow* @param {...AsyncFunction} functions - the asynchronous functions to compose* @returns {Function} a function that composes the `functions` in order* @example** // Requires lodash (or underscore), express3 and dresende's orm2.* // Part of an app, that fetches cats of the logged user.* // This example uses `seq` function to avoid overnesting and error* // handling clutter.* app.get('/cats', function(request, response) {* var User = request.models.User;* async.seq(* _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))* function(user, fn) {* user.getCats(fn); // 'getCats' has signature (callback(err, data))* }* )(req.session.user_id, function (err, cats) {* if (err) {* console.error(err);* response.json({ status: 'error', message: err.message });* } else {* response.json({ status: 'ok', message: 'Cats found', data: cats });* }* });* });*/function seq() /*...functions*/{var _functions = (0, _arrayMap2.default)(arguments, _wrapAsync2.default);return function () /*...args*/{var args = (0, _slice2.default)(arguments);var that = this;var cb = args[args.length - 1];if (typeof cb == 'function') {args.pop();} else {cb = _noop2.default;}(0, _reduce2.default)(_functions, args, function (newargs, fn, cb) {fn.apply(that, newargs.concat(function (err /*, ...nextargs*/) {var nextargs = (0, _slice2.default)(arguments, 1);cb(err, nextargs);}));}, function (err, results) {cb.apply(that, [err].concat(results));});};}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filterLimit = require('./filterLimit');var _filterLimit2 = _interopRequireDefault(_filterLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.** @name filterSeries* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results)*/exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filter = require('./internal/filter');var _filter2 = _interopRequireDefault(_filter);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a* time.** @name filterLimit* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/exports.default = (0, _doParallelLimit2.default)(_filter2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filter = require('./internal/filter');var _filter2 = _interopRequireDefault(_filter);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns a new array of all the values in `coll` which pass an async truth* test. This operation is performed in parallel, but the results array will be* in the same order as the original.** @name filter* @static* @memberOf module:Collections* @method* @alias select* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).* @example** async.filter(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, results) {* // results now equals an array of the existing files* });*/exports.default = (0, _doParallel2.default)(_filter2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (opts, task) {if (!task) {task = opts;opts = null;}var _task = (0, _wrapAsync2.default)(task);return (0, _initialParams2.default)(function (args, callback) {function taskFn(cb) {_task.apply(null, args.concat(cb));}if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback);});};var _retry = require('./retry');var _retry2 = _interopRequireDefault(_retry);var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];/*** A close relative of [`retry`]{@link module:ControlFlow.retry}. This method* wraps a task and makes it retryable, rather than immediately calling it* with retries.** @name retryable* @static* @memberOf module:ControlFlow* @method* @see [async.retry]{@link module:ControlFlow.retry}* @category Control Flow* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional* options, exactly the same as from `retry`* @param {AsyncFunction} task - the asynchronous function to wrap.* This function will be passed any arguments passed to the returned wrapper.* Invoked with (...args, callback).* @returns {AsyncFunction} The wrapped function, which when invoked, will* retry on an error, based on the parameters specified in `opts`.* This function will accept the same parameters as `task`.* @example** async.auto({* dep1: async.retryable(3, getFromFlakyService),* process: ["dep1", async.retryable(3, function (results, cb) {* maybeProcessData(results.dep1, cb);* })]* }, callback);*/
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = retry;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _constant = require('lodash/constant');var _constant2 = _interopRequireDefault(_constant);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Attempts to get a successful response from `task` no more than `times` times* before returning an error. If the task is successful, the `callback` will be* passed the result of the successful task. If all attempts fail, the callback* will be passed the error and result (if any) of the final attempt.** @name retry* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @see [async.retryable]{@link module:ControlFlow.retryable}* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an* object with `times` and `interval` or a number.* * `times` - The number of attempts to make before giving up. The default* is `5`.* * `interval` - The time to wait between retries, in milliseconds. The* default is `0`. The interval may also be specified as a function of the* retry count (see example).* * `errorFilter` - An optional synchronous function that is invoked on* erroneous result. If it returns `true` the retry attempts will continue;* if the function returns `false` the retry flow is aborted with the current* attempt's error and result being returned to the final callback.* Invoked with (err).* * If `opts` is a number, the number specifies the number of times to retry,* with the default interval of `0`.* @param {AsyncFunction} task - An async function to retry.* Invoked with (callback).* @param {Function} [callback] - An optional callback which is called when the* task has succeeded, or after the final failed attempt. It receives the `err`* and `result` arguments of the last attempt at completing the `task`. Invoked* with (err, results).** @example** // The `retry` function can be used as a stand-alone control flow by passing* // a callback, as shown below:** // try calling apiMethod 3 times* async.retry(3, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod 3 times, waiting 200 ms between each retry* async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod 10 times with exponential backoff* // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)* async.retry({* times: 10,* interval: function(retryCount) {* return 50 * Math.pow(2, retryCount);* }* }, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod the default 5 times no delay between each retry* async.retry(apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod only when error condition satisfies, all other* // errors will abort the retry control flow and return to final callback* async.retry({* errorFilter: function(err) {* return err.message === 'Temporary error'; // only retry on a specific error* }* }, apiMethod, function(err, result) {* // do something with the result* });** // to retry individual methods that are not as reliable within other* // control flow functions, use the `retryable` wrapper:* async.auto({* users: api.getUsers.bind(api),* payments: async.retryable(3, api.getPayments.bind(api))* }, function(err, results) {* // do something with the results* });**/function retry(opts, task, callback) {var DEFAULT_TIMES = 5;var DEFAULT_INTERVAL = 0;var options = {times: DEFAULT_TIMES,intervalFunc: (0, _constant2.default)(DEFAULT_INTERVAL)};function parseTimes(acc, t) {if (typeof t === 'object') {acc.times = +t.times || DEFAULT_TIMES;acc.intervalFunc = typeof t.interval === 'function' ? t.interval : (0, _constant2.default)(+t.interval || DEFAULT_INTERVAL);acc.errorFilter = t.errorFilter;} else if (typeof t === 'number' || typeof t === 'string') {acc.times = +t || DEFAULT_TIMES;} else {throw new Error("Invalid arguments for async.retry");}}if (arguments.length < 3 && typeof opts === 'function') {callback = task || _noop2.default;task = opts;} else {parseTimes(options, opts);callback = callback || _noop2.default;}if (typeof task !== 'function') {throw new Error("Invalid arguments for async.retry");}var _task = (0, _wrapAsync2.default)(task);var attempt = 1;function retryAttempt() {_task(function (err) {if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) {setTimeout(retryAttempt, options.intervalFunc(attempt));} else {callback.apply(null, arguments);}});}retryAttempt();}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _rejectLimit = require('./rejectLimit');var _rejectLimit2 = _interopRequireDefault(_rejectLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.** @name rejectSeries* @static* @memberOf module:Collections* @method* @see [async.reject]{@link module:Collections.reject}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/exports.default = (0, _doLimit2.default)(_rejectLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _reject = require('./internal/reject');var _reject2 = _interopRequireDefault(_reject);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a* time.** @name rejectLimit* @static* @memberOf module:Collections* @method* @see [async.reject]{@link module:Collections.reject}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/exports.default = (0, _doParallelLimit2.default)(_reject2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _reject = require('./internal/reject');var _reject2 = _interopRequireDefault(_reject);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.** @name reject* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).* @example** async.reject(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, results) {* // results now equals an array of missing files* createFiles(results);* });*/exports.default = (0, _doParallel2.default)(_reject2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reflectAll;var _reflect = require('./reflect');var _reflect2 = _interopRequireDefault(_reflect);var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _arrayMap2 = require('lodash/_arrayMap');var _arrayMap3 = _interopRequireDefault(_arrayMap2);var _baseForOwn = require('lodash/_baseForOwn');var _baseForOwn2 = _interopRequireDefault(_baseForOwn);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** A helper function that wraps an array or an object of functions with `reflect`.** @name reflectAll* @static* @memberOf module:Utils* @method* @see [async.reflect]{@link module:Utils.reflect}* @category Util* @param {Array|Object|Iterable} tasks - The collection of* [async functions]{@link AsyncFunction} to wrap in `async.reflect`.* @returns {Array} Returns an array of async functions, each wrapped in* `async.reflect`* @example** let tasks = [* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* // do some more stuff but error ...* callback(new Error('bad stuff happened'));* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ];** async.parallel(async.reflectAll(tasks),* // optional callback* function(err, results) {* // values* // results[0].value = 'one'* // results[1].error = Error('bad stuff happened')* // results[2].value = 'two'* });** // an example using an object instead of an array* let tasks = {* one: function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* two: function(callback) {* callback('two');* },* three: function(callback) {* setTimeout(function() {* callback(null, 'three');* }, 100);* }* };** async.parallel(async.reflectAll(tasks),* // optional callback* function(err, results) {* // values* // results.one.value = 'one'* // results.two.error = 'two'* // results.three.value = 'three'* });*/function reflectAll(tasks) {var results;if ((0, _isArray2.default)(tasks)) {results = (0, _arrayMap3.default)(tasks, _reflect2.default);} else {results = {};(0, _baseForOwn2.default)(tasks, function (task, key) {results[key] = _reflect2.default.call(this, task);});}return results;}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reflect;var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Wraps the async function in another function that always completes with a* result object, even when it errors.** The result object has either the property `error` or `value`.** @name reflect* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - The async function you want to wrap* @returns {Function} - A function that always passes null to it's callback as* the error. The second argument to the callback will be an `object` with* either an `error` or a `value` property.* @example** async.parallel([* async.reflect(function(callback) {* // do some stuff ...* callback(null, 'one');* }),* async.reflect(function(callback) {* // do some more stuff but error ...* callback('bad stuff happened');* }),* async.reflect(function(callback) {* // do some more stuff ...* callback(null, 'two');* })* ],* // optional callback* function(err, results) {* // values* // results[0].value = 'one'* // results[1].error = 'bad stuff happened'* // results[2].value = 'two'* });*/function reflect(fn) {var _fn = (0, _wrapAsync2.default)(fn);return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) {args.push(function callback(error, cbArg) {if (error) {reflectCallback(null, { error: error });} else {var value;if (arguments.length <= 2) {value = cbArg;} else {value = (0, _slice2.default)(arguments, 1);}reflectCallback(null, { value: value });}});return _fn.apply(this, args);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reduceRight;var _reduce = require('./reduce');var _reduce2 = _interopRequireDefault(_reduce);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.** @name reduceRight* @static* @memberOf module:Collections* @method* @see [async.reduce]{@link module:Collections.reduce}* @alias foldr* @category Collection* @param {Array} array - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).*/function reduceRight(array, memo, iteratee, callback) {var reversed = (0, _slice2.default)(array).reverse();(0, _reduce2.default)(reversed, memo, iteratee, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reduce;var _eachOfSeries = require('./eachOfSeries');var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Reduces `coll` into a single value using an async `iteratee` to return each* successive step. `memo` is the initial state of the reduction. This function* only operates in series.** For performance reasons, it may make sense to split a call to this function* into a parallel map, and then use the normal `Array.prototype.reduce` on the* results. This function is for situations where each step in the reduction* needs to be async; if you can get the data before reducing it, then it's* probably a good idea to do so.** @name reduce* @static* @memberOf module:Collections* @method* @alias inject* @alias foldl* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).* @example** async.reduce([1,2,3], 0, function(memo, item, callback) {* // pointless async:* process.nextTick(function() {* callback(null, memo + item)* });* }, function(err, result) {* // result is now equal to the last value of memo, which is 6* });*/function reduce(coll, memo, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _eachOfSeries2.default)(coll, function (x, i, callback) {_iteratee(memo, x, function (err, v) {memo = v;callback(err);});}, function (err) {callback(err, memo);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = race;var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Runs the `tasks` array of functions in parallel, without waiting until the* previous function has completed. Once any of the `tasks` complete or pass an* error to its callback, the main `callback` is immediately called. It's* equivalent to `Promise.race()`.** @name race* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}* to run. Each function can complete with an optional `result` value.* @param {Function} callback - A callback to run once any of the functions have* completed. This function gets an error or result from the first function that* completed. Invoked with (err, result).* @returns undefined* @example** async.race([* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ],* // main callback* function(err, result) {* // the result will be equal to 'two' as it finishes earlier* });*/function race(tasks, callback) {callback = (0, _once2.default)(callback || _noop2.default);if (!(0, _isArray2.default)(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));if (!tasks.length) return callback();for (var i = 0, l = tasks.length; i < l; i++) {(0, _wrapAsync2.default)(tasks[i])(callback);}}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (worker, concurrency) {var _worker = (0, _wrapAsync2.default)(worker);return (0, _queue2.default)(function (items, cb) {_worker(items[0], cb);}, concurrency, 1);};var _queue = require('./internal/queue');var _queue2 = _interopRequireDefault(_queue);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];/*** A queue of tasks for the worker function to complete.* @typedef {Object} QueueObject* @memberOf module:ControlFlow* @property {Function} length - a function returning the number of items* waiting to be processed. Invoke with `queue.length()`.* @property {boolean} started - a boolean indicating whether or not any* items have been pushed and processed by the queue.* @property {Function} running - a function returning the number of items* currently being processed. Invoke with `queue.running()`.* @property {Function} workersList - a function returning the array of items* currently being processed. Invoke with `queue.workersList()`.* @property {Function} idle - a function returning false if there are items* waiting or being processed, or true if not. Invoke with `queue.idle()`.* @property {number} concurrency - an integer for determining how many `worker`* functions should be run in parallel. This property can be changed after a* `queue` is created to alter the concurrency on-the-fly.* @property {Function} push - add a new task to the `queue`. Calls `callback`* once the `worker` has finished processing the task. Instead of a single task,* a `tasks` array can be submitted. The respective callback is used for every* task in the list. Invoke with `queue.push(task, [callback])`,* @property {Function} unshift - add a new task to the front of the `queue`.* Invoke with `queue.unshift(task, [callback])`.* @property {Function} remove - remove items from the queue that match a test* function. The test function will be passed an object with a `data` property,* and a `priority` property, if this is a* [priorityQueue]{@link module:ControlFlow.priorityQueue} object.* Invoked with `queue.remove(testFn)`, where `testFn` is of the form* `function ({data, priority}) {}` and returns a Boolean.* @property {Function} saturated - a callback that is called when the number of* running workers hits the `concurrency` limit, and further tasks will be* queued.* @property {Function} unsaturated - a callback that is called when the number* of running workers is less than the `concurrency` & `buffer` limits, and* further tasks will not be queued.* @property {number} buffer - A minimum threshold buffer in order to say that* the `queue` is `unsaturated`.* @property {Function} empty - a callback that is called when the last item* from the `queue` is given to a `worker`.* @property {Function} drain - a callback that is called when the last item* from the `queue` has returned from the `worker`.* @property {Function} error - a callback that is called when a task errors.* Has the signature `function(error, task)`.* @property {boolean} paused - a boolean for determining whether the queue is* in a paused state.* @property {Function} pause - a function that pauses the processing of tasks* until `resume()` is called. Invoke with `queue.pause()`.* @property {Function} resume - a function that resumes the processing of* queued tasks when the queue is paused. Invoke with `queue.resume()`.* @property {Function} kill - a function that removes the `drain` callback and* empties remaining tasks from the queue forcing it to go idle. No more tasks* should be pushed to the queue after calling this function. Invoke with `queue.kill()`.*//*** Creates a `queue` object with the specified `concurrency`. Tasks added to the* `queue` are processed in parallel (up to the `concurrency` limit). If all* `worker`s are in progress, the task is queued until one becomes available.* Once a `worker` completes a `task`, that `task`'s callback is called.** @name queue* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {AsyncFunction} worker - An async function for processing a queued task.* If you want to handle errors from an individual task, pass a callback to* `q.push()`. Invoked with (task, callback).* @param {number} [concurrency=1] - An `integer` for determining how many* `worker` functions should be run in parallel. If omitted, the concurrency* defaults to `1`. If the concurrency is `0`, an error is thrown.* @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can* attached as certain properties to listen for specific events during the* lifecycle of the queue.* @example** // create a queue object with concurrency 2* var q = async.queue(function(task, callback) {* console.log('hello ' + task.name);* callback();* }, 2);** // assign a callback* q.drain = function() {* console.log('all items have been processed');* };** // add some items to the queue* q.push({name: 'foo'}, function(err) {* console.log('finished processing foo');* });* q.push({name: 'bar'}, function (err) {* console.log('finished processing bar');* });** // add some items to the queue (batch-wise)* q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {* console.log('finished processing item');* });** // add some items to the front of the queue* q.unshift({name: 'bar'}, function (err) {* console.log('finished processing bar');* });*/
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (worker, concurrency) {// Start with a normal queuevar q = (0, _queue2.default)(worker, concurrency);// Override push to accept second parameter representing priorityq.push = function (data, priority, callback) {if (callback == null) callback = _noop2.default;if (typeof callback !== 'function') {throw new Error('task callback must be a function');}q.started = true;if (!(0, _isArray2.default)(data)) {data = [data];}if (data.length === 0) {// call drain immediately if there are no tasksreturn (0, _setImmediate2.default)(function () {q.drain();});}priority = priority || 0;var nextNode = q._tasks.head;while (nextNode && priority >= nextNode.priority) {nextNode = nextNode.next;}for (var i = 0, l = data.length; i < l; i++) {var item = {data: data[i],priority: priority,callback: callback};if (nextNode) {q._tasks.insertBefore(nextNode, item);} else {q._tasks.push(item);}}(0, _setImmediate2.default)(q.process);};// Remove unshift functiondelete q.unshift;return q;};var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _setImmediate = require('./setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);var _queue = require('./queue');var _queue2 = _interopRequireDefault(_queue);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];/*** The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and* completed in ascending priority order.** @name priorityQueue* @static* @memberOf module:ControlFlow* @method* @see [async.queue]{@link module:ControlFlow.queue}* @category Control Flow* @param {AsyncFunction} worker - An async function for processing a queued task.* If you want to handle errors from an individual task, pass a callback to* `q.push()`.* Invoked with (task, callback).* @param {number} concurrency - An `integer` for determining how many `worker`* functions should be run in parallel. If omitted, the concurrency defaults to* `1`. If the concurrency is `0`, an error is thrown.* @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two* differences between `queue` and `priorityQueue` objects:* * `push(task, priority, [callback])` - `priority` should be a number. If an* array of `tasks` is given, all tasks will be assigned the same priority.* * The `unshift` method was removed.*/
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = parallelLimit;var _eachOfLimit = require('./internal/eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _parallel = require('./internal/parallel');var _parallel2 = _interopRequireDefault(_parallel);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a* time.** @name parallelLimit* @static* @memberOf module:ControlFlow* @method* @see [async.parallel]{@link module:ControlFlow.parallel}* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection of* [async functions]{@link AsyncFunction} to run.* Each async function can complete with any number of optional `result` values.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} [callback] - An optional callback to run once all the* functions have completed successfully. This function gets a results array* (or object) containing all the result arguments passed to the task callbacks.* Invoked with (err, results).*/function parallelLimit(tasks, limit, callback) {(0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = parallelLimit;var _eachOf = require('./eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _parallel = require('./internal/parallel');var _parallel2 = _interopRequireDefault(_parallel);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Run the `tasks` collection of functions in parallel, without waiting until* the previous function has completed. If any of the functions pass an error to* its callback, the main `callback` is immediately called with the value of the* error. Once the `tasks` have completed, the results are passed to the final* `callback` as an array.** **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about* parallel execution of code. If your tasks do not use any timers or perform* any I/O, they will actually be executed in series. Any synchronous setup* sections for each task will happen one after the other. JavaScript remains* single-threaded.** **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the* execution of other tasks when a task fails.** It is also possible to use an object instead of an array. Each property will* be run as a function and the results will be passed to the final `callback`* as an object instead of an array. This can be a more readable way of handling* results from {@link async.parallel}.** @name parallel* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection of* [async functions]{@link AsyncFunction} to run.* Each async function can complete with any number of optional `result` values.* @param {Function} [callback] - An optional callback to run once all the* functions have completed successfully. This function gets a results array* (or object) containing all the result arguments passed to the task callbacks.* Invoked with (err, results).** @example* async.parallel([* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ],* // optional callback* function(err, results) {* // the results array will equal ['one','two'] even though* // the second function had a shorter timeout.* });** // an example using an object instead of an array* async.parallel({* one: function(callback) {* setTimeout(function() {* callback(null, 1);* }, 200);* },* two: function(callback) {* setTimeout(function() {* callback(null, 2);* }, 100);* }* }, function(err, results) {* // results is now equals to: {one: 1, two: 2}* });*/function parallelLimit(tasks, callback) {(0, _parallel2.default)(_eachOf2.default, tasks, callback);}module.exports = exports['default'];
{"_from": "async@^2.6.2","_id": "async@2.6.3","_inBundle": false,"_integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","_location": "/async","_phantomChildren": {},"_requested": {"type": "range","registry": true,"raw": "async@^2.6.2","name": "async","escapedName": "async","rawSpec": "^2.6.2","saveSpec": null,"fetchSpec": "^2.6.2"},"_requiredBy": ["/portfinder"],"_resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz","_shasum": "d72625e2344a3656e3a3ad4fa749fa83299d82ff","_spec": "async@^2.6.2","_where": "/home/a/documents/pijul/nicoty/bitburner_scripts/node_modules/portfinder","author": {"name": "Caolan McMahon"},"bugs": {"url": "https://github.com/caolan/async/issues"},"bundleDependencies": false,"dependencies": {"lodash": "^4.17.14"},"deprecated": false,"description": "Higher-order functions and common patterns for asynchronous code","devDependencies": {"babel-cli": "^6.24.0","babel-core": "^6.26.3","babel-plugin-add-module-exports": "^0.2.1","babel-plugin-istanbul": "^2.0.1","babel-plugin-transform-es2015-modules-commonjs": "^6.26.2","babel-preset-es2015": "^6.3.13","babel-preset-es2017": "^6.22.0","babelify": "^8.0.0","benchmark": "^2.1.1","bluebird": "^3.4.6","browserify": "^16.2.2","chai": "^4.1.2","cheerio": "^0.22.0","coveralls": "^3.0.1","es6-promise": "^2.3.0","eslint": "^2.13.1","fs-extra": "^0.26.7","gh-pages-deploy": "^0.5.0","jsdoc": "^3.4.0","karma": "^2.0.2","karma-browserify": "^5.2.0","karma-firefox-launcher": "^1.1.0","karma-mocha": "^1.2.0","karma-mocha-reporter": "^2.2.0","mocha": "^5.2.0","native-promise-only": "^0.8.0-a","nyc": "^11.8.0","rimraf": "^2.5.0","rollup": "^0.36.3","rollup-plugin-node-resolve": "^2.0.0","rollup-plugin-npm": "^2.0.0","rsvp": "^3.0.18","semver": "^5.5.0","uglify-js": "~2.7.3","yargs": "^11.0.0"},"gh-pages-deploy": {"staticpath": "docs"},"homepage": "https://caolan.github.io/async/","keywords": ["async","callback","module","utility"],"license": "MIT","main": "dist/async.js","name": "async","nyc": {"exclude": ["mocha_test"]},"repository": {"type": "git","url": "git+https://github.com/caolan/async.git"},"scripts": {"coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert","coveralls": "npm run coverage && nyc report --reporter=text-lcov | coveralls","jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js","lint": "eslint lib/ mocha_test/ perf/memory.js perf/suites.js perf/benchmark.js support/build/ support/*.js karma.conf.js","mocha-browser-test": "karma start","mocha-node-test": "mocha mocha_test/ --compilers js:babel-core/register","mocha-test": "npm run mocha-node-test && npm run mocha-browser-test","test": "npm run lint && npm run mocha-node-test"},"version": "2.6.3"}
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _setImmediate = require('./internal/setImmediate');/*** Calls `callback` on a later loop around the event loop. In Node.js this just* calls `process.nextTick`. In the browser it will use `setImmediate` if* available, otherwise `setTimeout(callback, 0)`, which means other higher* priority events may precede the execution of `callback`.** This is used internally for browser-compatibility purposes.** @name nextTick* @static* @memberOf module:Utils* @method* @see [async.setImmediate]{@link module:Utils.setImmediate}* @category Util* @param {Function} callback - The function to call on a later loop around* the event loop. Invoked with (args...).* @param {...*} args... - any number of additional arguments to pass to the* callback on the next tick.* @example** var call_order = [];* async.nextTick(function() {* call_order.push('two');* // call_order now equals ['one','two']* });* call_order.push('one');** async.setImmediate(function (a, b, c) {* // a, b, and c equal 1, 2, and 3* }, 1, 2, 3);*/var _defer;if (_setImmediate.hasNextTick) {_defer = process.nextTick;} else if (_setImmediate.hasSetImmediate) {_defer = setImmediate;} else {_defer = _setImmediate.fallback;}exports.default = (0, _setImmediate.wrap)(_defer);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = memoize;var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _setImmediate = require('./internal/setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function has(obj, key) {return key in obj;}/*** Caches the results of an async function. When creating a hash to store* function results against, the callback is omitted from the hash and an* optional hash function can be used.** If no hash function is specified, the first argument is used as a hash key,* which may work reasonably if it is a string or a data type that converts to a* distinct string. Note that objects and arrays will not behave reasonably.* Neither will cases where the other arguments are significant. In such cases,* specify your own hash function.** The cache of results is exposed as the `memo` property of the function* returned by `memoize`.** @name memoize* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - The async function to proxy and cache results from.* @param {Function} hasher - An optional function for generating a custom hash* for storing results. It has all the arguments applied to it apart from the* callback, and must be synchronous.* @returns {AsyncFunction} a memoized version of `fn`* @example** var slow_fn = function(name, callback) {* // do something* callback(null, result);* };* var fn = async.memoize(slow_fn);** // fn can now be used as if it were slow_fn* fn('some name', function() {* // callback* });*/function memoize(fn, hasher) {var memo = Object.create(null);var queues = Object.create(null);hasher = hasher || _identity2.default;var _fn = (0, _wrapAsync2.default)(fn);var memoized = (0, _initialParams2.default)(function memoized(args, callback) {var key = hasher.apply(null, args);if (has(memo, key)) {(0, _setImmediate2.default)(function () {callback.apply(null, memo[key]);});} else if (has(queues, key)) {queues[key].push(callback);} else {queues[key] = [callback];_fn.apply(null, args.concat(function () /*args*/{var args = (0, _slice2.default)(arguments);memo[key] = args;var q = queues[key];delete queues[key];for (var i = 0, l = q.length; i < l; i++) {q[i].apply(null, args);}}));}});memoized.memo = memo;memoized.unmemoized = fn;return memoized;}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _mapValuesLimit = require('./mapValuesLimit');var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.** @name mapValuesSeries* @static* @memberOf module:Collections* @method* @see [async.mapValues]{@link module:Collections.mapValues}* @category Collection* @param {Object} obj - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).*/exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = mapValuesLimit;var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a* time.** @name mapValuesLimit* @static* @memberOf module:Collections* @method* @see [async.mapValues]{@link module:Collections.mapValues}* @category Collection* @param {Object} obj - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).*/function mapValuesLimit(obj, limit, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var newObj = {};var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _eachOfLimit2.default)(obj, limit, function (val, key, next) {_iteratee(val, key, function (err, result) {if (err) return next(err);newObj[key] = result;next();});}, function (err) {callback(err, newObj);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _mapValuesLimit = require('./mapValuesLimit');var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** A relative of [`map`]{@link module:Collections.map}, designed for use with objects.** Produces a new Object by mapping each value of `obj` through the `iteratee`* function. The `iteratee` is called each `value` and `key` from `obj` and a* callback for when it has finished processing. Each of these callbacks takes* two arguments: an `error`, and the transformed item from `obj`. If `iteratee`* passes an error to its callback, the main `callback` (for the `mapValues`* function) is immediately called with the error.** Note, the order of the keys in the result is not guaranteed. The keys will* be roughly in the order they complete, (but this is very engine-specific)** @name mapValues* @static* @memberOf module:Collections* @method* @category Collection* @param {Object} obj - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).* @example** async.mapValues({* f1: 'file1',* f2: 'file2',* f3: 'file3'* }, function (file, key, callback) {* fs.stat(file, callback);* }, function(err, result) {* // result is now a map of stats for each file, e.g.* // {* // f1: [stats for file1],* // f2: [stats for file2],* // f3: [stats for file3]* // }* });*/exports.default = (0, _doLimit2.default)(_mapValuesLimit2.default, Infinity);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _mapLimit = require('./mapLimit');var _mapLimit2 = _interopRequireDefault(_mapLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.** @name mapSeries* @static* @memberOf module:Collections* @method* @see [async.map]{@link module:Collections.map}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an array of the* transformed items from the `coll`. Invoked with (err, results).*/exports.default = (0, _doLimit2.default)(_mapLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _map = require('./internal/map');var _map2 = _interopRequireDefault(_map);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.** @name mapLimit* @static* @memberOf module:Collections* @method* @see [async.map]{@link module:Collections.map}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an array of the* transformed items from the `coll`. Invoked with (err, results).*/exports.default = (0, _doParallelLimit2.default)(_map2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _map = require('./internal/map');var _map2 = _interopRequireDefault(_map);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Produces a new collection of values by mapping each value in `coll` through* the `iteratee` function. The `iteratee` is called with an item from `coll`* and a callback for when it has finished processing. Each of these callback* takes 2 arguments: an `error`, and the transformed item from `coll`. If* `iteratee` passes an error to its callback, the main `callback` (for the* `map` function) is immediately called with the error.** Note, that since this function applies the `iteratee` to each item in* parallel, there is no guarantee that the `iteratee` functions will complete* in order. However, the results array will be in the same order as the* original `coll`.** If `map` is passed an Object, the results will be an Array. The results* will roughly be in the order of the original Objects' keys (but this can* vary across JavaScript engines).** @name map* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an Array of the* transformed items from the `coll`. Invoked with (err, results).* @example** async.map(['file1','file2','file3'], fs.stat, function(err, results) {* // results is now an array of stats for each file* });*/exports.default = (0, _doParallel2.default)(_map2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _consoleFunc = require('./internal/consoleFunc');var _consoleFunc2 = _interopRequireDefault(_consoleFunc);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Logs the result of an `async` function to the `console`. Only works in* Node.js or in browsers that support `console.log` and `console.error` (such* as FF and Chrome). If multiple arguments are returned from the async* function, `console.log` is called on each argument in order.** @name log* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} function - The function you want to eventually apply* all arguments to.* @param {...*} arguments... - Any number of arguments to apply to the function.* @example** // in a module* var hello = function(name, callback) {* setTimeout(function() {* callback(null, 'hello ' + name);* }, 1000);* };** // in the node repl* node> async.log(hello, 'world');* 'hello world'*/exports.default = (0, _consoleFunc2.default)('log');module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.isAsync = undefined;var _asyncify = require('../asyncify');var _asyncify2 = _interopRequireDefault(_asyncify);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var supportsSymbol = typeof Symbol === 'function';function isAsync(fn) {return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';}function wrapAsync(asyncFn) {return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;}exports.default = wrapAsync;exports.isAsync = isAsync;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = _withoutIndex;function _withoutIndex(iteratee) {return function (value, index, callback) {return iteratee(value, callback);};}module.exports = exports["default"];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = slice;function slice(arrayLike, start) {start = start | 0;var newLen = Math.max(arrayLike.length - start, 0);var newArr = Array(newLen);for (var idx = 0; idx < newLen; idx++) {newArr[idx] = arrayLike[start + idx];}return newArr;}module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.hasNextTick = exports.hasSetImmediate = undefined;exports.fallback = fallback;exports.wrap = wrap;var _slice = require('./slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate;var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';function fallback(fn) {setTimeout(fn, 0);}function wrap(defer) {return function (fn /*, ...args*/) {var args = (0, _slice2.default)(arguments, 1);defer(function () {fn.apply(null, args);});};}var _defer;if (hasSetImmediate) {_defer = setImmediate;} else if (hasNextTick) {_defer = process.nextTick;} else {_defer = fallback;}exports.default = wrap(_defer);
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reject;var _filter = require('./filter');var _filter2 = _interopRequireDefault(_filter);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function reject(eachfn, arr, iteratee, callback) {(0, _filter2.default)(eachfn, arr, function (value, cb) {iteratee(value, function (err, v) {cb(err, !v);});}, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = queue;var _baseIndexOf = require('lodash/_baseIndexOf');var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _onlyOnce = require('./onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _setImmediate = require('./setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);var _DoublyLinkedList = require('./DoublyLinkedList');var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function queue(worker, concurrency, payload) {if (concurrency == null) {concurrency = 1;} else if (concurrency === 0) {throw new Error('Concurrency must not be zero');}var _worker = (0, _wrapAsync2.default)(worker);var numRunning = 0;var workersList = [];var processingScheduled = false;function _insert(data, insertAtFront, callback) {if (callback != null && typeof callback !== 'function') {throw new Error('task callback must be a function');}q.started = true;if (!(0, _isArray2.default)(data)) {data = [data];}if (data.length === 0 && q.idle()) {// call drain immediately if there are no tasksreturn (0, _setImmediate2.default)(function () {q.drain();});}for (var i = 0, l = data.length; i < l; i++) {var item = {data: data[i],callback: callback || _noop2.default};if (insertAtFront) {q._tasks.unshift(item);} else {q._tasks.push(item);}}if (!processingScheduled) {processingScheduled = true;(0, _setImmediate2.default)(function () {processingScheduled = false;q.process();});}}function _next(tasks) {return function (err) {numRunning -= 1;for (var i = 0, l = tasks.length; i < l; i++) {var task = tasks[i];var index = (0, _baseIndexOf2.default)(workersList, task, 0);if (index === 0) {workersList.shift();} else if (index > 0) {workersList.splice(index, 1);}task.callback.apply(task, arguments);if (err != null) {q.error(err, task.data);}}if (numRunning <= q.concurrency - q.buffer) {q.unsaturated();}if (q.idle()) {q.drain();}q.process();};}var isProcessing = false;var q = {_tasks: new _DoublyLinkedList2.default(),concurrency: concurrency,payload: payload,saturated: _noop2.default,unsaturated: _noop2.default,buffer: concurrency / 4,empty: _noop2.default,drain: _noop2.default,error: _noop2.default,started: false,paused: false,push: function (data, callback) {_insert(data, false, callback);},kill: function () {q.drain = _noop2.default;q._tasks.empty();},unshift: function (data, callback) {_insert(data, true, callback);},remove: function (testFn) {q._tasks.remove(testFn);},process: function () {// Avoid trying to start too many processing operations. This can occur// when callbacks resolve synchronously (#1267).if (isProcessing) {return;}isProcessing = true;while (!q.paused && numRunning < q.concurrency && q._tasks.length) {var tasks = [],data = [];var l = q._tasks.length;if (q.payload) l = Math.min(l, q.payload);for (var i = 0; i < l; i++) {var node = q._tasks.shift();tasks.push(node);workersList.push(node);data.push(node.data);}numRunning += 1;if (q._tasks.length === 0) {q.empty();}if (numRunning === q.concurrency) {q.saturated();}var cb = (0, _onlyOnce2.default)(_next(tasks));_worker(data, cb);}isProcessing = false;},length: function () {return q._tasks.length;},running: function () {return numRunning;},workersList: function () {return workersList;},idle: function () {return q._tasks.length + numRunning === 0;},pause: function () {q.paused = true;},resume: function () {if (q.paused === false) {return;}q.paused = false;(0, _setImmediate2.default)(q.process);}};return q;}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = _parallel;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _isArrayLike = require('lodash/isArrayLike');var _isArrayLike2 = _interopRequireDefault(_isArrayLike);var _slice = require('./slice');var _slice2 = _interopRequireDefault(_slice);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function _parallel(eachfn, tasks, callback) {callback = callback || _noop2.default;var results = (0, _isArrayLike2.default)(tasks) ? [] : {};eachfn(tasks, function (task, key, callback) {(0, _wrapAsync2.default)(task)(function (err, result) {if (arguments.length > 2) {result = (0, _slice2.default)(arguments, 1);}results[key] = result;callback(err);});}, function (err) {callback(err, results);});}module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = onlyOnce;function onlyOnce(fn) {return function () {if (fn === null) throw new Error("Callback was already called.");var callFn = fn;fn = null;callFn.apply(this, arguments);};}module.exports = exports["default"];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = once;function once(fn) {return function () {if (fn === null) return;var callFn = fn;fn = null;callFn.apply(this, arguments);};}module.exports = exports["default"];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = notId;function notId(v) {return !v;}module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = _asyncMap;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function _asyncMap(eachfn, arr, iteratee, callback) {callback = callback || _noop2.default;arr = arr || [];var results = [];var counter = 0;var _iteratee = (0, _wrapAsync2.default)(iteratee);eachfn(arr, function (value, _, callback) {var index = counter++;_iteratee(value, function (err, v) {results[index] = v;callback(err);});}, function (err) {callback(err, results);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = iterator;var _isArrayLike = require('lodash/isArrayLike');var _isArrayLike2 = _interopRequireDefault(_isArrayLike);var _getIterator = require('./getIterator');var _getIterator2 = _interopRequireDefault(_getIterator);var _keys = require('lodash/keys');var _keys2 = _interopRequireDefault(_keys);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function createArrayIterator(coll) {var i = -1;var len = coll.length;return function next() {return ++i < len ? { value: coll[i], key: i } : null;};}function createES2015Iterator(iterator) {var i = -1;return function next() {var item = iterator.next();if (item.done) return null;i++;return { value: item.value, key: i };};}function createObjectIterator(obj) {var okeys = (0, _keys2.default)(obj);var i = -1;var len = okeys.length;return function next() {var key = okeys[++i];return i < len ? { value: obj[key], key: key } : null;};}function iterator(coll) {if ((0, _isArrayLike2.default)(coll)) {return createArrayIterator(coll);}var iterator = (0, _getIterator2.default)(coll);return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (fn) {return function () /*...args, callback*/{var args = (0, _slice2.default)(arguments);var callback = args.pop();fn.call(this, args, callback);};};var _slice = require('./slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (coll) {return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();};var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = _findGetResult;function _findGetResult(v, x) {return x;}module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = _filter;var _arrayMap = require('lodash/_arrayMap');var _arrayMap2 = _interopRequireDefault(_arrayMap);var _isArrayLike = require('lodash/isArrayLike');var _isArrayLike2 = _interopRequireDefault(_isArrayLike);var _baseProperty = require('lodash/_baseProperty');var _baseProperty2 = _interopRequireDefault(_baseProperty);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function filterArray(eachfn, arr, iteratee, callback) {var truthValues = new Array(arr.length);eachfn(arr, function (x, index, callback) {iteratee(x, function (err, v) {truthValues[index] = !!v;callback(err);});}, function (err) {if (err) return callback(err);var results = [];for (var i = 0; i < arr.length; i++) {if (truthValues[i]) results.push(arr[i]);}callback(null, results);});}function filterGeneric(eachfn, coll, iteratee, callback) {var results = [];eachfn(coll, function (x, index, callback) {iteratee(x, function (err, v) {if (err) {callback(err);} else {if (v) {results.push({ index: index, value: x });}callback();}});}, function (err) {if (err) {callback(err);} else {callback(null, (0, _arrayMap2.default)(results.sort(function (a, b) {return a.index - b.index;}), (0, _baseProperty2.default)('value')));}});}function _filter(eachfn, coll, iteratee, callback) {var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric;filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback || _noop2.default);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = _eachOfLimit;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./once');var _once2 = _interopRequireDefault(_once);var _iterator = require('./iterator');var _iterator2 = _interopRequireDefault(_iterator);var _onlyOnce = require('./onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _breakLoop = require('./breakLoop');var _breakLoop2 = _interopRequireDefault(_breakLoop);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function _eachOfLimit(limit) {return function (obj, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);if (limit <= 0 || !obj) {return callback(null);}var nextElem = (0, _iterator2.default)(obj);var done = false;var running = 0;var looping = false;function iterateeCallback(err, value) {running -= 1;if (err) {done = true;callback(err);} else if (value === _breakLoop2.default || done && running <= 0) {done = true;return callback(null);} else if (!looping) {replenish();}}function replenish() {looping = true;while (running < limit && !done) {var elem = nextElem();if (elem === null) {done = true;if (running <= 0) {callback(null);}return;}running += 1;iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));}looping = false;}replenish();};}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = doParallelLimit;var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function doParallelLimit(fn) {return function (obj, limit, iteratee, callback) {return fn((0, _eachOfLimit2.default)(limit), obj, (0, _wrapAsync2.default)(iteratee), callback);};}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = doParallel;var _eachOf = require('../eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function doParallel(fn) {return function (obj, iteratee, callback) {return fn(_eachOf2.default, obj, (0, _wrapAsync2.default)(iteratee), callback);};}module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = doLimit;function doLimit(fn, limit) {return function (iterable, iteratee, callback) {return fn(iterable, limit, iteratee, callback);};}module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = _createTester;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _breakLoop = require('./breakLoop');var _breakLoop2 = _interopRequireDefault(_breakLoop);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function _createTester(check, getResult) {return function (eachfn, arr, iteratee, cb) {cb = cb || _noop2.default;var testPassed = false;var testResult;eachfn(arr, function (value, _, callback) {iteratee(value, function (err, result) {if (err) {callback(err);} else if (check(result) && !testResult) {testPassed = true;testResult = getResult(true, value);callback(null, _breakLoop2.default);} else {callback();}});}, function (err) {if (err) {cb(err);} else {cb(null, testPassed ? testResult : getResult(false));}});};}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = consoleFunc;var _arrayEach = require('lodash/_arrayEach');var _arrayEach2 = _interopRequireDefault(_arrayEach);var _slice = require('./slice');var _slice2 = _interopRequireDefault(_slice);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function consoleFunc(name) {return function (fn /*, ...args*/) {var args = (0, _slice2.default)(arguments, 1);args.push(function (err /*, ...args*/) {var args = (0, _slice2.default)(arguments, 1);if (typeof console === 'object') {if (err) {if (console.error) {console.error(err);}} else if (console[name]) {(0, _arrayEach2.default)(args, function (x) {console[name](x);});}}});(0, _wrapAsync2.default)(fn).apply(null, args);};}module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// A temporary value used to identify if the loop should be broken.// See #1064, #1293exports.default = {};module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = applyEach;var _slice = require('./slice');var _slice2 = _interopRequireDefault(_slice);var _initialParams = require('./initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _wrapAsync = require('./wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }function applyEach(eachfn) {return function (fns /*, ...args*/) {var args = (0, _slice2.default)(arguments, 1);var go = (0, _initialParams2.default)(function (args, callback) {var that = this;return eachfn(fns, function (fn, cb) {(0, _wrapAsync2.default)(fn).apply(that, args.concat(cb));}, callback);});if (args.length) {return go.apply(this, args);} else {return go;}};}module.exports = exports['default'];
"use strict";Object.defineProperty(exports, "__esModule", {value: true});exports.default = DLL;// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation// used for queues. This implementation assumes that the node provided by the user can be modified// to adjust the next and last properties. We implement only the minimal functionality// for queue support.function DLL() {this.head = this.tail = null;this.length = 0;}function setInitial(dll, node) {dll.length = 1;dll.head = dll.tail = node;}DLL.prototype.removeLink = function (node) {if (node.prev) node.prev.next = node.next;else this.head = node.next;if (node.next) node.next.prev = node.prev;else this.tail = node.prev;node.prev = node.next = null;this.length -= 1;return node;};DLL.prototype.empty = function () {while (this.head) this.shift();return this;};DLL.prototype.insertAfter = function (node, newNode) {newNode.prev = node;newNode.next = node.next;if (node.next) node.next.prev = newNode;else this.tail = newNode;node.next = newNode;this.length += 1;};DLL.prototype.insertBefore = function (node, newNode) {newNode.prev = node.prev;newNode.next = node;if (node.prev) node.prev.next = newNode;else this.head = newNode;node.prev = newNode;this.length += 1;};DLL.prototype.unshift = function (node) {if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);};DLL.prototype.push = function (node) {if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);};DLL.prototype.shift = function () {return this.head && this.removeLink(this.head);};DLL.prototype.pop = function () {return this.tail && this.removeLink(this.tail);};DLL.prototype.toArray = function () {var arr = Array(this.length);var curr = this.head;for (var idx = 0; idx < this.length; idx++) {arr[idx] = curr.data;curr = curr.next;}return arr;};DLL.prototype.remove = function (testFn) {var curr = this.head;while (!!curr) {var next = curr.next;if (testFn(curr)) {this.removeLink(curr);}curr = next;}return this;};module.exports = exports["default"];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reduce;var _eachOfSeries = require('./eachOfSeries');var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Reduces `coll` into a single value using an async `iteratee` to return each* successive step. `memo` is the initial state of the reduction. This function* only operates in series.** For performance reasons, it may make sense to split a call to this function* into a parallel map, and then use the normal `Array.prototype.reduce` on the* results. This function is for situations where each step in the reduction* needs to be async; if you can get the data before reducing it, then it's* probably a good idea to do so.** @name reduce* @static* @memberOf module:Collections* @method* @alias inject* @alias foldl* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).* @example** async.reduce([1,2,3], 0, function(memo, item, callback) {* // pointless async:* process.nextTick(function() {* callback(null, memo + item)* });* }, function(err, result) {* // result is now equal to the last value of memo, which is 6* });*/function reduce(coll, memo, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _eachOfSeries2.default)(coll, function (x, i, callback) {_iteratee(memo, x, function (err, v) {memo = v;callback(err);});}, function (err) {callback(err, memo);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined;var _apply = require('./apply');var _apply2 = _interopRequireDefault(_apply);var _applyEach = require('./applyEach');var _applyEach2 = _interopRequireDefault(_applyEach);var _applyEachSeries = require('./applyEachSeries');var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries);var _asyncify = require('./asyncify');var _asyncify2 = _interopRequireDefault(_asyncify);var _auto = require('./auto');var _auto2 = _interopRequireDefault(_auto);var _autoInject = require('./autoInject');var _autoInject2 = _interopRequireDefault(_autoInject);var _cargo = require('./cargo');var _cargo2 = _interopRequireDefault(_cargo);var _compose = require('./compose');var _compose2 = _interopRequireDefault(_compose);var _concat = require('./concat');var _concat2 = _interopRequireDefault(_concat);var _concatLimit = require('./concatLimit');var _concatLimit2 = _interopRequireDefault(_concatLimit);var _concatSeries = require('./concatSeries');var _concatSeries2 = _interopRequireDefault(_concatSeries);var _constant = require('./constant');var _constant2 = _interopRequireDefault(_constant);var _detect = require('./detect');var _detect2 = _interopRequireDefault(_detect);var _detectLimit = require('./detectLimit');var _detectLimit2 = _interopRequireDefault(_detectLimit);var _detectSeries = require('./detectSeries');var _detectSeries2 = _interopRequireDefault(_detectSeries);var _dir = require('./dir');var _dir2 = _interopRequireDefault(_dir);var _doDuring = require('./doDuring');var _doDuring2 = _interopRequireDefault(_doDuring);var _doUntil = require('./doUntil');var _doUntil2 = _interopRequireDefault(_doUntil);var _doWhilst = require('./doWhilst');var _doWhilst2 = _interopRequireDefault(_doWhilst);var _during = require('./during');var _during2 = _interopRequireDefault(_during);var _each = require('./each');var _each2 = _interopRequireDefault(_each);var _eachLimit = require('./eachLimit');var _eachLimit2 = _interopRequireDefault(_eachLimit);var _eachOf = require('./eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _eachOfSeries = require('./eachOfSeries');var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);var _eachSeries = require('./eachSeries');var _eachSeries2 = _interopRequireDefault(_eachSeries);var _ensureAsync = require('./ensureAsync');var _ensureAsync2 = _interopRequireDefault(_ensureAsync);var _every = require('./every');var _every2 = _interopRequireDefault(_every);var _everyLimit = require('./everyLimit');var _everyLimit2 = _interopRequireDefault(_everyLimit);var _everySeries = require('./everySeries');var _everySeries2 = _interopRequireDefault(_everySeries);var _filter = require('./filter');var _filter2 = _interopRequireDefault(_filter);var _filterLimit = require('./filterLimit');var _filterLimit2 = _interopRequireDefault(_filterLimit);var _filterSeries = require('./filterSeries');var _filterSeries2 = _interopRequireDefault(_filterSeries);var _forever = require('./forever');var _forever2 = _interopRequireDefault(_forever);var _groupBy = require('./groupBy');var _groupBy2 = _interopRequireDefault(_groupBy);var _groupByLimit = require('./groupByLimit');var _groupByLimit2 = _interopRequireDefault(_groupByLimit);var _groupBySeries = require('./groupBySeries');var _groupBySeries2 = _interopRequireDefault(_groupBySeries);var _log = require('./log');var _log2 = _interopRequireDefault(_log);var _map = require('./map');var _map2 = _interopRequireDefault(_map);var _mapLimit = require('./mapLimit');var _mapLimit2 = _interopRequireDefault(_mapLimit);var _mapSeries = require('./mapSeries');var _mapSeries2 = _interopRequireDefault(_mapSeries);var _mapValues = require('./mapValues');var _mapValues2 = _interopRequireDefault(_mapValues);var _mapValuesLimit = require('./mapValuesLimit');var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit);var _mapValuesSeries = require('./mapValuesSeries');var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries);var _memoize = require('./memoize');var _memoize2 = _interopRequireDefault(_memoize);var _nextTick = require('./nextTick');var _nextTick2 = _interopRequireDefault(_nextTick);var _parallel = require('./parallel');var _parallel2 = _interopRequireDefault(_parallel);var _parallelLimit = require('./parallelLimit');var _parallelLimit2 = _interopRequireDefault(_parallelLimit);var _priorityQueue = require('./priorityQueue');var _priorityQueue2 = _interopRequireDefault(_priorityQueue);var _queue = require('./queue');var _queue2 = _interopRequireDefault(_queue);var _race = require('./race');var _race2 = _interopRequireDefault(_race);var _reduce = require('./reduce');var _reduce2 = _interopRequireDefault(_reduce);var _reduceRight = require('./reduceRight');var _reduceRight2 = _interopRequireDefault(_reduceRight);var _reflect = require('./reflect');var _reflect2 = _interopRequireDefault(_reflect);var _reflectAll = require('./reflectAll');var _reflectAll2 = _interopRequireDefault(_reflectAll);var _reject = require('./reject');var _reject2 = _interopRequireDefault(_reject);var _rejectLimit = require('./rejectLimit');var _rejectLimit2 = _interopRequireDefault(_rejectLimit);var _rejectSeries = require('./rejectSeries');var _rejectSeries2 = _interopRequireDefault(_rejectSeries);var _retry = require('./retry');var _retry2 = _interopRequireDefault(_retry);var _retryable = require('./retryable');var _retryable2 = _interopRequireDefault(_retryable);var _seq = require('./seq');var _seq2 = _interopRequireDefault(_seq);var _series = require('./series');var _series2 = _interopRequireDefault(_series);var _setImmediate = require('./setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);var _some = require('./some');var _some2 = _interopRequireDefault(_some);var _someLimit = require('./someLimit');var _someLimit2 = _interopRequireDefault(_someLimit);var _someSeries = require('./someSeries');var _someSeries2 = _interopRequireDefault(_someSeries);var _sortBy = require('./sortBy');var _sortBy2 = _interopRequireDefault(_sortBy);var _timeout = require('./timeout');var _timeout2 = _interopRequireDefault(_timeout);var _times = require('./times');var _times2 = _interopRequireDefault(_times);var _timesLimit = require('./timesLimit');var _timesLimit2 = _interopRequireDefault(_timesLimit);var _timesSeries = require('./timesSeries');var _timesSeries2 = _interopRequireDefault(_timesSeries);var _transform = require('./transform');var _transform2 = _interopRequireDefault(_transform);var _tryEach = require('./tryEach');var _tryEach2 = _interopRequireDefault(_tryEach);var _unmemoize = require('./unmemoize');var _unmemoize2 = _interopRequireDefault(_unmemoize);var _until = require('./until');var _until2 = _interopRequireDefault(_until);var _waterfall = require('./waterfall');var _waterfall2 = _interopRequireDefault(_waterfall);var _whilst = require('./whilst');var _whilst2 = _interopRequireDefault(_whilst);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }exports.default = {apply: _apply2.default,applyEach: _applyEach2.default,applyEachSeries: _applyEachSeries2.default,asyncify: _asyncify2.default,auto: _auto2.default,autoInject: _autoInject2.default,cargo: _cargo2.default,compose: _compose2.default,concat: _concat2.default,concatLimit: _concatLimit2.default,concatSeries: _concatSeries2.default,constant: _constant2.default,detect: _detect2.default,detectLimit: _detectLimit2.default,detectSeries: _detectSeries2.default,dir: _dir2.default,doDuring: _doDuring2.default,doUntil: _doUntil2.default,doWhilst: _doWhilst2.default,during: _during2.default,each: _each2.default,eachLimit: _eachLimit2.default,eachOf: _eachOf2.default,eachOfLimit: _eachOfLimit2.default,eachOfSeries: _eachOfSeries2.default,eachSeries: _eachSeries2.default,ensureAsync: _ensureAsync2.default,every: _every2.default,everyLimit: _everyLimit2.default,everySeries: _everySeries2.default,filter: _filter2.default,filterLimit: _filterLimit2.default,filterSeries: _filterSeries2.default,forever: _forever2.default,groupBy: _groupBy2.default,groupByLimit: _groupByLimit2.default,groupBySeries: _groupBySeries2.default,log: _log2.default,map: _map2.default,mapLimit: _mapLimit2.default,mapSeries: _mapSeries2.default,mapValues: _mapValues2.default,mapValuesLimit: _mapValuesLimit2.default,mapValuesSeries: _mapValuesSeries2.default,memoize: _memoize2.default,nextTick: _nextTick2.default,parallel: _parallel2.default,parallelLimit: _parallelLimit2.default,priorityQueue: _priorityQueue2.default,queue: _queue2.default,race: _race2.default,reduce: _reduce2.default,reduceRight: _reduceRight2.default,reflect: _reflect2.default,reflectAll: _reflectAll2.default,reject: _reject2.default,rejectLimit: _rejectLimit2.default,rejectSeries: _rejectSeries2.default,retry: _retry2.default,retryable: _retryable2.default,seq: _seq2.default,series: _series2.default,setImmediate: _setImmediate2.default,some: _some2.default,someLimit: _someLimit2.default,someSeries: _someSeries2.default,sortBy: _sortBy2.default,timeout: _timeout2.default,times: _times2.default,timesLimit: _timesLimit2.default,timesSeries: _timesSeries2.default,transform: _transform2.default,tryEach: _tryEach2.default,unmemoize: _unmemoize2.default,until: _until2.default,waterfall: _waterfall2.default,whilst: _whilst2.default,// aliasesall: _every2.default,allLimit: _everyLimit2.default,allSeries: _everySeries2.default,any: _some2.default,anyLimit: _someLimit2.default,anySeries: _someSeries2.default,find: _detect2.default,findLimit: _detectLimit2.default,findSeries: _detectSeries2.default,forEach: _each2.default,forEachSeries: _eachSeries2.default,forEachLimit: _eachLimit2.default,forEachOf: _eachOf2.default,forEachOfSeries: _eachOfSeries2.default,forEachOfLimit: _eachOfLimit2.default,inject: _reduce2.default,foldl: _reduce2.default,foldr: _reduceRight2.default,select: _filter2.default,selectLimit: _filterLimit2.default,selectSeries: _filterSeries2.default,wrapSync: _asyncify2.default}; /*** An "async function" in the context of Async is an asynchronous function with* a variable number of parameters, with the final parameter being a callback.* (`function (arg1, arg2, ..., callback) {}`)* The final callback is of the form `callback(err, results...)`, which must be* called once the function is completed. The callback should be called with a* Error as its first argument to signal that an error occurred.* Otherwise, if no error occurred, it should be called with `null` as the first* argument, and any additional `result` arguments that may apply, to signal* successful completion.* The callback must be called exactly once, ideally on a later tick of the* JavaScript event loop.** This type of function is also referred to as a "Node-style async function",* or a "continuation passing-style function" (CPS). Most of the methods of this* library are themselves CPS/Node-style async functions, or functions that* return CPS/Node-style async functions.** Wherever we accept a Node-style async function, we also directly accept an* [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.* In this case, the `async` function will not be passed a final callback* argument, and any thrown error will be used as the `err` argument of the* implicit callback, and the return value will be used as the `result` value.* (i.e. a `rejected` of the returned Promise becomes the `err` callback* argument, and a `resolved` value becomes the `result`.)** Note, due to JavaScript limitations, we can only detect native `async`* functions and not transpilied implementations.* Your environment must have `async`/`await` support for this to work.* (e.g. Node > v7.6, or a recent version of a modern browser).* If you are using `async` functions through a transpiler (e.g. Babel), you* must still wrap the function with [asyncify]{@link module:Utils.asyncify},* because the `async function` will be compiled to an ordinary function that* returns a promise.** @typedef {Function} AsyncFunction* @static*//*** Async is a utility module which provides straight-forward, powerful functions* for working with asynchronous JavaScript. Although originally designed for* use with [Node.js](http://nodejs.org) and installable via* `npm install --save async`, it can also be used directly in the browser.* @module async* @see AsyncFunction*//*** A collection of `async` functions for manipulating collections, such as* arrays and objects.* @module Collections*//*** A collection of `async` functions for controlling the flow through a script.* @module ControlFlow*//*** A collection of `async` utility functions.* @module Utils*/exports.apply = _apply2.default;exports.applyEach = _applyEach2.default;exports.applyEachSeries = _applyEachSeries2.default;exports.asyncify = _asyncify2.default;exports.auto = _auto2.default;exports.autoInject = _autoInject2.default;exports.cargo = _cargo2.default;exports.compose = _compose2.default;exports.concat = _concat2.default;exports.concatLimit = _concatLimit2.default;exports.concatSeries = _concatSeries2.default;exports.constant = _constant2.default;exports.detect = _detect2.default;exports.detectLimit = _detectLimit2.default;exports.detectSeries = _detectSeries2.default;exports.dir = _dir2.default;exports.doDuring = _doDuring2.default;exports.doUntil = _doUntil2.default;exports.doWhilst = _doWhilst2.default;exports.during = _during2.default;exports.each = _each2.default;exports.eachLimit = _eachLimit2.default;exports.eachOf = _eachOf2.default;exports.eachOfLimit = _eachOfLimit2.default;exports.eachOfSeries = _eachOfSeries2.default;exports.eachSeries = _eachSeries2.default;exports.ensureAsync = _ensureAsync2.default;exports.every = _every2.default;exports.everyLimit = _everyLimit2.default;exports.everySeries = _everySeries2.default;exports.filter = _filter2.default;exports.filterLimit = _filterLimit2.default;exports.filterSeries = _filterSeries2.default;exports.forever = _forever2.default;exports.groupBy = _groupBy2.default;exports.groupByLimit = _groupByLimit2.default;exports.groupBySeries = _groupBySeries2.default;exports.log = _log2.default;exports.map = _map2.default;exports.mapLimit = _mapLimit2.default;exports.mapSeries = _mapSeries2.default;exports.mapValues = _mapValues2.default;exports.mapValuesLimit = _mapValuesLimit2.default;exports.mapValuesSeries = _mapValuesSeries2.default;exports.memoize = _memoize2.default;exports.nextTick = _nextTick2.default;exports.parallel = _parallel2.default;exports.parallelLimit = _parallelLimit2.default;exports.priorityQueue = _priorityQueue2.default;exports.queue = _queue2.default;exports.race = _race2.default;exports.reduce = _reduce2.default;exports.reduceRight = _reduceRight2.default;exports.reflect = _reflect2.default;exports.reflectAll = _reflectAll2.default;exports.reject = _reject2.default;exports.rejectLimit = _rejectLimit2.default;exports.rejectSeries = _rejectSeries2.default;exports.retry = _retry2.default;exports.retryable = _retryable2.default;exports.seq = _seq2.default;exports.series = _series2.default;exports.setImmediate = _setImmediate2.default;exports.some = _some2.default;exports.someLimit = _someLimit2.default;exports.someSeries = _someSeries2.default;exports.sortBy = _sortBy2.default;exports.timeout = _timeout2.default;exports.times = _times2.default;exports.timesLimit = _timesLimit2.default;exports.timesSeries = _timesSeries2.default;exports.transform = _transform2.default;exports.tryEach = _tryEach2.default;exports.unmemoize = _unmemoize2.default;exports.until = _until2.default;exports.waterfall = _waterfall2.default;exports.whilst = _whilst2.default;exports.all = _every2.default;exports.allLimit = _everyLimit2.default;exports.allSeries = _everySeries2.default;exports.any = _some2.default;exports.anyLimit = _someLimit2.default;exports.anySeries = _someSeries2.default;exports.find = _detect2.default;exports.findLimit = _detectLimit2.default;exports.findSeries = _detectSeries2.default;exports.forEach = _each2.default;exports.forEachSeries = _eachSeries2.default;exports.forEachLimit = _eachLimit2.default;exports.forEachOf = _eachOf2.default;exports.forEachOfSeries = _eachOfSeries2.default;exports.forEachOfLimit = _eachOfLimit2.default;exports.inject = _reduce2.default;exports.foldl = _reduce2.default;exports.foldr = _reduceRight2.default;exports.select = _filter2.default;exports.selectLimit = _filterLimit2.default;exports.selectSeries = _filterSeries2.default;exports.wrapSync = _asyncify2.default;
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _groupByLimit = require('./groupByLimit');var _groupByLimit2 = _interopRequireDefault(_groupByLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.** @name groupBySeries* @static* @memberOf module:Collections* @method* @see [async.groupBy]{@link module:Collections.groupBy}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.*/exports.default = (0, _doLimit2.default)(_groupByLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (coll, limit, iteratee, callback) {callback = callback || _noop2.default;var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _mapLimit2.default)(coll, limit, function (val, callback) {_iteratee(val, function (err, key) {if (err) return callback(err);return callback(null, { key: key, val: val });});}, function (err, mapResults) {var result = {};// from MDN, handle object having an `hasOwnProperty` propvar hasOwnProperty = Object.prototype.hasOwnProperty;for (var i = 0; i < mapResults.length; i++) {if (mapResults[i]) {var key = mapResults[i].key;var val = mapResults[i].val;if (hasOwnProperty.call(result, key)) {result[key].push(val);} else {result[key] = [val];}}}return callback(err, result);});};var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _mapLimit = require('./mapLimit');var _mapLimit2 = _interopRequireDefault(_mapLimit);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; };/*** The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.** @name groupByLimit* @static* @memberOf module:Collections* @method* @see [async.groupBy]{@link module:Collections.groupBy}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _groupByLimit = require('./groupByLimit');var _groupByLimit2 = _interopRequireDefault(_groupByLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns a new object, where each value corresponds to an array of items, from* `coll`, that returned the corresponding key. That is, the keys of the object* correspond to the values passed to the `iteratee` callback.** Note: Since this function applies the `iteratee` to each item in parallel,* there is no guarantee that the `iteratee` functions will complete in order.* However, the values for each key in the `result` will be in the same order as* the original `coll`. For Objects, the values will roughly be in the order of* the original Objects' keys (but this can vary across JavaScript engines).** @name groupBy* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.* @example** async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {* db.findById(userId, function(err, user) {* if (err) return callback(err);* return callback(null, user.age);* });* }, function(err, result) {* // result is object containing the userIds grouped by age* // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};* });*/exports.default = (0, _doLimit2.default)(_groupByLimit2.default, Infinity);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = forever;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _ensureAsync = require('./ensureAsync');var _ensureAsync2 = _interopRequireDefault(_ensureAsync);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Calls the asynchronous function `fn` with a callback parameter that allows it* to call itself again, in series, indefinitely.* If an error is passed to the callback then `errback` is called with the* error, and execution stops, otherwise it will never be called.** @name forever* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {AsyncFunction} fn - an async function to call repeatedly.* Invoked with (next).* @param {Function} [errback] - when `fn` passes an error to it's callback,* this function will be called, and execution stops. Invoked with (err).* @example** async.forever(* function(next) {* // next is suitable for passing to things that need a callback(err [, whatever]);* // it will result in this function being called again.* },* function(err) {* // if next is called with a value in its first parameter, it will appear* // in here as 'err', and execution will stop.* }* );*/function forever(fn, errback) {var done = (0, _onlyOnce2.default)(errback || _noop2.default);var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn));function next(err) {if (err) return done(err);task(next);}next();}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _eachLimit = require('./eachLimit');var _eachLimit2 = _interopRequireDefault(_eachLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.** @name eachSeries* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfSeries`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.** @name eachOfSeries* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Invoked with (err).*/exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachOfLimit;var _eachOfLimit2 = require('./internal/eachOfLimit');var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a* time.** @name eachOfLimit* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`. The `key` is the item's key, or index in the case of an* array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachOfLimit(coll, limit, iteratee, callback) {(0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (coll, iteratee, callback) {var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);};var _isArrayLike = require('lodash/isArrayLike');var _isArrayLike2 = _interopRequireDefault(_isArrayLike);var _breakLoop = require('./internal/breakLoop');var _breakLoop2 = _interopRequireDefault(_breakLoop);var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// eachOf implementation optimized for array-likesfunction eachOfArrayLike(coll, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var index = 0,completed = 0,length = coll.length;if (length === 0) {callback(null);}function iteratorCallback(err, value) {if (err) {callback(err);} else if (++completed === length || value === _breakLoop2.default) {callback(null);}}for (; index < length; index++) {iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));}}// a generic version of eachOf which can handle array, object, and iterator cases.var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);/*** Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument* to the iteratee.** @name eachOf* @static* @memberOf module:Collections* @method* @alias forEachOf* @category Collection* @see [async.each]{@link module:Collections.each}* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each* item in `coll`.* The `key` is the item's key, or index in the case of an array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};* var configs = {};** async.forEachOf(obj, function (value, key, callback) {* fs.readFile(__dirname + value, "utf8", function (err, data) {* if (err) return callback(err);* try {* configs[key] = JSON.parse(data);* } catch (e) {* return callback(e);* }* callback();* });* }, function (err) {* if (err) console.error(err.message);* // configs is now a map of JSON data* doSomethingWith(configs);* });*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachLimit;var _eachOfLimit = require('./internal/eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _withoutIndex = require('./internal/withoutIndex');var _withoutIndex2 = _interopRequireDefault(_withoutIndex);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.** @name eachLimit* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfLimit`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachLimit(coll, limit, iteratee, callback) {(0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachLimit;var _eachOf = require('./eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _withoutIndex = require('./internal/withoutIndex');var _withoutIndex2 = _interopRequireDefault(_withoutIndex);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Applies the function `iteratee` to each item in `coll`, in parallel.* The `iteratee` is called with an item from the list, and a callback for when* it has finished. If the `iteratee` passes an error to its `callback`, the* main `callback` (for the `each` function) is immediately called with the* error.** Note, that since this function applies `iteratee` to each item in parallel,* there is no guarantee that the iteratee functions will complete in order.** @name each* @static* @memberOf module:Collections* @method* @alias forEach* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to* each item in `coll`. Invoked with (item, callback).* The array index is not passed to the iteratee.* If you need the index, use `eachOf`.* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** // assuming openFiles is an array of file names and saveFile is a function* // to save the modified contents of that file:** async.each(openFiles, saveFile, function(err){* // if any of the saves produced an error, err would equal that error* });** // assuming openFiles is an array of file names* async.each(openFiles, function(file, callback) {** // Perform operation on file here.* console.log('Processing file ' + file);** if( file.length > 32 ) {* console.log('This file name is too long');* callback('File name too long');* } else {* // Do work to process file here* console.log('File processed');* callback();* }* }, function(err) {* // if any of the file processing produced an error, err would equal that error* if( err ) {* // One of the iterations produced an error.* // All processing will now stop.* console.log('A file failed to process');* } else {* console.log('All files have been processed successfully');* }* });*/function eachLimit(coll, iteratee, callback) {(0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reduceRight;var _reduce = require('./reduce');var _reduce2 = _interopRequireDefault(_reduce);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.** @name reduceRight* @static* @memberOf module:Collections* @method* @see [async.reduce]{@link module:Collections.reduce}* @alias foldr* @category Collection* @param {Array} array - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).*/function reduceRight(array, memo, iteratee, callback) {var reversed = (0, _slice2.default)(array).reverse();(0, _reduce2.default)(reversed, memo, iteratee, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = reduce;var _eachOfSeries = require('./eachOfSeries');var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Reduces `coll` into a single value using an async `iteratee` to return each* successive step. `memo` is the initial state of the reduction. This function* only operates in series.** For performance reasons, it may make sense to split a call to this function* into a parallel map, and then use the normal `Array.prototype.reduce` on the* results. This function is for situations where each step in the reduction* needs to be async; if you can get the data before reducing it, then it's* probably a good idea to do so.** @name reduce* @static* @memberOf module:Collections* @method* @alias inject* @alias foldl* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).* @example** async.reduce([1,2,3], 0, function(memo, item, callback) {* // pointless async:* process.nextTick(function() {* callback(null, memo + item)* });* }, function(err, result) {* // result is now equal to the last value of memo, which is 6* });*/function reduce(coll, memo, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _eachOfSeries2.default)(coll, function (x, i, callback) {_iteratee(memo, x, function (err, v) {memo = v;callback(err);});}, function (err) {callback(err, memo);});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _detectLimit = require('./detectLimit');var _detectLimit2 = _interopRequireDefault(_detectLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.** @name detectSeries* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findSeries* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _findGetResult = require('./internal/findGetResult');var _findGetResult2 = _interopRequireDefault(_findGetResult);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a* time.** @name detectLimit* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findLimit* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _findGetResult = require('./internal/findGetResult');var _findGetResult2 = _interopRequireDefault(_findGetResult);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns the first value in `coll` that passes an async truth test. The* `iteratee` is applied in parallel, meaning the first iteratee to return* `true` will fire the detect `callback` with that result. That means the* result might not be the first item in the original `coll` (in terms of order)* that passes the test.* If order within the original `coll` is important, then look at* [`detectSeries`]{@link module:Collections.detectSeries}.** @name detect* @static* @memberOf module:Collections* @method* @alias find* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).* @example** async.detect(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // result now equals the first file in the list that exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filterLimit = require('./filterLimit');var _filterLimit2 = _interopRequireDefault(_filterLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.** @name filterSeries* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results)*/exports.default = (0, _doLimit2.default)(_filterLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filter = require('./internal/filter');var _filter2 = _interopRequireDefault(_filter);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a* time.** @name filterLimit* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/exports.default = (0, _doParallelLimit2.default)(_filter2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _filter = require('./internal/filter');var _filter2 = _interopRequireDefault(_filter);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns a new array of all the values in `coll` which pass an async truth* test. This operation is performed in parallel, but the results array will be* in the same order as the original.** @name filter* @static* @memberOf module:Collections* @method* @alias select* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).* @example** async.filter(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, results) {* // results now equals an array of the existing files* });*/exports.default = (0, _doParallel2.default)(_filter2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _everyLimit = require('./everyLimit');var _everyLimit2 = _interopRequireDefault(_everyLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.** @name everySeries* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in series.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _notId = require('./internal/notId');var _notId2 = _interopRequireDefault(_notId);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.** @name everyLimit* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _notId = require('./internal/notId');var _notId2 = _interopRequireDefault(_notId);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns `true` if every element in `coll` satisfies an async test. If any* iteratee call returns `false`, the main `callback` is immediately called.** @name every* @static* @memberOf module:Collections* @method* @alias all* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).* @example** async.every(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then every file exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = ensureAsync;var _setImmediate = require('./internal/setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _wrapAsync = require('./internal/wrapAsync');function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Wrap an async function and ensure it calls its callback on a later tick of* the event loop. If the function already calls its callback on a next tick,* no extra deferral is added. This is useful for preventing stack overflows* (`RangeError: Maximum call stack size exceeded`) and generally keeping* [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)* contained. ES2017 `async` functions are returned as-is -- they are immune* to Zalgo's corrupting influences, as they always resolve on a later tick.** @name ensureAsync* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - an async function, one that expects a node-style* callback as its last argument.* @returns {AsyncFunction} Returns a wrapped function with the exact same call* signature as the function passed in.* @example** function sometimesAsync(arg, callback) {* if (cache[arg]) {* return callback(null, cache[arg]); // this would be synchronous!!* } else {* doSomeIO(arg, callback); // this IO would be asynchronous* }* }** // this has a risk of stack overflows if many results are cached in a row* async.mapSeries(args, sometimesAsync, done);** // this will defer sometimesAsync's callback if necessary,* // preventing stack overflows* async.mapSeries(args, async.ensureAsync(sometimesAsync), done);*/function ensureAsync(fn) {if ((0, _wrapAsync.isAsync)(fn)) return fn;return (0, _initialParams2.default)(function (args, callback) {var sync = true;args.push(function () {var innerArgs = arguments;if (sync) {(0, _setImmediate2.default)(function () {callback.apply(null, innerArgs);});} else {callback.apply(null, innerArgs);}});fn.apply(this, args);sync = false;});}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _eachLimit = require('./eachLimit');var _eachLimit2 = _interopRequireDefault(_eachLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.** @name eachSeries* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfSeries`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.** @name eachOfSeries* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Invoked with (err).*/exports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachOfLimit;var _eachOfLimit2 = require('./internal/eachOfLimit');var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a* time.** @name eachOfLimit* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`. The `key` is the item's key, or index in the case of an* array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachOfLimit(coll, limit, iteratee, callback) {(0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (coll, iteratee, callback) {var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);};var _isArrayLike = require('lodash/isArrayLike');var _isArrayLike2 = _interopRequireDefault(_isArrayLike);var _breakLoop = require('./internal/breakLoop');var _breakLoop2 = _interopRequireDefault(_breakLoop);var _eachOfLimit = require('./eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// eachOf implementation optimized for array-likesfunction eachOfArrayLike(coll, iteratee, callback) {callback = (0, _once2.default)(callback || _noop2.default);var index = 0,completed = 0,length = coll.length;if (length === 0) {callback(null);}function iteratorCallback(err, value) {if (err) {callback(err);} else if (++completed === length || value === _breakLoop2.default) {callback(null);}}for (; index < length; index++) {iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));}}// a generic version of eachOf which can handle array, object, and iterator cases.var eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);/*** Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument* to the iteratee.** @name eachOf* @static* @memberOf module:Collections* @method* @alias forEachOf* @category Collection* @see [async.each]{@link module:Collections.each}* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each* item in `coll`.* The `key` is the item's key, or index in the case of an array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};* var configs = {};** async.forEachOf(obj, function (value, key, callback) {* fs.readFile(__dirname + value, "utf8", function (err, data) {* if (err) return callback(err);* try {* configs[key] = JSON.parse(data);* } catch (e) {* return callback(e);* }* callback();* });* }, function (err) {* if (err) console.error(err.message);* // configs is now a map of JSON data* doSomethingWith(configs);* });*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachLimit;var _eachOfLimit = require('./internal/eachOfLimit');var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);var _withoutIndex = require('./internal/withoutIndex');var _withoutIndex2 = _interopRequireDefault(_withoutIndex);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.** @name eachLimit* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfLimit`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachLimit(coll, limit, iteratee, callback) {(0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = eachLimit;var _eachOf = require('./eachOf');var _eachOf2 = _interopRequireDefault(_eachOf);var _withoutIndex = require('./internal/withoutIndex');var _withoutIndex2 = _interopRequireDefault(_withoutIndex);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Applies the function `iteratee` to each item in `coll`, in parallel.* The `iteratee` is called with an item from the list, and a callback for when* it has finished. If the `iteratee` passes an error to its `callback`, the* main `callback` (for the `each` function) is immediately called with the* error.** Note, that since this function applies `iteratee` to each item in parallel,* there is no guarantee that the iteratee functions will complete in order.** @name each* @static* @memberOf module:Collections* @method* @alias forEach* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to* each item in `coll`. Invoked with (item, callback).* The array index is not passed to the iteratee.* If you need the index, use `eachOf`.* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** // assuming openFiles is an array of file names and saveFile is a function* // to save the modified contents of that file:** async.each(openFiles, saveFile, function(err){* // if any of the saves produced an error, err would equal that error* });** // assuming openFiles is an array of file names* async.each(openFiles, function(file, callback) {** // Perform operation on file here.* console.log('Processing file ' + file);** if( file.length > 32 ) {* console.log('This file name is too long');* callback('File name too long');* } else {* // Do work to process file here* console.log('File processed');* callback();* }* }, function(err) {* // if any of the file processing produced an error, err would equal that error* if( err ) {* // One of the iterations produced an error.* // All processing will now stop.* console.log('A file failed to process');* } else {* console.log('All files have been processed successfully');* }* });*/function eachLimit(coll, iteratee, callback) {(0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = during;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that* is passed a callback in the form of `function (err, truth)`. If error is* passed to `test` or `fn`, the main callback is immediately called with the* value of the error.** @name during* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {AsyncFunction} test - asynchronous truth test to perform before each* execution of `fn`. Invoked with (callback).* @param {AsyncFunction} fn - An async function which is called each time* `test` passes. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `fn` has stopped. `callback`* will be passed an error, if one occurred, otherwise `null`.* @example** var count = 0;** async.during(* function (callback) {* return callback(null, count < 5);* },* function (callback) {* count++;* setTimeout(callback, 1000);* },* function (err) {* // 5 seconds have passed* }* );*/function during(test, fn, callback) {callback = (0, _onlyOnce2.default)(callback || _noop2.default);var _fn = (0, _wrapAsync2.default)(fn);var _test = (0, _wrapAsync2.default)(test);function next(err) {if (err) return callback(err);_test(check);}function check(err, truth) {if (err) return callback(err);if (!truth) return callback(null);_fn(next);}_test(check);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = doWhilst;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in* the order of operations, the arguments `test` and `iteratee` are switched.** `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.** @name doWhilst* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {AsyncFunction} iteratee - A function which is called each time `test`* passes. Invoked with (callback).* @param {Function} test - synchronous truth test to perform after each* execution of `iteratee`. Invoked with any non-error callback results of* `iteratee`.* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `iteratee` has stopped.* `callback` will be passed an error and any arguments passed to the final* `iteratee`'s callback. Invoked with (err, [results]);*/function doWhilst(iteratee, test, callback) {callback = (0, _onlyOnce2.default)(callback || _noop2.default);var _iteratee = (0, _wrapAsync2.default)(iteratee);var next = function (err /*, ...args*/) {if (err) return callback(err);var args = (0, _slice2.default)(arguments, 1);if (test.apply(this, args)) return _iteratee(next);callback.apply(null, [null].concat(args));};_iteratee(next);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = doUntil;var _doWhilst = require('./doWhilst');var _doWhilst2 = _interopRequireDefault(_doWhilst);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the* argument ordering differs from `until`.** @name doUntil* @static* @memberOf module:ControlFlow* @method* @see [async.doWhilst]{@link module:ControlFlow.doWhilst}* @category Control Flow* @param {AsyncFunction} iteratee - An async function which is called each time* `test` fails. Invoked with (callback).* @param {Function} test - synchronous truth test to perform after each* execution of `iteratee`. Invoked with any non-error callback results of* `iteratee`.* @param {Function} [callback] - A callback which is called after the test* function has passed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);*/function doUntil(iteratee, test, callback) {(0, _doWhilst2.default)(iteratee, function () {return !test.apply(this, arguments);}, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = doDuring;var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in* the order of operations, the arguments `test` and `fn` are switched.** Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.* @name doDuring* @static* @memberOf module:ControlFlow* @method* @see [async.during]{@link module:ControlFlow.during}* @category Control Flow* @param {AsyncFunction} fn - An async function which is called each time* `test` passes. Invoked with (callback).* @param {AsyncFunction} test - asynchronous truth test to perform before each* execution of `fn`. Invoked with (...args, callback), where `...args` are the* non-error args from the previous callback of `fn`.* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `fn` has stopped. `callback`* will be passed an error if one occurred, otherwise `null`.*/function doDuring(fn, test, callback) {callback = (0, _onlyOnce2.default)(callback || _noop2.default);var _fn = (0, _wrapAsync2.default)(fn);var _test = (0, _wrapAsync2.default)(test);function next(err /*, ...args*/) {if (err) return callback(err);var args = (0, _slice2.default)(arguments, 1);args.push(check);_test.apply(this, args);};function check(err, truth) {if (err) return callback(err);if (!truth) return callback(null);_fn(next);}check(null, true);}module.exports = exports['default'];
{"version":3,"sources":["build/dist/async.js"],"names":["global","factory","exports","module","define","amd","async","this","slice","arrayLike","start","newLen","Math","max","length","newArr","Array","idx","isObject","value","type","fallback","fn","setTimeout","wrap","defer","args","arguments","apply","asyncify","func","initialParams","callback","result","e","then","invokeCallback","err","message","Error","error","setImmediate$1","rethrow","isAsync","supportsSymbol","Symbol","toStringTag","wrapAsync","asyncFn","applyEach$1","eachfn","fns","go","that","cb","concat","getRawTag","isOwn","hasOwnProperty","call","symToStringTag$1","tag","undefined","unmasked","nativeObjectToString","objectToString","nativeObjectToString$1","baseGetTag","undefinedTag","nullTag","symToStringTag","Object","isFunction","funcTag","genTag","asyncTag","proxyTag","isLength","MAX_SAFE_INTEGER","isArrayLike","noop","once","callFn","baseTimes","n","iteratee","index","isObjectLike","baseIsArguments","argsTag","stubFalse","isIndex","MAX_SAFE_INTEGER$1","reIsUint","test","baseIsTypedArray","typedArrayTags","baseUnary","arrayLikeKeys","inherited","isArr","isArray","isArg","isArguments","isBuff","isBuffer","isType","isTypedArray","skipIndexes","String","key","hasOwnProperty$1","push","isPrototype","Ctor","constructor","proto","prototype","objectProto$5","overArg","transform","arg","baseKeys","object","nativeKeys","hasOwnProperty$3","keys","createArrayIterator","coll","i","len","createES2015Iterator","iterator","item","next","done","createObjectIterator","obj","okeys","getIterator","onlyOnce","_eachOfLimit","limit","iterateeCallback","running","breakLoop","looping","replenish","elem","nextElem","eachOfLimit","doLimit","iterable","eachOfArrayLike","iteratorCallback","completed","doParallel","eachOf","_asyncMap","arr","results","counter","_iteratee","_","v","doParallelLimit","arrayEach","array","createBaseFor","fromRight","keysFunc","props","baseForOwn","baseFor","baseFindIndex","predicate","fromIndex","baseIsNaN","strictIndexOf","baseIndexOf","arrayMap","isSymbol","symbolTag","baseToString","symbolToString","INFINITY","baseSlice","end","castSlice","charsEndIndex","strSymbols","chrSymbols","charsStartIndex","asciiToArray","string","split","hasUnicode","reHasUnicode","unicodeToArray","match","reUnicode","stringToArray","toString","trim","chars","guard","replace","reTrim","join","parseParams","STRIP_COMMENTS","FN_ARGS","FN_ARG_SPLIT","map","FN_ARG","autoInject","tasks","newTasks","taskFn","newTask","taskCb","newArgs","params","name","fnIsAsync","hasNoDeps","pop","auto","DLL","head","tail","setInitial","dll","node","queue","worker","concurrency","payload","_insert","data","insertAtFront","q","started","idle","drain","l","_tasks","unshift","processingScheduled","process","_next","numRunning","task","workersList","shift","splice","buffer","unsaturated","_worker","isProcessing","saturated","empty","paused","kill","remove","testFn","min","pause","resume","cargo","reduce","memo","eachOfSeries","x","seq","_functions","newargs","nextargs","identity","_createTester","check","getResult","testResult","testPassed","_findGetResult","consoleFunc","console","doDuring","_test","truth","_fn","doWhilst","doUntil","during","_withoutIndex","eachLimit","eachLimit$1","ensureAsync","sync","innerArgs","notId","baseProperty","filterArray","truthValues","filterGeneric","sort","a","b","_filter","filter","forever","errback","mapValuesLimit","newObj","val","has","memoize","hasher","create","queues","memoized","unmemoized","_parallel","parallelLimit","parallelLimit$1","race","TypeError","reduceRight","reversed","reverse","reflect","reflectCallback","cbArg","reflectAll","reject$1","constant$1","retry","opts","parseTimes","acc","t","times","DEFAULT_TIMES","intervalFunc","interval","DEFAULT_INTERVAL","errorFilter","retryAttempt","_task","attempt","options","series","sortBy","comparator","left","right","criteria","timeout","milliseconds","info","timeoutCallback","code","timedOut","timer","clearTimeout","baseRange","step","nativeMax","nativeCeil","timeLimit","count","mapLimit","accumulator","k","tryEach","eachSeries","res","unmemoize","whilst","until","_defer","callArgs","hasSetImmediate","setImmediate","hasNextTick","nextTick","freeGlobal","freeSelf","self","root","Function","Symbol$1","objectProto","objectProto$1","iteratorSymbol","objectProto$3","hasOwnProperty$2","propertyIsEnumerable","freeExports","nodeType","freeModule","moduleExports","Buffer","nativeIsBuffer","argsTag$1","arrayTag","boolTag","dateTag","errorTag","funcTag$1","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","freeExports$1","freeModule$1","moduleExports$1","freeProcess","nodeUtil","types","require","binding","nodeIsTypedArray","objectProto$2","objectProto$4","eachOfGeneric","Infinity","eachOfImplementation","applyEach","mapSeries","applyEachSeries","enqueueTask","readyTasks","runTask","processQueue","runningTasks","run","addListener","taskName","taskListeners","listeners","taskComplete","hasError","taskCallback","safeResults","rkey","checkForDeadlocks","currentTask","readyToCheck","getDependents","dependent","uncheckedDependencies","numTasks","keys$$1","dependencies","remainingDependencies","dependencyName","symbolProto","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsVarRange","rsZWJ","RegExp","rsAstralRange$1","rsComboMarksRange$1","reComboHalfMarksRange$1","rsComboSymbolsRange$1","rsComboRange$1","rsVarRange$1","rsAstral","rsCombo","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsZWJ$1","reOptMod","rsOptVar","rsOptJoin","rsSeq","rsSymbol","removeLink","prev","insertAfter","newNode","insertBefore","toArray","curr","_defer$1","compose","_concat","concatLimit","mapResults","concatSeries","constant","values","detect","detectLimit","detectSeries","dir","every","everyLimit","everySeries","filterLimit","filterSeries","groupByLimit","groupBy","groupBySeries","log","mapValues","mapValuesSeries","queue$1","items","priorityQueue","priority","nextNode","reject","rejectLimit","rejectSeries","retryable","some","Boolean","someLimit","someSeries","ceil","timesSeries","waterfall","nextTask","taskIndex","each","parallel","timesLimit","all","allLimit","allSeries","any","anyLimit","anySeries","find","findLimit","findSeries","forEach","forEachSeries","forEachLimit","forEachOf","forEachOfSeries","forEachOfLimit","inject","foldl","foldr","select","selectLimit","selectSeries","wrapSync","defineProperty"],"mappings":"CAAC,SAAUA,EAAQC,GACE,gBAAZC,UAA0C,mBAAXC,QAAyBF,EAAQC,SACrD,kBAAXE,SAAyBA,OAAOC,IAAMD,QAAQ,WAAYH,GAChEA,EAASD,EAAOM,MAAQN,EAAOM,YAChCC,KAAM,SAAWL,GAAW,YAE9B,SAASM,GAAMC,EAAWC,GACtBA,GAAc,CAGd,KAAI,GAFAC,GAASC,KAAKC,IAAIJ,EAAUK,OAASJ,EAAO,GAC5CK,EAASC,MAAML,GACXM,EAAM,EAAGA,EAAMN,EAAQM,IAC3BF,EAAOE,GAAOR,EAAUC,EAAQO,EAEpC,OAAOF,GAyFX,QAASG,GAASC,GAChB,GAAIC,SAAcD,EAClB,OAAgB,OAATA,IAA0B,UAARC,GAA4B,YAARA,GAM/C,QAASC,GAASC,GACdC,WAAWD,EAAI,GAGnB,QAASE,GAAKC,GACV,MAAO,UAAUH,GACb,GAAII,GAAOlB,EAAMmB,UAAW,EAC5BF,GAAM,WACFH,EAAGM,MAAM,KAAMF,MAyE3B,QAASG,GAASC,GACd,MAAOC,IAAc,SAAUL,EAAMM,GACjC,GAAIC,EACJ,KACIA,EAASH,EAAKF,MAAMrB,KAAMmB,GAC5B,MAAOQ,GACL,MAAOF,GAASE,GAGhBhB,EAASe,IAAkC,kBAAhBA,GAAOE,KAClCF,EAAOE,KAAK,SAAShB,GACjBiB,EAAeJ,EAAU,KAAMb,IAChC,SAASkB,GACRD,EAAeJ,EAAUK,EAAIC,QAAUD,EAAM,GAAIE,OAAMF,MAG3DL,EAAS,KAAMC,KAK3B,QAASG,GAAeJ,EAAUQ,EAAOrB,GACrC,IACIa,EAASQ,EAAOrB,GAClB,MAAOe,GACLO,GAAeC,EAASR,IAIhC,QAASQ,GAAQF,GACb,KAAMA,GAKV,QAASG,GAAQrB,GACb,MAAOsB,KAA6C,kBAA3BtB,EAAGuB,OAAOC,aAGvC,QAASC,GAAUC,GACf,MAAOL,GAAQK,GAAWnB,EAASmB,GAAWA,EAGlD,QAASC,GAAYC,GACjB,MAAO,UAASC,GACZ,GAAIzB,GAAOlB,EAAMmB,UAAW,GACxByB,EAAKrB,GAAc,SAASL,EAAMM,GAClC,GAAIqB,GAAO9C,IACX,OAAO2C,GAAOC,EAAK,SAAU7B,EAAIgC,GAC7BP,EAAUzB,GAAIM,MAAMyB,EAAM3B,EAAK6B,OAAOD,KACvCtB,IAEP,OAAIN,GAAKZ,OACEsC,EAAGxB,MAAMrB,KAAMmB,GAGf0B,GAwCnB,QAASI,GAAUrC,GACjB,GAAIsC,GAAQC,GAAeC,KAAKxC,EAAOyC,IACnCC,EAAM1C,EAAMyC,GAEhB,KACEzC,EAAMyC,IAAoBE,MAC1B,IAAIC,IAAW,EACf,MAAO7B,IAET,GAAID,GAAS+B,GAAqBL,KAAKxC,EAQvC,OAPI4C,KACEN,EACFtC,EAAMyC,IAAoBC,QAEnB1C,GAAMyC,KAGV3B,EAoBT,QAASgC,GAAe9C,GACtB,MAAO+C,IAAuBP,KAAKxC,GAiBrC,QAASgD,GAAWhD,GAClB,MAAa,OAATA,EACe2C,SAAV3C,EAAsBiD,GAAeC,GAEtCC,IAAkBA,KAAkBC,QAAOpD,GAC/CqC,EAAUrC,GACV8C,EAAe9C,GA0BrB,QAASqD,GAAWrD,GAClB,IAAKD,EAASC,GACZ,OAAO,CAIT,IAAI0C,GAAMM,EAAWhD,EACrB,OAAO0C,IAAOY,IAAWZ,GAAOa,IAAUb,GAAOc,IAAYd,GAAOe,GAgCtE,QAASC,GAAS1D,GAChB,MAAuB,gBAATA,IACZA,GAAQ,GAAMA,EAAQ,GAAK,GAAKA,GAAS2D,GA4B7C,QAASC,GAAY5D,GACnB,MAAgB,OAATA,GAAiB0D,EAAS1D,EAAML,UAAY0D,EAAWrD,GAmBhE,QAAS6D,MAIT,QAASC,GAAK3D,GACV,MAAO,YACH,GAAW,OAAPA,EAAJ,CACA,GAAI4D,GAAS5D,CACbA,GAAK,KACL4D,EAAOtD,MAAMrB,KAAMoB,aAmB3B,QAASwD,GAAUC,EAAGC,GAIpB,IAHA,GAAIC,IAAQ,EACRrD,EAASjB,MAAMoE,KAEVE,EAAQF,GACfnD,EAAOqD,GAASD,EAASC,EAE3B,OAAOrD,GA2BT,QAASsD,GAAapE,GACpB,MAAgB,OAATA,GAAiC,gBAATA,GAajC,QAASqE,GAAgBrE,GACvB,MAAOoE,GAAapE,IAAUgD,EAAWhD,IAAUsE,GAyErD,QAASC,KACP,OAAO,EAmDT,QAASC,GAAQxE,EAAOL,GACtB,GAAIM,SAAcD,EAGlB,OAFAL,GAAmB,MAAVA,EAAiB8E,GAAqB9E,IAEtCA,IACE,UAARM,GACU,UAARA,GAAoByE,GAASC,KAAK3E,KAChCA,GAAQ,GAAMA,EAAQ,GAAK,GAAKA,EAAQL,EAqDjD,QAASiF,GAAiB5E,GACxB,MAAOoE,GAAapE,IAClB0D,EAAS1D,EAAML,WAAakF,GAAe7B,EAAWhD,IAU1D,QAAS8E,GAAUnE,GACjB,MAAO,UAASX,GACd,MAAOW,GAAKX,IAmEhB,QAAS+E,GAAc/E,EAAOgF,GAC5B,GAAIC,GAAQC,GAAQlF,GAChBmF,GAASF,GAASG,GAAYpF,GAC9BqF,GAAUJ,IAAUE,GAASG,GAAStF,GACtCuF,GAAUN,IAAUE,IAAUE,GAAUG,GAAaxF,GACrDyF,EAAcR,GAASE,GAASE,GAAUE,EAC1CzE,EAAS2E,EAAczB,EAAUhE,EAAML,OAAQ+F,WAC/C/F,EAASmB,EAAOnB,MAEpB,KAAK,GAAIgG,KAAO3F,IACTgF,IAAaY,GAAiBpD,KAAKxC,EAAO2F,IACzCF,IAEQ,UAAPE,GAECN,IAAkB,UAAPM,GAA0B,UAAPA,IAE9BJ,IAAkB,UAAPI,GAA0B,cAAPA,GAA8B,cAAPA,IAEtDnB,EAAQmB,EAAKhG,KAElBmB,EAAO+E,KAAKF,EAGhB,OAAO7E,GAaT,QAASgF,GAAY9F,GACnB,GAAI+F,GAAO/F,GAASA,EAAMgG,YACtBC,EAAwB,kBAARF,IAAsBA,EAAKG,WAAcC,EAE7D,OAAOnG,KAAUiG,EAWnB,QAASG,GAAQzF,EAAM0F,GACrB,MAAO,UAASC,GACd,MAAO3F,GAAK0F,EAAUC,KAoB1B,QAASC,GAASC,GAChB,IAAKV,EAAYU,GACf,MAAOC,IAAWD,EAEpB,IAAI1F,KACJ,KAAK,GAAI6E,KAAOvC,QAAOoD,GACjBE,GAAiBlE,KAAKgE,EAAQb,IAAe,eAAPA,GACxC7E,EAAO+E,KAAKF,EAGhB,OAAO7E,GA+BT,QAAS6F,GAAKH,GACZ,MAAO5C,GAAY4C,GAAUzB,EAAcyB,GAAUD,EAASC,GAGhE,QAASI,GAAoBC,GACzB,GAAIC,IAAI,EACJC,EAAMF,EAAKlH,MACf,OAAO,YACH,QAASmH,EAAIC,GAAO/G,MAAO6G,EAAKC,GAAInB,IAAKmB,GAAK,MAItD,QAASE,GAAqBC,GAC1B,GAAIH,IAAI,CACR,OAAO,YACH,GAAII,GAAOD,EAASE,MACpB,OAAID,GAAKE,KACE,MACXN,KACQ9G,MAAOkH,EAAKlH,MAAO2F,IAAKmB,KAIxC,QAASO,GAAqBC,GAC1B,GAAIC,GAAQZ,EAAKW,GACbR,GAAI,EACJC,EAAMQ,EAAM5H,MAChB,OAAO,YACH,GAAIgG,GAAM4B,IAAQT,EAClB,OAAOA,GAAIC,GAAO/G,MAAOsH,EAAI3B,GAAMA,IAAKA,GAAO,MAIvD,QAASsB,GAASJ,GACd,GAAIjD,EAAYiD,GACZ,MAAOD,GAAoBC,EAG/B,IAAII,GAAWO,GAAYX,EAC3B,OAAOI,GAAWD,EAAqBC,GAAYI,EAAqBR,GAG5E,QAASY,GAAStH,GACd,MAAO,YACH,GAAW,OAAPA,EAAa,KAAM,IAAIiB,OAAM,+BACjC,IAAI2C,GAAS5D,CACbA,GAAK,KACL4D,EAAOtD,MAAMrB,KAAMoB,YAI3B,QAASkH,GAAaC,GAClB,MAAO,UAAUL,EAAKpD,EAAUrD,GAU5B,QAAS+G,GAAiB1G,EAAKlB,GAE3B,GADA6H,GAAW,EACP3G,EACAkG,GAAO,EACPvG,EAASK,OAER,CAAA,GAAIlB,IAAU8H,IAAcV,GAAQS,GAAW,EAEhD,MADAT,IAAO,EACAvG,EAAS,KAEVkH,IACNC,KAIR,QAASA,KAEL,IADAD,GAAU,EACHF,EAAUF,IAAUP,GAAM,CAC7B,GAAIa,GAAOC,GACX,IAAa,OAATD,EAKA,MAJAb,IAAO,OACHS,GAAW,GACXhH,EAAS,MAIjBgH,IAAW,EACX3D,EAAS+D,EAAKjI,MAAOiI,EAAKtC,IAAK8B,EAASG,IAE5CG,GAAU,EArCd,GADAlH,EAAWiD,EAAKjD,GAAYgD,GACxB8D,GAAS,IAAML,EACf,MAAOzG,GAAS,KAEpB,IAAIqH,GAAWjB,EAASK,GACpBF,GAAO,EACPS,EAAU,EACVE,GAAU,CAkCdC,MAwBR,QAASG,GAAYtB,EAAMc,EAAOzD,EAAUrD,GACxC6G,EAAaC,GAAOd,EAAMjF,EAAUsC,GAAWrD,GAGnD,QAASuH,GAAQjI,EAAIwH,GACjB,MAAO,UAAUU,EAAUnE,EAAUrD,GACjC,MAAOV,GAAGkI,EAAUV,EAAOzD,EAAUrD,IAK7C,QAASyH,GAAgBzB,EAAM3C,EAAUrD,GASrC,QAAS0H,GAAiBrH,EAAKlB,GACvBkB,EACAL,EAASK,KACCsH,IAAc7I,GAAWK,IAAU8H,IAC7CjH,EAAS,MAZjBA,EAAWiD,EAAKjD,GAAYgD,EAC5B,IAAIM,GAAQ,EACRqE,EAAY,EACZ7I,EAASkH,EAAKlH,MAalB,KAZe,IAAXA,GACAkB,EAAS,MAWNsD,EAAQxE,EAAQwE,IACnBD,EAAS2C,EAAK1C,GAAQA,EAAOsD,EAASc,IAmD9C,QAASE,GAAWtI,GAChB,MAAO,UAAUmH,EAAKpD,EAAUrD,GAC5B,MAAOV,GAAGuI,GAAQpB,EAAK1F,EAAUsC,GAAWrD,IAIpD,QAAS8H,GAAU5G,EAAQ6G,EAAK1E,EAAUrD,GACtCA,EAAWA,GAAYgD,EACvB+E,EAAMA,KACN,IAAIC,MACAC,EAAU,EACVC,EAAYnH,EAAUsC,EAE1BnC,GAAO6G,EAAK,SAAU5I,EAAOgJ,EAAGnI,GAC5B,GAAIsD,GAAQ2E,GACZC,GAAU/I,EAAO,SAAUkB,EAAK+H,GAC5BJ,EAAQ1E,GAAS8E,EACjBpI,EAASK,MAEd,SAAUA,GACTL,EAASK,EAAK2H,KA6EtB,QAASK,GAAgB/I,GACrB,MAAO,UAAUmH,EAAKK,EAAOzD,EAAUrD,GACnC,MAAOV,GAAGuH,EAAaC,GAAQL,EAAK1F,EAAUsC,GAAWrD,IA2EjE,QAASsI,GAAUC,EAAOlF,GAIxB,IAHA,GAAIC,IAAQ,EACRxE,EAAkB,MAATyJ,EAAgB,EAAIA,EAAMzJ,SAE9BwE,EAAQxE,GACXuE,EAASkF,EAAMjF,GAAQA,EAAOiF,MAAW,IAI/C,MAAOA,GAUT,QAASC,GAAcC,GACrB,MAAO,UAAS9C,EAAQtC,EAAUqF,GAMhC,IALA,GAAIpF,IAAQ,EACRkE,EAAWjF,OAAOoD,GAClBgD,EAAQD,EAAS/C,GACjB7G,EAAS6J,EAAM7J,OAEZA,KAAU,CACf,GAAIgG,GAAM6D,EAAMF,EAAY3J,IAAWwE,EACvC,IAAID,EAASmE,EAAS1C,GAAMA,EAAK0C,MAAc,EAC7C,MAGJ,MAAO7B,IAyBX,QAASiD,GAAWjD,EAAQtC,GAC1B,MAAOsC,IAAUkD,GAAQlD,EAAQtC,EAAUyC,GAc7C,QAASgD,GAAcP,EAAOQ,EAAWC,EAAWP,GAIlD,IAHA,GAAI3J,GAASyJ,EAAMzJ,OACfwE,EAAQ0F,GAAaP,EAAY,GAAI,GAEjCA,EAAYnF,MAAYA,EAAQxE,GACtC,GAAIiK,EAAUR,EAAMjF,GAAQA,EAAOiF,GACjC,MAAOjF,EAGX,QAAO,EAUT,QAAS2F,GAAU9J,GACjB,MAAOA,KAAUA,EAanB,QAAS+J,GAAcX,EAAOpJ,EAAO6J,GAInC,IAHA,GAAI1F,GAAQ0F,EAAY,EACpBlK,EAASyJ,EAAMzJ,SAEVwE,EAAQxE,GACf,GAAIyJ,EAAMjF,KAAWnE,EACnB,MAAOmE,EAGX,QAAO,EAYT,QAAS6F,GAAYZ,EAAOpJ,EAAO6J,GACjC,MAAO7J,KAAUA,EACb+J,EAAcX,EAAOpJ,EAAO6J,GAC5BF,EAAcP,EAAOU,EAAWD,GAkQtC,QAASI,GAASb,EAAOlF,GAKvB,IAJA,GAAIC,IAAQ,EACRxE,EAAkB,MAATyJ,EAAgB,EAAIA,EAAMzJ,OACnCmB,EAASjB,MAAMF,KAEVwE,EAAQxE,GACfmB,EAAOqD,GAASD,EAASkF,EAAMjF,GAAQA,EAAOiF,EAEhD,OAAOtI,GAuBT,QAASoJ,GAASlK,GAChB,MAAuB,gBAATA,IACXoE,EAAapE,IAAUgD,EAAWhD,IAAUmK,GAkBjD,QAASC,GAAapK,GAEpB,GAAoB,gBAATA,GACT,MAAOA,EAET,IAAIkF,GAAQlF,GAEV,MAAOiK,GAASjK,EAAOoK,GAAgB,EAEzC,IAAIF,EAASlK,GACX,MAAOqK,IAAiBA,GAAe7H,KAAKxC,GAAS,EAEvD,IAAIc,GAAUd,EAAQ,EACtB,OAAkB,KAAVc,GAAkB,EAAId,IAAWsK,GAAY,KAAOxJ,EAY9D,QAASyJ,GAAUnB,EAAO7J,EAAOiL,GAC/B,GAAIrG,IAAQ,EACRxE,EAASyJ,EAAMzJ,MAEfJ,GAAQ,IACVA,GAASA,EAAQI,EAAS,EAAKA,EAASJ,GAE1CiL,EAAMA,EAAM7K,EAASA,EAAS6K,EAC1BA,EAAM,IACRA,GAAO7K,GAETA,EAASJ,EAAQiL,EAAM,EAAMA,EAAMjL,IAAW,EAC9CA,KAAW,CAGX,KADA,GAAIuB,GAASjB,MAAMF,KACVwE,EAAQxE,GACfmB,EAAOqD,GAASiF,EAAMjF,EAAQ5E,EAEhC,OAAOuB,GAYT,QAAS2J,IAAUrB,EAAO7J,EAAOiL,GAC/B,GAAI7K,GAASyJ,EAAMzJ,MAEnB,OADA6K,GAAc7H,SAAR6H,EAAoB7K,EAAS6K,GAC1BjL,GAASiL,GAAO7K,EAAUyJ,EAAQmB,EAAUnB,EAAO7J,EAAOiL,GAYrE,QAASE,IAAcC,EAAYC,GAGjC,IAFA,GAAIzG,GAAQwG,EAAWhL,OAEhBwE,KAAW6F,EAAYY,EAAYD,EAAWxG,GAAQ,IAAK,IAClE,MAAOA,GAYT,QAAS0G,IAAgBF,EAAYC,GAInC,IAHA,GAAIzG,IAAQ,EACRxE,EAASgL,EAAWhL,SAEfwE,EAAQxE,GAAUqK,EAAYY,EAAYD,EAAWxG,GAAQ,IAAK,IAC3E,MAAOA,GAUT,QAAS2G,IAAaC,GACpB,MAAOA,GAAOC,MAAM,IAwBtB,QAASC,IAAWF,GAClB,MAAOG,IAAavG,KAAKoG,GAsC3B,QAASI,IAAeJ,GACtB,MAAOA,GAAOK,MAAMC,QAUtB,QAASC,IAAcP,GACrB,MAAOE,IAAWF,GACdI,GAAeJ,GACfD,GAAaC,GAwBnB,QAASQ,IAASvL,GAChB,MAAgB,OAATA,EAAgB,GAAKoK,EAAapK,GA4B3C,QAASwL,IAAKT,EAAQU,EAAOC,GAE3B,GADAX,EAASQ,GAASR,GACdA,IAAWW,GAAmB/I,SAAV8I,GACtB,MAAOV,GAAOY,QAAQC,GAAQ,GAEhC,KAAKb,KAAYU,EAAQrB,EAAaqB,IACpC,MAAOV,EAET,IAAIJ,GAAaW,GAAcP,GAC3BH,EAAaU,GAAcG,GAC3BlM,EAAQsL,GAAgBF,EAAYC,GACpCJ,EAAME,GAAcC,EAAYC,GAAc,CAElD,OAAOH,IAAUE,EAAYpL,EAAOiL,GAAKqB,KAAK,IAQhD,QAASC,IAAYnL,GAOjB,MANAA,GAAOA,EAAK4K,WAAWI,QAAQI,GAAgB,IAC/CpL,EAAOA,EAAKyK,MAAMY,IAAS,GAAGL,QAAQ,IAAK,IAC3ChL,EAAOA,EAAOA,EAAKqK,MAAMiB,OACzBtL,EAAOA,EAAKuL,IAAI,SAAU5F,GACtB,MAAOkF,IAAKlF,EAAIqF,QAAQQ,GAAQ,OAuFxC,QAASC,IAAWC,EAAOxL,GACvB,GAAIyL,KAEJ7C,GAAW4C,EAAO,SAAUE,EAAQ5G,GA2BhC,QAAS6G,GAAQ3D,EAAS4D,GACtB,GAAIC,GAAUzC,EAAS0C,EAAQ,SAAUC,GACrC,MAAO/D,GAAQ+D,IAEnBF,GAAQ7G,KAAK4G,GACb7K,EAAU2K,GAAQ9L,MAAM,KAAMiM,GA/BlC,GAAIC,GACAE,EAAYrL,EAAQ+K,GACpBO,GACED,GAA+B,IAAlBN,EAAO5M,QACrBkN,GAA+B,IAAlBN,EAAO5M,MAEzB,IAAIuF,GAAQqH,GACRI,EAASJ,EAAOlN,MAAM,GAAG,GACzBkN,EAASA,EAAOA,EAAO5M,OAAS,GAEhC2M,EAAS3G,GAAOgH,EAAOvK,OAAOuK,EAAOhN,OAAS,EAAI6M,EAAUD,OACzD,IAAIO,EAEPR,EAAS3G,GAAO4G,MACb,CAEH,GADAI,EAASb,GAAYS,GACC,IAAlBA,EAAO5M,SAAiBkN,GAA+B,IAAlBF,EAAOhN,OAC5C,KAAM,IAAIyB,OAAM,yDAIfyL,IAAWF,EAAOI,MAEvBT,EAAS3G,GAAOgH,EAAOvK,OAAOoK,MAYtCQ,GAAKV,EAAUzL,GAOnB,QAASoM,MACL7N,KAAK8N,KAAO9N,KAAK+N,KAAO,KACxB/N,KAAKO,OAAS,EAGlB,QAASyN,IAAWC,EAAKC,GACrBD,EAAI1N,OAAS,EACb0N,EAAIH,KAAOG,EAAIF,KAAOG,EA6E1B,QAASC,IAAMC,EAAQC,EAAaC,GAahC,QAASC,GAAQC,EAAMC,EAAehN,GAClC,GAAgB,MAAZA,GAAwC,kBAAbA,GAC3B,KAAM,IAAIO,OAAM,mCAMpB,IAJA0M,EAAEC,SAAU,EACP7I,GAAQ0I,KACTA,GAAQA,IAEQ,IAAhBA,EAAKjO,QAAgBmO,EAAEE,OAEvB,MAAO1M,IAAe,WAClBwM,EAAEG,SAIV,KAAK,GAAInH,GAAI,EAAGoH,EAAIN,EAAKjO,OAAQmH,EAAIoH,EAAGpH,IAAK,CACzC,GAAII,IACA0G,KAAMA,EAAK9G,GACXjG,SAAUA,GAAYgD,EAGtBgK,GACAC,EAAEK,OAAOC,QAAQlH,GAEjB4G,EAAEK,OAAOtI,KAAKqB,GAIjBmH,IACDA,GAAsB,EACtB/M,GAAe,WACX+M,GAAsB,EACtBP,EAAEQ,aAKd,QAASC,GAAMlC,GACX,MAAO,UAASnL,GACZsN,GAAc,CAEd,KAAK,GAAI1H,GAAI,EAAGoH,EAAI7B,EAAM1M,OAAQmH,EAAIoH,EAAGpH,IAAK,CAC1C,GAAI2H,GAAOpC,EAAMvF,GAEb3C,EAAQ6F,EAAY0E,EAAaD,EAAM,EAC7B,KAAVtK,EACAuK,EAAYC,QACLxK,EAAQ,GACfuK,EAAYE,OAAOzK,EAAO,GAG9BsK,EAAK5N,SAASJ,MAAMgO,EAAMjO,WAEf,MAAPU,GACA4M,EAAEzM,MAAMH,EAAKuN,EAAKb,MAItBY,GAAeV,EAAEL,YAAcK,EAAEe,QACjCf,EAAEgB,cAGFhB,EAAEE,QACFF,EAAEG,QAENH,EAAEQ,WA7EV,GAAmB,MAAfb,EACAA,EAAc,MAEb,IAAmB,IAAhBA,EACJ,KAAM,IAAIrM,OAAM,+BAGpB,IAAI2N,GAAUnN,EAAU4L,GACpBgB,EAAa,EACbE,KAEAL,GAAsB,EAsEtBW,GAAe,EACflB,GACAK,OAAQ,GAAIlB,IACZQ,YAAaA,EACbC,QAASA,EACTuB,UAAWpL,EACXiL,YAAYjL,EACZgL,OAAQpB,EAAc,EACtByB,MAAOrL,EACPoK,MAAOpK,EACPxC,MAAOwC,EACPkK,SAAS,EACToB,QAAQ,EACRtJ,KAAM,SAAU+H,EAAM/M,GAClB8M,EAAQC,GAAM,EAAO/M,IAEzBuO,KAAM,WACFtB,EAAEG,MAAQpK,EACViK,EAAEK,OAAOe,SAEbd,QAAS,SAAUR,EAAM/M,GACrB8M,EAAQC,GAAM,EAAM/M,IAExBwO,OAAQ,SAAUC,GACdxB,EAAEK,OAAOkB,OAAOC,IAEpBhB,QAAS,WAGL,IAAIU,EAAJ,CAIA,IADAA,GAAe,GACRlB,EAAEqB,QAAUX,EAAaV,EAAEL,aAAeK,EAAEK,OAAOxO,QAAO,CAC7D,GAAI0M,MAAYuB,KACZM,EAAIJ,EAAEK,OAAOxO,MACbmO,GAAEJ,UAASQ,EAAIzO,KAAK8P,IAAIrB,EAAGJ,EAAEJ,SACjC,KAAK,GAAI5G,GAAI,EAAGA,EAAIoH,EAAGpH,IAAK,CACxB,GAAIwG,GAAOQ,EAAEK,OAAOQ,OACpBtC,GAAMxG,KAAKyH,GACXoB,EAAY7I,KAAKyH,GACjBM,EAAK/H,KAAKyH,EAAKM,MAGnBY,GAAc,EAEU,IAApBV,EAAEK,OAAOxO,QACTmO,EAAEoB,QAGFV,IAAeV,EAAEL,aACjBK,EAAEmB,WAGN,IAAI9M,GAAKsF,EAAS8G,EAAMlC,GACxB0C,GAAQnB,EAAMzL,GAElB6M,GAAe,IAEnBrP,OAAQ,WACJ,MAAOmO,GAAEK,OAAOxO,QAEpBkI,QAAS,WACL,MAAO2G,IAEXE,YAAa,WACT,MAAOA,IAEXV,KAAM,WACF,MAAOF,GAAEK,OAAOxO,OAAS6O,IAAe,GAE5CgB,MAAO,WACH1B,EAAEqB,QAAS,GAEfM,OAAQ,WACA3B,EAAEqB,UAAW,IACjBrB,EAAEqB,QAAS,EACX7N,GAAewM,EAAEQ,WAGzB,OAAOR,GAgFX,QAAS4B,IAAMlC,EAAQE,GACnB,MAAOH,IAAMC,EAAQ,EAAGE,GA8D5B,QAASiC,IAAO9I,EAAM+I,EAAM1L,EAAUrD,GAClCA,EAAWiD,EAAKjD,GAAYgD,EAC5B,IAAIkF,GAAYnH,EAAUsC,EAC1B2L,IAAahJ,EAAM,SAASiJ,EAAGhJ,EAAGjG,GAC9BkI,EAAU6G,EAAME,EAAG,SAAS5O,EAAK+H,GAC7B2G,EAAO3G,EACPpI,EAASK,MAEd,SAASA,GACRL,EAASK,EAAK0O,KA0CtB,QAASG,MACL,GAAIC,GAAa/F,EAASzJ,UAAWoB,EACrC,OAAO,YACH,GAAIrB,GAAOlB,EAAMmB,WACb0B,EAAO9C,KAEP+C,EAAK5B,EAAKA,EAAKZ,OAAS,EACX,mBAANwC,GACP5B,EAAKwM,MAEL5K,EAAK0B,EAGT8L,GAAOK,EAAYzP,EAAM,SAAS0P,EAAS9P,EAAIgC,GAC3ChC,EAAGM,MAAMyB,EAAM+N,EAAQ7N,OAAO,SAASlB,GACnC,GAAIgP,GAAW7Q,EAAMmB,UAAW,EAChC2B,GAAGjB,EAAKgP,OAGhB,SAAShP,EAAK2H,GACV1G,EAAG1B,MAAMyB,GAAOhB,GAAKkB,OAAOyG,OAsMxC,QAASsH,IAASnQ,GAChB,MAAOA,GAGT,QAASoQ,IAAcC,EAAOC,GAC1B,MAAO,UAASvO,EAAQ6G,EAAK1E,EAAU/B,GACnCA,EAAKA,GAAM0B,CACX,IACI0M,GADAC,GAAa,CAEjBzO,GAAO6G,EAAK,SAAS5I,EAAOgJ,EAAGnI,GAC3BqD,EAASlE,EAAO,SAASkB,EAAKJ,GACtBI,EACAL,EAASK,GACFmP,EAAMvP,KAAYyP,GACzBC,GAAa,EACbD,EAAaD,GAAU,EAAMtQ,GAC7Ba,EAAS,KAAMiH,KAEfjH,OAGT,SAASK,GACJA,EACAiB,EAAGjB,GAEHiB,EAAG,KAAMqO,EAAaD,EAAaD,GAAU,OAM7D,QAASG,IAAexH,EAAG6G,GACvB,MAAOA,GAsFX,QAASY,IAAY9D,GACjB,MAAO,UAAUzM,GACb,GAAII,GAAOlB,EAAMmB,UAAW,EAC5BD,GAAKsF,KAAK,SAAU3E,GAChB,GAAIX,GAAOlB,EAAMmB,UAAW,EACL,iBAAZmQ,WACHzP,EACIyP,QAAQtP,OACRsP,QAAQtP,MAAMH,GAEXyP,QAAQ/D,IACfzD,EAAU5I,EAAM,SAAUuP,GACtBa,QAAQ/D,GAAMkD,QAK9BlO,EAAUzB,GAAIM,MAAM,KAAMF,IAuDlC,QAASqQ,IAASzQ,EAAIwE,EAAM9D,GAKxB,QAASsG,GAAKjG,GACV,GAAIA,EAAK,MAAOL,GAASK,EACzB,IAAIX,GAAOlB,EAAMmB,UAAW,EAC5BD,GAAKsF,KAAKwK,GACVQ,EAAMpQ,MAAMrB,KAAMmB,GAGtB,QAAS8P,GAAMnP,EAAK4P,GAChB,MAAI5P,GAAYL,EAASK,GACpB4P,MACLC,GAAI5J,GADetG,EAAS,MAbhCA,EAAW4G,EAAS5G,GAAYgD,EAChC,IAAIkN,GAAMnP,EAAUzB,GAChB0Q,EAAQjP,EAAU+C,EAetB0L,GAAM,MAAM,GA0BhB,QAASW,IAAS9M,EAAUS,EAAM9D,GAC9BA,EAAW4G,EAAS5G,GAAYgD,EAChC,IAAIkF,GAAYnH,EAAUsC,GACtBiD,EAAO,SAASjG,GAChB,GAAIA,EAAK,MAAOL,GAASK,EACzB,IAAIX,GAAOlB,EAAMmB,UAAW,EAC5B,OAAImE,GAAKlE,MAAMrB,KAAMmB,GAAcwI,EAAU5B,OAC7CtG,GAASJ,MAAM,MAAO,MAAM2B,OAAO7B,IAEvCwI,GAAU5B,GAuBd,QAAS8J,IAAQ/M,EAAUS,EAAM9D,GAC7BmQ,GAAS9M,EAAU,WACf,OAAQS,EAAKlE,MAAMrB,KAAMoB,YAC1BK,GAuCP,QAASqQ,IAAOvM,EAAMxE,EAAIU,GAKtB,QAASsG,GAAKjG,GACV,MAAIA,GAAYL,EAASK,OACzB2P,GAAMR,GAGV,QAASA,GAAMnP,EAAK4P,GAChB,MAAI5P,GAAYL,EAASK,GACpB4P,MACLC,GAAI5J,GADetG,EAAS,MAXhCA,EAAW4G,EAAS5G,GAAYgD,EAChC,IAAIkN,GAAMnP,EAAUzB,GAChB0Q,EAAQjP,EAAU+C,EAatBkM,GAAMR,GAGV,QAASc,IAAcjN,GACnB,MAAO,UAAUlE,EAAOmE,EAAOtD,GAC3B,MAAOqD,GAASlE,EAAOa,IA6D/B,QAASuQ,IAAUvK,EAAM3C,EAAUrD,GAC/B6H,GAAO7B,EAAMsK,GAAcvP,EAAUsC,IAAYrD,GAuBrD,QAASwQ,IAAYxK,EAAMc,EAAOzD,EAAUrD,GACxC6G,EAAaC,GAAOd,EAAMsK,GAAcvP,EAAUsC,IAAYrD,GA2DlE,QAASyQ,IAAYnR,GACjB,MAAIqB,GAAQrB,GAAYA,EACjBS,GAAc,SAAUL,EAAMM,GACjC,GAAI0Q,IAAO,CACXhR,GAAKsF,KAAK,WACN,GAAI2L,GAAYhR,SACZ+Q,GACAjQ,GAAe,WACXT,EAASJ,MAAM,KAAM+Q,KAGzB3Q,EAASJ,MAAM,KAAM+Q,KAG7BrR,EAAGM,MAAMrB,KAAMmB,GACfgR,GAAO,IAIf,QAASE,IAAMxI,GACX,OAAQA,EAmFZ,QAASyI,IAAa/L,GACpB,MAAO,UAASa,GACd,MAAiB,OAAVA,EAAiB7D,OAAY6D,EAAOb,IAI/C,QAASgM,IAAY5P,EAAQ6G,EAAK1E,EAAUrD,GACxC,GAAI+Q,GAAc,GAAI/R,OAAM+I,EAAIjJ,OAChCoC,GAAO6G,EAAK,SAAUkH,EAAG3L,EAAOtD,GAC5BqD,EAAS4L,EAAG,SAAU5O,EAAK+H,GACvB2I,EAAYzN,KAAW8E,EACvBpI,EAASK,MAEd,SAAUA,GACT,GAAIA,EAAK,MAAOL,GAASK,EAEzB,KAAK,GADD2H,MACK/B,EAAI,EAAGA,EAAI8B,EAAIjJ,OAAQmH,IACxB8K,EAAY9K,IAAI+B,EAAQhD,KAAK+C,EAAI9B,GAEzCjG,GAAS,KAAMgI,KAIvB,QAASgJ,IAAc9P,EAAQ8E,EAAM3C,EAAUrD,GAC3C,GAAIgI,KACJ9G,GAAO8E,EAAM,SAAUiJ,EAAG3L,EAAOtD,GAC7BqD,EAAS4L,EAAG,SAAU5O,EAAK+H,GACnB/H,EACAL,EAASK,IAEL+H,GACAJ,EAAQhD,MAAM1B,MAAOA,EAAOnE,MAAO8P,IAEvCjP,QAGT,SAAUK,GACLA,EACAL,EAASK,GAETL,EAAS,KAAMoJ,EAASpB,EAAQiJ,KAAK,SAAUC,EAAGC,GAC9C,MAAOD,GAAE5N,MAAQ6N,EAAE7N,QACnBuN,GAAa,aAK7B,QAASO,IAAQlQ,EAAQ8E,EAAM3C,EAAUrD,GACrC,GAAIqR,GAAStO,EAAYiD,GAAQ8K,GAAcE,EAC/CK,GAAOnQ,EAAQ8E,EAAMjF,EAAUsC,GAAWrD,GAAYgD,GAqG1D,QAASsO,IAAQhS,EAAIiS,GAIjB,QAASjL,GAAKjG,GACV,MAAIA,GAAYkG,EAAKlG,OACrBuN,GAAKtH,GALT,GAAIC,GAAOK,EAAS2K,GAAWvO,GAC3B4K,EAAO7M,EAAU0P,GAAYnR,GAMjCgH,KAiKJ,QAASkL,IAAe/K,EAAKK,EAAOzD,EAAUrD,GAC1CA,EAAWiD,EAAKjD,GAAYgD,EAC5B,IAAIyO,MACAvJ,EAAYnH,EAAUsC,EAC1BiE,GAAYb,EAAKK,EAAO,SAAS4K,EAAK5M,EAAKwB,GACvC4B,EAAUwJ,EAAK5M,EAAK,SAAUzE,EAAKJ,GAC/B,MAAII,GAAYiG,EAAKjG,IACrBoR,EAAO3M,GAAO7E,MACdqG,SAEL,SAAUjG,GACTL,EAASK,EAAKoR,KAwEtB,QAASE,IAAIlL,EAAK3B,GACd,MAAOA,KAAO2B,GAwClB,QAASmL,IAAQtS,EAAIuS,GACjB,GAAI9C,GAAOxM,OAAOuP,OAAO,MACrBC,EAASxP,OAAOuP,OAAO,KAC3BD,GAASA,GAAUvC,EACnB,IAAIY,GAAMnP,EAAUzB,GAChB0S,EAAWjS,GAAc,SAAkBL,EAAMM,GACjD,GAAI8E,GAAM+M,EAAOjS,MAAM,KAAMF,EACzBiS,IAAI5C,EAAMjK,GACVrE,GAAe,WACXT,EAASJ,MAAM,KAAMmP,EAAKjK,MAEvB6M,GAAII,EAAQjN,GACnBiN,EAAOjN,GAAKE,KAAKhF,IAEjB+R,EAAOjN,IAAQ9E,GACfkQ,EAAItQ,MAAM,KAAMF,EAAK6B,OAAO,WACxB,GAAI7B,GAAOlB,EAAMmB,UACjBoP,GAAKjK,GAAOpF,CACZ,IAAIuN,GAAI8E,EAAOjN,SACRiN,GAAOjN,EACd,KAAK,GAAImB,GAAI,EAAGoH,EAAIJ,EAAEnO,OAAQmH,EAAIoH,EAAGpH,IACjCgH,EAAEhH,GAAGrG,MAAM,KAAMF,QAOjC,OAFAsS,GAASjD,KAAOA,EAChBiD,EAASC,WAAa3S,EACf0S,EA8CX,QAASE,IAAUhR,EAAQsK,EAAOxL,GAC9BA,EAAWA,GAAYgD,CACvB,IAAIgF,GAAUjF,EAAYyI,QAE1BtK,GAAOsK,EAAO,SAAUoC,EAAM9I,EAAK9E,GAC/Be,EAAU6M,GAAM,SAAUvN,EAAKJ,GACvBN,UAAUb,OAAS,IACnBmB,EAASzB,EAAMmB,UAAW,IAE9BqI,EAAQlD,GAAO7E,EACfD,EAASK,MAEd,SAAUA,GACTL,EAASK,EAAK2H,KAyEtB,QAASmK,IAAc3G,EAAOxL,GAC1BkS,GAAUrK,GAAQ2D,EAAOxL,GAsB7B,QAASoS,IAAgB5G,EAAO1E,EAAO9G,GACnCkS,GAAUrL,EAAaC,GAAQ0E,EAAOxL,GA+N1C,QAASqS,IAAK7G,EAAOxL,GAEjB,GADAA,EAAWiD,EAAKjD,GAAYgD,IACvBqB,GAAQmH,GAAQ,MAAOxL,GAAS,GAAIsS,WAAU,wDACnD,KAAK9G,EAAM1M,OAAQ,MAAOkB,IAC1B,KAAK,GAAIiG,GAAI,EAAGoH,EAAI7B,EAAM1M,OAAQmH,EAAIoH,EAAGpH,IACrClF,EAAUyK,EAAMvF,IAAIjG,GA0B5B,QAASuS,IAAahK,EAAOwG,EAAM1L,EAAUrD,GACzC,GAAIwS,GAAWhU,EAAM+J,GAAOkK,SAC5B3D,IAAO0D,EAAUzD,EAAM1L,EAAUrD,GA0CrC,QAAS0S,IAAQpT,GACb,GAAI4Q,GAAMnP,EAAUzB,EACpB,OAAOS,IAAc,SAAmBL,EAAMiT,GAe1C,MAdAjT,GAAKsF,KAAK,SAAkBxE,EAAOoS,GAC/B,GAAIpS,EACAmS,EAAgB,MAAQnS,MAAOA,QAC5B,CACH,GAAIrB,EAEAA,GADAQ,UAAUb,QAAU,EACZ8T,EAEApU,EAAMmB,UAAW,GAE7BgT,EAAgB,MAAQxT,MAAOA,OAIhC+Q,EAAItQ,MAAMrB,KAAMmB,KAuE/B,QAASmT,IAAWrH,GAChB,GAAIxD,EASJ,OARI3D,IAAQmH,GACRxD,EAAUoB,EAASoC,EAAOkH,KAE1B1K,KACAY,EAAW4C,EAAO,SAASoC,EAAM9I,GAC7BkD,EAAQlD,GAAO4N,GAAQ/Q,KAAKpD,KAAMqP,MAGnC5F,EAGX,QAAS8K,IAAS5R,EAAQ6G,EAAK1E,EAAUrD,GACrCoR,GAAQlQ,EAAQ6G,EAAK,SAAS5I,EAAOmC,GACjC+B,EAASlE,EAAO,SAASkB,EAAK+H,GAC1B9G,EAAGjB,GAAM+H,MAEdpI,GA2FP,QAAS+S,IAAW5T,GAClB,MAAO,YACL,MAAOA,IAwFX,QAAS6T,IAAMC,EAAMrF,EAAM5N,GASvB,QAASkT,GAAWC,EAAKC,GACrB,GAAiB,gBAANA,GACPD,EAAIE,OAASD,EAAEC,OAASC,EAExBH,EAAII,aAAqC,kBAAfH,GAAEI,SACxBJ,EAAEI,SACFT,IAAYK,EAAEI,UAAYC,GAE9BN,EAAIO,YAAcN,EAAEM,gBACjB,CAAA,GAAiB,gBAANN,IAA+B,gBAANA,GAGvC,KAAM,IAAI7S,OAAM,oCAFhB4S,GAAIE,OAASD,GAAKE,GAqB1B,QAASK,KACLC,EAAM,SAASvT,GACPA,GAAOwT,IAAYC,EAAQT,QACI,kBAAvBS,GAAQJ,aACZI,EAAQJ,YAAYrT,IACxBd,WAAWoU,EAAcG,EAAQP,aAAaM,IAE9C7T,EAASJ,MAAM,KAAMD,aA9CjC,GAAI2T,GAAgB,EAChBG,EAAmB,EAEnBK,GACAT,MAAOC,EACPC,aAAcR,GAAWU,GA2B7B,IARI9T,UAAUb,OAAS,GAAqB,kBAATmU,IAC/BjT,EAAW4N,GAAQ5K,EACnB4K,EAAOqF,IAEPC,EAAWY,EAASb,GACpBjT,EAAWA,GAAYgD,GAGP,kBAAT4K,GACP,KAAM,IAAIrN,OAAM,oCAGpB,IAAIqT,GAAQ7S,EAAU6M,GAElBiG,EAAU,CAadF,KAgHJ,QAASI,IAAOvI,EAAOxL,GACnBkS,GAAUlD,GAAcxD,EAAOxL,GA+HnC,QAASgU,IAAQhO,EAAM3C,EAAUrD,GAY7B,QAASiU,GAAWC,EAAMC,GACtB,GAAIjD,GAAIgD,EAAKE,SAAUjD,EAAIgD,EAAMC,QACjC,OAAOlD,GAAIC,GAAI,EAAKD,EAAIC,EAAI,EAAI,EAbpC,GAAIjJ,GAAYnH,EAAUsC,EAC1BgI,IAAIrF,EAAM,SAAUiJ,EAAGjP,GACnBkI,EAAU+G,EAAG,SAAU5O,EAAK+T,GACxB,MAAI/T,GAAYL,EAASK,OACzBL,GAAS,MAAOb,MAAO8P,EAAGmF,SAAUA,OAEzC,SAAU/T,EAAK2H,GACd,MAAI3H,GAAYL,EAASK,OACzBL,GAAS,KAAMoJ,EAASpB,EAAQiJ,KAAKgD,GAAapD,GAAa,aAkDvE,QAASwD,IAAQrT,EAASsT,EAAcC,GACpC,GAAIjV,GAAKyB,EAAUC,EAEnB,OAAOjB,IAAc,SAAUL,EAAMM,GAIjC,QAASwU,KACL,GAAIzI,GAAO/K,EAAQ+K,MAAQ,YACvBvL,EAAS,GAAID,OAAM,sBAAwBwL,EAAO,eACtDvL,GAAMiU,KAAO,YACTF,IACA/T,EAAM+T,KAAOA,GAEjBG,GAAW,EACX1U,EAASQ,GAXb,GACImU,GADAD,GAAW,CAcfhV,GAAKsF,KAAK,WACD0P,IACD1U,EAASJ,MAAM,KAAMD,WACrBiV,aAAaD,MAKrBA,EAAQpV,WAAWiV,EAAiBF,GACpChV,EAAGM,MAAM,KAAMF,KAmBvB,QAASmV,IAAUnW,EAAOiL,EAAKmL,EAAMrM,GAKnC,IAJA,GAAInF,IAAQ,EACRxE,EAASiW,GAAUC,IAAYrL,EAAMjL,IAAUoW,GAAQ,IAAK,GAC5D7U,EAASjB,MAAMF,GAEZA,KACLmB,EAAOwI,EAAY3J,IAAWwE,GAAS5E,EACvCA,GAASoW,CAEX,OAAO7U,GAmBT,QAASgV,IAAUC,EAAOpO,EAAOzD,EAAUrD,GACvC,GAAIkI,GAAYnH,EAAUsC,EAC1B8R,IAASN,GAAU,EAAGK,EAAO,GAAIpO,EAAOoB,EAAWlI,GA+FvD,QAASwF,IAAWQ,EAAMoP,EAAa/R,EAAUrD,GACzCL,UAAUb,QAAU,IACpBkB,EAAWqD,EACXA,EAAW+R,EACXA,EAAc/Q,GAAQ2B,UAE1BhG,EAAWiD,EAAKjD,GAAYgD,EAC5B,IAAIkF,GAAYnH,EAAUsC,EAE1BwE,IAAO7B,EAAM,SAASoC,EAAGiN,EAAG/T,GACxB4G,EAAUkN,EAAahN,EAAGiN,EAAG/T,IAC9B,SAASjB,GACRL,EAASK,EAAK+U,KAyCtB,QAASE,IAAQ9J,EAAOxL,GACpB,GACIC,GADAO,EAAQ,IAEZR,GAAWA,GAAYgD,EACvBuS,GAAW/J,EAAO,SAASoC,EAAM5N,GAC7Be,EAAU6M,GAAM,SAAUvN,EAAKmV,GAEvBvV,EADAN,UAAUb,OAAS,EACVN,EAAMmB,UAAW,GAEjB6V,EAEbhV,EAAQH,EACRL,GAAUK,MAEf,WACCL,EAASQ,EAAOP,KAiBxB,QAASwV,IAAUnW,GACf,MAAO,YACH,OAAQA,EAAG2S,YAAc3S,GAAIM,MAAM,KAAMD,YAsCjD,QAAS+V,IAAO5R,EAAMT,EAAUrD,GAC5BA,EAAW4G,EAAS5G,GAAYgD,EAChC,IAAIkF,GAAYnH,EAAUsC,EAC1B,KAAKS,IAAQ,MAAO9D,GAAS,KAC7B,IAAIsG,GAAO,SAASjG,GAChB,GAAIA,EAAK,MAAOL,GAASK,EACzB,IAAIyD,IAAQ,MAAOoE,GAAU5B,EAC7B,IAAI5G,GAAOlB,EAAMmB,UAAW,EAC5BK,GAASJ,MAAM,MAAO,MAAM2B,OAAO7B,IAEvCwI,GAAU5B,GAyBd,QAASqP,IAAM7R,EAAMT,EAAUrD,GAC3B0V,GAAO,WACH,OAAQ5R,EAAKlE,MAAMrB,KAAMoB,YAC1B0D,EAAUrD,GAzkKjB,GA8DI4V,IA9DAhW,GAAQ,SAASN,GACjB,GAAII,GAAOlB,EAAMmB,UAAW,EAC5B,OAAO,YACH,GAAIkW,GAAWrX,EAAMmB,UACrB,OAAOL,GAAGM,MAAM,KAAMF,EAAK6B,OAAOsU,MAItC9V,GAAgB,SAAUT,GAC1B,MAAO,YACH,GAAII,GAAOlB,EAAMmB,WACbK,EAAWN,EAAKwM,KACpB5M,GAAGqC,KAAKpD,KAAMmB,EAAMM,KAkCxB8V,GAA0C,kBAAjBC,eAA+BA,aACxDC,GAAiC,gBAAZvI,UAAoD,kBAArBA,SAAQwI,QAkB5DL,IADAE,GACSC,aACFC,GACEvI,QAAQwI,SAER5W,CAGb,IAAIoB,IAAiBjB,EAAKoW,IA2FtBhV,GAAmC,kBAAXC,QA6BxBqV,GAA8B,gBAAVlY,SAAsBA,QAAUA,OAAOuE,SAAWA,QAAUvE,OAGhFmY,GAA0B,gBAARC,OAAoBA,MAAQA,KAAK7T,SAAWA,QAAU6T,KAGxEC,GAAOH,IAAcC,IAAYG,SAAS,iBAG1CC,GAAWF,GAAKxV,OAGhB2V,GAAcjU,OAAO8C,UAGrB3D,GAAiB8U,GAAY9U,eAO7BM,GAAuBwU,GAAY9L,SAGnC9I,GAAmB2U,GAAWA,GAASzV,YAAcgB,OA8BrD2U,GAAgBlU,OAAO8C,UAOvBnD,GAAyBuU,GAAc/L,SAcvCrI,GAAU,gBACVD,GAAe,qBAGfE,GAAiBiU,GAAWA,GAASzV,YAAcgB,OAmBnDa,GAAW,yBACXF,GAAU,oBACVC,GAAS,6BACTE,GAAW,iBA8BXE,GAAmB,iBAgEnBmE,MA2BAyP,GAAmC,kBAAX7V,SAAyBA,OAAOuF,SAExDO,GAAc,SAAUX,GACxB,MAAO0Q,KAAkB1Q,EAAK0Q,KAAmB1Q,EAAK0Q,OAmDtDjT,GAAU,qBAcVkT,GAAgBpU,OAAO8C,UAGvBuR,GAAmBD,GAAcjV,eAGjCmV,GAAuBF,GAAcE,qBAoBrCtS,GAAcf,EAAgB,WAAa,MAAO7D,eAAkB6D,EAAkB,SAASrE,GACjG,MAAOoE,GAAapE,IAAUyX,GAAiBjV,KAAKxC,EAAO,YACxD0X,GAAqBlV,KAAKxC,EAAO,WA0BlCkF,GAAUrF,MAAMqF,QAoBhByS,GAAgC,gBAAX5Y,IAAuBA,IAAYA,EAAQ6Y,UAAY7Y,EAG5E8Y,GAAaF,IAAgC,gBAAV3Y,SAAsBA,SAAWA,OAAO4Y,UAAY5Y,OAGvF8Y,GAAgBD,IAAcA,GAAW9Y,UAAY4Y,GAGrDI,GAASD,GAAgBZ,GAAKa,OAASpV,OAGvCqV,GAAiBD,GAASA,GAAOzS,SAAW3C,OAmB5C2C,GAAW0S,IAAkBzT,EAG7BE,GAAqB,iBAGrBC,GAAW,mBAqBXuT,GAAY,qBACZC,GAAW,iBACXC,GAAU,mBACVC,GAAU,gBACVC,GAAW,iBACXC,GAAY,oBACZC,GAAS,eACTC,GAAY,kBACZC,GAAY,kBACZC,GAAY,kBACZC,GAAS,eACTC,GAAY,kBACZC,GAAa,mBAEbC,GAAiB,uBACjBC,GAAc,oBACdC,GAAa,wBACbC,GAAa,wBACbC,GAAU,qBACVC,GAAW,sBACXC,GAAW,sBACXC,GAAW,sBACXC,GAAkB,6BAClBC,GAAY,uBACZC,GAAY,uBAGZ3U,KACJA,IAAemU,IAAcnU,GAAeoU,IAC5CpU,GAAeqU,IAAWrU,GAAesU,IACzCtU,GAAeuU,IAAYvU,GAAewU,IAC1CxU,GAAeyU,IAAmBzU,GAAe0U,IACjD1U,GAAe2U,KAAa,EAC5B3U,GAAeoT,IAAapT,GAAeqT,IAC3CrT,GAAeiU,IAAkBjU,GAAesT,IAChDtT,GAAekU,IAAelU,GAAeuT,IAC7CvT,GAAewT,IAAYxT,GAAeyT,IAC1CzT,GAAe0T,IAAU1T,GAAe2T,IACxC3T,GAAe4T,IAAa5T,GAAe6T,IAC3C7T,GAAe8T,IAAU9T,GAAe+T,IACxC/T,GAAegU,KAAc,CA4B7B,IAAIY,IAAkC,gBAAX1a,IAAuBA,IAAYA,EAAQ6Y,UAAY7Y,EAG9E2a,GAAeD,IAAkC,gBAAVza,SAAsBA,SAAWA,OAAO4Y,UAAY5Y,OAG3F2a,GAAkBD,IAAgBA,GAAa3a,UAAY0a,GAG3DG,GAAcD,IAAmB5C,GAAWzI,QAG5CuL,GAAY,WACd,IAEE,GAAIC,GAAQJ,IAAgBA,GAAaK,SAAWL,GAAaK,QAAQ,QAAQD,KAEjF,OAAIA,GACKA,EAIFF,IAAeA,GAAYI,SAAWJ,GAAYI,QAAQ,QACjE,MAAOjZ,QAIPkZ,GAAmBJ,IAAYA,GAASrU,aAmBxCA,GAAeyU,GAAmBnV,EAAUmV,IAAoBrV,EAGhEsV,GAAgB9W,OAAO8C,UAGvBN,GAAmBsU,GAAc3X,eAsCjC4D,GAAgB/C,OAAO8C,UA+BvBO,GAAaL,EAAQhD,OAAOuD,KAAMvD,QAGlC+W,GAAgB/W,OAAO8C,UAGvBQ,GAAmByT,GAAc5X,eA0MjC6X,GAAgBhS,EAAQD,EAAakS,EAAAA,GAyCrC3R,GAAS,SAAS7B,EAAM3C,EAAUrD,GAClC,GAAIyZ,GAAuB1W,EAAYiD,GAAQyB,EAAkB8R,EACjEE,GAAqBzT,EAAMjF,EAAUsC,GAAWrD,IA+DhDqL,GAAMzD,EAAWE,GAmCjB4R,GAAYzY,EAAYoK,IA2BxB8J,GAAW9M,EAAgBP,GAoB3B6R,GAAYpS,EAAQ4N,GAAU,GAqB9ByE,GAAkB3Y,EAAY0Y,IA0D9B9Q,GAAUL,IAoKV2D,GAAO,SAAUX,EAAOoB,EAAa5M,GAiErC,QAAS6Z,GAAY/U,EAAK8I,GACtBkM,EAAW9U,KAAK,WACZ+U,EAAQjV,EAAK8I,KAIrB,QAASoM,KACL,GAA0B,IAAtBF,EAAWhb,QAAiC,IAAjBmb,EAC3B,MAAOja,GAAS,KAAMgI,EAE1B,MAAM8R,EAAWhb,QAAUmb,EAAerN,GAAa,CACnD,GAAIsN,GAAMJ,EAAWhM,OACrBoM,MAKR,QAASC,GAAYC,EAAU9a,GAC3B,GAAI+a,GAAgBC,EAAUF,EACzBC,KACDA,EAAgBC,EAAUF,OAG9BC,EAAcrV,KAAK1F,GAGvB,QAASib,GAAaH,GAClB,GAAIC,GAAgBC,EAAUF,MAC9B9R,GAAU+R,EAAe,SAAU/a,GAC/BA,MAEJ0a,IAIJ,QAASD,GAAQjV,EAAK8I,GAClB,IAAI4M,EAAJ,CAEA,GAAIC,GAAe7T,EAAS,SAASvG,EAAKJ,GAKtC,GAJAga,IACIta,UAAUb,OAAS,IACnBmB,EAASzB,EAAMmB,UAAW,IAE1BU,EAAK,CACL,GAAIqa,KACJ9R,GAAWZ,EAAS,SAAS0J,EAAKiJ,GAC9BD,EAAYC,GAAQjJ,IAExBgJ,EAAY5V,GAAO7E,EACnBua,GAAW,EACXF,EAAY/X,OAAOuP,OAAO,MAE1B9R,EAASK,EAAKqa,OAEd1S,GAAQlD,GAAO7E,EACfsa,EAAazV,IAIrBmV,IACA,IAAIvO,GAAS3K,EAAU6M,EAAKA,EAAK9O,OAAS,GACtC8O,GAAK9O,OAAS,EACd4M,EAAO1D,EAASyS,GAEhB/O,EAAO+O,IAIf,QAASG,KAML,IAFA,GAAIC,GACA5S,EAAU,EACP6S,EAAahc,QAChB+b,EAAcC,EAAa5O,MAC3BjE,IACAK,EAAUyS,EAAcF,GAAc,SAAUG,GACD,MAArCC,EAAsBD,IACxBF,EAAa9V,KAAKgW,IAK9B,IAAI/S,IAAYiT,EACZ,KAAM,IAAI3a,OACN,iEAKZ,QAASwa,GAAcX,GACnB,GAAIna,KAMJ,OALA2I,GAAW4C,EAAO,SAAUoC,EAAM9I,GAC1BT,GAAQuJ,IAASzE,EAAYyE,EAAMwM,EAAU,IAAM,GACnDna,EAAO+E,KAAKF,KAGb7E,EAlKgB,kBAAhB2M,KAEP5M,EAAW4M,EACXA,EAAc,MAElB5M,EAAWiD,EAAKjD,GAAYgD,EAC5B,IAAImY,GAAUrV,EAAK0F,GACf0P,EAAWC,EAAQrc,MACvB,KAAKoc,EACD,MAAOlb,GAAS,KAEf4M,KACDA,EAAcsO,EAGlB,IAAIlT,MACAiS,EAAe,EACfO,GAAW,EAEXF,EAAY/X,OAAOuP,OAAO,MAE1BgI,KAGAgB,KAEAG,IAEJrS,GAAW4C,EAAO,SAAUoC,EAAM9I,GAC9B,IAAKT,GAAQuJ,GAIT,MAFAiM,GAAY/U,GAAM8I,QAClBkN,GAAa9V,KAAKF,EAItB,IAAIsW,GAAexN,EAAKpP,MAAM,EAAGoP,EAAK9O,OAAS,GAC3Cuc,EAAwBD,EAAatc,MACzC,OAA8B,KAA1Buc,GACAxB,EAAY/U,EAAK8I,OACjBkN,GAAa9V,KAAKF,KAGtBmW,EAAsBnW,GAAOuW,MAE7B/S,GAAU8S,EAAc,SAAUE,GAC9B,IAAK9P,EAAM8P,GACP,KAAM,IAAI/a,OAAM,oBAAsBuE,EAClC,oCACAwW,EAAiB,QACjBF,EAAapQ,KAAK,MAE1BmP,GAAYmB,EAAgB,WACxBD,IAC8B,IAA1BA,GACAxB,EAAY/U,EAAK8I,UAMjCgN,IACAZ,KA6HA1Q,GAAY,kBAyBZG,GAAW,EAAI,EAGf8R,GAAchF,GAAWA,GAASlR,UAAYvD,OAC9C0H,GAAiB+R,GAAcA,GAAY7Q,SAAW5I,OAoHtD0Z,GAAgB,kBAChBC,GAAoB,kBACpBC,GAAwB,kBACxBC,GAAsB,kBACtBC,GAAeH,GAAoBC,GAAwBC,GAC3DE,GAAa,iBAGbC,GAAQ,UAGRzR,GAAe0R,OAAO,IAAMD,GAAQN,GAAiBI,GAAeC,GAAa,KAcjFG,GAAkB,kBAClBC,GAAsB,kBACtBC,GAA0B,kBAC1BC,GAAwB,kBACxBC,GAAiBH,GAAsBC,GAA0BC,GACjEE,GAAe,iBAGfC,GAAW,IAAMN,GAAkB,IACnCO,GAAU,IAAMH,GAAiB,IACjCI,GAAS,2BACTC,GAAa,MAAQF,GAAU,IAAMC,GAAS,IAC9CE,GAAc,KAAOV,GAAkB,IACvCW,GAAa,kCACbC,GAAa,qCACbC,GAAU,UAGVC,GAAWL,GAAa,IACxBM,GAAW,IAAMV,GAAe,KAChCW,GAAY,MAAQH,GAAU,OAASH,GAAaC,GAAYC,IAAY5R,KAAK,KAAO,IAAM+R,GAAWD,GAAW,KACpHG,GAAQF,GAAWD,GAAWE,GAC9BE,GAAW,OAASR,GAAcH,GAAU,IAAKA,GAASI,GAAYC,GAAYN,IAAUtR,KAAK,KAAO,IAGxGR,GAAYuR,OAAOS,GAAS,MAAQA,GAAS,KAAOU,GAAWD,GAAO,KAoDtElS,GAAS,aAwCTI,GAAU,qDACVC,GAAe,IACfE,GAAS,eACTJ,GAAiB,kCAsJrBkB,IAAI/G,UAAU8X,WAAa,SAAS1Q,GAQhC,MAPIA,GAAK2Q,KAAM3Q,EAAK2Q,KAAK9W,KAAOmG,EAAKnG,KAChC/H,KAAK8N,KAAOI,EAAKnG,KAClBmG,EAAKnG,KAAMmG,EAAKnG,KAAK8W,KAAO3Q,EAAK2Q,KAChC7e,KAAK+N,KAAOG,EAAK2Q,KAEtB3Q,EAAK2Q,KAAO3Q,EAAKnG,KAAO,KACxB/H,KAAKO,QAAU,EACR2N,GAGXL,GAAI/G,UAAUgJ,MAAQ,WAClB,KAAM9P,KAAK8N,MAAM9N,KAAKuP,OACtB,OAAOvP,OAGX6N,GAAI/G,UAAUgY,YAAc,SAAS5Q,EAAM6Q,GACvCA,EAAQF,KAAO3Q,EACf6Q,EAAQhX,KAAOmG,EAAKnG,KAChBmG,EAAKnG,KAAMmG,EAAKnG,KAAK8W,KAAOE,EAC3B/e,KAAK+N,KAAOgR,EACjB7Q,EAAKnG,KAAOgX,EACZ/e,KAAKO,QAAU,GAGnBsN,GAAI/G,UAAUkY,aAAe,SAAS9Q,EAAM6Q,GACxCA,EAAQF,KAAO3Q,EAAK2Q,KACpBE,EAAQhX,KAAOmG,EACXA,EAAK2Q,KAAM3Q,EAAK2Q,KAAK9W,KAAOgX,EAC3B/e,KAAK8N,KAAOiR,EACjB7Q,EAAK2Q,KAAOE,EACZ/e,KAAKO,QAAU,GAGnBsN,GAAI/G,UAAUkI,QAAU,SAASd,GACzBlO,KAAK8N,KAAM9N,KAAKgf,aAAahf,KAAK8N,KAAMI,GACvCF,GAAWhO,KAAMkO,IAG1BL,GAAI/G,UAAUL,KAAO,SAASyH,GACtBlO,KAAK+N,KAAM/N,KAAK8e,YAAY9e,KAAK+N,KAAMG,GACtCF,GAAWhO,KAAMkO,IAG1BL,GAAI/G,UAAUyI,MAAQ,WAClB,MAAOvP,MAAK8N,MAAQ9N,KAAK4e,WAAW5e,KAAK8N,OAG7CD,GAAI/G,UAAU6G,IAAM,WAChB,MAAO3N,MAAK+N,MAAQ/N,KAAK4e,WAAW5e,KAAK+N,OAG7CF,GAAI/G,UAAUmY,QAAU,WAGpB,IAAI,GAFAzV,GAAM/I,MAAMT,KAAKO,QACjB2e,EAAOlf,KAAK8N,KACRpN,EAAM,EAAGA,EAAMV,KAAKO,OAAQG,IAChC8I,EAAI9I,GAAOwe,EAAK1Q,KAChB0Q,EAAOA,EAAKnX,IAEhB,OAAOyB,IAGXqE,GAAI/G,UAAUmJ,OAAS,SAAUC,GAE7B,IADA,GAAIgP,GAAOlf,KAAK8N,KACRoR,GAAM,CACV,GAAInX,GAAOmX,EAAKnX,IACZmI,GAAOgP,IACPlf,KAAK4e,WAAWM,GAEpBA,EAAOnX,EAEX,MAAO/H,MA0QX,IAi3CImf,IAj3CA1O,GAAezH,EAAQD,EAAa,GAyJpCqW,GAAU,WACV,MAAOzO,IAAItP,MAAM,KAAMpB,EAAMmB,WAAW8S,YAGxCmL,GAAU5e,MAAMqG,UAAU9D,OAoB1Bsc,GAAc,SAAS7X,EAAMc,EAAOzD,EAAUrD,GAC9CA,EAAWA,GAAYgD,CACvB,IAAIkF,GAAYnH,EAAUsC,EAC1B8R,IAASnP,EAAMc,EAAO,SAAS4K,EAAK1R,GAChCkI,EAAUwJ,EAAK,SAASrR,GACpB,MAAIA,GAAYL,EAASK,GAClBL,EAAS,KAAMxB,EAAMmB,UAAW,OAE5C,SAASU,EAAKyd,GAEb,IAAK,GADD7d,MACKgG,EAAI,EAAGA,EAAI6X,EAAWhf,OAAQmH,IAC/B6X,EAAW7X,KACXhG,EAAS2d,GAAQhe,MAAMK,EAAQ6d,EAAW7X,IAIlD,OAAOjG,GAASK,EAAKJ,MA6BzBsB,GAASgG,EAAQsW,GAAarE,EAAAA,GAoB9BuE,GAAexW,EAAQsW,GAAa,GA4CpCG,GAAW,WACX,GAAIC,GAASzf,EAAMmB,WACfD,GAAQ,MAAM6B,OAAO0c,EACzB,OAAO,YACH,GAAIje,GAAWL,UAAUA,UAAUb,OAAS,EAC5C,OAAOkB,GAASJ,MAAMrB,KAAMmB,KA0FhCwe,GAAStW,EAAW2H,GAAcD,GAAUM,KAwB5CuO,GAAc9V,EAAgBkH,GAAcD,GAAUM,KAsBtDwO,GAAe7W,EAAQ4W,GAAa,GAoDpCE,GAAMxO,GAAY,OA6QlB0F,GAAahO,EAAQiJ,GAAa,GAwFlC8N,GAAQ1W,EAAW2H,GAAcqB,GAAOA,KAsBxC2N,GAAalW,EAAgBkH,GAAcqB,GAAOA,KAqBlD4N,GAAcjX,EAAQgX,GAAY,GAwFlClN,GAASzJ,EAAWwJ,IAqBpBqN,GAAcpW,EAAgB+I,IAmB9BsN,GAAenX,EAAQkX,GAAa,GA6DpCE,GAAe,SAAS3Y,EAAMc,EAAOzD,EAAUrD,GAC/CA,EAAWA,GAAYgD,CACvB,IAAIkF,GAAYnH,EAAUsC,EAC1B8R,IAASnP,EAAMc,EAAO,SAAS4K,EAAK1R,GAChCkI,EAAUwJ,EAAK,SAASrR,EAAKyE,GACzB,MAAIzE,GAAYL,EAASK,GAClBL,EAAS,MAAO8E,IAAKA,EAAK4M,IAAKA,OAE3C,SAASrR,EAAKyd,GAKb,IAAK,GAJD7d,MAEAyB,EAAiBa,OAAO8C,UAAU3D,eAE7BuE,EAAI,EAAGA,EAAI6X,EAAWhf,OAAQmH,IACnC,GAAI6X,EAAW7X,GAAI,CACf,GAAInB,GAAMgZ,EAAW7X,GAAGnB,IACpB4M,EAAMoM,EAAW7X,GAAGyL,GAEpBhQ,GAAeC,KAAK1B,EAAQ6E,GAC5B7E,EAAO6E,GAAKE,KAAK0M,GAEjBzR,EAAO6E,IAAQ4M,GAK3B,MAAO1R,GAASK,EAAKJ,MAwCzB2e,GAAUrX,EAAQoX,GAAcnF,EAAAA,GAqBhCqF,GAAgBtX,EAAQoX,GAAc,GA6BtCG,GAAMjP,GAAY,OAmFlBkP,GAAYxX,EAAQiK,GAAgBgI,EAAAA,GAqBpCwF,GAAkBzX,EAAQiK,GAAgB,EA4G1CkM,IADA1H,GACWvI,QAAQwI,SACZH,GACIC,aAEA1W,CAGf,IAAI4W,IAAWzW,EAAKke,IA4NhBuB,GAAU,SAAUtS,EAAQC,GAC5B,GAAIsB,GAAUnN,EAAU4L,EACxB,OAAOD,IAAM,SAAUwS,EAAO5d,GAC1B4M,EAAQgR,EAAM,GAAI5d,IACnBsL,EAAa,IA0BhBuS,GAAgB,SAASxS,EAAQC,GAEjC,GAAIK,GAAIgS,GAAQtS,EAAQC,EA4CxB,OAzCAK,GAAEjI,KAAO,SAAS+H,EAAMqS,EAAUpf,GAE9B,GADgB,MAAZA,IAAkBA,EAAWgD,GACT,kBAAbhD,GACP,KAAM,IAAIO,OAAM,mCAMpB,IAJA0M,EAAEC,SAAU,EACP7I,GAAQ0I,KACTA,GAAQA,IAEQ,IAAhBA,EAAKjO,OAEL,MAAO2B,IAAe,WAClBwM,EAAEG,SAIVgS,GAAWA,GAAY,CAEvB,KADA,GAAIC,GAAWpS,EAAEK,OAAOjB,KACjBgT,GAAYD,GAAYC,EAASD,UACpCC,EAAWA,EAAS/Y,IAGxB,KAAK,GAAIL,GAAI,EAAGoH,EAAIN,EAAKjO,OAAQmH,EAAIoH,EAAGpH,IAAK,CACzC,GAAII,IACA0G,KAAMA,EAAK9G,GACXmZ,SAAUA,EACVpf,SAAUA,EAGVqf,GACApS,EAAEK,OAAOiQ,aAAa8B,EAAUhZ,GAEhC4G,EAAEK,OAAOtI,KAAKqB,GAGtB5F,GAAewM,EAAEQ,gBAIdR,GAAEM,QAEFN,GA0PPqS,GAAS1X,EAAWkL,IAqBpByM,GAAclX,EAAgByK,IAmB9B0M,GAAejY,EAAQgY,GAAa,GAkMpCE,GAAY,SAAUxM,EAAMrF,GACvBA,IACDA,EAAOqF,EACPA,EAAO,KAEX,IAAIW,GAAQ7S,EAAU6M,EACtB,OAAO7N,IAAc,SAAUL,EAAMM,GACjC,QAAS0L,GAAOpK,GACZsS,EAAMhU,MAAM,KAAMF,EAAK6B,OAAOD,IAG9B2R,EAAMD,GAAMC,EAAMvH,EAAQ1L,GACzBgT,GAAMtH,EAAQ1L,MAuGvB0f,GAAO9X,EAAW2H,GAAcoQ,QAASrQ,KAuBzCsQ,GAAYvX,EAAgBkH,GAAcoQ,QAASrQ,KAsBnDuQ,GAAatY,EAAQqY,GAAW,GA4IhC5K,GAAapW,KAAKkhB,KAClB/K,GAAYnW,KAAKC,IA8EjBwU,GAAQ9L,EAAQ0N,GAAWuE,EAAAA,GAgB3BuG,GAAcxY,EAAQ0N,GAAW,GA2QjC+K,GAAY,SAASxU,EAAOxL,GAM5B,QAASigB,GAASvgB,GACd,GAAIkO,GAAO7M,EAAUyK,EAAM0U,KAC3BxgB,GAAKsF,KAAK4B,EAASN,IACnBsH,EAAKhO,MAAM,KAAMF,GAGrB,QAAS4G,GAAKjG,GACV,MAAIA,IAAO6f,IAAc1U,EAAM1M,OACpBkB,EAASJ,MAAM,KAAMD,eAEhCsgB,GAASzhB,EAAMmB,UAAW,IAd9B,GADAK,EAAWiD,EAAKjD,GAAYgD,IACvBqB,GAAQmH,GAAQ,MAAOxL,GAAS,GAAIO,OAAM,6DAC/C,KAAKiL,EAAM1M,OAAQ,MAAOkB,IAC1B,IAAIkgB,GAAY,CAehBD,QAoEA3c,IACA1D,MAAOA,GACP8Z,UAAWA,GACXE,gBAAiBA,GACjB/Z,SAAUA,EACVsM,KAAMA,GACNZ,WAAYA,GACZsD,MAAOA,GACP8O,QAASA,GACTpc,OAAQA,GACRsc,YAAaA,GACbE,aAAcA,GACdC,SAAUA,GACVE,OAAQA,GACRC,YAAaA,GACbC,aAAcA,GACdC,IAAKA,GACLtO,SAAUA,GACVK,QAASA,GACTD,SAAUA,GACVE,OAAQA,GACR8P,KAAM5P,GACNA,UAAWC,GACX3I,OAAQA,GACRP,YAAaA,EACb0H,aAAcA,GACduG,WAAYA,GACZ9E,YAAaA,GACb6N,MAAOA,GACPC,WAAYA,GACZC,YAAaA,GACbnN,OAAQA,GACRoN,YAAaA,GACbC,aAAcA,GACdpN,QAASA,GACTsN,QAASA,GACTD,aAAcA,GACdE,cAAeA,GACfC,IAAKA,GACLzT,IAAKA,GACL8J,SAAUA,GACVwE,UAAWA,GACXoF,UAAWA,GACXvN,eAAgBA,GAChBwN,gBAAiBA,GACjBpN,QAASA,GACTqE,SAAUA,GACVmK,SAAUjO,GACVA,cAAeC,GACf+M,cAAeA,GACfzS,MAAOuS,GACP5M,KAAMA,GACNvD,OAAQA,GACRyD,YAAaA,GACbG,QAASA,GACTG,WAAYA,GACZyM,OAAQA,GACRC,YAAaA,GACbC,aAAcA,GACdxM,MAAOA,GACPyM,UAAWA,GACXvQ,IAAKA,GACL6E,OAAQA,GACRgC,aAActV,GACdif,KAAMA,GACNE,UAAWA,GACXC,WAAYA,GACZ7L,OAAQA,GACRK,QAASA,GACThB,MAAOA,GACPgN,WAAYpL,GACZ8K,YAAaA,GACbva,UAAWA,GACX8P,QAASA,GACTG,UAAWA,GACXE,MAAOA,GACPqK,UAAWA,GACXtK,OAAQA,GAGR4K,IAAKhC,GACLiC,SAAUhC,GACViC,UAAWhC,GACXiC,IAAKf,GACLgB,SAAUd,GACVe,UAAWd,GACXe,KAAM1C,GACN2C,UAAW1C,GACX2C,WAAY1C,GACZ2C,QAASxQ,GACTyQ,cAAezL,GACf0L,aAAczQ,GACd0Q,UAAWrZ,GACXsZ,gBAAiBnS,GACjBoS,eAAgB9Z,EAChB+Z,OAAQvS,GACRwS,MAAOxS,GACPyS,MAAOhP,GACPiP,OAAQnQ,GACRoQ,YAAahD,GACbiD,aAAchD,GACdiD,SAAU9hB,EAGd3B,GAAiB,QAAIoF,GACrBpF,EAAQ0B,MAAQA,GAChB1B,EAAQwb,UAAYA,GACpBxb,EAAQ0b,gBAAkBA,GAC1B1b,EAAQ2B,SAAWA,EACnB3B,EAAQiO,KAAOA,GACfjO,EAAQqN,WAAaA,GACrBrN,EAAQ2Q,MAAQA,GAChB3Q,EAAQyf,QAAUA,GAClBzf,EAAQqD,OAASA,GACjBrD,EAAQ2f,YAAcA,GACtB3f,EAAQ6f,aAAeA,GACvB7f,EAAQ8f,SAAWA,GACnB9f,EAAQggB,OAASA,GACjBhgB,EAAQigB,YAAcA,GACtBjgB,EAAQkgB,aAAeA,GACvBlgB,EAAQmgB,IAAMA,GACdngB,EAAQ6R,SAAWA,GACnB7R,EAAQkS,QAAUA,GAClBlS,EAAQiS,SAAWA,GACnBjS,EAAQmS,OAASA,GACjBnS,EAAQiiB,KAAO5P,GACfrS,EAAQqS,UAAYC,GACpBtS,EAAQ2J,OAASA,GACjB3J,EAAQoJ,YAAcA,EACtBpJ,EAAQ8Q,aAAeA,GACvB9Q,EAAQqX,WAAaA,GACrBrX,EAAQuS,YAAcA,GACtBvS,EAAQogB,MAAQA,GAChBpgB,EAAQqgB,WAAaA,GACrBrgB,EAAQsgB,YAAcA,GACtBtgB,EAAQmT,OAASA,GACjBnT,EAAQugB,YAAcA,GACtBvgB,EAAQwgB,aAAeA,GACvBxgB,EAAQoT,QAAUA,GAClBpT,EAAQ0gB,QAAUA,GAClB1gB,EAAQygB,aAAeA,GACvBzgB,EAAQ2gB,cAAgBA,GACxB3gB,EAAQ4gB,IAAMA,GACd5gB,EAAQmN,IAAMA,GACdnN,EAAQiX,SAAWA,GACnBjX,EAAQyb,UAAYA,GACpBzb,EAAQ6gB,UAAYA,GACpB7gB,EAAQsT,eAAiBA,GACzBtT,EAAQ8gB,gBAAkBA,GAC1B9gB,EAAQ0T,QAAUA,GAClB1T,EAAQ+X,SAAWA,GACnB/X,EAAQkiB,SAAWjO,GACnBjU,EAAQiU,cAAgBC,GACxBlU,EAAQihB,cAAgBA,GACxBjhB,EAAQwO,MAAQuS,GAChB/gB,EAAQmU,KAAOA,GACfnU,EAAQ4Q,OAASA,GACjB5Q,EAAQqU,YAAcA,GACtBrU,EAAQwU,QAAUA,GAClBxU,EAAQ2U,WAAaA,GACrB3U,EAAQohB,OAASA,GACjBphB,EAAQqhB,YAAcA,GACtBrhB,EAAQshB,aAAeA,GACvBthB,EAAQ8U,MAAQA,GAChB9U,EAAQuhB,UAAYA,GACpBvhB,EAAQgR,IAAMA,GACdhR,EAAQ6V,OAASA,GACjB7V,EAAQ6X,aAAetV,GACvBvC,EAAQwhB,KAAOA,GACfxhB,EAAQ0hB,UAAYA,GACpB1hB,EAAQ2hB,WAAaA,GACrB3hB,EAAQ8V,OAASA,GACjB9V,EAAQmW,QAAUA,GAClBnW,EAAQmV,MAAQA,GAChBnV,EAAQmiB,WAAapL,GACrB/W,EAAQ6hB,YAAcA,GACtB7hB,EAAQsH,UAAYA,GACpBtH,EAAQoX,QAAUA,GAClBpX,EAAQuX,UAAYA,GACpBvX,EAAQyX,MAAQA,GAChBzX,EAAQ8hB,UAAYA,GACpB9hB,EAAQwX,OAASA,GACjBxX,EAAQoiB,IAAMhC,GACdpgB,EAAQqiB,SAAWhC,GACnBrgB,EAAQsiB,UAAYhC,GACpBtgB,EAAQuiB,IAAMf,GACdxhB,EAAQwiB,SAAWd,GACnB1hB,EAAQyiB,UAAYd,GACpB3hB,EAAQ0iB,KAAO1C,GACfhgB,EAAQ2iB,UAAY1C,GACpBjgB,EAAQ4iB,WAAa1C,GACrBlgB,EAAQ6iB,QAAUxQ,GAClBrS,EAAQ8iB,cAAgBzL,GACxBrX,EAAQ+iB,aAAezQ,GACvBtS,EAAQgjB,UAAYrZ,GACpB3J,EAAQijB,gBAAkBnS,GAC1B9Q,EAAQkjB,eAAiB9Z,EACzBpJ,EAAQmjB,OAASvS,GACjB5Q,EAAQojB,MAAQxS,GAChB5Q,EAAQqjB,MAAQhP,GAChBrU,EAAQsjB,OAASnQ,GACjBnT,EAAQujB,YAAchD,GACtBvgB,EAAQwjB,aAAehD,GACvBxgB,EAAQyjB,SAAW9hB,EAEnB0C,OAAOqf,eAAe1jB,EAAS,cAAgBiB,OAAO","file":"build/dist/async.min.js"}
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n,t){t|=0;for(var e=Math.max(n.length-t,0),r=Array(e),u=0;u<e;u++)r[u]=n[t+u];return r}function e(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function r(n){setTimeout(n,0)}function u(n){return function(e){var r=t(arguments,1);n(function(){e.apply(null,r)})}}function i(n){return ct(function(t,r){var u;try{u=n.apply(this,t)}catch(n){return r(n)}e(u)&&"function"==typeof u.then?u.then(function(n){o(r,null,n)},function(n){o(r,n.message?n:new Error(n))}):r(null,u)})}function o(n,t,e){try{n(t,e)}catch(n){lt(c,n)}}function c(n){throw n}function f(n){return st&&"AsyncFunction"===n[Symbol.toStringTag]}function a(n){return f(n)?i(n):n}function l(n){return function(e){var r=t(arguments,1),u=ct(function(t,r){var u=this;return n(e,function(n,e){a(n).apply(u,t.concat(e))},r)});return r.length?u.apply(this,r):u}}function s(n){var t=mt.call(n,bt),e=n[bt];try{n[bt]=void 0;var r=!0}catch(n){}var u=gt.call(n);return r&&(t?n[bt]=e:delete n[bt]),u}function p(n){return St.call(n)}function h(n){return null==n?void 0===n?Lt:kt:Ot&&Ot in Object(n)?s(n):p(n)}function y(n){if(!e(n))return!1;var t=h(n);return t==xt||t==Et||t==wt||t==At}function v(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Tt}function d(n){return null!=n&&v(n.length)&&!y(n)}function m(){}function g(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function b(n,t){for(var e=-1,r=Array(n);++e<n;)r[e]=t(e);return r}function j(n){return null!=n&&"object"==typeof n}function S(n){return j(n)&&h(n)==_t}function k(){return!1}function L(n,t){var e=typeof n;return t=null==t?Nt:t,!!t&&("number"==e||"symbol"!=e&&Qt.test(n))&&n>-1&&n%1==0&&n<t}function O(n){return j(n)&&v(n.length)&&!!me[h(n)]}function w(n){return function(t){return n(t)}}function x(n,t){var e=Pt(n),r=!e&&zt(n),u=!e&&!r&&Wt(n),i=!e&&!r&&!u&&Oe(n),o=e||r||u||i,c=o?b(n.length,String):[],f=c.length;for(var a in n)!t&&!xe.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||L(a,f))||c.push(a);return c}function E(n){var t=n&&n.constructor,e="function"==typeof t&&t.prototype||Ee;return n===e}function A(n,t){return function(e){return n(t(e))}}function T(n){if(!E(n))return Ae(n);var t=[];for(var e in Object(n))Be.call(n,e)&&"constructor"!=e&&t.push(e);return t}function B(n){return d(n)?x(n):T(n)}function F(n){var t=-1,e=n.length;return function(){return++t<e?{value:n[t],key:t}:null}}function I(n){var t=-1;return function(){var e=n.next();return e.done?null:(t++,{value:e.value,key:t})}}function _(n){var t=B(n),e=-1,r=t.length;return function(){var u=t[++e];return e<r?{value:n[u],key:u}:null}}function M(n){if(d(n))return F(n);var t=It(n);return t?I(t):_(n)}function U(n){return function(){if(null===n)throw new Error("Callback was already called.");var t=n;n=null,t.apply(this,arguments)}}function q(n){return function(t,e,r){function u(n,t){if(f-=1,n)c=!0,r(n);else{if(t===Bt||c&&f<=0)return c=!0,r(null);a||i()}}function i(){for(a=!0;f<n&&!c;){var t=o();if(null===t)return c=!0,void(f<=0&&r(null));f+=1,e(t.value,t.key,U(u))}a=!1}if(r=g(r||m),n<=0||!t)return r(null);var o=M(t),c=!1,f=0,a=!1;i()}}function z(n,t,e,r){q(t)(n,a(e),r)}function P(n,t){return function(e,r,u){return n(e,t,r,u)}}function V(n,t,e){function r(n,t){n?e(n):++i!==o&&t!==Bt||e(null)}e=g(e||m);var u=0,i=0,o=n.length;for(0===o&&e(null);u<o;u++)t(n[u],u,U(r))}function D(n){return function(t,e,r){return n(Ie,t,a(e),r)}}function R(n,t,e,r){r=r||m,t=t||[];var u=[],i=0,o=a(e);n(t,function(n,t,e){var r=i++;o(n,function(n,t){u[r]=t,e(n)})},function(n){r(n,u)})}function C(n){return function(t,e,r,u){return n(q(e),t,a(r),u)}}function $(n,t){for(var e=-1,r=null==n?0:n.length;++e<r&&t(n[e],e,n)!==!1;);return n}function W(n){return function(t,e,r){for(var u=-1,i=Object(t),o=r(t),c=o.length;c--;){var f=o[n?c:++u];if(e(i[f],f,i)===!1)break}return t}}function N(n,t){return n&&Pe(n,t,B)}function Q(n,t,e,r){for(var u=n.length,i=e+(r?1:-1);r?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function G(n){return n!==n}function H(n,t,e){for(var r=e-1,u=n.length;++r<u;)if(n[r]===t)return r;return-1}function J(n,t,e){return t===t?H(n,t,e):Q(n,G,e)}function K(n,t){for(var e=-1,r=null==n?0:n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function X(n){return"symbol"==typeof n||j(n)&&h(n)==De}function Y(n){if("string"==typeof n)return n;if(Pt(n))return K(n,Y)+"";if(X(n))return $e?$e.call(n):"";var t=n+"";return"0"==t&&1/n==-Re?"-0":t}function Z(n,t,e){var r=-1,u=n.length;t<0&&(t=-t>u?0:u+t),e=e>u?u:e,e<0&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(u);++r<u;)i[r]=n[r+t];return i}function nn(n,t,e){var r=n.length;return e=void 0===e?r:e,!t&&e>=r?n:Z(n,t,e)}function tn(n,t){for(var e=n.length;e--&&J(t,n[e],0)>-1;);return e}function en(n,t){for(var e=-1,r=n.length;++e<r&&J(t,n[e],0)>-1;);return e}function rn(n){return n.split("")}function un(n){return Xe.test(n)}function on(n){return n.match(mr)||[]}function cn(n){return un(n)?on(n):rn(n)}function fn(n){return null==n?"":Y(n)}function an(n,t,e){if(n=fn(n),n&&(e||void 0===t))return n.replace(gr,"");if(!n||!(t=Y(t)))return n;var r=cn(n),u=cn(t),i=en(r,u),o=tn(r,u)+1;return nn(r,i,o).join("")}function ln(n){return n=n.toString().replace(kr,""),n=n.match(br)[2].replace(" ",""),n=n?n.split(jr):[],n=n.map(function(n){return an(n.replace(Sr,""))})}function sn(n,t){var e={};N(n,function(n,t){function r(t,e){var r=K(u,function(n){return t[n]});r.push(e),a(n).apply(null,r)}var u,i=f(n),o=!i&&1===n.length||i&&0===n.length;if(Pt(n))u=n.slice(0,-1),n=n[n.length-1],e[t]=u.concat(u.length>0?r:n);else if(o)e[t]=n;else{if(u=ln(n),0===n.length&&!i&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");i||u.pop(),e[t]=u.concat(r)}}),Ve(e,t)}function pn(){this.head=this.tail=null,this.length=0}function hn(n,t){n.length=1,n.head=n.tail=t}function yn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");if(s.started=!0,Pt(n)||(n=[n]),0===n.length&&s.idle())return lt(function(){s.drain()});for(var r=0,u=n.length;r<u;r++){var i={data:n[r],callback:e||m};t?s._tasks.unshift(i):s._tasks.push(i)}f||(f=!0,lt(function(){f=!1,s.process()}))}function u(n){return function(t){o-=1;for(var e=0,r=n.length;e<r;e++){var u=n[e],i=J(c,u,0);0===i?c.shift():i>0&&c.splice(i,1),u.callback.apply(u,arguments),null!=t&&s.error(t,u.data)}o<=s.concurrency-s.buffer&&s.unsaturated(),s.idle()&&s.drain(),s.process()}}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=a(n),o=0,c=[],f=!1,l=!1,s={_tasks:new pn,concurrency:t,payload:e,saturated:m,unsaturated:m,buffer:t/4,empty:m,drain:m,error:m,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){s.drain=m,s._tasks.empty()},unshift:function(n,t){r(n,!0,t)},remove:function(n){s._tasks.remove(n)},process:function(){if(!l){for(l=!0;!s.paused&&o<s.concurrency&&s._tasks.length;){var n=[],t=[],e=s._tasks.length;s.payload&&(e=Math.min(e,s.payload));for(var r=0;r<e;r++){var f=s._tasks.shift();n.push(f),c.push(f),t.push(f.data)}o+=1,0===s._tasks.length&&s.empty(),o===s.concurrency&&s.saturated();var a=U(u(n));i(t,a)}l=!1}},length:function(){return s._tasks.length},running:function(){return o},workersList:function(){return c},idle:function(){return s._tasks.length+o===0},pause:function(){s.paused=!0},resume:function(){s.paused!==!1&&(s.paused=!1,lt(s.process))}};return s}function vn(n,t){return yn(n,1,t)}function dn(n,t,e,r){r=g(r||m);var u=a(e);Or(n,function(n,e,r){u(t,n,function(n,e){t=e,r(n)})},function(n){r(n,t)})}function mn(){var n=K(arguments,a);return function(){var e=t(arguments),r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=m,dn(n,e,function(n,e,u){e.apply(r,n.concat(function(n){var e=t(arguments,1);u(n,e)}))},function(n,t){u.apply(r,[n].concat(t))})}}function gn(n){return n}function bn(n,t){return function(e,r,u,i){i=i||m;var o,c=!1;e(r,function(e,r,i){u(e,function(r,u){r?i(r):n(u)&&!o?(c=!0,o=t(!0,e),i(null,Bt)):i()})},function(n){n?i(n):i(null,c?o:t(!1))})}}function jn(n,t){return t}function Sn(n){return function(e){var r=t(arguments,1);r.push(function(e){var r=t(arguments,1);"object"==typeof console&&(e?console.error&&console.error(e):console[n]&&$(r,function(t){console[n](t)}))}),a(e).apply(null,r)}}function kn(n,e,r){function u(n){if(n)return r(n);var e=t(arguments,1);e.push(i),c.apply(this,e)}function i(n,t){return n?r(n):t?void o(u):r(null)}r=U(r||m);var o=a(n),c=a(e);i(null,!0)}function Ln(n,e,r){r=U(r||m);var u=a(n),i=function(n){if(n)return r(n);var o=t(arguments,1);return e.apply(this,o)?u(i):void r.apply(null,[null].concat(o))};u(i)}function On(n,t,e){Ln(n,function(){return!t.apply(this,arguments)},e)}function wn(n,t,e){function r(n){return n?e(n):void o(u)}function u(n,t){return n?e(n):t?void i(r):e(null)}e=U(e||m);var i=a(t),o=a(n);o(u)}function xn(n){return function(t,e,r){return n(t,r)}}function En(n,t,e){Ie(n,xn(a(t)),e)}function An(n,t,e,r){q(t)(n,xn(a(e)),r)}function Tn(n){return f(n)?n:ct(function(t,e){var r=!0;t.push(function(){var n=arguments;r?lt(function(){e.apply(null,n)}):e.apply(null,n)}),n.apply(this,t),r=!1})}function Bn(n){return!n}function Fn(n){return function(t){return null==t?void 0:t[n]}}function In(n,t,e,r){var u=new Array(t.length);n(t,function(n,t,r){e(n,function(n,e){u[t]=!!e,r(n)})},function(n){if(n)return r(n);for(var e=[],i=0;i<t.length;i++)u[i]&&e.push(t[i]);r(null,e)})}function _n(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e,i){e?r(e):(i&&u.push({index:t,value:n}),r())})},function(n){n?r(n):r(null,K(u.sort(function(n,t){return n.index-t.index}),Fn("value")))})}function Mn(n,t,e,r){var u=d(t)?In:_n;u(n,t,a(e),r||m)}function Un(n,t){function e(n){return n?r(n):void u(e)}var r=U(t||m),u=a(Tn(n));e()}function qn(n,t,e,r){r=g(r||m);var u={},i=a(e);z(n,t,function(n,t,e){i(n,t,function(n,r){return n?e(n):(u[t]=r,void e())})},function(n){r(n,u)})}function zn(n,t){return t in n}function Pn(n,e){var r=Object.create(null),u=Object.create(null);e=e||gn;var i=a(n),o=ct(function(n,o){var c=e.apply(null,n);zn(r,c)?lt(function(){o.apply(null,r[c])}):zn(u,c)?u[c].push(o):(u[c]=[o],i.apply(null,n.concat(function(){var n=t(arguments);r[c]=n;var e=u[c];delete u[c];for(var i=0,o=e.length;i<o;i++)e[i].apply(null,n)})))});return o.memo=r,o.unmemoized=n,o}function Vn(n,e,r){r=r||m;var u=d(e)?[]:{};n(e,function(n,e,r){a(n)(function(n,i){arguments.length>2&&(i=t(arguments,1)),u[e]=i,r(n)})},function(n){r(n,u)})}function Dn(n,t){Vn(Ie,n,t)}function Rn(n,t,e){Vn(q(t),n,e)}function Cn(n,t){if(t=g(t||m),!Pt(n))return t(new TypeError("First argument to race must be an array of functions"));if(!n.length)return t();for(var e=0,r=n.length;e<r;e++)a(n[e])(t)}function $n(n,e,r,u){var i=t(n).reverse();dn(i,e,r,u)}function Wn(n){var e=a(n);return ct(function(n,r){return n.push(function(n,e){if(n)r(null,{error:n});else{var u;u=arguments.length<=2?e:t(arguments,1),r(null,{value:u})}}),e.apply(this,n)})}function Nn(n){var t;return Pt(n)?t=K(n,Wn):(t={},N(n,function(n,e){t[e]=Wn.call(this,n)})),t}function Qn(n,t,e,r){Mn(n,t,function(n,t){e(n,function(n,e){t(n,!e)})},r)}function Gn(n){return function(){return n}}function Hn(n,t,e){function r(n,t){if("object"==typeof t)n.times=+t.times||i,n.intervalFunc="function"==typeof t.interval?t.interval:Gn(+t.interval||o),n.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");n.times=+t||i}}function u(){f(function(n){n&&l++<c.times&&("function"!=typeof c.errorFilter||c.errorFilter(n))?setTimeout(u,c.intervalFunc(l)):e.apply(null,arguments)})}var i=5,o=0,c={times:i,intervalFunc:Gn(o)};if(arguments.length<3&&"function"==typeof n?(e=t||m,t=n):(r(c,n),e=e||m),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var f=a(t),l=1;u()}function Jn(n,t){Vn(Or,n,t)}function Kn(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return e<r?-1:e>r?1:0}var u=a(t);_e(n,function(n,t){u(n,function(e,r){return e?t(e):void t(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,K(t.sort(r),Fn("value")))})}function Xn(n,t,e){var r=a(n);return ct(function(u,i){function o(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),f=!0,i(r)}var c,f=!1;u.push(function(){f||(i.apply(null,arguments),clearTimeout(c))}),c=setTimeout(o,t),r.apply(null,u)})}function Yn(n,t,e,r){for(var u=-1,i=iu(uu((t-n)/(e||1)),0),o=Array(i);i--;)o[r?i:++u]=n,n+=e;return o}function Zn(n,t,e,r){var u=a(e);Ue(Yn(0,n,1),t,u,r)}function nt(n,t,e,r){arguments.length<=3&&(r=e,e=t,t=Pt(n)?[]:{}),r=g(r||m);var u=a(e);Ie(n,function(n,e,r){u(t,n,e,r)},function(n){r(n,t)})}function tt(n,e){var r,u=null;e=e||m,Ur(n,function(n,e){a(n)(function(n,i){r=arguments.length>2?t(arguments,1):i,u=n,e(!n)})},function(){e(u,r)})}function et(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function rt(n,e,r){r=U(r||m);var u=a(e);if(!n())return r(null);var i=function(e){if(e)return r(e);if(n())return u(i);var o=t(arguments,1);r.apply(null,[null].concat(o))};u(i)}function ut(n,t,e){rt(function(){return!n.apply(this,arguments)},t,e)}var it,ot=function(n){var e=t(arguments,1);return function(){var r=t(arguments);return n.apply(null,e.concat(r))}},ct=function(n){return function(){var e=t(arguments),r=e.pop();n.call(this,e,r)}},ft="function"==typeof setImmediate&&setImmediate,at="object"==typeof process&&"function"==typeof process.nextTick;it=ft?setImmediate:at?process.nextTick:r;var lt=u(it),st="function"==typeof Symbol,pt="object"==typeof global&&global&&global.Object===Object&&global,ht="object"==typeof self&&self&&self.Object===Object&&self,yt=pt||ht||Function("return this")(),vt=yt.Symbol,dt=Object.prototype,mt=dt.hasOwnProperty,gt=dt.toString,bt=vt?vt.toStringTag:void 0,jt=Object.prototype,St=jt.toString,kt="[object Null]",Lt="[object Undefined]",Ot=vt?vt.toStringTag:void 0,wt="[object AsyncFunction]",xt="[object Function]",Et="[object GeneratorFunction]",At="[object Proxy]",Tt=9007199254740991,Bt={},Ft="function"==typeof Symbol&&Symbol.iterator,It=function(n){return Ft&&n[Ft]&&n[Ft]()},_t="[object Arguments]",Mt=Object.prototype,Ut=Mt.hasOwnProperty,qt=Mt.propertyIsEnumerable,zt=S(function(){return arguments}())?S:function(n){return j(n)&&Ut.call(n,"callee")&&!qt.call(n,"callee")},Pt=Array.isArray,Vt="object"==typeof n&&n&&!n.nodeType&&n,Dt=Vt&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Dt&&Dt.exports===Vt,Ct=Rt?yt.Buffer:void 0,$t=Ct?Ct.isBuffer:void 0,Wt=$t||k,Nt=9007199254740991,Qt=/^(?:0|[1-9]\d*)$/,Gt="[object Arguments]",Ht="[object Array]",Jt="[object Boolean]",Kt="[object Date]",Xt="[object Error]",Yt="[object Function]",Zt="[object Map]",ne="[object Number]",te="[object Object]",ee="[object RegExp]",re="[object Set]",ue="[object String]",ie="[object WeakMap]",oe="[object ArrayBuffer]",ce="[object DataView]",fe="[object Float32Array]",ae="[object Float64Array]",le="[object Int8Array]",se="[object Int16Array]",pe="[object Int32Array]",he="[object Uint8Array]",ye="[object Uint8ClampedArray]",ve="[object Uint16Array]",de="[object Uint32Array]",me={};me[fe]=me[ae]=me[le]=me[se]=me[pe]=me[he]=me[ye]=me[ve]=me[de]=!0,me[Gt]=me[Ht]=me[oe]=me[Jt]=me[ce]=me[Kt]=me[Xt]=me[Yt]=me[Zt]=me[ne]=me[te]=me[ee]=me[re]=me[ue]=me[ie]=!1;var ge="object"==typeof n&&n&&!n.nodeType&&n,be=ge&&"object"==typeof module&&module&&!module.nodeType&&module,je=be&&be.exports===ge,Se=je&&pt.process,ke=function(){try{var n=be&&be.require&&be.require("util").types;return n?n:Se&&Se.binding&&Se.binding("util")}catch(n){}}(),Le=ke&&ke.isTypedArray,Oe=Le?w(Le):O,we=Object.prototype,xe=we.hasOwnProperty,Ee=Object.prototype,Ae=A(Object.keys,Object),Te=Object.prototype,Be=Te.hasOwnProperty,Fe=P(z,1/0),Ie=function(n,t,e){var r=d(n)?V:Fe;r(n,a(t),e)},_e=D(R),Me=l(_e),Ue=C(R),qe=P(Ue,1),ze=l(qe),Pe=W(),Ve=function(n,e,r){function u(n,t){j.push(function(){f(n,t)})}function i(){if(0===j.length&&0===v)return r(null,y);for(;j.length&&v<e;){var n=j.shift();n()}}function o(n,t){var e=b[n];e||(e=b[n]=[]),e.push(t)}function c(n){var t=b[n]||[];$(t,function(n){n()}),i()}function f(n,e){if(!d){var u=U(function(e,u){if(v--,arguments.length>2&&(u=t(arguments,1)),e){var i={};N(y,function(n,t){i[t]=n}),i[n]=u,d=!0,b=Object.create(null),r(e,i)}else y[n]=u,c(n)});v++;var i=a(e[e.length-1]);e.length>1?i(y,u):i(u)}}function l(){for(var n,t=0;S.length;)n=S.pop(),t++,$(s(n),function(n){0===--k[n]&&S.push(n)});if(t!==h)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function s(t){var e=[];return N(n,function(n,r){Pt(n)&&J(n,t,0)>=0&&e.push(r)}),e}"function"==typeof e&&(r=e,e=null),r=g(r||m);var p=B(n),h=p.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,b=Object.create(null),j=[],S=[],k={};N(n,function(t,e){if(!Pt(t))return u(e,[t]),void S.push(e);var r=t.slice(0,t.length-1),i=r.length;return 0===i?(u(e,t),void S.push(e)):(k[e]=i,void $(r,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+c+"` in "+r.join(", "));o(c,function(){i--,0===i&&u(e,t)})}))}),l(),i()},De="[object Symbol]",Re=1/0,Ce=vt?vt.prototype:void 0,$e=Ce?Ce.toString:void 0,We="\\ud800-\\udfff",Ne="\\u0300-\\u036f",Qe="\\ufe20-\\ufe2f",Ge="\\u20d0-\\u20ff",He=Ne+Qe+Ge,Je="\\ufe0e\\ufe0f",Ke="\\u200d",Xe=RegExp("["+Ke+We+He+Je+"]"),Ye="\\ud800-\\udfff",Ze="\\u0300-\\u036f",nr="\\ufe20-\\ufe2f",tr="\\u20d0-\\u20ff",er=Ze+nr+tr,rr="\\ufe0e\\ufe0f",ur="["+Ye+"]",ir="["+er+"]",or="\\ud83c[\\udffb-\\udfff]",cr="(?:"+ir+"|"+or+")",fr="[^"+Ye+"]",ar="(?:\\ud83c[\\udde6-\\uddff]){2}",lr="[\\ud800-\\udbff][\\udc00-\\udfff]",sr="\\u200d",pr=cr+"?",hr="["+rr+"]?",yr="(?:"+sr+"(?:"+[fr,ar,lr].join("|")+")"+hr+pr+")*",vr=hr+pr+yr,dr="(?:"+[fr+ir+"?",ir,ar,lr,ur].join("|")+")",mr=RegExp(or+"(?="+or+")|"+dr+vr,"g"),gr=/^\s+|\s+$/g,br=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,jr=/,/,Sr=/(=.+)?(\s*)$/,kr=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;pn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},pn.prototype.empty=function(){for(;this.head;)this.shift();return this},pn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},pn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},pn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):hn(this,n)},pn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):hn(this,n)},pn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},pn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},pn.prototype.toArray=function(){for(var n=Array(this.length),t=this.head,e=0;e<this.length;e++)n[e]=t.data,t=t.next;return n},pn.prototype.remove=function(n){for(var t=this.head;t;){var e=t.next;n(t)&&this.removeLink(t),t=e}return this};var Lr,Or=P(z,1),wr=function(){return mn.apply(null,t(arguments).reverse())},xr=Array.prototype.concat,Er=function(n,e,r,u){u=u||m;var i=a(r);Ue(n,e,function(n,e){i(n,function(n){return n?e(n):e(null,t(arguments,1))})},function(n,t){for(var e=[],r=0;r<t.length;r++)t[r]&&(e=xr.apply(e,t[r]));return u(n,e)})},Ar=P(Er,1/0),Tr=P(Er,1),Br=function(){var n=t(arguments),e=[null].concat(n);return function(){var n=arguments[arguments.length-1];return n.apply(this,e)}},Fr=D(bn(gn,jn)),Ir=C(bn(gn,jn)),_r=P(Ir,1),Mr=Sn("dir"),Ur=P(An,1),qr=D(bn(Bn,Bn)),zr=C(bn(Bn,Bn)),Pr=P(zr,1),Vr=D(Mn),Dr=C(Mn),Rr=P(Dr,1),Cr=function(n,t,e,r){r=r||m;var u=a(e);Ue(n,t,function(n,t){u(n,function(e,r){return e?t(e):t(null,{key:r,val:n})})},function(n,t){for(var e={},u=Object.prototype.hasOwnProperty,i=0;i<t.length;i++)if(t[i]){var o=t[i].key,c=t[i].val;u.call(e,o)?e[o].push(c):e[o]=[c]}return r(n,e)})},$r=P(Cr,1/0),Wr=P(Cr,1),Nr=Sn("log"),Qr=P(qn,1/0),Gr=P(qn,1);Lr=at?process.nextTick:ft?setImmediate:r;var Hr=u(Lr),Jr=function(n,t){var e=a(n);return yn(function(n,t){e(n[0],t)},t,1)},Kr=function(n,t){var e=Jr(n,t);return e.push=function(n,t,r){if(null==r&&(r=m),"function"!=typeof r)throw new Error("task callback must be a function");if(e.started=!0,Pt(n)||(n=[n]),0===n.length)return lt(function(){e.drain()});t=t||0;for(var u=e._tasks.head;u&&t>=u.priority;)u=u.next;for(var i=0,o=n.length;i<o;i++){var c={data:n[i],priority:t,callback:r};u?e._tasks.insertBefore(u,c):e._tasks.push(c)}lt(e.process)},delete e.unshift,e},Xr=D(Qn),Yr=C(Qn),Zr=P(Yr,1),nu=function(n,t){t||(t=n,n=null);var e=a(t);return ct(function(t,r){function u(n){e.apply(null,t.concat(n))}n?Hn(n,u,r):Hn(u,r)})},tu=D(bn(Boolean,gn)),eu=C(bn(Boolean,gn)),ru=P(eu,1),uu=Math.ceil,iu=Math.max,ou=P(Zn,1/0),cu=P(Zn,1),fu=function(n,e){function r(t){var e=a(n[i++]);t.push(U(u)),e.apply(null,t)}function u(u){return u||i===n.length?e.apply(null,arguments):void r(t(arguments,1))}if(e=g(e||m),!Pt(n))return e(new Error("First argument to waterfall must be an array of functions"));if(!n.length)return e();var i=0;r([])},au={apply:ot,applyEach:Me,applyEachSeries:ze,asyncify:i,auto:Ve,autoInject:sn,cargo:vn,compose:wr,concat:Ar,concatLimit:Er,concatSeries:Tr,constant:Br,detect:Fr,detectLimit:Ir,detectSeries:_r,dir:Mr,doDuring:kn,doUntil:On,doWhilst:Ln,during:wn,each:En,eachLimit:An,eachOf:Ie,eachOfLimit:z,eachOfSeries:Or,eachSeries:Ur,ensureAsync:Tn,every:qr,everyLimit:zr,everySeries:Pr,filter:Vr,filterLimit:Dr,filterSeries:Rr,forever:Un,groupBy:$r,groupByLimit:Cr,groupBySeries:Wr,log:Nr,map:_e,mapLimit:Ue,mapSeries:qe,mapValues:Qr,mapValuesLimit:qn,mapValuesSeries:Gr,memoize:Pn,nextTick:Hr,parallel:Dn,parallelLimit:Rn,priorityQueue:Kr,queue:Jr,race:Cn,reduce:dn,reduceRight:$n,reflect:Wn,reflectAll:Nn,reject:Xr,rejectLimit:Yr,rejectSeries:Zr,retry:Hn,retryable:nu,seq:mn,series:Jn,setImmediate:lt,some:tu,someLimit:eu,someSeries:ru,sortBy:Kn,timeout:Xn,times:ou,timesLimit:Zn,timesSeries:cu,transform:nt,tryEach:tt,unmemoize:et,until:ut,waterfall:fu,whilst:rt,all:qr,allLimit:zr,allSeries:Pr,any:tu,anyLimit:eu,anySeries:ru,find:Fr,findLimit:Ir,findSeries:_r,forEach:En,forEachSeries:Ur,forEachLimit:An,forEachOf:Ie,forEachOfSeries:Or,forEachOfLimit:z,inject:dn,foldl:dn,foldr:$n,select:Vr,selectLimit:Dr,selectSeries:Rr,wrapSync:i};n.default=au,n.apply=ot,n.applyEach=Me,n.applyEachSeries=ze,n.asyncify=i,n.auto=Ve,n.autoInject=sn,n.cargo=vn,n.compose=wr,n.concat=Ar,n.concatLimit=Er,n.concatSeries=Tr,n.constant=Br,n.detect=Fr,n.detectLimit=Ir,n.detectSeries=_r,n.dir=Mr,n.doDuring=kn,n.doUntil=On,n.doWhilst=Ln,n.during=wn,n.each=En,n.eachLimit=An,n.eachOf=Ie,n.eachOfLimit=z,n.eachOfSeries=Or,n.eachSeries=Ur,n.ensureAsync=Tn,n.every=qr,n.everyLimit=zr,n.everySeries=Pr,n.filter=Vr,n.filterLimit=Dr,n.filterSeries=Rr,n.forever=Un,n.groupBy=$r,n.groupByLimit=Cr,n.groupBySeries=Wr,n.log=Nr,n.map=_e,n.mapLimit=Ue,n.mapSeries=qe,n.mapValues=Qr,n.mapValuesLimit=qn,n.mapValuesSeries=Gr,n.memoize=Pn,n.nextTick=Hr,n.parallel=Dn,n.parallelLimit=Rn,n.priorityQueue=Kr,n.queue=Jr,n.race=Cn,n.reduce=dn,n.reduceRight=$n,n.reflect=Wn,n.reflectAll=Nn,n.reject=Xr,n.rejectLimit=Yr,n.rejectSeries=Zr,n.retry=Hn,n.retryable=nu,n.seq=mn,n.series=Jn,n.setImmediate=lt,n.some=tu,n.someLimit=eu,n.someSeries=ru,n.sortBy=Kn,n.timeout=Xn,n.times=ou,n.timesLimit=Zn,n.timesSeries=cu,n.transform=nt,n.tryEach=tt,n.unmemoize=et,n.until=ut,n.waterfall=fu,n.whilst=rt,n.all=qr,n.allLimit=zr,n.allSeries=Pr,n.any=tu,n.anyLimit=eu,n.anySeries=ru,n.find=Fr,n.findLimit=Ir,n.findSeries=_r,n.forEach=En,n.forEachSeries=Ur,n.forEachLimit=An,n.forEachOf=Ie,n.forEachOfSeries=Or,n.forEachOfLimit=z,n.inject=dn,n.foldl=dn,n.foldr=$n,n.select=Vr,n.selectLimit=Dr,n.selectSeries=Rr,n.wrapSync=i,Object.defineProperty(n,"__esModule",{value:!0})});//# sourceMappingURL=async.min.map
(function (global, factory) {typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :typeof define === 'function' && define.amd ? define(['exports'], factory) :(factory((global.async = global.async || {})));}(this, (function (exports) { 'use strict';function slice(arrayLike, start) {start = start|0;var newLen = Math.max(arrayLike.length - start, 0);var newArr = Array(newLen);for(var idx = 0; idx < newLen; idx++) {newArr[idx] = arrayLike[start + idx];}return newArr;}/*** Creates a continuation function with some arguments already applied.** Useful as a shorthand when combined with other control flow functions. Any* arguments passed to the returned function are added to the arguments* originally passed to apply.** @name apply* @static* @memberOf module:Utils* @method* @category Util* @param {Function} fn - The function you want to eventually apply all* arguments to. Invokes with (arguments...).* @param {...*} arguments... - Any number of arguments to automatically apply* when the continuation is called.* @returns {Function} the partially-applied function* @example** // using apply* async.parallel([* async.apply(fs.writeFile, 'testfile1', 'test1'),* async.apply(fs.writeFile, 'testfile2', 'test2')* ]);*** // the same process without using apply* async.parallel([* function(callback) {* fs.writeFile('testfile1', 'test1', callback);* },* function(callback) {* fs.writeFile('testfile2', 'test2', callback);* }* ]);** // It's possible to pass any number of additional arguments when calling the* // continuation:** node> var fn = async.apply(sys.puts, 'one');* node> fn('two', 'three');* one* two* three*/var apply = function(fn/*, ...args*/) {var args = slice(arguments, 1);return function(/*callArgs*/) {var callArgs = slice(arguments);return fn.apply(null, args.concat(callArgs));};};var initialParams = function (fn) {return function (/*...args, callback*/) {var args = slice(arguments);var callback = args.pop();fn.call(this, args, callback);};};/*** Checks if `value` is the* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an object, else `false`.* @example** _.isObject({});* // => true** _.isObject([1, 2, 3]);* // => true** _.isObject(_.noop);* // => true** _.isObject(null);* // => false*/function isObject(value) {var type = typeof value;return value != null && (type == 'object' || type == 'function');}var hasSetImmediate = typeof setImmediate === 'function' && setImmediate;var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';function fallback(fn) {setTimeout(fn, 0);}function wrap(defer) {return function (fn/*, ...args*/) {var args = slice(arguments, 1);defer(function () {fn.apply(null, args);});};}var _defer;if (hasSetImmediate) {_defer = setImmediate;} else if (hasNextTick) {_defer = process.nextTick;} else {_defer = fallback;}var setImmediate$1 = wrap(_defer);/*** Take a sync function and make it async, passing its return value to a* callback. This is useful for plugging sync functions into a waterfall,* series, or other async functions. Any arguments passed to the generated* function will be passed to the wrapped function (except for the final* callback argument). Errors thrown will be passed to the callback.** If the function passed to `asyncify` returns a Promise, that promises's* resolved/rejected state will be used to call the callback, rather than simply* the synchronous return value.** This also means you can asyncify ES2017 `async` functions.** @name asyncify* @static* @memberOf module:Utils* @method* @alias wrapSync* @category Util* @param {Function} func - The synchronous function, or Promise-returning* function to convert to an {@link AsyncFunction}.* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be* invoked with `(args..., callback)`.* @example** // passing a regular synchronous function* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(JSON.parse),* function (data, next) {* // data is the result of parsing the text.* // If there was a parsing error, it would have been caught.* }* ], callback);** // passing a function returning a promise* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(function (contents) {* return db.model.create(contents);* }),* function (model, next) {* // `model` is the instantiated model object.* // If there was an error, this function would be skipped.* }* ], callback);** // es2017 example, though `asyncify` is not needed if your JS environment* // supports async functions out of the box* var q = async.queue(async.asyncify(async function(file) {* var intermediateStep = await processFile(file);* return await somePromise(intermediateStep)* }));** q.push(files);*/function asyncify(func) {return initialParams(function (args, callback) {var result;try {result = func.apply(this, args);} catch (e) {return callback(e);}// if result is Promise objectif (isObject(result) && typeof result.then === 'function') {result.then(function(value) {invokeCallback(callback, null, value);}, function(err) {invokeCallback(callback, err.message ? err : new Error(err));});} else {callback(null, result);}});}function invokeCallback(callback, error, value) {try {callback(error, value);} catch (e) {setImmediate$1(rethrow, e);}}function rethrow(error) {throw error;}var supportsSymbol = typeof Symbol === 'function';function isAsync(fn) {return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';}function wrapAsync(asyncFn) {return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;}function applyEach$1(eachfn) {return function(fns/*, ...args*/) {var args = slice(arguments, 1);var go = initialParams(function(args, callback) {var that = this;return eachfn(fns, function (fn, cb) {wrapAsync(fn).apply(that, args.concat(cb));}, callback);});if (args.length) {return go.apply(this, args);}else {return go;}};}/** Detect free variable `global` from Node.js. */var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;/** Detect free variable `self`. */var freeSelf = typeof self == 'object' && self && self.Object === Object && self;/** Used as a reference to the global object. */var root = freeGlobal || freeSelf || Function('return this')();/** Built-in value references. */var Symbol$1 = root.Symbol;/** Used for built-in method references. */var objectProto = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty = objectProto.hasOwnProperty;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString = objectProto.toString;/** Built-in value references. */var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;/*** A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.** @private* @param {*} value The value to query.* @returns {string} Returns the raw `toStringTag`.*/function getRawTag(value) {var isOwn = hasOwnProperty.call(value, symToStringTag$1),tag = value[symToStringTag$1];try {value[symToStringTag$1] = undefined;var unmasked = true;} catch (e) {}var result = nativeObjectToString.call(value);if (unmasked) {if (isOwn) {value[symToStringTag$1] = tag;} else {delete value[symToStringTag$1];}}return result;}/** Used for built-in method references. */var objectProto$1 = Object.prototype;/*** Used to resolve the* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)* of values.*/var nativeObjectToString$1 = objectProto$1.toString;/*** Converts `value` to a string using `Object.prototype.toString`.** @private* @param {*} value The value to convert.* @returns {string} Returns the converted string.*/function objectToString(value) {return nativeObjectToString$1.call(value);}/** `Object#toString` result references. */var nullTag = '[object Null]';var undefinedTag = '[object Undefined]';/** Built-in value references. */var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;/*** The base implementation of `getTag` without fallbacks for buggy environments.** @private* @param {*} value The value to query.* @returns {string} Returns the `toStringTag`.*/function baseGetTag(value) {if (value == null) {return value === undefined ? undefinedTag : nullTag;}return (symToStringTag && symToStringTag in Object(value))? getRawTag(value): objectToString(value);}/** `Object#toString` result references. */var asyncTag = '[object AsyncFunction]';var funcTag = '[object Function]';var genTag = '[object GeneratorFunction]';var proxyTag = '[object Proxy]';/*** Checks if `value` is classified as a `Function` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a function, else `false`.* @example** _.isFunction(_);* // => true** _.isFunction(/abc/);* // => false*/function isFunction(value) {if (!isObject(value)) {return false;}// The use of `Object#toString` avoids issues with the `typeof` operator// in Safari 9 which returns 'object' for typed arrays and other constructors.var tag = baseGetTag(value);return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;}/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER = 9007199254740991;/*** Checks if `value` is a valid array-like length.** **Note:** This method is loosely based on* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.* @example** _.isLength(3);* // => true** _.isLength(Number.MIN_VALUE);* // => false** _.isLength(Infinity);* // => false** _.isLength('3');* // => false*/function isLength(value) {return typeof value == 'number' &&value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;}/*** Checks if `value` is array-like. A value is considered array-like if it's* not a function and has a `value.length` that's an integer greater than or* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is array-like, else `false`.* @example** _.isArrayLike([1, 2, 3]);* // => true** _.isArrayLike(document.body.children);* // => true** _.isArrayLike('abc');* // => true** _.isArrayLike(_.noop);* // => false*/function isArrayLike(value) {return value != null && isLength(value.length) && !isFunction(value);}// A temporary value used to identify if the loop should be broken.// See #1064, #1293var breakLoop = {};/*** This method returns `undefined`.** @static* @memberOf _* @since 2.3.0* @category Util* @example** _.times(2, _.noop);* // => [undefined, undefined]*/function noop() {// No operation performed.}function once(fn) {return function () {if (fn === null) return;var callFn = fn;fn = null;callFn.apply(this, arguments);};}var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;var getIterator = function (coll) {return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();};/*** The base implementation of `_.times` without support for iteratee shorthands* or max array length checks.** @private* @param {number} n The number of times to invoke `iteratee`.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the array of results.*/function baseTimes(n, iteratee) {var index = -1,result = Array(n);while (++index < n) {result[index] = iteratee(index);}return result;}/*** Checks if `value` is object-like. A value is object-like if it's not `null`* and has a `typeof` result of "object".** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is object-like, else `false`.* @example** _.isObjectLike({});* // => true** _.isObjectLike([1, 2, 3]);* // => true** _.isObjectLike(_.noop);* // => false** _.isObjectLike(null);* // => false*/function isObjectLike(value) {return value != null && typeof value == 'object';}/** `Object#toString` result references. */var argsTag = '[object Arguments]';/*** The base implementation of `_.isArguments`.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,*/function baseIsArguments(value) {return isObjectLike(value) && baseGetTag(value) == argsTag;}/** Used for built-in method references. */var objectProto$3 = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty$2 = objectProto$3.hasOwnProperty;/** Built-in value references. */var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;/*** Checks if `value` is likely an `arguments` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an `arguments` object,* else `false`.* @example** _.isArguments(function() { return arguments; }());* // => true** _.isArguments([1, 2, 3]);* // => false*/var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&!propertyIsEnumerable.call(value, 'callee');};/*** Checks if `value` is classified as an `Array` object.** @static* @memberOf _* @since 0.1.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is an array, else `false`.* @example** _.isArray([1, 2, 3]);* // => true** _.isArray(document.body.children);* // => false** _.isArray('abc');* // => false** _.isArray(_.noop);* // => false*/var isArray = Array.isArray;/*** This method returns `false`.** @static* @memberOf _* @since 4.13.0* @category Util* @returns {boolean} Returns `false`.* @example** _.times(2, _.stubFalse);* // => [false, false]*/function stubFalse() {return false;}/** Detect free variable `exports`. */var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports = freeModule && freeModule.exports === freeExports;/** Built-in value references. */var Buffer = moduleExports ? root.Buffer : undefined;/* Built-in method references for those with the same name as other `lodash` methods. */var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;/*** Checks if `value` is a buffer.** @static* @memberOf _* @since 4.3.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.* @example** _.isBuffer(new Buffer(2));* // => true** _.isBuffer(new Uint8Array(2));* // => false*/var isBuffer = nativeIsBuffer || stubFalse;/** Used as references for various `Number` constants. */var MAX_SAFE_INTEGER$1 = 9007199254740991;/** Used to detect unsigned integer values. */var reIsUint = /^(?:0|[1-9]\d*)$/;/*** Checks if `value` is a valid array-like index.** @private* @param {*} value The value to check.* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.*/function isIndex(value, length) {var type = typeof value;length = length == null ? MAX_SAFE_INTEGER$1 : length;return !!length &&(type == 'number' ||(type != 'symbol' && reIsUint.test(value))) &&(value > -1 && value % 1 == 0 && value < length);}/** `Object#toString` result references. */var argsTag$1 = '[object Arguments]';var arrayTag = '[object Array]';var boolTag = '[object Boolean]';var dateTag = '[object Date]';var errorTag = '[object Error]';var funcTag$1 = '[object Function]';var mapTag = '[object Map]';var numberTag = '[object Number]';var objectTag = '[object Object]';var regexpTag = '[object RegExp]';var setTag = '[object Set]';var stringTag = '[object String]';var weakMapTag = '[object WeakMap]';var arrayBufferTag = '[object ArrayBuffer]';var dataViewTag = '[object DataView]';var float32Tag = '[object Float32Array]';var float64Tag = '[object Float64Array]';var int8Tag = '[object Int8Array]';var int16Tag = '[object Int16Array]';var int32Tag = '[object Int32Array]';var uint8Tag = '[object Uint8Array]';var uint8ClampedTag = '[object Uint8ClampedArray]';var uint16Tag = '[object Uint16Array]';var uint32Tag = '[object Uint32Array]';/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags = {};typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =typedArrayTags[uint32Tag] = true;typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =typedArrayTags[errorTag] = typedArrayTags[funcTag$1] =typedArrayTags[mapTag] = typedArrayTags[numberTag] =typedArrayTags[objectTag] = typedArrayTags[regexpTag] =typedArrayTags[setTag] = typedArrayTags[stringTag] =typedArrayTags[weakMapTag] = false;/*** The base implementation of `_.isTypedArray` without Node.js optimizations.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.*/function baseIsTypedArray(value) {return isObjectLike(value) &&isLength(value.length) && !!typedArrayTags[baseGetTag(value)];}/*** The base implementation of `_.unary` without support for storing metadata.** @private* @param {Function} func The function to cap arguments for.* @returns {Function} Returns the new capped function.*/function baseUnary(func) {return function(value) {return func(value);};}/** Detect free variable `exports`. */var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;/** Detect free variable `module`. */var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;/** Detect free variable `process` from Node.js. */var freeProcess = moduleExports$1 && freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil = (function() {try {// Use `util.types` for Node.js 10+.var types = freeModule$1 && freeModule$1.require && freeModule$1.require('util').types;if (types) {return types;}// Legacy `process.binding('util')` for Node.js < 10.return freeProcess && freeProcess.binding && freeProcess.binding('util');} catch (e) {}}());/* Node.js helper references. */var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;/*** Checks if `value` is classified as a typed array.** @static* @memberOf _* @since 3.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.* @example** _.isTypedArray(new Uint8Array);* // => true** _.isTypedArray([]);* // => false*/var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;/** Used for built-in method references. */var objectProto$2 = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty$1 = objectProto$2.hasOwnProperty;/*** Creates an array of the enumerable property names of the array-like `value`.** @private* @param {*} value The value to query.* @param {boolean} inherited Specify returning inherited property names.* @returns {Array} Returns the array of property names.*/function arrayLikeKeys(value, inherited) {var isArr = isArray(value),isArg = !isArr && isArguments(value),isBuff = !isArr && !isArg && isBuffer(value),isType = !isArr && !isArg && !isBuff && isTypedArray(value),skipIndexes = isArr || isArg || isBuff || isType,result = skipIndexes ? baseTimes(value.length, String) : [],length = result.length;for (var key in value) {if ((inherited || hasOwnProperty$1.call(value, key)) &&!(skipIndexes && (// Safari 9 has enumerable `arguments.length` in strict mode.key == 'length' ||// Node.js 0.10 has enumerable non-index properties on buffers.(isBuff && (key == 'offset' || key == 'parent')) ||// PhantomJS 2 has enumerable non-index properties on typed arrays.(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||// Skip index properties.isIndex(key, length)))) {result.push(key);}}return result;}/** Used for built-in method references. */var objectProto$5 = Object.prototype;/*** Checks if `value` is likely a prototype object.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.*/function isPrototype(value) {var Ctor = value && value.constructor,proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;return value === proto;}/*** Creates a unary function that invokes `func` with its argument transformed.** @private* @param {Function} func The function to wrap.* @param {Function} transform The argument transform.* @returns {Function} Returns the new function.*/function overArg(func, transform) {return function(arg) {return func(transform(arg));};}/* Built-in method references for those with the same name as other `lodash` methods. */var nativeKeys = overArg(Object.keys, Object);/** Used for built-in method references. */var objectProto$4 = Object.prototype;/** Used to check objects for own properties. */var hasOwnProperty$3 = objectProto$4.hasOwnProperty;/*** The base implementation of `_.keys` which doesn't treat sparse arrays as dense.** @private* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.*/function baseKeys(object) {if (!isPrototype(object)) {return nativeKeys(object);}var result = [];for (var key in Object(object)) {if (hasOwnProperty$3.call(object, key) && key != 'constructor') {result.push(key);}}return result;}/*** Creates an array of the own enumerable property names of `object`.** **Note:** Non-object values are coerced to objects. See the* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)* for more details.** @static* @since 0.1.0* @memberOf _* @category Object* @param {Object} object The object to query.* @returns {Array} Returns the array of property names.* @example** function Foo() {* this.a = 1;* this.b = 2;* }** Foo.prototype.c = 3;** _.keys(new Foo);* // => ['a', 'b'] (iteration order is not guaranteed)** _.keys('hi');* // => ['0', '1']*/function keys(object) {return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);}function createArrayIterator(coll) {var i = -1;var len = coll.length;return function next() {return ++i < len ? {value: coll[i], key: i} : null;}}function createES2015Iterator(iterator) {var i = -1;return function next() {var item = iterator.next();if (item.done)return null;i++;return {value: item.value, key: i};}}function createObjectIterator(obj) {var okeys = keys(obj);var i = -1;var len = okeys.length;return function next() {var key = okeys[++i];return i < len ? {value: obj[key], key: key} : null;};}function iterator(coll) {if (isArrayLike(coll)) {return createArrayIterator(coll);}var iterator = getIterator(coll);return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);}function onlyOnce(fn) {return function() {if (fn === null) throw new Error("Callback was already called.");var callFn = fn;fn = null;callFn.apply(this, arguments);};}function _eachOfLimit(limit) {return function (obj, iteratee, callback) {callback = once(callback || noop);if (limit <= 0 || !obj) {return callback(null);}var nextElem = iterator(obj);var done = false;var running = 0;var looping = false;function iterateeCallback(err, value) {running -= 1;if (err) {done = true;callback(err);}else if (value === breakLoop || (done && running <= 0)) {done = true;return callback(null);}else if (!looping) {replenish();}}function replenish () {looping = true;while (running < limit && !done) {var elem = nextElem();if (elem === null) {done = true;if (running <= 0) {callback(null);}return;}running += 1;iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));}looping = false;}replenish();};}/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a* time.** @name eachOfLimit* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`. The `key` is the item's key, or index in the case of an* array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachOfLimit(coll, limit, iteratee, callback) {_eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);}function doLimit(fn, limit) {return function (iterable, iteratee, callback) {return fn(iterable, limit, iteratee, callback);};}// eachOf implementation optimized for array-likesfunction eachOfArrayLike(coll, iteratee, callback) {callback = once(callback || noop);var index = 0,completed = 0,length = coll.length;if (length === 0) {callback(null);}function iteratorCallback(err, value) {if (err) {callback(err);} else if ((++completed === length) || value === breakLoop) {callback(null);}}for (; index < length; index++) {iteratee(coll[index], index, onlyOnce(iteratorCallback));}}// a generic version of eachOf which can handle array, object, and iterator cases.var eachOfGeneric = doLimit(eachOfLimit, Infinity);/*** Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument* to the iteratee.** @name eachOf* @static* @memberOf module:Collections* @method* @alias forEachOf* @category Collection* @see [async.each]{@link module:Collections.each}* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each* item in `coll`.* The `key` is the item's key, or index in the case of an array.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};* var configs = {};** async.forEachOf(obj, function (value, key, callback) {* fs.readFile(__dirname + value, "utf8", function (err, data) {* if (err) return callback(err);* try {* configs[key] = JSON.parse(data);* } catch (e) {* return callback(e);* }* callback();* });* }, function (err) {* if (err) console.error(err.message);* // configs is now a map of JSON data* doSomethingWith(configs);* });*/var eachOf = function(coll, iteratee, callback) {var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;eachOfImplementation(coll, wrapAsync(iteratee), callback);};function doParallel(fn) {return function (obj, iteratee, callback) {return fn(eachOf, obj, wrapAsync(iteratee), callback);};}function _asyncMap(eachfn, arr, iteratee, callback) {callback = callback || noop;arr = arr || [];var results = [];var counter = 0;var _iteratee = wrapAsync(iteratee);eachfn(arr, function (value, _, callback) {var index = counter++;_iteratee(value, function (err, v) {results[index] = v;callback(err);});}, function (err) {callback(err, results);});}/*** Produces a new collection of values by mapping each value in `coll` through* the `iteratee` function. The `iteratee` is called with an item from `coll`* and a callback for when it has finished processing. Each of these callback* takes 2 arguments: an `error`, and the transformed item from `coll`. If* `iteratee` passes an error to its callback, the main `callback` (for the* `map` function) is immediately called with the error.** Note, that since this function applies the `iteratee` to each item in* parallel, there is no guarantee that the `iteratee` functions will complete* in order. However, the results array will be in the same order as the* original `coll`.** If `map` is passed an Object, the results will be an Array. The results* will roughly be in the order of the original Objects' keys (but this can* vary across JavaScript engines).** @name map* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an Array of the* transformed items from the `coll`. Invoked with (err, results).* @example** async.map(['file1','file2','file3'], fs.stat, function(err, results) {* // results is now an array of stats for each file* });*/var map = doParallel(_asyncMap);/*** Applies the provided arguments to each function in the array, calling* `callback` after all functions have completed. If you only provide the first* argument, `fns`, then it will return a function which lets you pass in the* arguments as if it were a single function call. If more arguments are* provided, `callback` is required while `args` is still optional.** @name applyEach* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s* to all call with the same arguments* @param {...*} [args] - any number of separate arguments to pass to the* function.* @param {Function} [callback] - the final argument should be the callback,* called when all functions have completed processing.* @returns {Function} - If only the first argument, `fns`, is provided, it will* return a function which lets you pass in the arguments as if it were a single* function call. The signature is `(..args, callback)`. If invoked with any* arguments, `callback` is required.* @example** async.applyEach([enableSearch, updateSchema], 'bucket', callback);** // partial application example:* async.each(* buckets,* async.applyEach([enableSearch, updateSchema]),* callback* );*/var applyEach = applyEach$1(map);function doParallelLimit(fn) {return function (obj, limit, iteratee, callback) {return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);};}/*** The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.** @name mapLimit* @static* @memberOf module:Collections* @method* @see [async.map]{@link module:Collections.map}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an array of the* transformed items from the `coll`. Invoked with (err, results).*/var mapLimit = doParallelLimit(_asyncMap);/*** The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.** @name mapSeries* @static* @memberOf module:Collections* @method* @see [async.map]{@link module:Collections.map}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with the transformed item.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Results is an array of the* transformed items from the `coll`. Invoked with (err, results).*/var mapSeries = doLimit(mapLimit, 1);/*** The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.** @name applyEachSeries* @static* @memberOf module:ControlFlow* @method* @see [async.applyEach]{@link module:ControlFlow.applyEach}* @category Control Flow* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all* call with the same arguments* @param {...*} [args] - any number of separate arguments to pass to the* function.* @param {Function} [callback] - the final argument should be the callback,* called when all functions have completed processing.* @returns {Function} - If only the first argument is provided, it will return* a function which lets you pass in the arguments as if it were a single* function call.*/var applyEachSeries = applyEach$1(mapSeries);/*** A specialized version of `_.forEach` for arrays without support for* iteratee shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns `array`.*/function arrayEach(array, iteratee) {var index = -1,length = array == null ? 0 : array.length;while (++index < length) {if (iteratee(array[index], index, array) === false) {break;}}return array;}/*** Creates a base function for methods like `_.forIn` and `_.forOwn`.** @private* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Function} Returns the new base function.*/function createBaseFor(fromRight) {return function(object, iteratee, keysFunc) {var index = -1,iterable = Object(object),props = keysFunc(object),length = props.length;while (length--) {var key = props[fromRight ? length : ++index];if (iteratee(iterable[key], key, iterable) === false) {break;}}return object;};}/*** The base implementation of `baseForOwn` which iterates over `object`* properties returned by `keysFunc` and invokes `iteratee` for each property.* Iteratee functions may exit iteration early by explicitly returning `false`.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @param {Function} keysFunc The function to get the keys of `object`.* @returns {Object} Returns `object`.*/var baseFor = createBaseFor();/*** The base implementation of `_.forOwn` without support for iteratee shorthands.** @private* @param {Object} object The object to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Object} Returns `object`.*/function baseForOwn(object, iteratee) {return object && baseFor(object, iteratee, keys);}/*** The base implementation of `_.findIndex` and `_.findLastIndex` without* support for iteratee shorthands.** @private* @param {Array} array The array to inspect.* @param {Function} predicate The function invoked per iteration.* @param {number} fromIndex The index to search from.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseFindIndex(array, predicate, fromIndex, fromRight) {var length = array.length,index = fromIndex + (fromRight ? 1 : -1);while ((fromRight ? index-- : ++index < length)) {if (predicate(array[index], index, array)) {return index;}}return -1;}/*** The base implementation of `_.isNaN` without support for number objects.** @private* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.*/function baseIsNaN(value) {return value !== value;}/*** A specialized version of `_.indexOf` which performs strict equality* comparisons of values, i.e. `===`.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function strictIndexOf(array, value, fromIndex) {var index = fromIndex - 1,length = array.length;while (++index < length) {if (array[index] === value) {return index;}}return -1;}/*** The base implementation of `_.indexOf` without `fromIndex` bounds checks.** @private* @param {Array} array The array to inspect.* @param {*} value The value to search for.* @param {number} fromIndex The index to search from.* @returns {number} Returns the index of the matched value, else `-1`.*/function baseIndexOf(array, value, fromIndex) {return value === value? strictIndexOf(array, value, fromIndex): baseFindIndex(array, baseIsNaN, fromIndex);}/*** Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on* their requirements. Each function can optionally depend on other functions* being completed first, and each function is run as soon as its requirements* are satisfied.** If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence* will stop. Further tasks will not execute (so any other functions depending* on it will not run), and the main `callback` is immediately called with the* error.** {@link AsyncFunction}s also receive an object containing the results of functions which* have completed so far as the first argument, if they have dependencies. If a* task function has no dependencies, it will only be passed a callback.** @name auto* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Object} tasks - An object. Each of its properties is either a* function or an array of requirements, with the {@link AsyncFunction} itself the last item* in the array. The object's key of a property serves as the name of the task* defined by that property, i.e. can be used when specifying requirements for* other tasks. The function receives one or two arguments:* * a `results` object, containing the results of the previously executed* functions, only passed if the task has any dependencies,* * a `callback(err, result)` function, which must be called when finished,* passing an `error` (which can be `null`) and the result of the function's* execution.* @param {number} [concurrency=Infinity] - An optional `integer` for* determining the maximum number of tasks that can be run in parallel. By* default, as many as possible.* @param {Function} [callback] - An optional callback which is called when all* the tasks have been completed. It receives the `err` argument if any `tasks`* pass an error to their callback. Results are always returned; however, if an* error occurs, no further `tasks` will be performed, and the results object* will only contain partial results. Invoked with (err, results).* @returns undefined* @example** async.auto({* // this function will just be passed a callback* readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),* showData: ['readData', function(results, cb) {* // results.readData is the file's contents* // ...* }]* }, callback);** async.auto({* get_data: function(callback) {* console.log('in get_data');* // async code to get some data* callback(null, 'data', 'converted to array');* },* make_folder: function(callback) {* console.log('in make_folder');* // async code to create a directory to store a file in* // this is run at the same time as getting the data* callback(null, 'folder');* },* write_file: ['get_data', 'make_folder', function(results, callback) {* console.log('in write_file', JSON.stringify(results));* // once there is some data and the directory exists,* // write the data to a file in the directory* callback(null, 'filename');* }],* email_link: ['write_file', function(results, callback) {* console.log('in email_link', JSON.stringify(results));* // once the file is written let's email a link to it...* // results.write_file contains the filename returned by write_file.* callback(null, {'file':results.write_file, 'email':'user@example.com'});* }]* }, function(err, results) {* console.log('err = ', err);* console.log('results = ', results);* });*/var auto = function (tasks, concurrency, callback) {if (typeof concurrency === 'function') {// concurrency is optional, shift the args.callback = concurrency;concurrency = null;}callback = once(callback || noop);var keys$$1 = keys(tasks);var numTasks = keys$$1.length;if (!numTasks) {return callback(null);}if (!concurrency) {concurrency = numTasks;}var results = {};var runningTasks = 0;var hasError = false;var listeners = Object.create(null);var readyTasks = [];// for cycle detection:var readyToCheck = []; // tasks that have been identified as reachable// without the possibility of returning to an ancestor taskvar uncheckedDependencies = {};baseForOwn(tasks, function (task, key) {if (!isArray(task)) {// no dependenciesenqueueTask(key, [task]);readyToCheck.push(key);return;}var dependencies = task.slice(0, task.length - 1);var remainingDependencies = dependencies.length;if (remainingDependencies === 0) {enqueueTask(key, task);readyToCheck.push(key);return;}uncheckedDependencies[key] = remainingDependencies;arrayEach(dependencies, function (dependencyName) {if (!tasks[dependencyName]) {throw new Error('async.auto task `' + key +'` has a non-existent dependency `' +dependencyName + '` in ' +dependencies.join(', '));}addListener(dependencyName, function () {remainingDependencies--;if (remainingDependencies === 0) {enqueueTask(key, task);}});});});checkForDeadlocks();processQueue();function enqueueTask(key, task) {readyTasks.push(function () {runTask(key, task);});}function processQueue() {if (readyTasks.length === 0 && runningTasks === 0) {return callback(null, results);}while(readyTasks.length && runningTasks < concurrency) {var run = readyTasks.shift();run();}}function addListener(taskName, fn) {var taskListeners = listeners[taskName];if (!taskListeners) {taskListeners = listeners[taskName] = [];}taskListeners.push(fn);}function taskComplete(taskName) {var taskListeners = listeners[taskName] || [];arrayEach(taskListeners, function (fn) {fn();});processQueue();}function runTask(key, task) {if (hasError) return;var taskCallback = onlyOnce(function(err, result) {runningTasks--;if (arguments.length > 2) {result = slice(arguments, 1);}if (err) {var safeResults = {};baseForOwn(results, function(val, rkey) {safeResults[rkey] = val;});safeResults[key] = result;hasError = true;listeners = Object.create(null);callback(err, safeResults);} else {results[key] = result;taskComplete(key);}});runningTasks++;var taskFn = wrapAsync(task[task.length - 1]);if (task.length > 1) {taskFn(results, taskCallback);} else {taskFn(taskCallback);}}function checkForDeadlocks() {// Kahn's algorithm// https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm// http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.htmlvar currentTask;var counter = 0;while (readyToCheck.length) {currentTask = readyToCheck.pop();counter++;arrayEach(getDependents(currentTask), function (dependent) {if (--uncheckedDependencies[dependent] === 0) {readyToCheck.push(dependent);}});}if (counter !== numTasks) {throw new Error('async.auto cannot execute tasks due to a recursive dependency');}}function getDependents(taskName) {var result = [];baseForOwn(tasks, function (task, key) {if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {result.push(key);}});return result;}};/*** A specialized version of `_.map` for arrays without support for iteratee* shorthands.** @private* @param {Array} [array] The array to iterate over.* @param {Function} iteratee The function invoked per iteration.* @returns {Array} Returns the new mapped array.*/function arrayMap(array, iteratee) {var index = -1,length = array == null ? 0 : array.length,result = Array(length);while (++index < length) {result[index] = iteratee(array[index], index, array);}return result;}/** `Object#toString` result references. */var symbolTag = '[object Symbol]';/*** Checks if `value` is classified as a `Symbol` primitive or object.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to check.* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.* @example** _.isSymbol(Symbol.iterator);* // => true** _.isSymbol('abc');* // => false*/function isSymbol(value) {return typeof value == 'symbol' ||(isObjectLike(value) && baseGetTag(value) == symbolTag);}/** Used as references for various `Number` constants. */var INFINITY = 1 / 0;/** Used to convert symbols to primitives and strings. */var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;var symbolToString = symbolProto ? symbolProto.toString : undefined;/*** The base implementation of `_.toString` which doesn't convert nullish* values to empty strings.** @private* @param {*} value The value to process.* @returns {string} Returns the string.*/function baseToString(value) {// Exit early for strings to avoid a performance hit in some environments.if (typeof value == 'string') {return value;}if (isArray(value)) {// Recursively convert values (susceptible to call stack limits).return arrayMap(value, baseToString) + '';}if (isSymbol(value)) {return symbolToString ? symbolToString.call(value) : '';}var result = (value + '');return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;}/*** The base implementation of `_.slice` without an iteratee call guard.** @private* @param {Array} array The array to slice.* @param {number} [start=0] The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the slice of `array`.*/function baseSlice(array, start, end) {var index = -1,length = array.length;if (start < 0) {start = -start > length ? 0 : (length + start);}end = end > length ? length : end;if (end < 0) {end += length;}length = start > end ? 0 : ((end - start) >>> 0);start >>>= 0;var result = Array(length);while (++index < length) {result[index] = array[index + start];}return result;}/*** Casts `array` to a slice if it's needed.** @private* @param {Array} array The array to inspect.* @param {number} start The start position.* @param {number} [end=array.length] The end position.* @returns {Array} Returns the cast slice.*/function castSlice(array, start, end) {var length = array.length;end = end === undefined ? length : end;return (!start && end >= length) ? array : baseSlice(array, start, end);}/*** Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the last unmatched string symbol.*/function charsEndIndex(strSymbols, chrSymbols) {var index = strSymbols.length;while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}/*** Used by `_.trim` and `_.trimStart` to get the index of the first string symbol* that is not found in the character symbols.** @private* @param {Array} strSymbols The string symbols to inspect.* @param {Array} chrSymbols The character symbols to find.* @returns {number} Returns the index of the first unmatched string symbol.*/function charsStartIndex(strSymbols, chrSymbols) {var index = -1,length = strSymbols.length;while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}return index;}/*** Converts an ASCII `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function asciiToArray(string) {return string.split('');}/** Used to compose unicode character classes. */var rsAstralRange = '\\ud800-\\udfff';var rsComboMarksRange = '\\u0300-\\u036f';var reComboHalfMarksRange = '\\ufe20-\\ufe2f';var rsComboSymbolsRange = '\\u20d0-\\u20ff';var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;var rsVarRange = '\\ufe0e\\ufe0f';/** Used to compose unicode capture groups. */var rsZWJ = '\\u200d';/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');/*** Checks if `string` contains Unicode symbols.** @private* @param {string} string The string to inspect.* @returns {boolean} Returns `true` if a symbol is found, else `false`.*/function hasUnicode(string) {return reHasUnicode.test(string);}/** Used to compose unicode character classes. */var rsAstralRange$1 = '\\ud800-\\udfff';var rsComboMarksRange$1 = '\\u0300-\\u036f';var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;var rsVarRange$1 = '\\ufe0e\\ufe0f';/** Used to compose unicode capture groups. */var rsAstral = '[' + rsAstralRange$1 + ']';var rsCombo = '[' + rsComboRange$1 + ']';var rsFitz = '\\ud83c[\\udffb-\\udfff]';var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';var rsNonAstral = '[^' + rsAstralRange$1 + ']';var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}';var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]';var rsZWJ$1 = '\\u200d';/** Used to compose unicode regexes. */var reOptMod = rsModifier + '?';var rsOptVar = '[' + rsVarRange$1 + ']?';var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';var rsSeq = rsOptVar + reOptMod + rsOptJoin;var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');/*** Converts a Unicode `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function unicodeToArray(string) {return string.match(reUnicode) || [];}/*** Converts `string` to an array.** @private* @param {string} string The string to convert.* @returns {Array} Returns the converted array.*/function stringToArray(string) {return hasUnicode(string)? unicodeToArray(string): asciiToArray(string);}/*** Converts `value` to a string. An empty string is returned for `null`* and `undefined` values. The sign of `-0` is preserved.** @static* @memberOf _* @since 4.0.0* @category Lang* @param {*} value The value to convert.* @returns {string} Returns the converted string.* @example** _.toString(null);* // => ''** _.toString(-0);* // => '-0'** _.toString([1, 2, 3]);* // => '1,2,3'*/function toString(value) {return value == null ? '' : baseToString(value);}/** Used to match leading and trailing whitespace. */var reTrim = /^\s+|\s+$/g;/*** Removes leading and trailing whitespace or specified characters from `string`.** @static* @memberOf _* @since 3.0.0* @category String* @param {string} [string=''] The string to trim.* @param {string} [chars=whitespace] The characters to trim.* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.* @returns {string} Returns the trimmed string.* @example** _.trim(' abc ');* // => 'abc'** _.trim('-_-abc-_-', '_-');* // => 'abc'** _.map([' foo ', ' bar '], _.trim);* // => ['foo', 'bar']*/function trim(string, chars, guard) {string = toString(string);if (string && (guard || chars === undefined)) {return string.replace(reTrim, '');}if (!string || !(chars = baseToString(chars))) {return string;}var strSymbols = stringToArray(string),chrSymbols = stringToArray(chars),start = charsStartIndex(strSymbols, chrSymbols),end = charsEndIndex(strSymbols, chrSymbols) + 1;return castSlice(strSymbols, start, end).join('');}var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;var FN_ARG_SPLIT = /,/;var FN_ARG = /(=.+)?(\s*)$/;var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;function parseParams(func) {func = func.toString().replace(STRIP_COMMENTS, '');func = func.match(FN_ARGS)[2].replace(' ', '');func = func ? func.split(FN_ARG_SPLIT) : [];func = func.map(function (arg){return trim(arg.replace(FN_ARG, ''));});return func;}/*** A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent* tasks are specified as parameters to the function, after the usual callback* parameter, with the parameter names matching the names of the tasks it* depends on. This can provide even more readable task graphs which can be* easier to maintain.** If a final callback is specified, the task results are similarly injected,* specified as named parameters after the initial error parameter.** The autoInject function is purely syntactic sugar and its semantics are* otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.** @name autoInject* @static* @memberOf module:ControlFlow* @method* @see [async.auto]{@link module:ControlFlow.auto}* @category Control Flow* @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of* the form 'func([dependencies...], callback). The object's key of a property* serves as the name of the task defined by that property, i.e. can be used* when specifying requirements for other tasks.* * The `callback` parameter is a `callback(err, result)` which must be called* when finished, passing an `error` (which can be `null`) and the result of* the function's execution. The remaining parameters name other tasks on* which the task is dependent, and the results from those tasks are the* arguments of those parameters.* @param {Function} [callback] - An optional callback which is called when all* the tasks have been completed. It receives the `err` argument if any `tasks`* pass an error to their callback, and a `results` object with any completed* task results, similar to `auto`.* @example** // The example from `auto` can be rewritten as follows:* async.autoInject({* get_data: function(callback) {* // async code to get some data* callback(null, 'data', 'converted to array');* },* make_folder: function(callback) {* // async code to create a directory to store a file in* // this is run at the same time as getting the data* callback(null, 'folder');* },* write_file: function(get_data, make_folder, callback) {* // once there is some data and the directory exists,* // write the data to a file in the directory* callback(null, 'filename');* },* email_link: function(write_file, callback) {* // once the file is written let's email a link to it...* // write_file contains the filename returned by write_file.* callback(null, {'file':write_file, 'email':'user@example.com'});* }* }, function(err, results) {* console.log('err = ', err);* console.log('email_link = ', results.email_link);* });** // If you are using a JS minifier that mangles parameter names, `autoInject`* // will not work with plain functions, since the parameter names will be* // collapsed to a single letter identifier. To work around this, you can* // explicitly specify the names of the parameters your task function needs* // in an array, similar to Angular.js dependency injection.** // This still has an advantage over plain `auto`, since the results a task* // depends on are still spread into arguments.* async.autoInject({* //...* write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {* callback(null, 'filename');* }],* email_link: ['write_file', function(write_file, callback) {* callback(null, {'file':write_file, 'email':'user@example.com'});* }]* //...* }, function(err, results) {* console.log('err = ', err);* console.log('email_link = ', results.email_link);* });*/function autoInject(tasks, callback) {var newTasks = {};baseForOwn(tasks, function (taskFn, key) {var params;var fnIsAsync = isAsync(taskFn);var hasNoDeps =(!fnIsAsync && taskFn.length === 1) ||(fnIsAsync && taskFn.length === 0);if (isArray(taskFn)) {params = taskFn.slice(0, -1);taskFn = taskFn[taskFn.length - 1];newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);} else if (hasNoDeps) {// no dependencies, use the function as-isnewTasks[key] = taskFn;} else {params = parseParams(taskFn);if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {throw new Error("autoInject task functions require explicit parameters.");}// remove callback paramif (!fnIsAsync) params.pop();newTasks[key] = params.concat(newTask);}function newTask(results, taskCb) {var newArgs = arrayMap(params, function (name) {return results[name];});newArgs.push(taskCb);wrapAsync(taskFn).apply(null, newArgs);}});auto(newTasks, callback);}// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation// used for queues. This implementation assumes that the node provided by the user can be modified// to adjust the next and last properties. We implement only the minimal functionality// for queue support.function DLL() {this.head = this.tail = null;this.length = 0;}function setInitial(dll, node) {dll.length = 1;dll.head = dll.tail = node;}DLL.prototype.removeLink = function(node) {if (node.prev) node.prev.next = node.next;else this.head = node.next;if (node.next) node.next.prev = node.prev;else this.tail = node.prev;node.prev = node.next = null;this.length -= 1;return node;};DLL.prototype.empty = function () {while(this.head) this.shift();return this;};DLL.prototype.insertAfter = function(node, newNode) {newNode.prev = node;newNode.next = node.next;if (node.next) node.next.prev = newNode;else this.tail = newNode;node.next = newNode;this.length += 1;};DLL.prototype.insertBefore = function(node, newNode) {newNode.prev = node.prev;newNode.next = node;if (node.prev) node.prev.next = newNode;else this.head = newNode;node.prev = newNode;this.length += 1;};DLL.prototype.unshift = function(node) {if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);};DLL.prototype.push = function(node) {if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);};DLL.prototype.shift = function() {return this.head && this.removeLink(this.head);};DLL.prototype.pop = function() {return this.tail && this.removeLink(this.tail);};DLL.prototype.toArray = function () {var arr = Array(this.length);var curr = this.head;for(var idx = 0; idx < this.length; idx++) {arr[idx] = curr.data;curr = curr.next;}return arr;};DLL.prototype.remove = function (testFn) {var curr = this.head;while(!!curr) {var next = curr.next;if (testFn(curr)) {this.removeLink(curr);}curr = next;}return this;};function queue(worker, concurrency, payload) {if (concurrency == null) {concurrency = 1;}else if(concurrency === 0) {throw new Error('Concurrency must not be zero');}var _worker = wrapAsync(worker);var numRunning = 0;var workersList = [];var processingScheduled = false;function _insert(data, insertAtFront, callback) {if (callback != null && typeof callback !== 'function') {throw new Error('task callback must be a function');}q.started = true;if (!isArray(data)) {data = [data];}if (data.length === 0 && q.idle()) {// call drain immediately if there are no tasksreturn setImmediate$1(function() {q.drain();});}for (var i = 0, l = data.length; i < l; i++) {var item = {data: data[i],callback: callback || noop};if (insertAtFront) {q._tasks.unshift(item);} else {q._tasks.push(item);}}if (!processingScheduled) {processingScheduled = true;setImmediate$1(function() {processingScheduled = false;q.process();});}}function _next(tasks) {return function(err){numRunning -= 1;for (var i = 0, l = tasks.length; i < l; i++) {var task = tasks[i];var index = baseIndexOf(workersList, task, 0);if (index === 0) {workersList.shift();} else if (index > 0) {workersList.splice(index, 1);}task.callback.apply(task, arguments);if (err != null) {q.error(err, task.data);}}if (numRunning <= (q.concurrency - q.buffer) ) {q.unsaturated();}if (q.idle()) {q.drain();}q.process();};}var isProcessing = false;var q = {_tasks: new DLL(),concurrency: concurrency,payload: payload,saturated: noop,unsaturated:noop,buffer: concurrency / 4,empty: noop,drain: noop,error: noop,started: false,paused: false,push: function (data, callback) {_insert(data, false, callback);},kill: function () {q.drain = noop;q._tasks.empty();},unshift: function (data, callback) {_insert(data, true, callback);},remove: function (testFn) {q._tasks.remove(testFn);},process: function () {// Avoid trying to start too many processing operations. This can occur// when callbacks resolve synchronously (#1267).if (isProcessing) {return;}isProcessing = true;while(!q.paused && numRunning < q.concurrency && q._tasks.length){var tasks = [], data = [];var l = q._tasks.length;if (q.payload) l = Math.min(l, q.payload);for (var i = 0; i < l; i++) {var node = q._tasks.shift();tasks.push(node);workersList.push(node);data.push(node.data);}numRunning += 1;if (q._tasks.length === 0) {q.empty();}if (numRunning === q.concurrency) {q.saturated();}var cb = onlyOnce(_next(tasks));_worker(data, cb);}isProcessing = false;},length: function () {return q._tasks.length;},running: function () {return numRunning;},workersList: function () {return workersList;},idle: function() {return q._tasks.length + numRunning === 0;},pause: function () {q.paused = true;},resume: function () {if (q.paused === false) { return; }q.paused = false;setImmediate$1(q.process);}};return q;}/*** A cargo of tasks for the worker function to complete. Cargo inherits all of* the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.* @typedef {Object} CargoObject* @memberOf module:ControlFlow* @property {Function} length - A function returning the number of items* waiting to be processed. Invoke like `cargo.length()`.* @property {number} payload - An `integer` for determining how many tasks* should be process per round. This property can be changed after a `cargo` is* created to alter the payload on-the-fly.* @property {Function} push - Adds `task` to the `queue`. The callback is* called once the `worker` has finished processing the task. Instead of a* single task, an array of `tasks` can be submitted. The respective callback is* used for every task in the list. Invoke like `cargo.push(task, [callback])`.* @property {Function} saturated - A callback that is called when the* `queue.length()` hits the concurrency and further tasks will be queued.* @property {Function} empty - A callback that is called when the last item* from the `queue` is given to a `worker`.* @property {Function} drain - A callback that is called when the last item* from the `queue` has returned from the `worker`.* @property {Function} idle - a function returning false if there are items* waiting or being processed, or true if not. Invoke like `cargo.idle()`.* @property {Function} pause - a function that pauses the processing of tasks* until `resume()` is called. Invoke like `cargo.pause()`.* @property {Function} resume - a function that resumes the processing of* queued tasks when the queue is paused. Invoke like `cargo.resume()`.* @property {Function} kill - a function that removes the `drain` callback and* empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.*//*** Creates a `cargo` object with the specified payload. Tasks added to the* cargo will be processed altogether (up to the `payload` limit). If the* `worker` is in progress, the task is queued until it becomes available. Once* the `worker` has completed some tasks, each callback of those tasks is* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)* for how `cargo` and `queue` work.** While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers* at a time, cargo passes an array of tasks to a single worker, repeating* when the worker is finished.** @name cargo* @static* @memberOf module:ControlFlow* @method* @see [async.queue]{@link module:ControlFlow.queue}* @category Control Flow* @param {AsyncFunction} worker - An asynchronous function for processing an array* of queued tasks. Invoked with `(tasks, callback)`.* @param {number} [payload=Infinity] - An optional `integer` for determining* how many tasks should be processed per round; if omitted, the default is* unlimited.* @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can* attached as certain properties to listen for specific events during the* lifecycle of the cargo and inner queue.* @example** // create a cargo object with payload 2* var cargo = async.cargo(function(tasks, callback) {* for (var i=0; i<tasks.length; i++) {* console.log('hello ' + tasks[i].name);* }* callback();* }, 2);** // add some items* cargo.push({name: 'foo'}, function(err) {* console.log('finished processing foo');* });* cargo.push({name: 'bar'}, function(err) {* console.log('finished processing bar');* });* cargo.push({name: 'baz'}, function(err) {* console.log('finished processing baz');* });*/function cargo(worker, payload) {return queue(worker, 1, payload);}/*** The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.** @name eachOfSeries* @static* @memberOf module:Collections* @method* @see [async.eachOf]{@link module:Collections.eachOf}* @alias forEachOfSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* Invoked with (item, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Invoked with (err).*/var eachOfSeries = doLimit(eachOfLimit, 1);/*** Reduces `coll` into a single value using an async `iteratee` to return each* successive step. `memo` is the initial state of the reduction. This function* only operates in series.** For performance reasons, it may make sense to split a call to this function* into a parallel map, and then use the normal `Array.prototype.reduce` on the* results. This function is for situations where each step in the reduction* needs to be async; if you can get the data before reducing it, then it's* probably a good idea to do so.** @name reduce* @static* @memberOf module:Collections* @method* @alias inject* @alias foldl* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).* @example** async.reduce([1,2,3], 0, function(memo, item, callback) {* // pointless async:* process.nextTick(function() {* callback(null, memo + item)* });* }, function(err, result) {* // result is now equal to the last value of memo, which is 6* });*/function reduce(coll, memo, iteratee, callback) {callback = once(callback || noop);var _iteratee = wrapAsync(iteratee);eachOfSeries(coll, function(x, i, callback) {_iteratee(memo, x, function(err, v) {memo = v;callback(err);});}, function(err) {callback(err, memo);});}/*** Version of the compose function that is more natural to read. Each function* consumes the return value of the previous function. It is the equivalent of* [compose]{@link module:ControlFlow.compose} with the arguments reversed.** Each function is executed with the `this` binding of the composed function.** @name seq* @static* @memberOf module:ControlFlow* @method* @see [async.compose]{@link module:ControlFlow.compose}* @category Control Flow* @param {...AsyncFunction} functions - the asynchronous functions to compose* @returns {Function} a function that composes the `functions` in order* @example** // Requires lodash (or underscore), express3 and dresende's orm2.* // Part of an app, that fetches cats of the logged user.* // This example uses `seq` function to avoid overnesting and error* // handling clutter.* app.get('/cats', function(request, response) {* var User = request.models.User;* async.seq(* _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))* function(user, fn) {* user.getCats(fn); // 'getCats' has signature (callback(err, data))* }* )(req.session.user_id, function (err, cats) {* if (err) {* console.error(err);* response.json({ status: 'error', message: err.message });* } else {* response.json({ status: 'ok', message: 'Cats found', data: cats });* }* });* });*/function seq(/*...functions*/) {var _functions = arrayMap(arguments, wrapAsync);return function(/*...args*/) {var args = slice(arguments);var that = this;var cb = args[args.length - 1];if (typeof cb == 'function') {args.pop();} else {cb = noop;}reduce(_functions, args, function(newargs, fn, cb) {fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) {var nextargs = slice(arguments, 1);cb(err, nextargs);}));},function(err, results) {cb.apply(that, [err].concat(results));});};}/*** Creates a function which is a composition of the passed asynchronous* functions. Each function consumes the return value of the function that* follows. Composing functions `f()`, `g()`, and `h()` would produce the result* of `f(g(h()))`, only this version uses callbacks to obtain the return values.** Each function is executed with the `this` binding of the composed function.** @name compose* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {...AsyncFunction} functions - the asynchronous functions to compose* @returns {Function} an asynchronous function that is the composed* asynchronous `functions`* @example** function add1(n, callback) {* setTimeout(function () {* callback(null, n + 1);* }, 10);* }** function mul3(n, callback) {* setTimeout(function () {* callback(null, n * 3);* }, 10);* }** var add1mul3 = async.compose(mul3, add1);* add1mul3(4, function (err, result) {* // result now equals 15* });*/var compose = function(/*...args*/) {return seq.apply(null, slice(arguments).reverse());};var _concat = Array.prototype.concat;/*** The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.** @name concatLimit* @static* @memberOf module:Collections* @method* @see [async.concat]{@link module:Collections.concat}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,* which should use an array as its result. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).*/var concatLimit = function(coll, limit, iteratee, callback) {callback = callback || noop;var _iteratee = wrapAsync(iteratee);mapLimit(coll, limit, function(val, callback) {_iteratee(val, function(err /*, ...args*/) {if (err) return callback(err);return callback(null, slice(arguments, 1));});}, function(err, mapResults) {var result = [];for (var i = 0; i < mapResults.length; i++) {if (mapResults[i]) {result = _concat.apply(result, mapResults[i]);}}return callback(err, result);});};/*** Applies `iteratee` to each item in `coll`, concatenating the results. Returns* the concatenated list. The `iteratee`s are called in parallel, and the* results are concatenated as they return. There is no guarantee that the* results array will be returned in the original order of `coll` passed to the* `iteratee` function.** @name concat* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,* which should use an array as its result. Invoked with (item, callback).* @param {Function} [callback(err)] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).* @example** async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {* // files is now a list of filenames that exist in the 3 directories* });*/var concat = doLimit(concatLimit, Infinity);/*** The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.** @name concatSeries* @static* @memberOf module:Collections* @method* @see [async.concat]{@link module:Collections.concat}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.* The iteratee should complete with an array an array of results.* Invoked with (item, callback).* @param {Function} [callback(err)] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).*/var concatSeries = doLimit(concatLimit, 1);/*** Returns a function that when called, calls-back with the values provided.* Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to* [`auto`]{@link module:ControlFlow.auto}.** @name constant* @static* @memberOf module:Utils* @method* @category Util* @param {...*} arguments... - Any number of arguments to automatically invoke* callback with.* @returns {AsyncFunction} Returns a function that when invoked, automatically* invokes the callback with the previous given arguments.* @example** async.waterfall([* async.constant(42),* function (value, next) {* // value === 42* },* //...* ], callback);** async.waterfall([* async.constant(filename, "utf8"),* fs.readFile,* function (fileData, next) {* //...* }* //...* ], callback);** async.auto({* hostname: async.constant("https://server.net/"),* port: findFreePort,* launchServer: ["hostname", "port", function (options, cb) {* startServer(options, cb);* }],* //...* }, callback);*/var constant = function(/*...values*/) {var values = slice(arguments);var args = [null].concat(values);return function (/*...ignoredArgs, callback*/) {var callback = arguments[arguments.length - 1];return callback.apply(this, args);};};/*** This method returns the first argument it receives.** @static* @since 0.1.0* @memberOf _* @category Util* @param {*} value Any value.* @returns {*} Returns `value`.* @example** var object = { 'a': 1 };** console.log(_.identity(object) === object);* // => true*/function identity(value) {return value;}function _createTester(check, getResult) {return function(eachfn, arr, iteratee, cb) {cb = cb || noop;var testPassed = false;var testResult;eachfn(arr, function(value, _, callback) {iteratee(value, function(err, result) {if (err) {callback(err);} else if (check(result) && !testResult) {testPassed = true;testResult = getResult(true, value);callback(null, breakLoop);} else {callback();}});}, function(err) {if (err) {cb(err);} else {cb(null, testPassed ? testResult : getResult(false));}});};}function _findGetResult(v, x) {return x;}/*** Returns the first value in `coll` that passes an async truth test. The* `iteratee` is applied in parallel, meaning the first iteratee to return* `true` will fire the detect `callback` with that result. That means the* result might not be the first item in the original `coll` (in terms of order)* that passes the test.* If order within the original `coll` is important, then look at* [`detectSeries`]{@link module:Collections.detectSeries}.** @name detect* @static* @memberOf module:Collections* @method* @alias find* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).* @example** async.detect(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // result now equals the first file in the list that exists* });*/var detect = doParallel(_createTester(identity, _findGetResult));/*** The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a* time.** @name detectLimit* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findLimit* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/var detectLimit = doParallelLimit(_createTester(identity, _findGetResult));/*** The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.** @name detectSeries* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findSeries* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/var detectSeries = doLimit(detectLimit, 1);function consoleFunc(name) {return function (fn/*, ...args*/) {var args = slice(arguments, 1);args.push(function (err/*, ...args*/) {var args = slice(arguments, 1);if (typeof console === 'object') {if (err) {if (console.error) {console.error(err);}} else if (console[name]) {arrayEach(args, function (x) {console[name](x);});}}});wrapAsync(fn).apply(null, args);};}/*** Logs the result of an [`async` function]{@link AsyncFunction} to the* `console` using `console.dir` to display the properties of the resulting object.* Only works in Node.js or in browsers that support `console.dir` and* `console.error` (such as FF and Chrome).* If multiple arguments are returned from the async function,* `console.dir` is called on each argument in order.** @name dir* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} function - The function you want to eventually apply* all arguments to.* @param {...*} arguments... - Any number of arguments to apply to the function.* @example** // in a module* var hello = function(name, callback) {* setTimeout(function() {* callback(null, {hello: name});* }, 1000);* };** // in the node repl* node> async.dir(hello, 'world');* {hello: 'world'}*/var dir = consoleFunc('dir');/*** The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in* the order of operations, the arguments `test` and `fn` are switched.** Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.* @name doDuring* @static* @memberOf module:ControlFlow* @method* @see [async.during]{@link module:ControlFlow.during}* @category Control Flow* @param {AsyncFunction} fn - An async function which is called each time* `test` passes. Invoked with (callback).* @param {AsyncFunction} test - asynchronous truth test to perform before each* execution of `fn`. Invoked with (...args, callback), where `...args` are the* non-error args from the previous callback of `fn`.* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `fn` has stopped. `callback`* will be passed an error if one occurred, otherwise `null`.*/function doDuring(fn, test, callback) {callback = onlyOnce(callback || noop);var _fn = wrapAsync(fn);var _test = wrapAsync(test);function next(err/*, ...args*/) {if (err) return callback(err);var args = slice(arguments, 1);args.push(check);_test.apply(this, args);}function check(err, truth) {if (err) return callback(err);if (!truth) return callback(null);_fn(next);}check(null, true);}/*** The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in* the order of operations, the arguments `test` and `iteratee` are switched.** `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.** @name doWhilst* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {AsyncFunction} iteratee - A function which is called each time `test`* passes. Invoked with (callback).* @param {Function} test - synchronous truth test to perform after each* execution of `iteratee`. Invoked with any non-error callback results of* `iteratee`.* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `iteratee` has stopped.* `callback` will be passed an error and any arguments passed to the final* `iteratee`'s callback. Invoked with (err, [results]);*/function doWhilst(iteratee, test, callback) {callback = onlyOnce(callback || noop);var _iteratee = wrapAsync(iteratee);var next = function(err/*, ...args*/) {if (err) return callback(err);var args = slice(arguments, 1);if (test.apply(this, args)) return _iteratee(next);callback.apply(null, [null].concat(args));};_iteratee(next);}/*** Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the* argument ordering differs from `until`.** @name doUntil* @static* @memberOf module:ControlFlow* @method* @see [async.doWhilst]{@link module:ControlFlow.doWhilst}* @category Control Flow* @param {AsyncFunction} iteratee - An async function which is called each time* `test` fails. Invoked with (callback).* @param {Function} test - synchronous truth test to perform after each* execution of `iteratee`. Invoked with any non-error callback results of* `iteratee`.* @param {Function} [callback] - A callback which is called after the test* function has passed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);*/function doUntil(iteratee, test, callback) {doWhilst(iteratee, function() {return !test.apply(this, arguments);}, callback);}/*** Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that* is passed a callback in the form of `function (err, truth)`. If error is* passed to `test` or `fn`, the main callback is immediately called with the* value of the error.** @name during* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {AsyncFunction} test - asynchronous truth test to perform before each* execution of `fn`. Invoked with (callback).* @param {AsyncFunction} fn - An async function which is called each time* `test` passes. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `fn` has stopped. `callback`* will be passed an error, if one occurred, otherwise `null`.* @example** var count = 0;** async.during(* function (callback) {* return callback(null, count < 5);* },* function (callback) {* count++;* setTimeout(callback, 1000);* },* function (err) {* // 5 seconds have passed* }* );*/function during(test, fn, callback) {callback = onlyOnce(callback || noop);var _fn = wrapAsync(fn);var _test = wrapAsync(test);function next(err) {if (err) return callback(err);_test(check);}function check(err, truth) {if (err) return callback(err);if (!truth) return callback(null);_fn(next);}_test(check);}function _withoutIndex(iteratee) {return function (value, index, callback) {return iteratee(value, callback);};}/*** Applies the function `iteratee` to each item in `coll`, in parallel.* The `iteratee` is called with an item from the list, and a callback for when* it has finished. If the `iteratee` passes an error to its `callback`, the* main `callback` (for the `each` function) is immediately called with the* error.** Note, that since this function applies `iteratee` to each item in parallel,* there is no guarantee that the iteratee functions will complete in order.** @name each* @static* @memberOf module:Collections* @method* @alias forEach* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to* each item in `coll`. Invoked with (item, callback).* The array index is not passed to the iteratee.* If you need the index, use `eachOf`.* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).* @example** // assuming openFiles is an array of file names and saveFile is a function* // to save the modified contents of that file:** async.each(openFiles, saveFile, function(err){* // if any of the saves produced an error, err would equal that error* });** // assuming openFiles is an array of file names* async.each(openFiles, function(file, callback) {** // Perform operation on file here.* console.log('Processing file ' + file);** if( file.length > 32 ) {* console.log('This file name is too long');* callback('File name too long');* } else {* // Do work to process file here* console.log('File processed');* callback();* }* }, function(err) {* // if any of the file processing produced an error, err would equal that error* if( err ) {* // One of the iterations produced an error.* // All processing will now stop.* console.log('A file failed to process');* } else {* console.log('All files have been processed successfully');* }* });*/function eachLimit(coll, iteratee, callback) {eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);}/*** The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.** @name eachLimit* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfLimit`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/function eachLimit$1(coll, limit, iteratee, callback) {_eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);}/*** The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.** @name eachSeries* @static* @memberOf module:Collections* @method* @see [async.each]{@link module:Collections.each}* @alias forEachSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each* item in `coll`.* The array index is not passed to the iteratee.* If you need the index, use `eachOfSeries`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called when all* `iteratee` functions have finished, or an error occurs. Invoked with (err).*/var eachSeries = doLimit(eachLimit$1, 1);/*** Wrap an async function and ensure it calls its callback on a later tick of* the event loop. If the function already calls its callback on a next tick,* no extra deferral is added. This is useful for preventing stack overflows* (`RangeError: Maximum call stack size exceeded`) and generally keeping* [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)* contained. ES2017 `async` functions are returned as-is -- they are immune* to Zalgo's corrupting influences, as they always resolve on a later tick.** @name ensureAsync* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - an async function, one that expects a node-style* callback as its last argument.* @returns {AsyncFunction} Returns a wrapped function with the exact same call* signature as the function passed in.* @example** function sometimesAsync(arg, callback) {* if (cache[arg]) {* return callback(null, cache[arg]); // this would be synchronous!!* } else {* doSomeIO(arg, callback); // this IO would be asynchronous* }* }** // this has a risk of stack overflows if many results are cached in a row* async.mapSeries(args, sometimesAsync, done);** // this will defer sometimesAsync's callback if necessary,* // preventing stack overflows* async.mapSeries(args, async.ensureAsync(sometimesAsync), done);*/function ensureAsync(fn) {if (isAsync(fn)) return fn;return initialParams(function (args, callback) {var sync = true;args.push(function () {var innerArgs = arguments;if (sync) {setImmediate$1(function () {callback.apply(null, innerArgs);});} else {callback.apply(null, innerArgs);}});fn.apply(this, args);sync = false;});}function notId(v) {return !v;}/*** Returns `true` if every element in `coll` satisfies an async test. If any* iteratee call returns `false`, the main `callback` is immediately called.** @name every* @static* @memberOf module:Collections* @method* @alias all* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).* @example** async.every(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then every file exists* });*/var every = doParallel(_createTester(notId, notId));/*** The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.** @name everyLimit* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/var everyLimit = doParallelLimit(_createTester(notId, notId));/*** The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.** @name everySeries* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in series.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/var everySeries = doLimit(everyLimit, 1);/*** The base implementation of `_.property` without support for deep paths.** @private* @param {string} key The key of the property to get.* @returns {Function} Returns the new accessor function.*/function baseProperty(key) {return function(object) {return object == null ? undefined : object[key];};}function filterArray(eachfn, arr, iteratee, callback) {var truthValues = new Array(arr.length);eachfn(arr, function (x, index, callback) {iteratee(x, function (err, v) {truthValues[index] = !!v;callback(err);});}, function (err) {if (err) return callback(err);var results = [];for (var i = 0; i < arr.length; i++) {if (truthValues[i]) results.push(arr[i]);}callback(null, results);});}function filterGeneric(eachfn, coll, iteratee, callback) {var results = [];eachfn(coll, function (x, index, callback) {iteratee(x, function (err, v) {if (err) {callback(err);} else {if (v) {results.push({index: index, value: x});}callback();}});}, function (err) {if (err) {callback(err);} else {callback(null, arrayMap(results.sort(function (a, b) {return a.index - b.index;}), baseProperty('value')));}});}function _filter(eachfn, coll, iteratee, callback) {var filter = isArrayLike(coll) ? filterArray : filterGeneric;filter(eachfn, coll, wrapAsync(iteratee), callback || noop);}/*** Returns a new array of all the values in `coll` which pass an async truth* test. This operation is performed in parallel, but the results array will be* in the same order as the original.** @name filter* @static* @memberOf module:Collections* @method* @alias select* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).* @example** async.filter(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, results) {* // results now equals an array of the existing files* });*/var filter = doParallel(_filter);/*** The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a* time.** @name filterLimit* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/var filterLimit = doParallelLimit(_filter);/*** The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.** @name filterSeries* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @alias selectSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - A truth test to apply to each item in `coll`.* The `iteratee` is passed a `callback(err, truthValue)`, which must be called* with a boolean argument once it has completed. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results)*/var filterSeries = doLimit(filterLimit, 1);/*** Calls the asynchronous function `fn` with a callback parameter that allows it* to call itself again, in series, indefinitely.* If an error is passed to the callback then `errback` is called with the* error, and execution stops, otherwise it will never be called.** @name forever* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {AsyncFunction} fn - an async function to call repeatedly.* Invoked with (next).* @param {Function} [errback] - when `fn` passes an error to it's callback,* this function will be called, and execution stops. Invoked with (err).* @example** async.forever(* function(next) {* // next is suitable for passing to things that need a callback(err [, whatever]);* // it will result in this function being called again.* },* function(err) {* // if next is called with a value in its first parameter, it will appear* // in here as 'err', and execution will stop.* }* );*/function forever(fn, errback) {var done = onlyOnce(errback || noop);var task = wrapAsync(ensureAsync(fn));function next(err) {if (err) return done(err);task(next);}next();}/*** The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.** @name groupByLimit* @static* @memberOf module:Collections* @method* @see [async.groupBy]{@link module:Collections.groupBy}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.*/var groupByLimit = function(coll, limit, iteratee, callback) {callback = callback || noop;var _iteratee = wrapAsync(iteratee);mapLimit(coll, limit, function(val, callback) {_iteratee(val, function(err, key) {if (err) return callback(err);return callback(null, {key: key, val: val});});}, function(err, mapResults) {var result = {};// from MDN, handle object having an `hasOwnProperty` propvar hasOwnProperty = Object.prototype.hasOwnProperty;for (var i = 0; i < mapResults.length; i++) {if (mapResults[i]) {var key = mapResults[i].key;var val = mapResults[i].val;if (hasOwnProperty.call(result, key)) {result[key].push(val);} else {result[key] = [val];}}}return callback(err, result);});};/*** Returns a new object, where each value corresponds to an array of items, from* `coll`, that returned the corresponding key. That is, the keys of the object* correspond to the values passed to the `iteratee` callback.** Note: Since this function applies the `iteratee` to each item in parallel,* there is no guarantee that the `iteratee` functions will complete in order.* However, the values for each key in the `result` will be in the same order as* the original `coll`. For Objects, the values will roughly be in the order of* the original Objects' keys (but this can vary across JavaScript engines).** @name groupBy* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.* @example** async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {* db.findById(userId, function(err, user) {* if (err) return callback(err);* return callback(null, user.age);* });* }, function(err, result) {* // result is object containing the userIds grouped by age* // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};* });*/var groupBy = doLimit(groupByLimit, Infinity);/*** The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.** @name groupBySeries* @static* @memberOf module:Collections* @method* @see [async.groupBy]{@link module:Collections.groupBy}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a `key` to group the value under.* Invoked with (value, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. Result is an `Object` whoses* properties are arrays of values which returned the corresponding key.*/var groupBySeries = doLimit(groupByLimit, 1);/*** Logs the result of an `async` function to the `console`. Only works in* Node.js or in browsers that support `console.log` and `console.error` (such* as FF and Chrome). If multiple arguments are returned from the async* function, `console.log` is called on each argument in order.** @name log* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} function - The function you want to eventually apply* all arguments to.* @param {...*} arguments... - Any number of arguments to apply to the function.* @example** // in a module* var hello = function(name, callback) {* setTimeout(function() {* callback(null, 'hello ' + name);* }, 1000);* };** // in the node repl* node> async.log(hello, 'world');* 'hello world'*/var log = consoleFunc('log');/*** The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a* time.** @name mapValuesLimit* @static* @memberOf module:Collections* @method* @see [async.mapValues]{@link module:Collections.mapValues}* @category Collection* @param {Object} obj - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).*/function mapValuesLimit(obj, limit, iteratee, callback) {callback = once(callback || noop);var newObj = {};var _iteratee = wrapAsync(iteratee);eachOfLimit(obj, limit, function(val, key, next) {_iteratee(val, key, function (err, result) {if (err) return next(err);newObj[key] = result;next();});}, function (err) {callback(err, newObj);});}/*** A relative of [`map`]{@link module:Collections.map}, designed for use with objects.** Produces a new Object by mapping each value of `obj` through the `iteratee`* function. The `iteratee` is called each `value` and `key` from `obj` and a* callback for when it has finished processing. Each of these callbacks takes* two arguments: an `error`, and the transformed item from `obj`. If `iteratee`* passes an error to its callback, the main `callback` (for the `mapValues`* function) is immediately called with the error.** Note, the order of the keys in the result is not guaranteed. The keys will* be roughly in the order they complete, (but this is very engine-specific)** @name mapValues* @static* @memberOf module:Collections* @method* @category Collection* @param {Object} obj - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).* @example** async.mapValues({* f1: 'file1',* f2: 'file2',* f3: 'file3'* }, function (file, key, callback) {* fs.stat(file, callback);* }, function(err, result) {* // result is now a map of stats for each file, e.g.* // {* // f1: [stats for file1],* // f2: [stats for file2],* // f3: [stats for file3]* // }* });*/var mapValues = doLimit(mapValuesLimit, Infinity);/*** The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.** @name mapValuesSeries* @static* @memberOf module:Collections* @method* @see [async.mapValues]{@link module:Collections.mapValues}* @category Collection* @param {Object} obj - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each value and key* in `coll`.* The iteratee should complete with the transformed value as its result.* Invoked with (value, key, callback).* @param {Function} [callback] - A callback which is called when all `iteratee`* functions have finished, or an error occurs. `result` is a new object consisting* of each key from `obj`, with each transformed value on the right-hand side.* Invoked with (err, result).*/var mapValuesSeries = doLimit(mapValuesLimit, 1);function has(obj, key) {return key in obj;}/*** Caches the results of an async function. When creating a hash to store* function results against, the callback is omitted from the hash and an* optional hash function can be used.** If no hash function is specified, the first argument is used as a hash key,* which may work reasonably if it is a string or a data type that converts to a* distinct string. Note that objects and arrays will not behave reasonably.* Neither will cases where the other arguments are significant. In such cases,* specify your own hash function.** The cache of results is exposed as the `memo` property of the function* returned by `memoize`.** @name memoize* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - The async function to proxy and cache results from.* @param {Function} hasher - An optional function for generating a custom hash* for storing results. It has all the arguments applied to it apart from the* callback, and must be synchronous.* @returns {AsyncFunction} a memoized version of `fn`* @example** var slow_fn = function(name, callback) {* // do something* callback(null, result);* };* var fn = async.memoize(slow_fn);** // fn can now be used as if it were slow_fn* fn('some name', function() {* // callback* });*/function memoize(fn, hasher) {var memo = Object.create(null);var queues = Object.create(null);hasher = hasher || identity;var _fn = wrapAsync(fn);var memoized = initialParams(function memoized(args, callback) {var key = hasher.apply(null, args);if (has(memo, key)) {setImmediate$1(function() {callback.apply(null, memo[key]);});} else if (has(queues, key)) {queues[key].push(callback);} else {queues[key] = [callback];_fn.apply(null, args.concat(function(/*args*/) {var args = slice(arguments);memo[key] = args;var q = queues[key];delete queues[key];for (var i = 0, l = q.length; i < l; i++) {q[i].apply(null, args);}}));}});memoized.memo = memo;memoized.unmemoized = fn;return memoized;}/*** Calls `callback` on a later loop around the event loop. In Node.js this just* calls `process.nextTick`. In the browser it will use `setImmediate` if* available, otherwise `setTimeout(callback, 0)`, which means other higher* priority events may precede the execution of `callback`.** This is used internally for browser-compatibility purposes.** @name nextTick* @static* @memberOf module:Utils* @method* @see [async.setImmediate]{@link module:Utils.setImmediate}* @category Util* @param {Function} callback - The function to call on a later loop around* the event loop. Invoked with (args...).* @param {...*} args... - any number of additional arguments to pass to the* callback on the next tick.* @example** var call_order = [];* async.nextTick(function() {* call_order.push('two');* // call_order now equals ['one','two']* });* call_order.push('one');** async.setImmediate(function (a, b, c) {* // a, b, and c equal 1, 2, and 3* }, 1, 2, 3);*/var _defer$1;if (hasNextTick) {_defer$1 = process.nextTick;} else if (hasSetImmediate) {_defer$1 = setImmediate;} else {_defer$1 = fallback;}var nextTick = wrap(_defer$1);function _parallel(eachfn, tasks, callback) {callback = callback || noop;var results = isArrayLike(tasks) ? [] : {};eachfn(tasks, function (task, key, callback) {wrapAsync(task)(function (err, result) {if (arguments.length > 2) {result = slice(arguments, 1);}results[key] = result;callback(err);});}, function (err) {callback(err, results);});}/*** Run the `tasks` collection of functions in parallel, without waiting until* the previous function has completed. If any of the functions pass an error to* its callback, the main `callback` is immediately called with the value of the* error. Once the `tasks` have completed, the results are passed to the final* `callback` as an array.** **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about* parallel execution of code. If your tasks do not use any timers or perform* any I/O, they will actually be executed in series. Any synchronous setup* sections for each task will happen one after the other. JavaScript remains* single-threaded.** **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the* execution of other tasks when a task fails.** It is also possible to use an object instead of an array. Each property will* be run as a function and the results will be passed to the final `callback`* as an object instead of an array. This can be a more readable way of handling* results from {@link async.parallel}.** @name parallel* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection of* [async functions]{@link AsyncFunction} to run.* Each async function can complete with any number of optional `result` values.* @param {Function} [callback] - An optional callback to run once all the* functions have completed successfully. This function gets a results array* (or object) containing all the result arguments passed to the task callbacks.* Invoked with (err, results).** @example* async.parallel([* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ],* // optional callback* function(err, results) {* // the results array will equal ['one','two'] even though* // the second function had a shorter timeout.* });** // an example using an object instead of an array* async.parallel({* one: function(callback) {* setTimeout(function() {* callback(null, 1);* }, 200);* },* two: function(callback) {* setTimeout(function() {* callback(null, 2);* }, 100);* }* }, function(err, results) {* // results is now equals to: {one: 1, two: 2}* });*/function parallelLimit(tasks, callback) {_parallel(eachOf, tasks, callback);}/*** The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a* time.** @name parallelLimit* @static* @memberOf module:ControlFlow* @method* @see [async.parallel]{@link module:ControlFlow.parallel}* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection of* [async functions]{@link AsyncFunction} to run.* Each async function can complete with any number of optional `result` values.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} [callback] - An optional callback to run once all the* functions have completed successfully. This function gets a results array* (or object) containing all the result arguments passed to the task callbacks.* Invoked with (err, results).*/function parallelLimit$1(tasks, limit, callback) {_parallel(_eachOfLimit(limit), tasks, callback);}/*** A queue of tasks for the worker function to complete.* @typedef {Object} QueueObject* @memberOf module:ControlFlow* @property {Function} length - a function returning the number of items* waiting to be processed. Invoke with `queue.length()`.* @property {boolean} started - a boolean indicating whether or not any* items have been pushed and processed by the queue.* @property {Function} running - a function returning the number of items* currently being processed. Invoke with `queue.running()`.* @property {Function} workersList - a function returning the array of items* currently being processed. Invoke with `queue.workersList()`.* @property {Function} idle - a function returning false if there are items* waiting or being processed, or true if not. Invoke with `queue.idle()`.* @property {number} concurrency - an integer for determining how many `worker`* functions should be run in parallel. This property can be changed after a* `queue` is created to alter the concurrency on-the-fly.* @property {Function} push - add a new task to the `queue`. Calls `callback`* once the `worker` has finished processing the task. Instead of a single task,* a `tasks` array can be submitted. The respective callback is used for every* task in the list. Invoke with `queue.push(task, [callback])`,* @property {Function} unshift - add a new task to the front of the `queue`.* Invoke with `queue.unshift(task, [callback])`.* @property {Function} remove - remove items from the queue that match a test* function. The test function will be passed an object with a `data` property,* and a `priority` property, if this is a* [priorityQueue]{@link module:ControlFlow.priorityQueue} object.* Invoked with `queue.remove(testFn)`, where `testFn` is of the form* `function ({data, priority}) {}` and returns a Boolean.* @property {Function} saturated - a callback that is called when the number of* running workers hits the `concurrency` limit, and further tasks will be* queued.* @property {Function} unsaturated - a callback that is called when the number* of running workers is less than the `concurrency` & `buffer` limits, and* further tasks will not be queued.* @property {number} buffer - A minimum threshold buffer in order to say that* the `queue` is `unsaturated`.* @property {Function} empty - a callback that is called when the last item* from the `queue` is given to a `worker`.* @property {Function} drain - a callback that is called when the last item* from the `queue` has returned from the `worker`.* @property {Function} error - a callback that is called when a task errors.* Has the signature `function(error, task)`.* @property {boolean} paused - a boolean for determining whether the queue is* in a paused state.* @property {Function} pause - a function that pauses the processing of tasks* until `resume()` is called. Invoke with `queue.pause()`.* @property {Function} resume - a function that resumes the processing of* queued tasks when the queue is paused. Invoke with `queue.resume()`.* @property {Function} kill - a function that removes the `drain` callback and* empties remaining tasks from the queue forcing it to go idle. No more tasks* should be pushed to the queue after calling this function. Invoke with `queue.kill()`.*//*** Creates a `queue` object with the specified `concurrency`. Tasks added to the* `queue` are processed in parallel (up to the `concurrency` limit). If all* `worker`s are in progress, the task is queued until one becomes available.* Once a `worker` completes a `task`, that `task`'s callback is called.** @name queue* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {AsyncFunction} worker - An async function for processing a queued task.* If you want to handle errors from an individual task, pass a callback to* `q.push()`. Invoked with (task, callback).* @param {number} [concurrency=1] - An `integer` for determining how many* `worker` functions should be run in parallel. If omitted, the concurrency* defaults to `1`. If the concurrency is `0`, an error is thrown.* @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can* attached as certain properties to listen for specific events during the* lifecycle of the queue.* @example** // create a queue object with concurrency 2* var q = async.queue(function(task, callback) {* console.log('hello ' + task.name);* callback();* }, 2);** // assign a callback* q.drain = function() {* console.log('all items have been processed');* };** // add some items to the queue* q.push({name: 'foo'}, function(err) {* console.log('finished processing foo');* });* q.push({name: 'bar'}, function (err) {* console.log('finished processing bar');* });** // add some items to the queue (batch-wise)* q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {* console.log('finished processing item');* });** // add some items to the front of the queue* q.unshift({name: 'bar'}, function (err) {* console.log('finished processing bar');* });*/var queue$1 = function (worker, concurrency) {var _worker = wrapAsync(worker);return queue(function (items, cb) {_worker(items[0], cb);}, concurrency, 1);};/*** The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and* completed in ascending priority order.** @name priorityQueue* @static* @memberOf module:ControlFlow* @method* @see [async.queue]{@link module:ControlFlow.queue}* @category Control Flow* @param {AsyncFunction} worker - An async function for processing a queued task.* If you want to handle errors from an individual task, pass a callback to* `q.push()`.* Invoked with (task, callback).* @param {number} concurrency - An `integer` for determining how many `worker`* functions should be run in parallel. If omitted, the concurrency defaults to* `1`. If the concurrency is `0`, an error is thrown.* @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two* differences between `queue` and `priorityQueue` objects:* * `push(task, priority, [callback])` - `priority` should be a number. If an* array of `tasks` is given, all tasks will be assigned the same priority.* * The `unshift` method was removed.*/var priorityQueue = function(worker, concurrency) {// Start with a normal queuevar q = queue$1(worker, concurrency);// Override push to accept second parameter representing priorityq.push = function(data, priority, callback) {if (callback == null) callback = noop;if (typeof callback !== 'function') {throw new Error('task callback must be a function');}q.started = true;if (!isArray(data)) {data = [data];}if (data.length === 0) {// call drain immediately if there are no tasksreturn setImmediate$1(function() {q.drain();});}priority = priority || 0;var nextNode = q._tasks.head;while (nextNode && priority >= nextNode.priority) {nextNode = nextNode.next;}for (var i = 0, l = data.length; i < l; i++) {var item = {data: data[i],priority: priority,callback: callback};if (nextNode) {q._tasks.insertBefore(nextNode, item);} else {q._tasks.push(item);}}setImmediate$1(q.process);};// Remove unshift functiondelete q.unshift;return q;};/*** Runs the `tasks` array of functions in parallel, without waiting until the* previous function has completed. Once any of the `tasks` complete or pass an* error to its callback, the main `callback` is immediately called. It's* equivalent to `Promise.race()`.** @name race* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}* to run. Each function can complete with an optional `result` value.* @param {Function} callback - A callback to run once any of the functions have* completed. This function gets an error or result from the first function that* completed. Invoked with (err, result).* @returns undefined* @example** async.race([* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ],* // main callback* function(err, result) {* // the result will be equal to 'two' as it finishes earlier* });*/function race(tasks, callback) {callback = once(callback || noop);if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));if (!tasks.length) return callback();for (var i = 0, l = tasks.length; i < l; i++) {wrapAsync(tasks[i])(callback);}}/*** Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.** @name reduceRight* @static* @memberOf module:Collections* @method* @see [async.reduce]{@link module:Collections.reduce}* @alias foldr* @category Collection* @param {Array} array - A collection to iterate over.* @param {*} memo - The initial state of the reduction.* @param {AsyncFunction} iteratee - A function applied to each item in the* array to produce the next step in the reduction.* The `iteratee` should complete with the next state of the reduction.* If the iteratee complete with an error, the reduction is stopped and the* main `callback` is immediately called with the error.* Invoked with (memo, item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the reduced value. Invoked with* (err, result).*/function reduceRight (array, memo, iteratee, callback) {var reversed = slice(array).reverse();reduce(reversed, memo, iteratee, callback);}/*** Wraps the async function in another function that always completes with a* result object, even when it errors.** The result object has either the property `error` or `value`.** @name reflect* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} fn - The async function you want to wrap* @returns {Function} - A function that always passes null to it's callback as* the error. The second argument to the callback will be an `object` with* either an `error` or a `value` property.* @example** async.parallel([* async.reflect(function(callback) {* // do some stuff ...* callback(null, 'one');* }),* async.reflect(function(callback) {* // do some more stuff but error ...* callback('bad stuff happened');* }),* async.reflect(function(callback) {* // do some more stuff ...* callback(null, 'two');* })* ],* // optional callback* function(err, results) {* // values* // results[0].value = 'one'* // results[1].error = 'bad stuff happened'* // results[2].value = 'two'* });*/function reflect(fn) {var _fn = wrapAsync(fn);return initialParams(function reflectOn(args, reflectCallback) {args.push(function callback(error, cbArg) {if (error) {reflectCallback(null, { error: error });} else {var value;if (arguments.length <= 2) {value = cbArg;} else {value = slice(arguments, 1);}reflectCallback(null, { value: value });}});return _fn.apply(this, args);});}/*** A helper function that wraps an array or an object of functions with `reflect`.** @name reflectAll* @static* @memberOf module:Utils* @method* @see [async.reflect]{@link module:Utils.reflect}* @category Util* @param {Array|Object|Iterable} tasks - The collection of* [async functions]{@link AsyncFunction} to wrap in `async.reflect`.* @returns {Array} Returns an array of async functions, each wrapped in* `async.reflect`* @example** let tasks = [* function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* function(callback) {* // do some more stuff but error ...* callback(new Error('bad stuff happened'));* },* function(callback) {* setTimeout(function() {* callback(null, 'two');* }, 100);* }* ];** async.parallel(async.reflectAll(tasks),* // optional callback* function(err, results) {* // values* // results[0].value = 'one'* // results[1].error = Error('bad stuff happened')* // results[2].value = 'two'* });** // an example using an object instead of an array* let tasks = {* one: function(callback) {* setTimeout(function() {* callback(null, 'one');* }, 200);* },* two: function(callback) {* callback('two');* },* three: function(callback) {* setTimeout(function() {* callback(null, 'three');* }, 100);* }* };** async.parallel(async.reflectAll(tasks),* // optional callback* function(err, results) {* // values* // results.one.value = 'one'* // results.two.error = 'two'* // results.three.value = 'three'* });*/function reflectAll(tasks) {var results;if (isArray(tasks)) {results = arrayMap(tasks, reflect);} else {results = {};baseForOwn(tasks, function(task, key) {results[key] = reflect.call(this, task);});}return results;}function reject$1(eachfn, arr, iteratee, callback) {_filter(eachfn, arr, function(value, cb) {iteratee(value, function(err, v) {cb(err, !v);});}, callback);}/*** The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.** @name reject* @static* @memberOf module:Collections* @method* @see [async.filter]{@link module:Collections.filter}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).* @example** async.reject(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, results) {* // results now equals an array of missing files* createFiles(results);* });*/var reject = doParallel(reject$1);/*** The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a* time.** @name rejectLimit* @static* @memberOf module:Collections* @method* @see [async.reject]{@link module:Collections.reject}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/var rejectLimit = doParallelLimit(reject$1);/*** The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.** @name rejectSeries* @static* @memberOf module:Collections* @method* @see [async.reject]{@link module:Collections.reject}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {Function} iteratee - An async truth test to apply to each item in* `coll`.* The should complete with a boolean value as its `result`.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Invoked with (err, results).*/var rejectSeries = doLimit(rejectLimit, 1);/*** Creates a function that returns `value`.** @static* @memberOf _* @since 2.4.0* @category Util* @param {*} value The value to return from the new function.* @returns {Function} Returns the new constant function.* @example** var objects = _.times(2, _.constant({ 'a': 1 }));** console.log(objects);* // => [{ 'a': 1 }, { 'a': 1 }]** console.log(objects[0] === objects[1]);* // => true*/function constant$1(value) {return function() {return value;};}/*** Attempts to get a successful response from `task` no more than `times` times* before returning an error. If the task is successful, the `callback` will be* passed the result of the successful task. If all attempts fail, the callback* will be passed the error and result (if any) of the final attempt.** @name retry* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @see [async.retryable]{@link module:ControlFlow.retryable}* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an* object with `times` and `interval` or a number.* * `times` - The number of attempts to make before giving up. The default* is `5`.* * `interval` - The time to wait between retries, in milliseconds. The* default is `0`. The interval may also be specified as a function of the* retry count (see example).* * `errorFilter` - An optional synchronous function that is invoked on* erroneous result. If it returns `true` the retry attempts will continue;* if the function returns `false` the retry flow is aborted with the current* attempt's error and result being returned to the final callback.* Invoked with (err).* * If `opts` is a number, the number specifies the number of times to retry,* with the default interval of `0`.* @param {AsyncFunction} task - An async function to retry.* Invoked with (callback).* @param {Function} [callback] - An optional callback which is called when the* task has succeeded, or after the final failed attempt. It receives the `err`* and `result` arguments of the last attempt at completing the `task`. Invoked* with (err, results).** @example** // The `retry` function can be used as a stand-alone control flow by passing* // a callback, as shown below:** // try calling apiMethod 3 times* async.retry(3, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod 3 times, waiting 200 ms between each retry* async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod 10 times with exponential backoff* // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)* async.retry({* times: 10,* interval: function(retryCount) {* return 50 * Math.pow(2, retryCount);* }* }, apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod the default 5 times no delay between each retry* async.retry(apiMethod, function(err, result) {* // do something with the result* });** // try calling apiMethod only when error condition satisfies, all other* // errors will abort the retry control flow and return to final callback* async.retry({* errorFilter: function(err) {* return err.message === 'Temporary error'; // only retry on a specific error* }* }, apiMethod, function(err, result) {* // do something with the result* });** // to retry individual methods that are not as reliable within other* // control flow functions, use the `retryable` wrapper:* async.auto({* users: api.getUsers.bind(api),* payments: async.retryable(3, api.getPayments.bind(api))* }, function(err, results) {* // do something with the results* });**/function retry(opts, task, callback) {var DEFAULT_TIMES = 5;var DEFAULT_INTERVAL = 0;var options = {times: DEFAULT_TIMES,intervalFunc: constant$1(DEFAULT_INTERVAL)};function parseTimes(acc, t) {if (typeof t === 'object') {acc.times = +t.times || DEFAULT_TIMES;acc.intervalFunc = typeof t.interval === 'function' ?t.interval :constant$1(+t.interval || DEFAULT_INTERVAL);acc.errorFilter = t.errorFilter;} else if (typeof t === 'number' || typeof t === 'string') {acc.times = +t || DEFAULT_TIMES;} else {throw new Error("Invalid arguments for async.retry");}}if (arguments.length < 3 && typeof opts === 'function') {callback = task || noop;task = opts;} else {parseTimes(options, opts);callback = callback || noop;}if (typeof task !== 'function') {throw new Error("Invalid arguments for async.retry");}var _task = wrapAsync(task);var attempt = 1;function retryAttempt() {_task(function(err) {if (err && attempt++ < options.times &&(typeof options.errorFilter != 'function' ||options.errorFilter(err))) {setTimeout(retryAttempt, options.intervalFunc(attempt));} else {callback.apply(null, arguments);}});}retryAttempt();}/*** A close relative of [`retry`]{@link module:ControlFlow.retry}. This method* wraps a task and makes it retryable, rather than immediately calling it* with retries.** @name retryable* @static* @memberOf module:ControlFlow* @method* @see [async.retry]{@link module:ControlFlow.retry}* @category Control Flow* @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional* options, exactly the same as from `retry`* @param {AsyncFunction} task - the asynchronous function to wrap.* This function will be passed any arguments passed to the returned wrapper.* Invoked with (...args, callback).* @returns {AsyncFunction} The wrapped function, which when invoked, will* retry on an error, based on the parameters specified in `opts`.* This function will accept the same parameters as `task`.* @example** async.auto({* dep1: async.retryable(3, getFromFlakyService),* process: ["dep1", async.retryable(3, function (results, cb) {* maybeProcessData(results.dep1, cb);* })]* }, callback);*/var retryable = function (opts, task) {if (!task) {task = opts;opts = null;}var _task = wrapAsync(task);return initialParams(function (args, callback) {function taskFn(cb) {_task.apply(null, args.concat(cb));}if (opts) retry(opts, taskFn, callback);else retry(taskFn, callback);});};/*** Run the functions in the `tasks` collection in series, each one running once* the previous function has completed. If any functions in the series pass an* error to its callback, no more functions are run, and `callback` is* immediately called with the value of the error. Otherwise, `callback`* receives an array of results when `tasks` have completed.** It is also possible to use an object instead of an array. Each property will* be run as a function, and the results will be passed to the final `callback`* as an object instead of an array. This can be a more readable way of handling* results from {@link async.series}.** **Note** that while many implementations preserve the order of object* properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)* explicitly states that** > The mechanics and order of enumerating the properties is not specified.** So if you rely on the order in which your series of functions are executed,* and want this to work on all platforms, consider using an array.** @name series* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection containing* [async functions]{@link AsyncFunction} to run in series.* Each function can complete with any number of optional `result` values.* @param {Function} [callback] - An optional callback to run once all the* functions have completed. This function gets a results array (or object)* containing all the result arguments passed to the `task` callbacks. Invoked* with (err, result).* @example* async.series([* function(callback) {* // do some stuff ...* callback(null, 'one');* },* function(callback) {* // do some more stuff ...* callback(null, 'two');* }* ],* // optional callback* function(err, results) {* // results is now equal to ['one', 'two']* });** async.series({* one: function(callback) {* setTimeout(function() {* callback(null, 1);* }, 200);* },* two: function(callback){* setTimeout(function() {* callback(null, 2);* }, 100);* }* }, function(err, results) {* // results is now equal to: {one: 1, two: 2}* });*/function series(tasks, callback) {_parallel(eachOfSeries, tasks, callback);}/*** Returns `true` if at least one element in the `coll` satisfies an async test.* If any iteratee call returns `true`, the main `callback` is immediately* called.** @name some* @static* @memberOf module:Collections* @method* @alias any* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).* @example** async.some(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then at least one of the files exists* });*/var some = doParallel(_createTester(Boolean, identity));/*** The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.** @name someLimit* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anyLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/var someLimit = doParallelLimit(_createTester(Boolean, identity));/*** The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.** @name someSeries* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anySeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in series.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/var someSeries = doLimit(someLimit, 1);/*** Sorts a list by the results of running each `coll` value through an async* `iteratee`.** @name sortBy* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async function to apply to each item in* `coll`.* The iteratee should complete with a value to use as the sort criteria as* its `result`.* Invoked with (item, callback).* @param {Function} callback - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is the items* from the original `coll` sorted by the values returned by the `iteratee`* calls. Invoked with (err, results).* @example** async.sortBy(['file1','file2','file3'], function(file, callback) {* fs.stat(file, function(err, stats) {* callback(err, stats.mtime);* });* }, function(err, results) {* // results is now the original array of files sorted by* // modified date* });** // By modifying the callback parameter the* // sorting order can be influenced:** // ascending order* async.sortBy([1,9,3,5], function(x, callback) {* callback(null, x);* }, function(err,result) {* // result callback* });** // descending order* async.sortBy([1,9,3,5], function(x, callback) {* callback(null, x*-1); //<- x*-1 instead of x, turns the order around* }, function(err,result) {* // result callback* });*/function sortBy (coll, iteratee, callback) {var _iteratee = wrapAsync(iteratee);map(coll, function (x, callback) {_iteratee(x, function (err, criteria) {if (err) return callback(err);callback(null, {value: x, criteria: criteria});});}, function (err, results) {if (err) return callback(err);callback(null, arrayMap(results.sort(comparator), baseProperty('value')));});function comparator(left, right) {var a = left.criteria, b = right.criteria;return a < b ? -1 : a > b ? 1 : 0;}}/*** Sets a time limit on an asynchronous function. If the function does not call* its callback within the specified milliseconds, it will be called with a* timeout error. The code property for the error object will be `'ETIMEDOUT'`.** @name timeout* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} asyncFn - The async function to limit in time.* @param {number} milliseconds - The specified time limit.* @param {*} [info] - Any variable you want attached (`string`, `object`, etc)* to timeout Error for more information..* @returns {AsyncFunction} Returns a wrapped function that can be used with any* of the control flow functions.* Invoke this function with the same parameters as you would `asyncFunc`.* @example** function myFunction(foo, callback) {* doAsyncTask(foo, function(err, data) {* // handle errors* if (err) return callback(err);** // do some stuff ...** // return processed data* return callback(null, data);* });* }** var wrapped = async.timeout(myFunction, 1000);** // call `wrapped` as you would `myFunction`* wrapped({ bar: 'bar' }, function(err, data) {* // if `myFunction` takes < 1000 ms to execute, `err`* // and `data` will have their expected values** // else `err` will be an Error with the code 'ETIMEDOUT'* });*/function timeout(asyncFn, milliseconds, info) {var fn = wrapAsync(asyncFn);return initialParams(function (args, callback) {var timedOut = false;var timer;function timeoutCallback() {var name = asyncFn.name || 'anonymous';var error = new Error('Callback function "' + name + '" timed out.');error.code = 'ETIMEDOUT';if (info) {error.info = info;}timedOut = true;callback(error);}args.push(function () {if (!timedOut) {callback.apply(null, arguments);clearTimeout(timer);}});// setup timer and call original functiontimer = setTimeout(timeoutCallback, milliseconds);fn.apply(null, args);});}/* Built-in method references for those with the same name as other `lodash` methods. */var nativeCeil = Math.ceil;var nativeMax = Math.max;/*** The base implementation of `_.range` and `_.rangeRight` which doesn't* coerce arguments.** @private* @param {number} start The start of the range.* @param {number} end The end of the range.* @param {number} step The value to increment or decrement by.* @param {boolean} [fromRight] Specify iterating from right to left.* @returns {Array} Returns the range of numbers.*/function baseRange(start, end, step, fromRight) {var index = -1,length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),result = Array(length);while (length--) {result[fromRight ? length : ++index] = start;start += step;}return result;}/*** The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a* time.** @name timesLimit* @static* @memberOf module:ControlFlow* @method* @see [async.times]{@link module:ControlFlow.times}* @category Control Flow* @param {number} count - The number of times to run the function.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see [async.map]{@link module:Collections.map}.*/function timeLimit(count, limit, iteratee, callback) {var _iteratee = wrapAsync(iteratee);mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);}/*** Calls the `iteratee` function `n` times, and accumulates results in the same* manner you would use with [map]{@link module:Collections.map}.** @name times* @static* @memberOf module:ControlFlow* @method* @see [async.map]{@link module:Collections.map}* @category Control Flow* @param {number} n - The number of times to run the function.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see {@link module:Collections.map}.* @example** // Pretend this is some complicated async factory* var createUser = function(id, callback) {* callback(null, {* id: 'user' + id* });* };** // generate 5 users* async.times(5, function(n, next) {* createUser(n, function(err, user) {* next(err, user);* });* }, function(err, users) {* // we should now have 5 users* });*/var times = doLimit(timeLimit, Infinity);/*** The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.** @name timesSeries* @static* @memberOf module:ControlFlow* @method* @see [async.times]{@link module:ControlFlow.times}* @category Control Flow* @param {number} n - The number of times to run the function.* @param {AsyncFunction} iteratee - The async function to call `n` times.* Invoked with the iteration index and a callback: (n, next).* @param {Function} callback - see {@link module:Collections.map}.*/var timesSeries = doLimit(timeLimit, 1);/*** A relative of `reduce`. Takes an Object or Array, and iterates over each* element in series, each step potentially mutating an `accumulator` value.* The type of the accumulator defaults to the type of collection passed in.** @name transform* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {*} [accumulator] - The initial state of the transform. If omitted,* it will default to an empty Object or Array, depending on the type of `coll`* @param {AsyncFunction} iteratee - A function applied to each item in the* collection that potentially modifies the accumulator.* Invoked with (accumulator, item, key, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result is the transformed accumulator.* Invoked with (err, result).* @example** async.transform([1,2,3], function(acc, item, index, callback) {* // pointless async:* process.nextTick(function() {* acc.push(item * 2)* callback(null)* });* }, function(err, result) {* // result is now equal to [2, 4, 6]* });** @example** async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {* setImmediate(function () {* obj[key] = val * 2;* callback();* })* }, function (err, result) {* // result is equal to {a: 2, b: 4, c: 6}* })*/function transform (coll, accumulator, iteratee, callback) {if (arguments.length <= 3) {callback = iteratee;iteratee = accumulator;accumulator = isArray(coll) ? [] : {};}callback = once(callback || noop);var _iteratee = wrapAsync(iteratee);eachOf(coll, function(v, k, cb) {_iteratee(accumulator, v, k, cb);}, function(err) {callback(err, accumulator);});}/*** It runs each task in series but stops whenever any of the functions were* successful. If one of the tasks were successful, the `callback` will be* passed the result of the successful task. If all tasks fail, the callback* will be passed the error and result (if any) of the final attempt.** @name tryEach* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} tasks - A collection containing functions to* run, each function is passed a `callback(err, result)` it must call on* completion with an error `err` (which can be `null`) and an optional `result`* value.* @param {Function} [callback] - An optional callback which is called when one* of the tasks has succeeded, or all have failed. It receives the `err` and* `result` arguments of the last attempt at completing the `task`. Invoked with* (err, results).* @example* async.tryEach([* function getDataFromFirstWebsite(callback) {* // Try getting the data from the first website* callback(err, data);* },* function getDataFromSecondWebsite(callback) {* // First website failed,* // Try getting the data from the backup website* callback(err, data);* }* ],* // optional callback* function(err, results) {* Now do something with the data.* });**/function tryEach(tasks, callback) {var error = null;var result;callback = callback || noop;eachSeries(tasks, function(task, callback) {wrapAsync(task)(function (err, res/*, ...args*/) {if (arguments.length > 2) {result = slice(arguments, 1);} else {result = res;}error = err;callback(!err);});}, function () {callback(error, result);});}/*** Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,* unmemoized form. Handy for testing.** @name unmemoize* @static* @memberOf module:Utils* @method* @see [async.memoize]{@link module:Utils.memoize}* @category Util* @param {AsyncFunction} fn - the memoized function* @returns {AsyncFunction} a function that calls the original unmemoized function*/function unmemoize(fn) {return function () {return (fn.unmemoized || fn).apply(null, arguments);};}/*** Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when* stopped, or an error occurs.** @name whilst* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Function} test - synchronous truth test to perform before each* execution of `iteratee`. Invoked with ().* @param {AsyncFunction} iteratee - An async function which is called each time* `test` passes. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has failed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);* @returns undefined* @example** var count = 0;* async.whilst(* function() { return count < 5; },* function(callback) {* count++;* setTimeout(function() {* callback(null, count);* }, 1000);* },* function (err, n) {* // 5 seconds have passed, n = 5* }* );*/function whilst(test, iteratee, callback) {callback = onlyOnce(callback || noop);var _iteratee = wrapAsync(iteratee);if (!test()) return callback(null);var next = function(err/*, ...args*/) {if (err) return callback(err);if (test()) return _iteratee(next);var args = slice(arguments, 1);callback.apply(null, [null].concat(args));};_iteratee(next);}/*** Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when* stopped, or an error occurs. `callback` will be passed an error and any* arguments passed to the final `iteratee`'s callback.** The inverse of [whilst]{@link module:ControlFlow.whilst}.** @name until* @static* @memberOf module:ControlFlow* @method* @see [async.whilst]{@link module:ControlFlow.whilst}* @category Control Flow* @param {Function} test - synchronous truth test to perform before each* execution of `iteratee`. Invoked with ().* @param {AsyncFunction} iteratee - An async function which is called each time* `test` fails. Invoked with (callback).* @param {Function} [callback] - A callback which is called after the test* function has passed and repeated execution of `iteratee` has stopped. `callback`* will be passed an error and any arguments passed to the final `iteratee`'s* callback. Invoked with (err, [results]);*/function until(test, iteratee, callback) {whilst(function() {return !test.apply(this, arguments);}, iteratee, callback);}/*** Runs the `tasks` array of functions in series, each passing their results to* the next in the array. However, if any of the `tasks` pass an error to their* own callback, the next function is not executed, and the main `callback` is* immediately called with the error.** @name waterfall* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array} tasks - An array of [async functions]{@link AsyncFunction}* to run.* Each function should complete with any number of `result` values.* The `result` values will be passed as arguments, in order, to the next task.* @param {Function} [callback] - An optional callback to run once all the* functions have completed. This will be passed the results of the last task's* callback. Invoked with (err, [results]).* @returns undefined* @example** async.waterfall([* function(callback) {* callback(null, 'one', 'two');* },* function(arg1, arg2, callback) {* // arg1 now equals 'one' and arg2 now equals 'two'* callback(null, 'three');* },* function(arg1, callback) {* // arg1 now equals 'three'* callback(null, 'done');* }* ], function (err, result) {* // result now equals 'done'* });** // Or, with named functions:* async.waterfall([* myFirstFunction,* mySecondFunction,* myLastFunction,* ], function (err, result) {* // result now equals 'done'* });* function myFirstFunction(callback) {* callback(null, 'one', 'two');* }* function mySecondFunction(arg1, arg2, callback) {* // arg1 now equals 'one' and arg2 now equals 'two'* callback(null, 'three');* }* function myLastFunction(arg1, callback) {* // arg1 now equals 'three'* callback(null, 'done');* }*/var waterfall = function(tasks, callback) {callback = once(callback || noop);if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));if (!tasks.length) return callback();var taskIndex = 0;function nextTask(args) {var task = wrapAsync(tasks[taskIndex++]);args.push(onlyOnce(next));task.apply(null, args);}function next(err/*, ...args*/) {if (err || taskIndex === tasks.length) {return callback.apply(null, arguments);}nextTask(slice(arguments, 1));}nextTask([]);};/*** An "async function" in the context of Async is an asynchronous function with* a variable number of parameters, with the final parameter being a callback.* (`function (arg1, arg2, ..., callback) {}`)* The final callback is of the form `callback(err, results...)`, which must be* called once the function is completed. The callback should be called with a* Error as its first argument to signal that an error occurred.* Otherwise, if no error occurred, it should be called with `null` as the first* argument, and any additional `result` arguments that may apply, to signal* successful completion.* The callback must be called exactly once, ideally on a later tick of the* JavaScript event loop.** This type of function is also referred to as a "Node-style async function",* or a "continuation passing-style function" (CPS). Most of the methods of this* library are themselves CPS/Node-style async functions, or functions that* return CPS/Node-style async functions.** Wherever we accept a Node-style async function, we also directly accept an* [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.* In this case, the `async` function will not be passed a final callback* argument, and any thrown error will be used as the `err` argument of the* implicit callback, and the return value will be used as the `result` value.* (i.e. a `rejected` of the returned Promise becomes the `err` callback* argument, and a `resolved` value becomes the `result`.)** Note, due to JavaScript limitations, we can only detect native `async`* functions and not transpilied implementations.* Your environment must have `async`/`await` support for this to work.* (e.g. Node > v7.6, or a recent version of a modern browser).* If you are using `async` functions through a transpiler (e.g. Babel), you* must still wrap the function with [asyncify]{@link module:Utils.asyncify},* because the `async function` will be compiled to an ordinary function that* returns a promise.** @typedef {Function} AsyncFunction* @static*//*** Async is a utility module which provides straight-forward, powerful functions* for working with asynchronous JavaScript. Although originally designed for* use with [Node.js](http://nodejs.org) and installable via* `npm install --save async`, it can also be used directly in the browser.* @module async* @see AsyncFunction*//*** A collection of `async` functions for manipulating collections, such as* arrays and objects.* @module Collections*//*** A collection of `async` functions for controlling the flow through a script.* @module ControlFlow*//*** A collection of `async` utility functions.* @module Utils*/var index = {apply: apply,applyEach: applyEach,applyEachSeries: applyEachSeries,asyncify: asyncify,auto: auto,autoInject: autoInject,cargo: cargo,compose: compose,concat: concat,concatLimit: concatLimit,concatSeries: concatSeries,constant: constant,detect: detect,detectLimit: detectLimit,detectSeries: detectSeries,dir: dir,doDuring: doDuring,doUntil: doUntil,doWhilst: doWhilst,during: during,each: eachLimit,eachLimit: eachLimit$1,eachOf: eachOf,eachOfLimit: eachOfLimit,eachOfSeries: eachOfSeries,eachSeries: eachSeries,ensureAsync: ensureAsync,every: every,everyLimit: everyLimit,everySeries: everySeries,filter: filter,filterLimit: filterLimit,filterSeries: filterSeries,forever: forever,groupBy: groupBy,groupByLimit: groupByLimit,groupBySeries: groupBySeries,log: log,map: map,mapLimit: mapLimit,mapSeries: mapSeries,mapValues: mapValues,mapValuesLimit: mapValuesLimit,mapValuesSeries: mapValuesSeries,memoize: memoize,nextTick: nextTick,parallel: parallelLimit,parallelLimit: parallelLimit$1,priorityQueue: priorityQueue,queue: queue$1,race: race,reduce: reduce,reduceRight: reduceRight,reflect: reflect,reflectAll: reflectAll,reject: reject,rejectLimit: rejectLimit,rejectSeries: rejectSeries,retry: retry,retryable: retryable,seq: seq,series: series,setImmediate: setImmediate$1,some: some,someLimit: someLimit,someSeries: someSeries,sortBy: sortBy,timeout: timeout,times: times,timesLimit: timeLimit,timesSeries: timesSeries,transform: transform,tryEach: tryEach,unmemoize: unmemoize,until: until,waterfall: waterfall,whilst: whilst,// aliasesall: every,allLimit: everyLimit,allSeries: everySeries,any: some,anyLimit: someLimit,anySeries: someSeries,find: detect,findLimit: detectLimit,findSeries: detectSeries,forEach: eachLimit,forEachSeries: eachSeries,forEachLimit: eachLimit$1,forEachOf: eachOf,forEachOfSeries: eachOfSeries,forEachOfLimit: eachOfLimit,inject: reduce,foldl: reduce,foldr: reduceRight,select: filter,selectLimit: filterLimit,selectSeries: filterSeries,wrapSync: asyncify};exports['default'] = index;exports.apply = apply;exports.applyEach = applyEach;exports.applyEachSeries = applyEachSeries;exports.asyncify = asyncify;exports.auto = auto;exports.autoInject = autoInject;exports.cargo = cargo;exports.compose = compose;exports.concat = concat;exports.concatLimit = concatLimit;exports.concatSeries = concatSeries;exports.constant = constant;exports.detect = detect;exports.detectLimit = detectLimit;exports.detectSeries = detectSeries;exports.dir = dir;exports.doDuring = doDuring;exports.doUntil = doUntil;exports.doWhilst = doWhilst;exports.during = during;exports.each = eachLimit;exports.eachLimit = eachLimit$1;exports.eachOf = eachOf;exports.eachOfLimit = eachOfLimit;exports.eachOfSeries = eachOfSeries;exports.eachSeries = eachSeries;exports.ensureAsync = ensureAsync;exports.every = every;exports.everyLimit = everyLimit;exports.everySeries = everySeries;exports.filter = filter;exports.filterLimit = filterLimit;exports.filterSeries = filterSeries;exports.forever = forever;exports.groupBy = groupBy;exports.groupByLimit = groupByLimit;exports.groupBySeries = groupBySeries;exports.log = log;exports.map = map;exports.mapLimit = mapLimit;exports.mapSeries = mapSeries;exports.mapValues = mapValues;exports.mapValuesLimit = mapValuesLimit;exports.mapValuesSeries = mapValuesSeries;exports.memoize = memoize;exports.nextTick = nextTick;exports.parallel = parallelLimit;exports.parallelLimit = parallelLimit$1;exports.priorityQueue = priorityQueue;exports.queue = queue$1;exports.race = race;exports.reduce = reduce;exports.reduceRight = reduceRight;exports.reflect = reflect;exports.reflectAll = reflectAll;exports.reject = reject;exports.rejectLimit = rejectLimit;exports.rejectSeries = rejectSeries;exports.retry = retry;exports.retryable = retryable;exports.seq = seq;exports.series = series;exports.setImmediate = setImmediate$1;exports.some = some;exports.someLimit = someLimit;exports.someSeries = someSeries;exports.sortBy = sortBy;exports.timeout = timeout;exports.times = times;exports.timesLimit = timeLimit;exports.timesSeries = timesSeries;exports.transform = transform;exports.tryEach = tryEach;exports.unmemoize = unmemoize;exports.until = until;exports.waterfall = waterfall;exports.whilst = whilst;exports.all = every;exports.allLimit = everyLimit;exports.allSeries = everySeries;exports.any = some;exports.anyLimit = someLimit;exports.anySeries = someSeries;exports.find = detect;exports.findLimit = detectLimit;exports.findSeries = detectSeries;exports.forEach = eachLimit;exports.forEachSeries = eachSeries;exports.forEachLimit = eachLimit$1;exports.forEachOf = eachOf;exports.forEachOfSeries = eachOfSeries;exports.forEachOfLimit = eachOfLimit;exports.inject = reduce;exports.foldl = reduce;exports.foldr = reduceRight;exports.select = filter;exports.selectLimit = filterLimit;exports.selectSeries = filterSeries;exports.wrapSync = asyncify;Object.defineProperty(exports, '__esModule', { value: true });})));
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _consoleFunc = require('./internal/consoleFunc');var _consoleFunc2 = _interopRequireDefault(_consoleFunc);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Logs the result of an [`async` function]{@link AsyncFunction} to the* `console` using `console.dir` to display the properties of the resulting object.* Only works in Node.js or in browsers that support `console.dir` and* `console.error` (such as FF and Chrome).* If multiple arguments are returned from the async function,* `console.dir` is called on each argument in order.** @name dir* @static* @memberOf module:Utils* @method* @category Util* @param {AsyncFunction} function - The function you want to eventually apply* all arguments to.* @param {...*} arguments... - Any number of arguments to apply to the function.* @example** // in a module* var hello = function(name, callback) {* setTimeout(function() {* callback(null, {hello: name});* }, 1000);* };** // in the node repl* node> async.dir(hello, 'world');* {hello: 'world'}*/exports.default = (0, _consoleFunc2.default)('dir');module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _detectLimit = require('./detectLimit');var _detectLimit2 = _interopRequireDefault(_detectLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.** @name detectSeries* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findSeries* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/exports.default = (0, _doLimit2.default)(_detectLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _findGetResult = require('./internal/findGetResult');var _findGetResult2 = _interopRequireDefault(_findGetResult);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a* time.** @name detectLimit* @static* @memberOf module:Collections* @method* @see [async.detect]{@link module:Collections.detect}* @alias findLimit* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _findGetResult = require('./internal/findGetResult');var _findGetResult2 = _interopRequireDefault(_findGetResult);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns the first value in `coll` that passes an async truth test. The* `iteratee` is applied in parallel, meaning the first iteratee to return* `true` will fire the detect `callback` with that result. That means the* result might not be the first item in the original `coll` (in terms of order)* that passes the test.* If order within the original `coll` is important, then look at* [`detectSeries`]{@link module:Collections.detectSeries}.** @name detect* @static* @memberOf module:Collections* @method* @alias find* @category Collections* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.* The iteratee must complete with a boolean value as its result.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the `iteratee` functions have finished.* Result will be the first item in the array that passes the truth test* (iteratee) or the value `undefined` if none passed. Invoked with* (err, result).* @example** async.detect(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // result now equals the first file in the list that exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_identity2.default, _findGetResult2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function () /*...values*/{var values = (0, _slice2.default)(arguments);var args = [null].concat(values);return function () /*...ignoredArgs, callback*/{var callback = arguments[arguments.length - 1];return callback.apply(this, args);};};var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; };/*** Returns a function that when called, calls-back with the values provided.* Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to* [`auto`]{@link module:ControlFlow.auto}.** @name constant* @static* @memberOf module:Utils* @method* @category Util* @param {...*} arguments... - Any number of arguments to automatically invoke* callback with.* @returns {AsyncFunction} Returns a function that when invoked, automatically* invokes the callback with the previous given arguments.* @example** async.waterfall([* async.constant(42),* function (value, next) {* // value === 42* },* //...* ], callback);** async.waterfall([* async.constant(filename, "utf8"),* fs.readFile,* function (fileData, next) {* //...* }* //...* ], callback);** async.auto({* hostname: async.constant("https://server.net/"),* port: findFreePort,* launchServer: ["hostname", "port", function (options, cb) {* startServer(options, cb);* }],* //...* }, callback);*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _concatLimit = require('./concatLimit');var _concatLimit2 = _interopRequireDefault(_concatLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.** @name concatSeries* @static* @memberOf module:Collections* @method* @see [async.concat]{@link module:Collections.concat}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.* The iteratee should complete with an array an array of results.* Invoked with (item, callback).* @param {Function} [callback(err)] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).*/exports.default = (0, _doLimit2.default)(_concatLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (coll, limit, iteratee, callback) {callback = callback || _noop2.default;var _iteratee = (0, _wrapAsync2.default)(iteratee);(0, _mapLimit2.default)(coll, limit, function (val, callback) {_iteratee(val, function (err /*, ...args*/) {if (err) return callback(err);return callback(null, (0, _slice2.default)(arguments, 1));});}, function (err, mapResults) {var result = [];for (var i = 0; i < mapResults.length; i++) {if (mapResults[i]) {result = _concat.apply(result, mapResults[i]);}}return callback(err, result);});};var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _mapLimit = require('./mapLimit');var _mapLimit2 = _interopRequireDefault(_mapLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _concat = Array.prototype.concat;/*** The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.** @name concatLimit* @static* @memberOf module:Collections* @method* @see [async.concat]{@link module:Collections.concat}* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,* which should use an array as its result. Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);var _concatLimit = require('./concatLimit');var _concatLimit2 = _interopRequireDefault(_concatLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Applies `iteratee` to each item in `coll`, concatenating the results. Returns* the concatenated list. The `iteratee`s are called in parallel, and the* results are concatenated as they return. There is no guarantee that the* results array will be returned in the original order of `coll` passed to the* `iteratee` function.** @name concat* @static* @memberOf module:Collections* @method* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,* which should use an array as its result. Invoked with (item, callback).* @param {Function} [callback(err)] - A callback which is called after all the* `iteratee` functions have finished, or an error occurs. Results is an array* containing the concatenated results of the `iteratee` function. Invoked with* (err, results).* @example** async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {* // files is now a list of filenames that exist in the 3 directories* });*/exports.default = (0, _doLimit2.default)(_concatLimit2.default, Infinity);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function () /*...args*/{return _seq2.default.apply(null, (0, _slice2.default)(arguments).reverse());};var _seq = require('./seq');var _seq2 = _interopRequireDefault(_seq);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; };/*** Creates a function which is a composition of the passed asynchronous* functions. Each function consumes the return value of the function that* follows. Composing functions `f()`, `g()`, and `h()` would produce the result* of `f(g(h()))`, only this version uses callbacks to obtain the return values.** Each function is executed with the `this` binding of the composed function.** @name compose* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {...AsyncFunction} functions - the asynchronous functions to compose* @returns {Function} an asynchronous function that is the composed* asynchronous `functions`* @example** function add1(n, callback) {* setTimeout(function () {* callback(null, n + 1);* }, 10);* }** function mul3(n, callback) {* setTimeout(function () {* callback(null, n * 3);* }, 10);* }** var add1mul3 = async.compose(mul3, add1);* add1mul3(4, function (err, result) {* // result now equals 15* });*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = cargo;var _queue = require('./internal/queue');var _queue2 = _interopRequireDefault(_queue);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** A cargo of tasks for the worker function to complete. Cargo inherits all of* the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.* @typedef {Object} CargoObject* @memberOf module:ControlFlow* @property {Function} length - A function returning the number of items* waiting to be processed. Invoke like `cargo.length()`.* @property {number} payload - An `integer` for determining how many tasks* should be process per round. This property can be changed after a `cargo` is* created to alter the payload on-the-fly.* @property {Function} push - Adds `task` to the `queue`. The callback is* called once the `worker` has finished processing the task. Instead of a* single task, an array of `tasks` can be submitted. The respective callback is* used for every task in the list. Invoke like `cargo.push(task, [callback])`.* @property {Function} saturated - A callback that is called when the* `queue.length()` hits the concurrency and further tasks will be queued.* @property {Function} empty - A callback that is called when the last item* from the `queue` is given to a `worker`.* @property {Function} drain - A callback that is called when the last item* from the `queue` has returned from the `worker`.* @property {Function} idle - a function returning false if there are items* waiting or being processed, or true if not. Invoke like `cargo.idle()`.* @property {Function} pause - a function that pauses the processing of tasks* until `resume()` is called. Invoke like `cargo.pause()`.* @property {Function} resume - a function that resumes the processing of* queued tasks when the queue is paused. Invoke like `cargo.resume()`.* @property {Function} kill - a function that removes the `drain` callback and* empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.*//*** Creates a `cargo` object with the specified payload. Tasks added to the* cargo will be processed altogether (up to the `payload` limit). If the* `worker` is in progress, the task is queued until it becomes available. Once* the `worker` has completed some tasks, each callback of those tasks is* called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)* for how `cargo` and `queue` work.** While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers* at a time, cargo passes an array of tasks to a single worker, repeating* when the worker is finished.** @name cargo* @static* @memberOf module:ControlFlow* @method* @see [async.queue]{@link module:ControlFlow.queue}* @category Control Flow* @param {AsyncFunction} worker - An asynchronous function for processing an array* of queued tasks. Invoked with `(tasks, callback)`.* @param {number} [payload=Infinity] - An optional `integer` for determining* how many tasks should be processed per round; if omitted, the default is* unlimited.* @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can* attached as certain properties to listen for specific events during the* lifecycle of the cargo and inner queue.* @example** // create a cargo object with payload 2* var cargo = async.cargo(function(tasks, callback) {* for (var i=0; i<tasks.length; i++) {* console.log('hello ' + tasks[i].name);* }* callback();* }, 2);** // add some items* cargo.push({name: 'foo'}, function(err) {* console.log('finished processing foo');* });* cargo.push({name: 'bar'}, function(err) {* console.log('finished processing bar');* });* cargo.push({name: 'baz'}, function(err) {* console.log('finished processing baz');* });*/function cargo(worker, payload) {return (0, _queue2.default)(worker, 1, payload);}module.exports = exports['default'];
{"name": "async","main": "dist/async.js","ignore": ["bower_components","lib","mocha_test","node_modules","perf","support","**/.*","*.config.js","*.json","index.js","Makefile"]}
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = autoInject;var _auto = require('./auto');var _auto2 = _interopRequireDefault(_auto);var _baseForOwn = require('lodash/_baseForOwn');var _baseForOwn2 = _interopRequireDefault(_baseForOwn);var _arrayMap = require('lodash/_arrayMap');var _arrayMap2 = _interopRequireDefault(_arrayMap);var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _trim = require('lodash/trim');var _trim2 = _interopRequireDefault(_trim);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m;var FN_ARG_SPLIT = /,/;var FN_ARG = /(=.+)?(\s*)$/;var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;function parseParams(func) {func = func.toString().replace(STRIP_COMMENTS, '');func = func.match(FN_ARGS)[2].replace(' ', '');func = func ? func.split(FN_ARG_SPLIT) : [];func = func.map(function (arg) {return (0, _trim2.default)(arg.replace(FN_ARG, ''));});return func;}/*** A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent* tasks are specified as parameters to the function, after the usual callback* parameter, with the parameter names matching the names of the tasks it* depends on. This can provide even more readable task graphs which can be* easier to maintain.** If a final callback is specified, the task results are similarly injected,* specified as named parameters after the initial error parameter.** The autoInject function is purely syntactic sugar and its semantics are* otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.** @name autoInject* @static* @memberOf module:ControlFlow* @method* @see [async.auto]{@link module:ControlFlow.auto}* @category Control Flow* @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of* the form 'func([dependencies...], callback). The object's key of a property* serves as the name of the task defined by that property, i.e. can be used* when specifying requirements for other tasks.* * The `callback` parameter is a `callback(err, result)` which must be called* when finished, passing an `error` (which can be `null`) and the result of* the function's execution. The remaining parameters name other tasks on* which the task is dependent, and the results from those tasks are the* arguments of those parameters.* @param {Function} [callback] - An optional callback which is called when all* the tasks have been completed. It receives the `err` argument if any `tasks`* pass an error to their callback, and a `results` object with any completed* task results, similar to `auto`.* @example** // The example from `auto` can be rewritten as follows:* async.autoInject({* get_data: function(callback) {* // async code to get some data* callback(null, 'data', 'converted to array');* },* make_folder: function(callback) {* // async code to create a directory to store a file in* // this is run at the same time as getting the data* callback(null, 'folder');* },* write_file: function(get_data, make_folder, callback) {* // once there is some data and the directory exists,* // write the data to a file in the directory* callback(null, 'filename');* },* email_link: function(write_file, callback) {* // once the file is written let's email a link to it...* // write_file contains the filename returned by write_file.* callback(null, {'file':write_file, 'email':'user@example.com'});* }* }, function(err, results) {* console.log('err = ', err);* console.log('email_link = ', results.email_link);* });** // If you are using a JS minifier that mangles parameter names, `autoInject`* // will not work with plain functions, since the parameter names will be* // collapsed to a single letter identifier. To work around this, you can* // explicitly specify the names of the parameters your task function needs* // in an array, similar to Angular.js dependency injection.** // This still has an advantage over plain `auto`, since the results a task* // depends on are still spread into arguments.* async.autoInject({* //...* write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {* callback(null, 'filename');* }],* email_link: ['write_file', function(write_file, callback) {* callback(null, {'file':write_file, 'email':'user@example.com'});* }]* //...* }, function(err, results) {* console.log('err = ', err);* console.log('email_link = ', results.email_link);* });*/function autoInject(tasks, callback) {var newTasks = {};(0, _baseForOwn2.default)(tasks, function (taskFn, key) {var params;var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn);var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0;if ((0, _isArray2.default)(taskFn)) {params = taskFn.slice(0, -1);taskFn = taskFn[taskFn.length - 1];newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);} else if (hasNoDeps) {// no dependencies, use the function as-isnewTasks[key] = taskFn;} else {params = parseParams(taskFn);if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {throw new Error("autoInject task functions require explicit parameters.");}// remove callback paramif (!fnIsAsync) params.pop();newTasks[key] = params.concat(newTask);}function newTask(results, taskCb) {var newArgs = (0, _arrayMap2.default)(params, function (name) {return results[name];});newArgs.push(taskCb);(0, _wrapAsync2.default)(taskFn).apply(null, newArgs);}});(0, _auto2.default)(newTasks, callback);}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (tasks, concurrency, callback) {if (typeof concurrency === 'function') {// concurrency is optional, shift the args.callback = concurrency;concurrency = null;}callback = (0, _once2.default)(callback || _noop2.default);var keys = (0, _keys2.default)(tasks);var numTasks = keys.length;if (!numTasks) {return callback(null);}if (!concurrency) {concurrency = numTasks;}var results = {};var runningTasks = 0;var hasError = false;var listeners = Object.create(null);var readyTasks = [];// for cycle detection:var readyToCheck = []; // tasks that have been identified as reachable// without the possibility of returning to an ancestor taskvar uncheckedDependencies = {};(0, _baseForOwn2.default)(tasks, function (task, key) {if (!(0, _isArray2.default)(task)) {// no dependenciesenqueueTask(key, [task]);readyToCheck.push(key);return;}var dependencies = task.slice(0, task.length - 1);var remainingDependencies = dependencies.length;if (remainingDependencies === 0) {enqueueTask(key, task);readyToCheck.push(key);return;}uncheckedDependencies[key] = remainingDependencies;(0, _arrayEach2.default)(dependencies, function (dependencyName) {if (!tasks[dependencyName]) {throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));}addListener(dependencyName, function () {remainingDependencies--;if (remainingDependencies === 0) {enqueueTask(key, task);}});});});checkForDeadlocks();processQueue();function enqueueTask(key, task) {readyTasks.push(function () {runTask(key, task);});}function processQueue() {if (readyTasks.length === 0 && runningTasks === 0) {return callback(null, results);}while (readyTasks.length && runningTasks < concurrency) {var run = readyTasks.shift();run();}}function addListener(taskName, fn) {var taskListeners = listeners[taskName];if (!taskListeners) {taskListeners = listeners[taskName] = [];}taskListeners.push(fn);}function taskComplete(taskName) {var taskListeners = listeners[taskName] || [];(0, _arrayEach2.default)(taskListeners, function (fn) {fn();});processQueue();}function runTask(key, task) {if (hasError) return;var taskCallback = (0, _onlyOnce2.default)(function (err, result) {runningTasks--;if (arguments.length > 2) {result = (0, _slice2.default)(arguments, 1);}if (err) {var safeResults = {};(0, _baseForOwn2.default)(results, function (val, rkey) {safeResults[rkey] = val;});safeResults[key] = result;hasError = true;listeners = Object.create(null);callback(err, safeResults);} else {results[key] = result;taskComplete(key);}});runningTasks++;var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]);if (task.length > 1) {taskFn(results, taskCallback);} else {taskFn(taskCallback);}}function checkForDeadlocks() {// Kahn's algorithm// https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm// http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.htmlvar currentTask;var counter = 0;while (readyToCheck.length) {currentTask = readyToCheck.pop();counter++;(0, _arrayEach2.default)(getDependents(currentTask), function (dependent) {if (--uncheckedDependencies[dependent] === 0) {readyToCheck.push(dependent);}});}if (counter !== numTasks) {throw new Error('async.auto cannot execute tasks due to a recursive dependency');}}function getDependents(taskName) {var result = [];(0, _baseForOwn2.default)(tasks, function (task, key) {if ((0, _isArray2.default)(task) && (0, _baseIndexOf2.default)(task, taskName, 0) >= 0) {result.push(key);}});return result;}};var _arrayEach = require('lodash/_arrayEach');var _arrayEach2 = _interopRequireDefault(_arrayEach);var _baseForOwn = require('lodash/_baseForOwn');var _baseForOwn2 = _interopRequireDefault(_baseForOwn);var _baseIndexOf = require('lodash/_baseIndexOf');var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);var _isArray = require('lodash/isArray');var _isArray2 = _interopRequireDefault(_isArray);var _keys = require('lodash/keys');var _keys2 = _interopRequireDefault(_keys);var _noop = require('lodash/noop');var _noop2 = _interopRequireDefault(_noop);var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);var _once = require('./internal/once');var _once2 = _interopRequireDefault(_once);var _onlyOnce = require('./internal/onlyOnce');var _onlyOnce2 = _interopRequireDefault(_onlyOnce);var _wrapAsync = require('./internal/wrapAsync');var _wrapAsync2 = _interopRequireDefault(_wrapAsync);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }module.exports = exports['default'];/*** Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on* their requirements. Each function can optionally depend on other functions* being completed first, and each function is run as soon as its requirements* are satisfied.** If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence* will stop. Further tasks will not execute (so any other functions depending* on it will not run), and the main `callback` is immediately called with the* error.** {@link AsyncFunction}s also receive an object containing the results of functions which* have completed so far as the first argument, if they have dependencies. If a* task function has no dependencies, it will only be passed a callback.** @name auto* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Object} tasks - An object. Each of its properties is either a* function or an array of requirements, with the {@link AsyncFunction} itself the last item* in the array. The object's key of a property serves as the name of the task* defined by that property, i.e. can be used when specifying requirements for* other tasks. The function receives one or two arguments:* * a `results` object, containing the results of the previously executed* functions, only passed if the task has any dependencies,* * a `callback(err, result)` function, which must be called when finished,* passing an `error` (which can be `null`) and the result of the function's* execution.* @param {number} [concurrency=Infinity] - An optional `integer` for* determining the maximum number of tasks that can be run in parallel. By* default, as many as possible.* @param {Function} [callback] - An optional callback which is called when all* the tasks have been completed. It receives the `err` argument if any `tasks`* pass an error to their callback. Results are always returned; however, if an* error occurs, no further `tasks` will be performed, and the results object* will only contain partial results. Invoked with (err, results).* @returns undefined* @example** async.auto({* // this function will just be passed a callback* readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),* showData: ['readData', function(results, cb) {* // results.readData is the file's contents* // ...* }]* }, callback);** async.auto({* get_data: function(callback) {* console.log('in get_data');* // async code to get some data* callback(null, 'data', 'converted to array');* },* make_folder: function(callback) {* console.log('in make_folder');* // async code to create a directory to store a file in* // this is run at the same time as getting the data* callback(null, 'folder');* },* write_file: ['get_data', 'make_folder', function(results, callback) {* console.log('in write_file', JSON.stringify(results));* // once there is some data and the directory exists,* // write the data to a file in the directory* callback(null, 'filename');* }],* email_link: ['write_file', function(results, callback) {* console.log('in email_link', JSON.stringify(results));* // once the file is written let's email a link to it...* // results.write_file contains the filename returned by write_file.* callback(null, {'file':results.write_file, 'email':'user@example.com'});* }]* }, function(err, results) {* console.log('err = ', err);* console.log('results = ', results);* });*/
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = asyncify;var _isObject = require('lodash/isObject');var _isObject2 = _interopRequireDefault(_isObject);var _initialParams = require('./internal/initialParams');var _initialParams2 = _interopRequireDefault(_initialParams);var _setImmediate = require('./internal/setImmediate');var _setImmediate2 = _interopRequireDefault(_setImmediate);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Take a sync function and make it async, passing its return value to a* callback. This is useful for plugging sync functions into a waterfall,* series, or other async functions. Any arguments passed to the generated* function will be passed to the wrapped function (except for the final* callback argument). Errors thrown will be passed to the callback.** If the function passed to `asyncify` returns a Promise, that promises's* resolved/rejected state will be used to call the callback, rather than simply* the synchronous return value.** This also means you can asyncify ES2017 `async` functions.** @name asyncify* @static* @memberOf module:Utils* @method* @alias wrapSync* @category Util* @param {Function} func - The synchronous function, or Promise-returning* function to convert to an {@link AsyncFunction}.* @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be* invoked with `(args..., callback)`.* @example** // passing a regular synchronous function* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(JSON.parse),* function (data, next) {* // data is the result of parsing the text.* // If there was a parsing error, it would have been caught.* }* ], callback);** // passing a function returning a promise* async.waterfall([* async.apply(fs.readFile, filename, "utf8"),* async.asyncify(function (contents) {* return db.model.create(contents);* }),* function (model, next) {* // `model` is the instantiated model object.* // If there was an error, this function would be skipped.* }* ], callback);** // es2017 example, though `asyncify` is not needed if your JS environment* // supports async functions out of the box* var q = async.queue(async.asyncify(async function(file) {* var intermediateStep = await processFile(file);* return await somePromise(intermediateStep)* }));** q.push(files);*/function asyncify(func) {return (0, _initialParams2.default)(function (args, callback) {var result;try {result = func.apply(this, args);} catch (e) {return callback(e);}// if result is Promise objectif ((0, _isObject2.default)(result) && typeof result.then === 'function') {result.then(function (value) {invokeCallback(callback, null, value);}, function (err) {invokeCallback(callback, err.message ? err : new Error(err));});} else {callback(null, result);}});}function invokeCallback(callback, error, value) {try {callback(error, value);} catch (e) {(0, _setImmediate2.default)(rethrow, e);}}function rethrow(error) {throw error;}module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _applyEach = require('./internal/applyEach');var _applyEach2 = _interopRequireDefault(_applyEach);var _mapSeries = require('./mapSeries');var _mapSeries2 = _interopRequireDefault(_mapSeries);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.** @name applyEachSeries* @static* @memberOf module:ControlFlow* @method* @see [async.applyEach]{@link module:ControlFlow.applyEach}* @category Control Flow* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all* call with the same arguments* @param {...*} [args] - any number of separate arguments to pass to the* function.* @param {Function} [callback] - the final argument should be the callback,* called when all functions have completed processing.* @returns {Function} - If only the first argument is provided, it will return* a function which lets you pass in the arguments as if it were a single* function call.*/exports.default = (0, _applyEach2.default)(_mapSeries2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _applyEach = require('./internal/applyEach');var _applyEach2 = _interopRequireDefault(_applyEach);var _map = require('./map');var _map2 = _interopRequireDefault(_map);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Applies the provided arguments to each function in the array, calling* `callback` after all functions have completed. If you only provide the first* argument, `fns`, then it will return a function which lets you pass in the* arguments as if it were a single function call. If more arguments are* provided, `callback` is required while `args` is still optional.** @name applyEach* @static* @memberOf module:ControlFlow* @method* @category Control Flow* @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s* to all call with the same arguments* @param {...*} [args] - any number of separate arguments to pass to the* function.* @param {Function} [callback] - the final argument should be the callback,* called when all functions have completed processing.* @returns {Function} - If only the first argument, `fns`, is provided, it will* return a function which lets you pass in the arguments as if it were a single* function call. The signature is `(..args, callback)`. If invoked with any* arguments, `callback` is required.* @example** async.applyEach([enableSearch, updateSchema], 'bucket', callback);** // partial application example:* async.each(* buckets,* async.applyEach([enableSearch, updateSchema]),* callback* );*/exports.default = (0, _applyEach2.default)(_map2.default);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});exports.default = function (fn /*, ...args*/) {var args = (0, _slice2.default)(arguments, 1);return function () /*callArgs*/{var callArgs = (0, _slice2.default)(arguments);return fn.apply(null, args.concat(callArgs));};};var _slice = require('./internal/slice');var _slice2 = _interopRequireDefault(_slice);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; };/*** Creates a continuation function with some arguments already applied.** Useful as a shorthand when combined with other control flow functions. Any* arguments passed to the returned function are added to the arguments* originally passed to apply.** @name apply* @static* @memberOf module:Utils* @method* @category Util* @param {Function} fn - The function you want to eventually apply all* arguments to. Invokes with (arguments...).* @param {...*} arguments... - Any number of arguments to automatically apply* when the continuation is called.* @returns {Function} the partially-applied function* @example** // using apply* async.parallel([* async.apply(fs.writeFile, 'testfile1', 'test1'),* async.apply(fs.writeFile, 'testfile2', 'test2')* ]);*** // the same process without using apply* async.parallel([* function(callback) {* fs.writeFile('testfile1', 'test1', callback);* },* function(callback) {* fs.writeFile('testfile2', 'test2', callback);* }* ]);** // It's possible to pass any number of additional arguments when calling the* // continuation:** node> var fn = async.apply(sys.puts, 'one');* node> fn('two', 'three');* one* two* three*/module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _someLimit = require('./someLimit');var _someLimit2 = _interopRequireDefault(_someLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.** @name someSeries* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anySeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in series.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/exports.default = (0, _doLimit2.default)(_someLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.** @name someLimit* @static* @memberOf module:Collections* @method* @see [async.some]{@link module:Collections.some}* @alias anyLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(Boolean, _identity2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _identity = require('lodash/identity');var _identity2 = _interopRequireDefault(_identity);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns `true` if at least one element in the `coll` satisfies an async test.* If any iteratee call returns `true`, the main `callback` is immediately* called.** @name some* @static* @memberOf module:Collections* @method* @alias any* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collections in parallel.* The iteratee should complete with a boolean `result` value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called as soon as any* iteratee returns `true`, or after all the iteratee functions have finished.* Result will be either `true` or `false` depending on the values of the async* tests. Invoked with (err, result).* @example** async.some(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then at least one of the files exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _everyLimit = require('./everyLimit');var _everyLimit2 = _interopRequireDefault(_everyLimit);var _doLimit = require('./internal/doLimit');var _doLimit2 = _interopRequireDefault(_doLimit);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.** @name everySeries* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allSeries* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in series.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/exports.default = (0, _doLimit2.default)(_everyLimit2.default, 1);module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallelLimit = require('./internal/doParallelLimit');var _doParallelLimit2 = _interopRequireDefault(_doParallelLimit);var _notId = require('./internal/notId');var _notId2 = _interopRequireDefault(_notId);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.** @name everyLimit* @static* @memberOf module:Collections* @method* @see [async.every]{@link module:Collections.every}* @alias allLimit* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {number} limit - The maximum number of async operations at a time.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).*/exports.default = (0, _doParallelLimit2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));module.exports = exports['default'];
'use strict';Object.defineProperty(exports, "__esModule", {value: true});var _createTester = require('./internal/createTester');var _createTester2 = _interopRequireDefault(_createTester);var _doParallel = require('./internal/doParallel');var _doParallel2 = _interopRequireDefault(_doParallel);var _notId = require('./internal/notId');var _notId2 = _interopRequireDefault(_notId);function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/*** Returns `true` if every element in `coll` satisfies an async test. If any* iteratee call returns `false`, the main `callback` is immediately called.** @name every* @static* @memberOf module:Collections* @method* @alias all* @category Collection* @param {Array|Iterable|Object} coll - A collection to iterate over.* @param {AsyncFunction} iteratee - An async truth test to apply to each item* in the collection in parallel.* The iteratee must complete with a boolean result value.* Invoked with (item, callback).* @param {Function} [callback] - A callback which is called after all the* `iteratee` functions have finished. Result will be either `true` or `false`* depending on the values of the async tests. Invoked with (err, result).* @example** async.every(['file1','file2','file3'], function(filePath, callback) {* fs.access(filePath, function(err) {* callback(null, !err)* });* }, function(err, result) {* // if result is true then every file exists* });*/exports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));module.exports = exports['default'];
[](https://travis-ci.org/caolan/async)[](https://www.npmjs.com/package/async)[](https://coveralls.io/r/caolan/async?branch=master)[](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[](https://www.libhive.com/providers/npm/packages/async)[](https://www.jsdelivr.com/package/npm/async)Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm install --save async`, it can also be used directly in the browser.This version of the package is optimized for the Node.js environment. If you use Async with webpack, install [`async-es`](https://www.npmjs.com/package/async-es) instead.For Documentation, visit <https://caolan.github.io/async/>*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)*```javascript// for use with Node-style callbacks...var async = require("async");var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};var configs = {};async.forEachOf(obj, (value, key, callback) => {fs.readFile(__dirname + value, "utf8", (err, data) => {if (err) return callback(err);try {configs[key] = JSON.parse(data);} catch (e) {return callback(e);}callback();});}, err => {if (err) console.error(err.message);// configs is now a map of JSON datadoSomethingWith(configs);});``````javascriptvar async = require("async");// ...or ES2017 async functionsasync.mapLimit(urls, 5, async function(url) {const response = await fetch(url)return response.body}, (err, results) => {if (err) throw err// results is now an array of the response bodiesconsole.log(results)})```
Copyright (c) 2010-2018 Caolan McMahonPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.
# v2.6.3- Updated lodash to squelch a security warning (#1675)# v2.6.2- Updated lodash to squelch a security warning (#1620)# v2.6.1- Updated lodash to prevent `npm audit` warnings. (#1532, #1533)- Made `async-es` more optimized for webpack users (#1517)- Fixed a stack overflow with large collections and a synchronous iterator (#1514)- Various small fixes/chores (#1505, #1511, #1527, #1530)# v2.6.0- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483)- Improved `queue` performance. (#1448, #1454)- Add missing sourcemap (#1452, #1453)- Various doc updates (#1448, #1471, #1483)# v2.5.0- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430))- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436))- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429))- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424))# v2.4.1- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419))# v2.4.0- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687))- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395))- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391))- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403))- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408))- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367))- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412))# v2.3.0- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390))- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392))# v2.2.0- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364))- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381))- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385))# v2.1.5- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358))- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349))- Avoid stack overflow case in queue- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined.- Cleanup implementations of `some`, `every` and `find`# v2.1.3- Make bundle size smaller- Create optimized hotpath for `filter` in array case.# v2.1.2- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)).# v2.1.0- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261))- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253))- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254))- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300))- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302))# v2.0.1- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)).# v2.0.0Lots of changes here!First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well.The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before.We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size.Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy.Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that:1. Takes a variable number of arguments2. The last argument is always a callback3. The callback can accept any number of arguments4. The first argument passed to the callback will be treated as an error result, if the argument is truthy5. Any number of result arguments can be passed after the "error" argument6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop.There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`.Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`.Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205).## New Features- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996))- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038))- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074))- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027))- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095))- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052))- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053))- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)).- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100))- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637))- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058))- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161))- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)).- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034))- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170))- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088))## Breaking changes- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050))- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042))- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050))- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177))- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041))- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847))- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058))- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224))- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)).- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078))- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237))- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176))## Bug Fixes- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)).- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)).- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)).## Other- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases.- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`).- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238))Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async.------------------------------------------# v1.5.2- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998))- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994))- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002))# v1.5.1- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946))- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963))- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966))- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993))- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980))# v1.5.0- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892))- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873))- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637))- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891))- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904))- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912))# v1.4.2- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879))# v1.4.1- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866))- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861))- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870))# v1.4.0- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840))- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836))- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829))- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823))- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824))- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))# v1.3.0New Features:- Added `constant`- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806))- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800))- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793))- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804))- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642))- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803))- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794))Bug Fixes:- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783))# v1.2.1Bug Fix:- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))# v1.2.0New Features:- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743))- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772))Bug Fixes:- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777))# v1.1.1Bug Fix:- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782))# v1.1.0New Features:- `cargo` now supports all of the same methods and event callbacks as `queue`.- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769))- Optimized `map`, `eachOf`, and `waterfall` families of functions- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)).- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618))- Reduced file size by 4kb, (minified version by 1kb)- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768))Bug Fixes:- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622))- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754))- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439))- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668))- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578))- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557))- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593))- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766))# v1.0.0No known breaking changes, we are simply complying with semver from here on out.Changes:- Start using a changelog!- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321))- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663))- Better support for require.js ([#527](https://github.com/caolan/async/issues/527))- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714))- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758))- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611))- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729))- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546))- Optimize internal `_each`, `_map` and `_keys` functions.
{"name": "a","version": "0.1.0","lockfileVersion": 2,"requires": true,"packages": {"node_modules/async": {"version": "2.6.3","resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz","integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==","dependencies": {"lodash": "^4.17.14"}},"node_modules/basic-auth": {"version": "1.1.0","resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz","integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=","engines": {"node": ">= 0.6"}},"node_modules/colors": {"version": "1.4.0","resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz","integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==","engines": {"node": ">=0.1.90"}},"node_modules/corser": {"version": "2.0.1","resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz","integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=","engines": {"node": ">= 0.4.0"}},"node_modules/debug": {"version": "3.2.7","resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz","integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==","dependencies": {"ms": "^2.1.1"}},"node_modules/ecstatic": {"version": "3.3.2","resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz","integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==","dependencies": {"he": "^1.1.1","mime": "^1.6.0","minimist": "^1.1.0","url-join": "^2.0.5"},"bin": {"ecstatic": "lib/ecstatic.js"}},"node_modules/eventemitter3": {"version": "4.0.7","resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz","integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="},"node_modules/follow-redirects": {"version": "1.13.1","resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.1.tgz","integrity": "sha512-SSG5xmZh1mkPGyKzjZP8zLjltIfpW32Y5QpdNJyjcfGxK3qo3NDDkZOZSFiGn1A6SclQxY9GzEwAHQ3dmYRWpg==","engines": {"node": ">=4.0"}},"node_modules/he": {"version": "1.2.0","resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz","integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==","bin": {"he": "bin/he"}},"node_modules/http-proxy": {"version": "1.18.1","resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz","integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==","dependencies": {"eventemitter3": "^4.0.0","follow-redirects": "^1.0.0","requires-port": "^1.0.0"},"engines": {"node": ">=8.0.0"}},"node_modules/http-server": {"version": "0.12.3","resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz","integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==","dependencies": {"basic-auth": "^1.0.3","colors": "^1.4.0","corser": "^2.0.1","ecstatic": "^3.3.2","http-proxy": "^1.18.0","minimist": "^1.2.5","opener": "^1.5.1","portfinder": "^1.0.25","secure-compare": "3.0.1","union": "~0.5.0"},"bin": {"hs": "bin/http-server","http-server": "bin/http-server"},"engines": {"node": ">=6"}},"node_modules/lodash": {"version": "4.17.20","resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz","integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="},"node_modules/mime": {"version": "1.6.0","resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz","integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==","bin": {"mime": "cli.js"},"engines": {"node": ">=4"}},"node_modules/minimist": {"version": "1.2.5","resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz","integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="},"node_modules/mkdirp": {"version": "0.5.5","resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz","integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==","dependencies": {"minimist": "^1.2.5"},"bin": {"mkdirp": "bin/cmd.js"}},"node_modules/ms": {"version": "2.1.3","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz","integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="},"node_modules/opener": {"version": "1.5.2","resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz","integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==","bin": {"opener": "bin/opener-bin.js"}},"node_modules/portfinder": {"version": "1.0.28","resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz","integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==","dependencies": {"async": "^2.6.2","debug": "^3.1.1","mkdirp": "^0.5.5"},"engines": {"node": ">= 0.12.0"}},"node_modules/qs": {"version": "6.9.4","resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz","integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==","engines": {"node": ">=0.6"}},"node_modules/requires-port": {"version": "1.0.0","resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz","integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="},"node_modules/secure-compare": {"version": "3.0.1","resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz","integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="},"node_modules/union": {"version": "0.5.0","resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz","integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==","dependencies": {"qs": "^6.4.0"},"engines": {"node": ">= 0.8.0"}},"node_modules/url-join": {"version": "2.0.5","resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz","integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="}}}
IntxLNK.�.�/�o�p�e�n�e�r�/�b�i�n�/�o�p�e�n�e�r�-�b�i�n�.�j�s�
IntxLNK.�.�/�m�k�d�i�r�p�/�b�i�n�/�c�m�d�.�j�s�
IntxLNK.�.�/�m�i�m�e�/�c�l�i�.�j�s�
IntxLNK.�.�/�h�t�t�p�-�s�e�r�v�e�r�/�b�i�n�/�h�t�t�p�-�s�e�r�v�e�r�
IntxLNK.�.�/�h�t�t�p�-�s�e�r�v�e�r�/�b�i�n�/�h�t�t�p�-�s�e�r�v�e�r�
IntxLNK.�.�/�h�e�/�b�i�n�/�h�e�
IntxLNK.�.�/�e�c�s�t�a�t�i�c�/�l�i�b�/�e�c�s�t�a�t�i�c�.�j�s�
/*** @description nicoty.sbin.weaken.manager.js - 4.2GB - Perpetually runs enough threads of cyclic weaken to meet the specified botnet RAM usage threshold.* @license BlueOak-1.0.0* @todo Add some capability to kill the instance with the largest amount of threads to increase free RAM for other things?* @todo `float_network_ram_fraction_to_use` might not provide enough RAM for even 1 thread of the script, so we should just skip in that case.*/import {array_get_schedule_script,void_schedule_script_runner,} from "nicoty.lib.ram.script.js";import { float_get_network_ram_fraction_used_by_script } from "nicoty.lib.ps.js";/*** @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @param {string} object_netscript.args.1 - The cyclic weaken script.* @param {number} object_netscript.args.2 - The fraction of the botnet's RAM that should be used.* @param {string} object_netscript.args.3 - The hostname that the hacking script would run in.* @param {string} object_netscript.args.4 - The name of the hacking script.* @param {any[]} object_netscript.args.5 - Contains the arguments to be passed to the cyclic weaken script.*/export const main = async (object_netscript) => {const float_period = object_netscript.args[0],string_script = object_netscript.args[1],float_ram_utilisation_maximum = object_netscript.args[2],string_server_hacker = object_netscript.args[3],string_script_hacker = object_netscript.args[4],array_arguments = object_netscript.args[5];// Wait until the hacking script has been executed before executing ang cyclic weaken scripts, to prevent these from hogging the RAM.for (;!object_netscript.ps(string_server_hacker).some((object_script) => object_script.filename == string_script_hacker);) {await object_netscript.sleep(float_period);}for (;;) {const float_network_ram_fraction_to_use =float_ram_utilisation_maximum -float_get_network_ram_fraction_used_by_script({object_netscript: object_netscript,string_script: string_script,});float_network_ram_fraction_to_use > 0 &&void_schedule_script_runner({object_netscript: object_netscript,array_schedule: array_get_schedule_script({object_netscript: object_netscript,array_scripts: [{string_script: string_script,float_threads_or_fraction_botnet: float_network_ram_fraction_to_use,array_arguments: array_arguments,},],}),}),await object_netscript.sleep(float_period);}};
/*** @description nicoty.sbin.hack.js - 1.85GB - Waits for the time specified, then weakens the specified server.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait.* @param {number} object_netscript.args.1 - The server to target.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {await object_netscript.sleep(Date.now() + object_netscript.args[1]),await object_netscript.weaken(object_netscript.args[0]);};
/*** @description nicoty.sbin.weaken.cyclic.js - 1.75GB - Perpetually weakens the server currently targetted by the hacking script.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {constfloat_period = object_netscript.args[0],object_document = parent["document"];for (;;) {try {await object_netscript.weaken(object_document.nicoty_hacker_string_server_target_actual);} catch (object_exception) {}await object_netscript.sleep(float_period);}};
/*** @description nicoty.sbin.tor.js - 3.8GB - Perpetually tries to buy a TOR Router until one is owned.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {const float_period = object_netscript.args[0];for (;!object_netscript.scan("home").includes("darkweb");) {try {object_netscript.purchaseTor();} catch (object_exception) {object_netscript.print(`WARNING: ${JSON.stringify(object_exception)}`);}await object_netscript.sleep(float_period);}};
/*** Prioritise lower "volatility" stocks as they have the greatest potential to keep increasing or keep decreasing in price for longer periods of time. In this case "volatility" is the amount of times peaks and troughs in price changes happen divided by amount of ticks - need to confirm if amount of flip flopping really is predicatable and constant though, or if it changes randomly.** Assumptions: Using a constant SMA of growth works (for all stocks). Maybe should use volatility dependent smoothing instead though?** Process for long (just inverse things for short):** filter:* * remove stocks with sma5 growth (i.e., price change (curr tick price minus prev tick price) divided by price from previous tick) less than sma10 of growth (i.e., will buy only if sma5 of growth is greater than sma10 of growth as this indicates an upwards momentum) and* * stock with sma5 growth <= 0 (i.e., will only buy if stock is actually increasing in price and not just decreasing in price slower than it was before). we are using growth or price change rather than just price as the former also indicates direction in addition to magnitude rather than just magnitude which is the case for the latter.** then sort by decreasing (biggest first) sma5 of growth * curr price * buyable shares** buy if:* * (commission * 2) / (total price of buyable shares + (2 * commission)) < some fraction (default 1 = pays off 100% after one growth tick. if 0.5 = pays off after 2, etc.) of sma5 growth as this would indicate that growth is sufficient to break even from commission, and* * (highest price - curr price) * buyable shares > 2 * commission as we are assuming that highest price might actually be the cap, so we need to ensure that even if it's reached, we can still break even. can also filter to remove stocks using all these criteria in filter stage.** sell if momentum reversed (i.e., sma5 growth is less than sma10, sma5 is negative) and we'd make a profit if we sell.** @description nicoty.bin.stock.trader.js - 22.2GB - Trades stocks.* @license BlueOak-1.0.0* @todo Loading data should be done by start up script. Saving should be done by this (during updates), and the user interface.* @todo When loading state from local storage, rebuild the arrays of stocks invested in by iterating through the stocks object instead of deserialising from local storage. This will be a once every start up event, so shouldn't be too inefficient, and will also prevent having to save the array to the local storage for every transaction.* @todo Sell profitable currently only sells when forecast becomes bad. It should sell when there's profit to be made regardless of that.* @todo Remove unecessary cloning.* @todo Sell stocks to buy a better ones (when, how much better? by which metric?).* @todo Should we have a feature that allows orders to be placed manually? If so, use a global array to put tasks in, then process the array at the start of the loop until it's empty, and make an interface that can be used to manually buy and sell stocks if the user wishes. This is so that we can track and recalculate average price of owned shares (otherwise, if player transacts using game's interface, we can't track it without unless we use getStockPosition). Also, probably need to put order info in each stock object. Probably need a mapping of stock symbol to stock array's index for efficient lookup.* @todo Use absolute CMA of price growth when filtering stocks, instead of SMA? Maybe even use actual volatility if available (this will incur extra RAM though)?* @todo If using SMA, determine if number of ticks used in SMA should be greater if volatility is higher. i.e., use Kaufman's Adaptive Moving Average?*/import { object_get_updated, any_while } from "nicoty.lib.no.netscript.js";/*** @description A stock object.* @typedef {Object} Stock* @property {string} string_symbol - The stock's symbol.* @property {number} integer_shares_long - The number owned shares of this stock in the long position.* @property {number} integer_shares_short - The number owned shares of this stock in the short position.* @property {number} float_average_cash_spent_per_share_long - The average cash spent per share owned in the long position.* @property {number} float_average_cash_spent_per_share_short - The average cash spent per share owned in the short position.* @property {number} float_price_average_biggest - The biggest observed average price of this stock.* @property {number[]} array_prices_average - An array of this stock's recent average prices.*//*** @description A stocks object.* @typedef {Object.<string, Stock>} Stocks*//*** @description A stock market object.* @typedef {Object} StockMarket* @property {Stocks} object_stocks - A stocks object.* @property {string[]} array_stocks_invested_long - Contains symbols of stocks in which shares in the long position are owned.* @property {string[]} array_stocks_invested_short - Contains symbols of stocks in which shares in the short position are owned.* @property {number} float_cash_invested - The amount of cash currently invested in the market.*//*** @description Constants.* @readonly* @property {number} float_commission - The cost of a transaction.* @property {number} float_period_update_stock - The delay between each market update in milliseconds. @see {@link msPerStockUpdate in src/StockMartket/StockMarket.tsx}* @property {Object} object_document - Shortcut to `Document`.* @property {Object} object_storage - Shortcut to the local storage.* @property {string} string_server_home - The name of the player's home server.* @property {string} string_prefix - Prefix used for local storage keys to namespace them.* @property {string} string_prefix_stock - Prefix used for local storage keys of stock objects.* @property {string} string_property_cash_invested - The local storage key used for the cash invested value.* @property {string} string_property_investment_capital - The local storage key used for the investment capital value.* @property {string} string_property_prices_average_length - The local storage key used for the average price length value.* @property {string} string_property_trade - The local storage key used for the trade boolean value.* @property {string} string_property_liquidate_profitable - The local storage key used for the liquidate when profitable boolean value.* @property {string} string_property_liquidate_asap - The local storage key used for the liquidate as soon as possible boolean value.*/const object_constants = {float_commission: 100e3,get float_commission_double() {return this.float_commission * 2;},float_period_update_stock: 6e3,object_document: parent["document"],object_storage: parent["window"].localStorage,string_server_home: "home",string_prefix: "nicoty_stocks_",get string_prefix_stock() {return this.string_prefix + "object_stock_";},get string_property_cash_invested() {return this.string_prefix + "float_cash_invested";},get string_property_investment_capital() {return this.string_prefix + "float_investment_capital";},get string_property_prices_average_length() {return this.string_prefix + "integer_prices_average_length";},get string_property_trade() {return this.string_prefix + "boolean_trade";},get string_property_sell_profitable() {return this.string_prefix + "boolean_sell_profitable";},get string_property_sell_asap() {return this.string_prefix + "boolean_sell_asap";},};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Returns a new stock object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares_long - The number owned shares of this stock in the long position.* @param {number} object_arguments.integer_shares_short - The number owned shares of this stock in the short position.* @param {number} object_arguments.float_average_cash_spent_per_share_long - The average cash spent per share owned in the long position.* @param {number} object_arguments.float_average_cash_spent_per_share_short - The average cash spent per share owned in the short position.* @param {number} object_arguments.float_price_average_biggest - The biggest observed average price of this stock.* @param {number[]} object_arguments.array_prices_average - An array of this stock's recent average prices.* @returns {Stock} Stock object.*/const object_get_stock = ({string_symbol,integer_shares_long,integer_shares_short,float_average_cash_spent_per_share_long,float_average_cash_spent_per_share_short,float_price_average_biggest,array_prices_average,}) => ({string_symbol: string_symbol,integer_shares_long: integer_shares_long,integer_shares_short: integer_shares_short,float_average_cash_spent_per_share_long: float_average_cash_spent_per_share_long,float_average_cash_spent_per_share_short: float_average_cash_spent_per_share_short,float_price_average_biggest: float_price_average_biggest,array_prices_average: array_prices_average,});/*** @description Returns the number of shares of this stock in existence.* @param {string} string_symbol - The stock's symbol.* @returns {number} The number of shares of this stock in existence.*/const integer_shares_max = (string_symbol) =>object_netscript.getStockMaxShares(string_symbol);/*** @description Returns this stock's current ask price.* @param {string} string_symbol - The stock's symbol.* @returns {number} This stock's current ask price.*/const float_get_price_ask = (string_symbol) =>object_netscript.getStockAskPrice(string_symbol);/*** @description Returns this stock's current bid price.* @param {string} string_symbol - The stock's symbol.* @returns {number} This stock's current bid price.*/const float_get_price_bid = (string_symbol) =>object_netscript.getStockBidPrice(string_symbol);/*** @description Returns this stock's current average price.* @param {string} string_symbol - The stock's symbol.* @returns {number} This stock's current average price.*/const float_get_price_average = (string_symbol) =>(float_get_price_ask(string_symbol) + float_get_price_bid(string_symbol)) /2;/*** @description Returns the current forecast for this stock.* @param {string} string_symbol - The stock's symbol.* @returns {number} This stock's forecast.*/const float_get_forecast = (string_symbol) =>object_netscript.getStockForecast(string_symbol);/*** @description Buys shares in the long position and returns the amount bought if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to buy.* @returns {number} The amount of shares bought if transaction was successful, otherwise `0`.*/const integer_buy_long = ({ string_symbol, integer_shares }) =>object_netscript.buyStock(string_symbol, integer_shares);/*** @description Buys shares in the short position and returns the amount bought if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to buy.* @returns {number} The amount of shares bought if transaction was successful, otherwise `0`.*/const integer_buy_short = ({ string_symbol, integer_shares }) =>object_netscript.shortStock(string_symbol, integer_shares);/*** @description Sells shares in the long position and returns the amount sold if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @returns {number} The amount of shares sold if transaction was successful, otherwise `0`.*/const integer_sell_long = ({ string_symbol, integer_shares }) =>object_netscript.sellStock(string_symbol, integer_shares);/*** @description Sells shares in the short position and returns the amount sold if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @returns {number} The amount of shares sold if transaction was successful, otherwise `0`.*/const integer_sell_short = ({ string_symbol, integer_shares }) =>object_netscript.sellShort(string_symbol, integer_shares);/*** @description Returns the server's current cash.* @param {string} string_server - The server to get the cash of.* @returns {number} The server's current cash.*/const float_get_cash_server = (string_server) =>object_netscript.getServerMoneyAvailable(string_server);/*** @description Returns the player's current cash.* @returns {number} The player's current cash.*/const float_get_cash_player = () =>float_get_cash_server(object_constants.string_server_home);/*** @description Buys shares and returns the amount bought if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to buy.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @returns {number} The amount of shares bought if transaction was successful, otherwise `0`.*/const integer_buy = ({ string_symbol, integer_shares, boolean_long }) =>boolean_long? integer_buy_long({ string_symbol, integer_shares }): integer_buy_short({ string_symbol, integer_shares });/*** @description Sells shares and returns the amount sold if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @returns {number} The amount of shares sold if transaction was successful, otherwise `0`.*/const integer_sell = ({ string_symbol, integer_shares, boolean_long }) =>boolean_long? integer_sell_long({ string_symbol, integer_shares }): integer_sell_short({ string_symbol, integer_shares });/*** @description Sells shares and returns the amount sold if the transaction was sucessful, otherwise returns `0`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @returns {number} The amount of shares sold if transaction was successful, otherwise `0`.*/const integer_get_shares_owned = ({ object_stock, boolean_long }) =>boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short;/*** @description Returns an array of symbols of stocks in the game.* @returns {string[]} Contains the stocks' symbols.*/const array_get_stocks_symbols = () => object_netscript.getStockSymbols();/*** @description Returns an updated array of a stock's recent average prices.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {number} object_arguments.integer_prices_average_length - The maximum length of the stock's average price array.* @returns {number[]} Updated array of a stock's recent average prices.*/const array_get_prices_average_updated = ({object_stock,integer_prices_average_length,}) => {const array_prices_average = object_stock.array_prices_average.concat(float_get_price_average(object_stock.string_symbol)),integer_prices_average_length_current = array_prices_average.length;return integer_prices_average_length_current > integer_prices_average_length? array_prices_average.slice(integer_prices_average_length_current - integer_prices_average_length): array_prices_average;};/*** @description Takes a stock object and returns a new one based on the original, but with an updated average price array and biggest average price value. This is ran after a stock market tick.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The original stock object.* @param {number} object_arguments.integer_prices_average_length - The maximum length of the stock's average price array.* @returns {Stock} The new stock object with an updated average price array and biggest average price value.*/const object_get_stock_tick_updated = ({object_stock,integer_prices_average_length,}) => {const float_price_average = float_get_price_average(object_stock.string_symbol);return object_get_updated({object_original: object_stock,object_properties_new:float_price_average > object_stock.float_price_average_biggest? {array_prices_average: array_get_prices_average_updated({object_stock: object_stock,integer_prices_average_length: integer_prices_average_length,}),float_price_average_biggest: float_price_average,}: {array_prices_average: array_get_prices_average_updated({object_stock: object_stock,integer_prices_average_length: integer_prices_average_length,}),},});};/*** @description Returns `true` if the 4S Market Data API is accessible, otherwise returns `false`.* @param {string} [string_symbol] - A valid stock symbol.* @returns {boolean} `true` if the 4S Market Data API is accessible, otherwise `false`.*/const boolean_have_4S = (string_symbol = array_get_stocks_symbols()[0]) => {try {float_get_forecast(string_symbol);return true;} catch (object_exception) {return false;}};/*** @description Returns `true` if shorting stocks is possible, otherwise returns `false`.* @param {string} [string_symbol] - A valid stock symbol.* @returns {boolean} `true` if shorting stocks is possible, otherwise `false`.*/const boolean_can_short = (string_symbol = array_get_stocks_symbols()[0]) => {try {integer_sell_short(string_symbol, 0);return true;} catch (object_exception) {return false;}};/*** @description Returns the profit to be made if shares are sold.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. `true` = long, `false` = short.* @returns {number} The profit to be made if shares are sold.*/const float_get_profit = ({ object_stock, integer_shares, boolean_long }) =>integer_shares *(boolean_long? float_get_price_bid(object_stock.string_symbol) -object_stock.float_average_cash_spent_per_share_long: float_get_price_ask(object_stock.string_symbol) -object_stock.float_average_cash_spent_per_share_short) -object_constants.float_commission;/*** @description Returns the current number of available shares of this stock.* @param {Stock} object_stock - The stock object.* @returns {number} The current number of available shares of this stock.*/const integer_get_shares_available = ({string_symbol,integer_shares_long,integer_shares_short,}) =>integer_shares_max(string_symbol) -(integer_shares_long + integer_shares_short);/*** @description Returns the current number of affordable shares of this stock in either the long or short position.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {number} object_arguments.float_cash - The amount of cash that can be spent.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. `true` = long, `false` = short.* @returns {number} The number of affordable shares of this stock in either the long or short position.*/const integer_get_shares_buyable = ({object_stock,float_cash,boolean_long,}) => {const integer_can_buy = Math.floor((float_cash - object_constants.float_commission_double) /(boolean_long? float_get_price_ask(object_stock.string_symbol): float_get_price_bid(object_stock.string_symbol))),integer_available_shares = integer_get_shares_available(object_stock);return integer_can_buy > integer_available_shares? integer_available_shares: integer_can_buy;};/*** @description Takes a stock object and returns a new one based on the original, but with an updated average cash per share value. This is ran after buying shares.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock The original stock object.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares to add.* @returns {Stock} The new stock object with an updated average cash per share value.*/const object_get_stock_updated_average_cash_spent_per_share = ({object_stock,boolean_long,integer_shares,}) => {const integer_shares_current = boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short,integer_shares_total = integer_shares_current + integer_shares;return object_get_updated({object_original: object_stock,object_properties_new: boolean_long? {float_average_cash_spent_per_share_long:(integer_shares_current *object_stock.float_average_cash_spent_per_share_long) /integer_shares_total +(integer_shares *(float_get_price_ask(object_stock.string_symbol) +object_constants.float_commission / integer_shares)) /integer_shares_total,}: {float_average_cash_spent_per_share_short:(integer_shares_current *object_stock.float_average_cash_spent_per_share_short) /integer_shares_total +(integer_shares *(float_get_price_bid(object_stock.string_symbol) +object_constants.float_commission / integer_shares)) /integer_shares_total,},});};/*** @description Takes a stock object and returns a new one based on the original, but with values updated after buying some shares.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock The original stock object.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares to add.* @returns {Stock} The new stock object with values updated after buying some shares.*/const object_get_stock_updated_after_buying = ({object_stock,boolean_long,integer_shares,}) => {const integer_shares_owned = boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short,integer_shares_available = integer_get_shares_available(object_stock),integer_shares_total = integer_shares_owned + integer_shares;return object_get_updated({object_original: object_get_stock_updated_average_cash_spent_per_share({object_stock: object_stock,boolean_long: boolean_long,integer_shares:integer_shares_total > integer_shares_available? integer_shares_available: integer_shares,}),object_properties_new: boolean_long? {integer_shares_long:integer_shares_total > integer_shares_available? integer_shares_owned + integer_shares_available: integer_shares_owned + integer_shares,}: {integer_shares_short:integer_shares_total > integer_shares_available? integer_shares_owned + integer_shares_available: integer_shares_owned + integer_shares,},});};/*** @description Takes a stock object and returns a new one based on the original, but with values updated after selling some shares.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock The original stock object.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @returns {Stock} The new stock object with values updated after selling some shares.*/const object_get_stock_updated_after_selling = ({object_stock,boolean_long,integer_shares,}) => {const integer_shares_total =(boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short) - integer_shares;return object_get_updated({object_original: object_stock,object_properties_new: boolean_long? {integer_shares_long: Math.max(0, integer_shares_total),float_average_cash_spent_per_share_long:integer_shares_total <= 0? 0: object_stock.float_average_cash_spent_per_share_long,}: {integer_shares_short: Math.max(0, integer_shares_total),float_average_cash_spent_per_share_short:integer_shares_total <= 0? 0: object_stock.float_average_cash_spent_per_share_short,},});};/*** @description Returns an object containing stock objects for all existing stock symbols.* @returns {Stocks} Contains stock objects for all existing stock symbols.*/const object_get_stocks = () =>Object.fromEntries(array_get_stocks_symbols().map((string_symbol) => {const float_price_average = float_get_price_average(string_symbol);return [string_symbol,object_get_stock({string_symbol: string_symbol,integer_shares_long: 0,integer_shares_short: 0,float_average_cash_spent_per_share_long: 0,float_average_cash_spent_per_share_short: 0,float_price_average_biggest: float_price_average,array_prices_average: [float_price_average],}),];}));/*** @description Takes a stocks object and returns a new one based on the original, but updated after selling shares in a stock.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stocks} object_arguments.object_stocks The original stocks object.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted were in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares removed.* @returns {Stocks} The new array of stock objects with the updated stock object.*/const object_get_stocks_updated_after_selling = ({object_stocks,string_symbol,boolean_long,integer_shares,}) =>object_get_updated({object_original: object_stocks,object_properties_new: {[string_symbol]: object_get_stock_updated_after_selling({object_stock: object_stocks[string_symbol],boolean_long: boolean_long,integer_shares: integer_shares,}),},});/*** @description Takes a stocks object and returns a new one based on the original, but with values updated after one market tick.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stocks} object_arguments.object_stocks The original stocks objects.* @param {number} object_arguments.integer_prices_average_length - The maximum length of the stock objects' average price arrays.* @returns {Stocks} The new stocks object with values updated after one market tick.*/const object_get_stocks_updated_after_tick = ({object_stocks,integer_prices_average_length,}) =>Object.fromEntries(Object.entries(object_stocks).map(([string_symbol, object_stock]) => [string_symbol,object_get_stock_tick_updated({object_stock: object_stock,integer_prices_average_length: integer_prices_average_length,}),]));/*** @description Returns the remaining amount of cash that can be used for investment.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_cash_invested - The amount of cash currently invested in the market.* @param {number} object_arguments.float_investment_capital - The fraction of cash that can be used for investment.* @returns {number} The remaining amount of cash that can be used for investment.*/const float_get_capital_left = ({float_cash_invested,float_investment_capital,}) => {return ((float_get_cash_player() + float_cash_invested) *float_investment_capital -float_cash_invested);};/*** @description Returns the growth rate between two numbers.* @param {Object} object_numbers - The array of numbers to calculate growth rate of.* @param {number} object_numbers.float_old - The old number.* @param {number} object_numbers.float_new - The new number.* @returns {number} The growth rate.*/const float_get_growth = ({ float_old, float_new }) =>float_old < Number.MIN_VALUE? (float_new - Number.MIN_VALUE) / Number.MIN_VALUE: (float_new - float_old) / float_old;/*** @description Returns the average growth rate of an array of numbers.* @param {number[]} array_numbers - The array of numbers to calculate the average growth rate of.* @returns {number} The average growth rate.*/const float_get_growth_average = (array_numbers) =>array_numbers.length > 1? array_numbers.reduce((float_accumulator, float_current, integer_index) =>integer_index > 0? float_get_growth({float_old: array_numbers[integer_index - 1],float_new: float_current,}) + float_accumulator: 0,0) /(array_numbers.length - 1): 0;/*** @description Returns the absolute average growth rate of an array of numbers.* @param {number[]} array_numbers - The array of numbers to calculate the absolute average growth rate of.* @returns {number} The absolute average growth rate.*/const float_get_growth_average_absolute = (array_numbers) =>array_numbers.length > 1? array_numbers.reduce((float_accumulator, float_current, integer_index) =>integer_index > 0? Math.abs(float_get_growth({float_old: array_numbers[integer_index - 1],float_new: float_current,})) + float_accumulator: 0,0) /(array_numbers.length - 1): 0;/*** @description Returns the average of the latest growth rates of an array of numbers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number[]} object_arguments.array_numbers - Array of numbers to average the growth rates of.* @param {number} object_arguments.integer_latest_length - Number of last growth rates to average.* @returns Average growth rate.*/const float_get_growth_average_range_latest = ({array_numbers,integer_latest_length,}) => {const integer_numbers_length = array_numbers.length;return integer_numbers_length > integer_latest_length? float_get_growth_average(array_numbers.slice(integer_numbers_length - integer_latest_length)): float_get_growth_average(array_numbers);};/*** @description Returns the average of the lagging growth rates of an array of numbers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number[]} object_arguments.array_numbers - Array of numbers to average the growth rates of.* @param {number} object_arguments.integer_lagging_length - Number of last growth rates to average.* @returns Average growth rate.*/const float_get_growth_average_range_lagging = ({array_numbers,integer_lagging_length,}) => {const integer_numbers_length = array_numbers.length,integer_difference = integer_numbers_length - integer_lagging_length;return integer_numbers_length > integer_lagging_length? float_get_growth_average(array_numbers.slice(integer_difference - integer_lagging_length,integer_difference)): float_get_growth_average(array_numbers);};/*** @description Returns true if shares of a stock should be bought, otherwise false.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {number} object_arguments.integer_shares - The amount of shares to buy.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. True = long, false = short.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter ranger average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @returns {boolean} True if shares should be bought, otherwise false.*/const boolean_should_buy = ({object_stock,integer_shares,boolean_long,integer_smoothing,}) => {if (boolean_have_4S(object_stock.string_symbol)) {return boolean_long? float_get_forecast(object_stock.string_symbol) > 0.5 &&// Ensure that growth is sufficient to break even from commissions.object_constants.float_commission_double /(integer_shares *float_get_price_ask(object_stock.string_symbol) +object_constants.float_commission_double) <float_get_growth_average_absolute(object_stock.array_prices_average) &&// Assume that the biggest recorded price is the biggest the price can reach, so need to ensure that even if it's reached, we can still break even.(object_stock.float_price_average_biggest -float_get_price_average(object_stock.string_symbol)) *integer_shares >object_constants.float_commission_double: float_get_forecast(object_stock.string_symbol) < 0.5 &&// Ensure that growth is sufficient to break even from commissions.object_constants.float_commission_double /(integer_shares *float_get_price_bid(object_stock.string_symbol) +object_constants.float_commission_double) <float_get_growth_average_absolute(object_stock.array_prices_average) &&// Assume that 0 is the lowest the price can reach, so need to ensure that even if it's reached, we can still break even.float_get_price_average(object_stock.string_symbol) *integer_shares >object_constants.float_commission_double;} else {const float_growth_average_range_latest = float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: integer_smoothing,});return boolean_long? // Buy only if latest SMA of growth is greater than lagging as this indicates an upwards momentum.float_growth_average_range_latest >float_get_growth_average_range_lagging({array_numbers: object_stock.array_prices_average,integer_lagging_length: integer_smoothing,}) &&// Buy only if stock has actually been increasing in price and not just decreasing in price at a slower rate than it was before.float_growth_average_range_latest > 0 &&// Just to be extra safe, ensure that the stock's latest growth was also positive.float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: 2,}) > 0 &&// Ensure that growth is sufficient to break even from commissions.object_constants.float_commission_double /(integer_shares *float_get_price_ask(object_stock.string_symbol) +object_constants.float_commission_double) <float_get_growth_average_absolute(object_stock.array_prices_average) &&// Assume that the biggest recorded price is the biggest the price can reach, so need to ensure that even if it's reached, we can still break even.(object_stock.float_price_average_biggest -float_get_price_average(object_stock.string_symbol)) *integer_shares >object_constants.float_commission_double: // Buy only if latest SMA of growth is less than lagging as this indicates a downwards momentum.float_growth_average_range_latest <float_get_growth_average_range_lagging({array_numbers: object_stock.array_prices_average,integer_lagging_length: integer_smoothing,}) &&// Buy only if stock has actually been decreasing in price and not just increasing in price at a slower rate than it was before.float_growth_average_range_latest < 0 &&// Just to be extra safe, ensure that the stock's latest growth was also negative.float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: 2,}) < 0 &&// Ensure that growth is sufficient to break even from commissions.object_constants.float_commission_double /(integer_shares *float_get_price_bid(object_stock.string_symbol) +object_constants.float_commission_double) <float_get_growth_average_absolute(object_stock.array_prices_average) &&// Assume that 0 is the lowest the price can reach, so need to ensure that even if it's reached, we can still break even.float_get_price_average(object_stock.string_symbol) *integer_shares >object_constants.float_commission_double;}};/*** @description Returns a new stock market object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stocks} object_arguments.object_stocks - A stocks object.* @param {string[]} object_arguments.array_stocks_invested_long - Contains symbols of stocks in which shares in the long position are owned.* @param {string[]} object_arguments.array_stocks_invested_short - Contains symbols of stocks in which shares in the short position are owned.* @param {number} object_arguments.float_cash_invested - The amount of cash currently invested in the market.* @returns {StockMarket} The new stock market object.*/const object_get_stock_market = ({object_stocks,array_stocks_invested_long,array_stocks_invested_short,float_cash_invested,}) => ({object_stocks: object_stocks,array_stocks_invested_long: array_stocks_invested_long,array_stocks_invested_short: array_stocks_invested_short,float_cash_invested: float_cash_invested,});/*** @description Takes a stocks object and returns the stock object that's best for buying shares, or `null` if none of the objects are ideal.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market The original stock market object.* @param {boolean} object_arguments.boolean_long - Whether the forecast values are being calculated for shares in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter range average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @param {number} object_arguments.float_investment_capital - The fraction of total cash that can be used for investment.* @returns {Stock|null} The stock object that's best for buying shares, or `null` if none of the objects are ideal.* @todo It's inefficient that we check for 4S Market Data TIX API access and whether or not we're transacting longs or shorts every iteration. Maybe we shouldn't in-line those checks?*/const object_or_null_get_stock_buy = ({object_stock_market,boolean_long,integer_smoothing,float_investment_capital,}) => {const array_stocks_filtered = Object.entries(object_stock_market.object_stocks).map(([string_symbol, object_stock]) => object_stock).filter((object_stock) =>boolean_should_buy({object_stock: object_stock,integer_shares: integer_get_shares_buyable({object_stock: object_stock,float_cash: float_get_capital_left({float_cash_invested: object_stock_market.float_cash_invested,float_investment_capital: float_investment_capital,}),boolean_long: boolean_long,}),boolean_long: boolean_long,integer_smoothing: integer_smoothing,}));return array_stocks_filtered.length === 0? null: array_stocks_filtered.reduce((object_stock_and_score_best, object_stock) => {const object_stock_and_score = {float_score: boolean_have_4S(array_stocks_filtered[0].string_symbol)? float_get_forecast(object_stock.string_symbol): float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: integer_smoothing,}),object_stock: object_stock,};return (boolean_long? object_stock_and_score.float_score >object_stock_and_score_best.float_score: object_stock_and_score.float_score <object_stock_and_score_best.float_score)? object_stock_and_score: object_stock_and_score_best;},{float_score: (boolean_long ? -1 : 1) / 0,object_stock: null,}).object_stock;};/*** @description Takes a stocks object and returns a new one based on the original, but updated after buying shares in a stock.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stocks} object_arguments.object_stocks The original array of stock objects.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted were in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares added.* @returns {Stocks} The new stocks object with the updated stock object.*/const object_get_stocks_updated_after_buying = ({object_stocks,string_symbol,boolean_long,integer_shares,}) =>object_get_updated({object_original: object_stocks,object_properties_new: {[string_symbol]: object_get_stock_updated_after_buying({object_stock: object_stocks[string_symbol],boolean_long: boolean_long,integer_shares: integer_shares,}),},});/*** @description Takes a stock market object and returns a new one based on the original, but with values updated after one market tick.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {number} object_arguments.integer_prices_average_length - The maximum length of the stock objects' average price arrays.* @returns {StockMarket} Stocks object.*/const object_get_stock_market_updated_after_tick = ({object_stock_market,integer_prices_average_length,}) =>object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_tick({object_stocks: object_stock_market.object_stocks,integer_prices_average_length: integer_prices_average_length,}),},});/*** @description Takes a stock market object and returns a new one based on the original, but with values updated after buying some shares of a stock.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted were in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares added.* @returns {StockMarket} The updated stock market object.*/const object_get_stock_market_updated_after_buying = ({object_stock_market,string_symbol,boolean_long,integer_shares,}) =>boolean_long? object_stock_market.array_stocks_invested_long.includes(string_symbol)? object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_buying({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested +object_constants.float_commission +integer_shares * float_get_price_ask(string_symbol),},}): object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_buying({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),array_stocks_invested_long: object_stock_market.array_stocks_invested_long.concat(string_symbol),float_cash_invested:object_stock_market.float_cash_invested +object_constants.float_commission +integer_shares * float_get_price_ask(string_symbol),},}): object_stock_market.array_stocks_invested_short.includes(string_symbol)? object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_buying({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested +object_constants.float_commission +integer_shares * float_get_price_bid(string_symbol),},}): object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_buying({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),array_stocks_invested_short: object_stock_market.array_stocks_invested_short.concat(string_symbol),float_cash_invested:object_stock_market.float_cash_invested +object_constants.float_commission +integer_shares * float_get_price_bid(string_symbol),},});/*** @description Takes a stock market object and returns a new one based on the original, but with values updated after selling some shares of a stock.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {string} object_arguments.string_symbol - The stock's symbol.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted were in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_shares - The amount of shares removed.* @returns {StockMarket} Stocks object.*/const object_get_stock_market_updated_after_selling = ({object_stock_market,string_symbol,boolean_long,integer_shares,}) =>boolean_long? integer_shares >=object_stock_market.object_stocks[string_symbol].integer_shares_long? object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_selling({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested -float_get_profit({object_stock:object_stock_market.object_stocks[string_symbol],integer_shares: integer_shares,boolean_long: boolean_long,}),array_stocks_invested_long: object_stock_market.array_stocks_invested_long.filter((string_symbol_invested) =>string_symbol != string_symbol_invested),},}): object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_selling({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested -float_get_profit({object_stock:object_stock_market.object_stocks[string_symbol],integer_shares: integer_shares,boolean_long: boolean_long,}),},}): integer_shares >=object_stock_market.object_stocks[string_symbol].integer_shares_short? object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_selling({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested -float_get_profit({object_stock: object_stock_market.object_stocks[string_symbol],integer_shares: integer_shares,boolean_long: boolean_long,}),array_stocks_invested_short: object_stock_market.array_stocks_invested_short.filter((string_symbol_invested) =>string_symbol != string_symbol_invested),},}): object_get_updated({object_original: object_stock_market,object_properties_new: {object_stocks: object_get_stocks_updated_after_selling({object_stocks: object_stock_market.object_stocks,string_symbol: string_symbol,boolean_long: boolean_long,integer_shares: integer_shares,}),float_cash_invested:object_stock_market.float_cash_invested -float_get_profit({object_stock: object_stock_market.object_stocks[string_symbol],integer_shares: integer_shares,boolean_long: boolean_long,}),},});/*** @description Returns true if shares should be sold, otherwise false.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Stock} object_arguments.object_stock - The stock object.* @param {number} object_arguments.integer_shares - The amount of shares to sell.* @param {boolean} object_arguments.boolean_long - Whether the value is being calculated for shares in the long or short position. True = long, false = short.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter ranger average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @returns {boolean} True if shares should be sold, otherwise false.*/const boolean_should_sell = ({object_stock,integer_shares,boolean_long,integer_smoothing,}) =>boolean_have_4S(object_stock.string_symbol)? float_get_profit({object_stock: object_stock,integer_shares: integer_shares,boolean_long: boolean_long,}) > 0 &&(boolean_long? float_get_forecast(object_stock.string_symbol) < 0.5: float_get_forecast(object_stock.string_symbol) > 0.5): float_get_profit({object_stock: object_stock,integer_shares: integer_shares,boolean_long: boolean_long,}) > 0 &&(boolean_long? float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: integer_smoothing,}) <float_get_growth_average_range_lagging({array_numbers: object_stock.array_prices_average,integer_lagging_length: integer_smoothing,}) &&float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: 2,}) < 0: float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: integer_smoothing,}) >float_get_growth_average_range_lagging({array_numbers: object_stock.array_prices_average,integer_lagging_length: integer_smoothing,}) &&float_get_growth_average_range_latest({array_numbers: object_stock.array_prices_average,integer_latest_length: 2,}) > 0);/*** @description Takes a stocks object and returns a stock object that should be sold, or `null` if none of the objects should be sold.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market The stock market object.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter range average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @returns {Stock|undefined} The stock object that's best for buying shares, or `null` if none of the objects are ideal.*/const object_get_stock_sell = ({object_stock_market,boolean_long,integer_smoothing,}) =>array_get_stocks_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,}).find((object_stock) =>boolean_should_sell({object_stock: object_stock,integer_shares: boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short,boolean_long: boolean_long,integer_smoothing: integer_smoothing,}));/*** @description Returns an array of stock symbols in which shares are owned.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {boolean} object_arguments.boolean_long - Whether the stocks to get are in the the long or short position. `true` = long, `false` = short.* @returns {string[]} Contains the stock symbols in which shares are owned.*/const array_get_stock_symbols_invested = ({object_stock_market,boolean_long,}) =>boolean_long? object_stock_market.array_stocks_invested_long: object_stock_market.array_stocks_invested_short;/*** @description Serialises some data and saves it into local storage using the specified key.* @param {Object} object_arguments - Contains the arguments for the function.* @param {any} object_arguments.any_data - The data to save.* @param {string} object_arguments.string_key - The key to use.*/const void_save = ({ any_data, string_key }) =>object_constants.object_storage.setItem(string_key,JSON.stringify(any_data));/*** @description Loads some data from local storage using the specified key then deserialises and returns it.* @param {string} string_key - The key to use.* @return {any} The loaded, deserialised data.* @todo Handle failure cases.*/const any_load = (string_key) =>JSON.parse(object_constants.object_storage.getItem(string_key));/*** @description Returns an array of stock objects in which shares are owned.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {boolean} object_arguments.boolean_long - Whether the stocks to get are in the the long or short position. `true` = long, `false` = short.* @returns {Stock[]} Contains the stock objects in which shares are owned.*/const array_get_stocks_invested = ({ object_stock_market, boolean_long }) =>array_get_stock_symbols_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,}).map((string_symbol) => object_stock_market.object_stocks[string_symbol]);/*** @description Sells invested shares if the conditions of the provided function is met and returns an updated stock market object. This function is effectful and impure.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stocks object.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @param {function} object_arguments.object_get_stock - The function to used to get the stock object to sell shares of.* @param {function} object_arguments.integer_get_shares - The function to determine how many shares of the stock to sell.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter range average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @returns {StockMarket} The updated stock market object.* @todo Should saving to local storage happen here?* @todo Handle cases when transaction fails.*/const object_get_stock_market_updated_after_selling_conditional = ({object_stock_market,boolean_long,object_get_stock,integer_get_shares,integer_smoothing,}) => {const object_stock_to_sell_initial = object_get_stock({object_stock_market: object_stock_market,boolean_long: boolean_long,integer_smoothing: integer_smoothing,});if (null === object_stock_to_sell_initial ||void 0 === object_stock_to_sell_initial)return object_stock_market;const integer_shares_to_sell = integer_get_shares({object_stock_market: object_stock_market,boolean_long: boolean_long,object_stock: object_stock_to_sell_initial,});if (null === integer_shares_to_sell || void 0 === integer_shares_to_sell)return object_stock_market;return any_while({any_state: {object_stock_market: object_stock_market,boolean_long: boolean_long,object_get_stock: object_get_stock,object_stock: object_stock_to_sell_initial,integer_get_shares: integer_get_shares,integer_shares: integer_shares_to_sell,integer_smoothing: integer_smoothing,},boolean_condition: (object_state) =>(void 0 != object_state.object_stock ||null != object_state.object_stock) &&0 < object_state.integer_shares &&object_constants.float_commission <= float_get_cash_player(),any_function: (object_state) => {const object_stock = object_state.object_stock;if (0 <integer_sell({string_symbol: object_stock.string_symbol,integer_shares: object_state.integer_shares,boolean_long: object_state.boolean_long,})) {/*** @description Transaction was successful, return updated state object.* @type {StockMarket}*/const object_stock_market = object_get_stock_market_updated_after_selling({object_stock_market: object_state.object_stock_market,string_symbol: object_stock.string_symbol,boolean_long: object_state.boolean_long,integer_shares: object_state.integer_shares,});void_save({any_data:object_stock_market.object_stocks[object_stock.string_symbol],string_key:object_constants.string_prefix_stock + object_stock.string_symbol,});void_save({any_data: object_stock_market.float_cash_invested,string_key: object_constants.string_property_cash_invested,});const object_stock_to_sell = object_state.object_get_stock({object_stock_market: object_stock_market,boolean_long: object_state.boolean_long,integer_smoothing: object_state.integer_smoothing,});return null === object_stock_to_sell ||void 0 === object_stock_to_sell? object_get_updated({object_original: object_state,object_properties_new: {object_stock_market: object_stock_market,object_stock: object_stock_to_sell,integer_shares: null,},}): object_get_updated({object_original: object_state,object_properties_new: {object_stock_market: object_stock_market,object_stock: object_stock_to_sell,integer_shares: object_state.integer_get_shares({object_stock_market: object_stock_market,boolean_long: object_state.boolean_long,object_stock: object_stock_to_sell,}),},});}},}).object_stock_market;};/*** @description Buys shares of a stock that returns `true` when passed to the provided function and returns an updated stock market object. This function is effectful and impure.* @param {Object} object_arguments - Contains the arguments for the function.* @param {StockMarket} object_arguments.object_stock_market - The original stock market object.* @param {number} object_arguments.float_investment_capital - The fraction of total assets to potentially be used for investing in the market.* @param {boolean} object_arguments.boolean_long - Whether the shares transacted are in the long or short position. `true` = long, `false` = short.* @param {function} object_arguments.object_get_stock - The function to used to get the stock object to buy shares of.* @param {function} object_arguments.integer_get_shares - The function to determine how many shares of the stock to buy.* @param {number} object_arguments.integer_smoothing - The amount of values to average for the shorter range average growth rate, which is compared with the longer range average growth rate when 4S Market Data API is inaccessible.* @returns {StockMarket} The updated stock market object.* @todo Should saving to local storage happen here?* @todo Handle cases when transaction fails.*/const object_get_stock_market_updated_after_buying_conditional = ({object_stock_market,float_investment_capital,boolean_long,object_get_stock,integer_get_shares,integer_smoothing,}) => {const object_stock_to_buy_initial = object_get_stock({object_stock_market: object_stock_market,boolean_long: boolean_long,float_investment_capital: float_investment_capital,integer_smoothing: integer_smoothing,});if (null === object_stock_to_buy_initial ||void 0 === object_stock_to_buy_initial)return object_stock_market;const integer_shares_to_buy = integer_get_shares({object_stock_market: object_stock_market,boolean_long: boolean_long,float_investment_capital: float_investment_capital,object_stock: object_stock_to_buy_initial,});if (null === integer_shares_to_buy || void 0 === integer_shares_to_buy)return object_stock_market;return any_while({any_state: {object_stock_market: object_stock_market,boolean_long: boolean_long,float_investment_capital: float_investment_capital,object_get_stock: object_get_stock,object_stock: object_stock_to_buy_initial,integer_get_shares: integer_get_shares,integer_shares: integer_shares_to_buy,integer_smoothing: integer_smoothing,},boolean_condition: (object_state) =>(void 0 != object_state.object_stock ||null != object_state.object_stock) &&0 < object_state.integer_shares &&object_constants.float_commission_double <=float_get_capital_left({float_cash_invested:object_state.object_stock_market.float_cash_invested,float_investment_capital: object_state.float_investment_capital,}),any_function: (object_state) => {const object_stock = object_state.object_stock;if (0 <integer_buy({string_symbol: object_stock.string_symbol,integer_shares: object_state.integer_shares,boolean_long: object_state.boolean_long,})) {/*** @description Transaction was successful, return updated state object.* @type {StockMarket}*/const object_stock_market = object_get_stock_market_updated_after_buying({object_stock_market: object_state.object_stock_market,string_symbol: object_stock.string_symbol,boolean_long: object_state.boolean_long,integer_shares: object_state.integer_shares,});void_save({any_data:object_stock_market.object_stocks[object_stock.string_symbol],string_key:object_constants.string_prefix_stock + object_stock.string_symbol,});void_save({any_data: object_stock_market.float_cash_invested,string_key: object_constants.string_property_cash_invested,});const object_stock_to_buy = object_state.object_get_stock({object_stock_market: object_stock_market,boolean_long: object_state.boolean_long,float_investment_capital: object_state.float_investment_capital,integer_smoothing: object_state.integer_smoothing,});return null === object_stock_to_buy || void 0 === object_stock_to_buy? object_get_updated({object_original: object_state,object_properties_new: {object_stock_market: object_stock_market,object_stock: object_stock_to_buy,integer_shares: null,},}): object_get_updated({object_original: object_state,object_properties_new: {object_stock_market: object_stock_market,object_stock: object_stock_to_buy,integer_shares: object_state.integer_get_shares({object_stock_market: object_stock_market,boolean_long: object_state.boolean_long,float_investment_capital:object_state.float_investment_capital,object_stock: object_stock_to_buy,}),},});}},}).object_stock_market;};/*** @description Serialises stock objects and saves them into local storage.* @param {Stocks} object_stocks - The data to save.*/const void_save_stocks = (object_stocks) =>Object.entries(object_stocks).map(([string_symbol, object_stock]) =>void_save({any_data: object_stock,string_key: object_constants.string_prefix_stock + string_symbol,}));/*** @description Main entry point to the script.* @todo This whole function sucks and doesn't follow the principle of separation of concerns. Figure out a way to better write it.*/const void_main = async () => {let integer_time = Date.now(),integer_prices_average_length =object_constants.object_document[object_constants.string_property_prices_average_length],string_cash_invested_buffer = object_constants.object_storage.getItem(object_constants.string_property_cash_invested);/*** @type {StockMarket}* @todo Coercing its type here seems bad?*/let object_stock_market;// Load data from storage if it exists, otherwise create a new one.if (string_cash_invested_buffer === null) {// Need to initialise new data.object_stock_market = object_get_stock_market({object_stocks: object_get_stocks(),array_stocks_invested_long: [],array_stocks_invested_short: [],float_cash_invested: 0,});void_save({any_data:object_constants.object_document[object_constants.string_property_sell_asap],string_key: object_constants.string_property_sell_asap,});void_save({any_data:object_constants.object_document[object_constants.string_property_sell_profitable],string_key: object_constants.string_property_sell_profitable,});void_save({any_data:object_constants.object_document[object_constants.string_property_trade],string_key: object_constants.string_property_trade,});} else {if (await object_netscript.prompt(`Existing stock market information detected. Do you want to keep it?Select "No" if you've just reset after installing augmentations or defeating a BitNode, otherwise select "Yes".`)) {// Need to parse existing data.const array_stock_symbols = array_get_stocks_symbols(),object_stocks = Object.fromEntries(array_stock_symbols.map((string_symbol) => [string_symbol,any_load(object_constants.string_prefix_stock + string_symbol),]));object_stock_market = object_get_stock_market({object_stocks: object_stocks,array_stocks_invested_long: array_stock_symbols.filter((string_symbol) =>object_stocks[string_symbol].integer_shares_long > 0),array_stocks_invested_short: array_stock_symbols.filter((string_symbol) =>object_stocks[string_symbol].integer_shares_short > 0),float_cash_invested: JSON.parse(string_cash_invested_buffer),});object_constants.object_document[object_constants.string_property_sell_asap] = any_load(object_constants.string_property_sell_asap);object_constants.object_document[object_constants.string_property_sell_profitable] = any_load(object_constants.string_property_sell_profitable);object_constants.object_document[object_constants.string_property_trade] = any_load(object_constants.string_property_trade);} else {// Need to initialise new data.object_stock_market = object_get_stock_market({object_stocks: object_get_stocks(),array_stocks_invested_long: [],array_stocks_invested_short: [],float_cash_invested: 0,});void_save({any_data:object_constants.object_document[object_constants.string_property_sell_asap],string_key: object_constants.string_property_sell_asap,});void_save({any_data:object_constants.object_document[object_constants.string_property_sell_profitable],string_key: object_constants.string_property_sell_profitable,});void_save({any_data:object_constants.object_document[object_constants.string_property_trade],string_key: object_constants.string_property_trade,});}}const string_symbol_any = Object.entries(object_stock_market.object_stocks)[0][0];let integer_prices_average_length_double =integer_prices_average_length * 2;for (;;) {// Increase amount of recorded prices if necessary.for (;integer_prices_average_length_double >object_stock_market.object_stocks[string_symbol_any].array_prices_average.length;) {integer_prices_average_length =object_constants.object_document[object_constants.string_property_prices_average_length];integer_prices_average_length_double =integer_prices_average_length * 2;await object_netscript.sleep(Math.max(1,object_constants.float_period_update_stock +integer_time -Date.now()));integer_time = Date.now();object_stock_market = object_get_stock_market_updated_after_tick({object_stock_market: object_stock_market,integer_prices_average_length: integer_prices_average_length_double,});void_save_stocks(object_stock_market.object_stocks);}// Maximum length of arrays reached, can now begin transacting.let float_investment_capital =object_constants.object_document[object_constants.string_property_investment_capital];(integer_prices_average_length =object_constants.object_document[object_constants.string_property_prices_average_length]),(integer_prices_average_length_double =integer_prices_average_length * 2);// Force liquidate - sell all shares if cash is sufficient for commission fees.if (object_constants.object_document[object_constants.string_property_sell_asap]) {object_stock_market = object_get_stock_market_updated_after_selling_conditional({object_stock_market: boolean_have_4S? object_get_stock_market_updated_after_selling_conditional({object_stock_market: object_stock_market,boolean_long: false,object_get_stock: ({ object_stock_market, boolean_long }) => {const array_stocks_invested = array_get_stocks_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,});return 0 >= array_stocks_invested.length? null: array_stocks_invested[0];},integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,}): object_stock_market,boolean_long: true,object_get_stock: ({ object_stock_market, boolean_long }) => {const array_stocks_invested = array_get_stocks_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,});return 0 >= array_stocks_invested.length? null: array_stocks_invested[0];},integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,});}// Liquidate when profitable.if (object_constants.object_document[object_constants.string_property_sell_profitable]) {object_stock_market = object_get_stock_market_updated_after_selling_conditional({object_stock_market: boolean_have_4S? object_get_stock_market_updated_after_selling_conditional({object_stock_market: object_stock_market,boolean_long: false,object_get_stock: ({ object_stock_market, boolean_long }) =>array_get_stocks_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,}).find((object_stock) =>0 <float_get_profit({object_stock: object_stock,integer_shares: boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short,boolean_long: boolean_long,})),integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,}): object_stock_market,boolean_long: true,object_get_stock: ({ object_stock_market, boolean_long }) =>array_get_stocks_invested({object_stock_market: object_stock_market,boolean_long: boolean_long,}).find((object_stock) =>0 <float_get_profit({object_stock: object_stock,integer_shares: boolean_long? object_stock.integer_shares_long: object_stock.integer_shares_short,boolean_long: boolean_long,})),integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,});}// Trade.if (object_constants.object_document[object_constants.string_property_trade]) {object_stock_market = boolean_can_short(string_symbol_any)? object_get_stock_market_updated_after_buying_conditional({object_stock_market: object_get_stock_market_updated_after_selling_conditional({object_stock_market: object_get_stock_market_updated_after_buying_conditional({object_stock_market: object_get_stock_market_updated_after_selling_conditional({object_stock_market: object_stock_market,boolean_long: true,object_get_stock: object_get_stock_sell,integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,}),float_investment_capital: float_investment_capital,boolean_long: false,object_get_stock: object_or_null_get_stock_buy,integer_get_shares: ({object_stock_market,boolean_long,float_investment_capital,object_stock,}) =>integer_get_shares_buyable({object_stock: object_stock,float_cash: float_get_capital_left({float_cash_invested:object_stock_market.float_cash_invested,float_investment_capital: float_investment_capital,}),boolean_long: boolean_long,}),integer_smoothing: integer_prices_average_length,}),boolean_long: false,object_get_stock: object_get_stock_sell,integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,}),float_investment_capital: float_investment_capital,boolean_long: true,object_get_stock: object_or_null_get_stock_buy,integer_get_shares: ({object_stock_market,boolean_long,float_investment_capital,object_stock,}) =>integer_get_shares_buyable({object_stock: object_stock,float_cash: float_get_capital_left({float_cash_invested:object_stock_market.float_cash_invested,float_investment_capital: float_investment_capital,}),boolean_long: boolean_long,}),integer_smoothing: integer_prices_average_length,}): object_get_stock_market_updated_after_buying_conditional({object_stock_market: object_get_stock_market_updated_after_selling_conditional({object_stock_market: object_stock_market,boolean_long: true,object_get_stock: object_get_stock_sell,integer_get_shares: integer_get_shares_owned,integer_smoothing: integer_prices_average_length,}),float_investment_capital: float_investment_capital,boolean_long: true,object_get_stock: object_or_null_get_stock_buy,integer_get_shares: ({object_stock_market,boolean_long,float_investment_capital,object_stock,}) =>integer_get_shares_buyable({object_stock: object_stock,float_cash: float_get_capital_left({float_cash_invested:object_stock_market.float_cash_invested,float_investment_capital: float_investment_capital,}),boolean_long: boolean_long,}),integer_smoothing: integer_prices_average_length,});}// Update after market tick.await object_netscript.sleep(Math.max(1,object_constants.float_period_update_stock + integer_time - Date.now()));integer_time = Date.now();object_stock_market = object_get_stock_market_updated_after_tick({object_stock_market: object_stock_market,integer_prices_average_length: integer_prices_average_length_double,});void_save_stocks(object_stock_market.object_stocks);}};await void_main();};
/*** @description nicoty.sbin.servers.js - 8.85GB - Perpetually tries to buy the best server with the available cash if RAM utilisation of the network is over a threshold, unless there are 25 servers already, in which case deletes the worst server and replaces it with a better one, unless all 25 already have the maximum possible RAM.* @license BlueOak-1.0.0*/import {float_get_network_ram_utilisation,float_get_server_ram_total,} from "nicoty.lib.ram.server.js";/*** @description Constants.* @readonly* @property {number} BaseCostFor1GBOfRamServer - Cost of server per 1 GB of RAM.* @property {number} PurchasedServerLimit - Maximum amount of purchased servers allowed.* @property {number} integer_server_ram_min - Minimum RAM of purchased servers possible.* @property {number} PurchasedServerMaxRam - Maximum RAM of purchased servers possible. 2^20.* @see {@link https://github.com/danielyxie/bitburner/blob/master/src/Constants.ts|Bitburner's source code}.*/const object_constants = {BaseCostFor1GBOfRamServer: 55000,PurchasedServerLimit: 25,integer_server_ram_min: 2,PurchasedServerMaxRam: 1048576,};export const main = async (object_netscript) => {/*** @description Returns `true` if all the bought servers have maximum RAM, otherwise returns `false`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} [object_arguments.array_servers_bought] - Contains the names of bought servers.* @returns {boolean} `true` if all the bought servers have maximum RAM, otherwise `false`.*/const boolean_servers_bought_all_max = (array_servers_bought = object_netscript.getPurchasedServers()) =>array_servers_bought.every((string_server) =>float_get_server_ram_total({object_netscript: object_netscript,string_server: string_server,}) >= object_constants.PurchasedServerMaxRam);/*** @description Returns the name of the bought server with the smallest RAM.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} [object_arguments.array_servers_bought] - Contains the names of bought servers.* @returns {string|null} The name of the bought server with the smallest RAM.*/const string_get_server_bought_smallest = (array_servers_bought = object_netscript.getPurchasedServers()) =>array_servers_bought.reduce((object_server_smallest, string_server) => {const integer_ram = float_get_server_ram_total({object_netscript: object_netscript,string_server: string_server,});return integer_ram < object_server_smallest.integer_ram? {string_server: string_server,integer_ram: integer_ram,}: object_server_smallest;},{string_server: null,integer_ram: 1 / 0,}).string_server;/*** @description Returns the name of the bought server with the biggest RAM.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} [object_arguments.array_servers_bought] - Contains the names of bought servers.* @returns {string|null} The name of the bought server with the biggest RAM.*/const string_get_server_bought_biggest = (array_servers_bought = object_netscript.getPurchasedServers()) =>array_servers_bought.reduce((object_server_biggest, string_server) => {const integer_ram = float_get_server_ram_total({object_netscript: object_netscript,string_server: string_server,});return integer_ram > object_server_biggest.integer_ram? {string_server: string_server,integer_ram: integer_ram,}: object_server_biggest;},{string_server: null,integer_ram: -1 / 0,}).string_server;/*** @description Returns the RAM of the server bought with the biggest amount of RAM.* @param {string} [string_server_bought_biggest] - The name of server bought with the biggest amount of RAM.* @returns {number} The RAM of the server bought with the biggest amount of RAM.*/const integer_get_ram_server_bought_biggest = (string_server_bought_biggest = string_get_server_bought_biggest(object_netscript.getPurchasedServers())) =>float_get_server_ram_total({object_netscript: object_netscript,string_server: string_server_bought_biggest,});/*** @description Returns the most amount of RAM of a server that can be bought.* @returns {number} The most amount of RAM of a server that can be bought.*/const integer_get_ram_biggest_can_buy = () =>Math.max(object_constants.PurchasedServerMaxRam,Math.pow(2,Math.trunc(Math.log2(object_netscript.getServerMoneyAvailable("home") /object_constants.BaseCostFor1GBOfRamServer) / Math.log2(2))));/*** @description The first set of conditions that should be met before buying a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.integer_servers_bought_amount] - The amount of servers bought.* @param {number} [object_arguments.integer_ram_biggest_can_buy] - The amount of RAM of the server with the biggest amount of RAM that can be bought.* @returns {boolean} `true` if the conditions are met, otherwise `false`.* @todo Don't hardcode "home", maybe pass it it as a function parameter?*/const boolean_conditions_server_buy_a = ({integer_servers_bought_amount: a = object_netscript.getPurchasedServers().length,integer_ram_biggest_can_buy: b = integer_get_ram_biggest_can_buy(),}) =>// There are no bought servers yet.0 === a &&// RAM is at least equal to the minimum RAM possible for bought servers.b >= object_constants.integer_server_ram_min &&// RAM is at least equal to the RAM of "home" (probably a bad idea to hardcode this since the name of "home" might change in the future) or maximum RAM.(b >=float_get_server_ram_total({object_netscript: object_netscript,string_server: "home",}) ||b >= object_constants.PurchasedServerMaxRam);/*** @description The second set of conditions that should be met before buying a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.integer_servers_bought_amount] - The amount of servers bought.* @returns {boolean} `true` if the conditions are met, otherwise `false`.*/const boolean_conditions_server_buy_b = (integer_servers_bought_amount = object_netscript.getPurchasedServers().length) =>// There is at least one bought server.integer_servers_bought_amount >= 1 &&// The amount of bought servers is less that the maximum allowedinteger_servers_bought_amount < object_constants.PurchasedServerLimit;/*** @description The third set of conditions that should be met before buying a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.integer_ram_biggest_can_buy] - The amount of RAM of the server with the biggest amount of RAM that can be bought.* @param {number} [object_arguments.integer_ram_server_bought_biggest] - The amount of RAM of the server bought with the biggest amount of RAM.* @returns {boolean} `true` if the conditions are met, otherwise `false`.*/const boolean_conditions_server_buy_c = ({integer_ram_biggest_can_buy: c = integer_get_ram_biggest_can_buy(),integer_ram_server_bought_biggest: b = integer_get_ram_server_bought_biggest(string_get_server_bought_biggest(object_netscript.getPurchasedServers())),}) =>// A server with the maximum amount of RAM hasn't been bought yet. A server with RAM greater than the amount of RAM of the server bought with the biggest amount of RAM should be bought.b < object_constants.PurchasedServerMaxRam &&b < c;/*** @description The fourth set of conditions that should be met before buying a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.integer_ram_biggest_can_buy] - The amount of RAM of the server with the biggest amount of RAM that can be bought.* @param {number} [object_arguments.integer_ram_server_bought_biggest] - The amount of RAM of the server bought with the biggest amount of RAM.* @returns {boolean} `true` if the conditions are met, otherwise `false`.*/const boolean_conditions_server_buy_d = ({integer_ram_biggest_can_buy: c = integer_get_ram_biggest_can_buy(),integer_ram_server_bought_biggest: b = integer_get_ram_server_bought_biggest(string_get_server_bought_biggest(object_netscript.getPurchasedServers())),}) =>// A server with the maximum amount of RAM has already been bought. Another one should be bought.b == object_constants.PurchasedServerMaxRam &&c >= object_constants.PurchasedServerMaxRam;/*** @description The set of conditions that should be met before buying a server.* @param {number} float_ram_utilisation_threshold - The fraction of the network of rooted server's RAM that must be being used.* @returns {boolean} `true` if the conditions are met, otherwise `false`.*/const boolean_conditions_server_buy = (float_ram_utilisation_threshold) => {const array_servers_bought = object_netscript.getPurchasedServers(),integer_ram_biggest_can_buy = integer_get_ram_biggest_can_buy(),integer_ram_server_bought_biggest = integer_get_ram_server_bought_biggest(string_get_server_bought_biggest(array_servers_bought));return (!boolean_servers_bought_all_max(array_servers_bought) &&float_get_network_ram_utilisation(object_netscript) > float_ram_utilisation_threshold &&(boolean_conditions_server_buy_a({integer_servers_bought_amount: array_servers_bought.length,integer_ram_biggest_can_buy: integer_ram_biggest_can_buy,}) || (boolean_conditions_server_buy_b(array_servers_bought.length) &&(boolean_conditions_server_buy_c({integer_ram_biggest_can_buy: integer_ram_biggest_can_buy,integer_ram_server_bought_biggest: integer_ram_server_bought_biggest,}) || boolean_conditions_server_buy_d({integer_ram_biggest_can_buy: integer_ram_biggest_can_buy,integer_ram_server_bought_biggest: integer_ram_server_bought_biggest,})))));};/*** @description The set of conditions that should be met before deleting servers and buying better ones.* @param {number} float_ram_utilisation_threshold - The fraction of the network of rooted server's RAM that must be being used.* @returns {boolean} `true` if the conditions are met, otherwise `false`.*/const boolean_conditions_server_replace = (float_ram_utilisation_threshold) => {const array_servers_bought = object_netscript.getPurchasedServers();return (// The maximum amount of servers has been bought.array_servers_bought.length == object_constants.PurchasedServerLimit &&// Not all servers have the maximum amount of RAM.!boolean_servers_bought_all_max(array_servers_bought) &&// Cash is at least equal to the price of the cheapest server bought + the next highest server after that, which is twice the price of the former, thus 3. This check is so that a server with the same RAM as before isn't bought.object_netscript.getServerMoneyAvailable("home") >=3 *object_constants.BaseCostFor1GBOfRamServer *float_get_server_ram_total({object_netscript: object_netscript,string_server: string_get_server_bought_smallest(array_servers_bought),}) &&// The utilisation of the network's RAM is greater than the threshold.float_get_network_ram_utilisation(object_netscript) > float_ram_utilisation_threshold);};const void_main = async () => {constfloat_period = object_netscript.args[0],string_servers_bought_name = object_netscript.args[1],float_ram_utilisation_threshold = object_netscript.args[2];for (;;) {// Replace servers with better ones.for (;boolean_conditions_server_replace(float_ram_utilisation_threshold);) {object_netscript.deleteServer(string_get_server_bought_smallest(object_netscript.getPurchasedServers()));const integer_ram_biggest_can_buy = integer_get_ram_biggest_can_buy();object_netscript.purchaseServer(`${string_servers_bought_name}-${integer_ram_biggest_can_buy}`,integer_ram_biggest_can_buy),await object_netscript.sleep(float_period);}// Buy servers.for (;boolean_conditions_server_buy(float_ram_utilisation_threshold);) {const integer_ram_biggest_can_buy = integer_get_ram_biggest_can_buy();object_netscript.purchaseServer(`${string_servers_bought_name}-${integer_ram_biggest_can_buy}`,integer_ram_biggest_can_buy),await object_netscript.sleep(float_period);}await object_netscript.sleep(float_period);}};await void_main();};
/*** @description nicoty.sbin.ram.js - 6.6GB - Perpetually tries to upgrade the RAM of "home" if the RAM utilisation of the network of rooted servers is over a threshold value and there is sufficient cash.* @license BlueOak-1.0.0*/import {float_get_network_ram_utilisation,} from "nicoty.lib.ram.server.js";/*** @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @param {string[]} object_netscript.args.1 - The RAM utilisation threshold value.*/export const main = async (object_netscript) => {const float_period = object_netscript.args[0],float_ram_utilisation_threshold = object_netscript.args[1];for (;;) {try {for (;object_netscript.getServerMoneyAvailable("home") >= object_netscript.getUpgradeHomeRamCost() &&float_get_network_ram_utilisation(object_netscript) > float_ram_utilisation_threshold;)object_netscript.upgradeHomeRam();} catch (object_exception) {object_netscript.print(`WARNING: ${JSON.stringify(object_exception)}`);}await object_netscript.sleep(float_period);}};
/*** @description nicoty.sbin.programs.js - 3.7GB - Perpetually tries to buy programs.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @param {string[]} object_netscript.args.1 - Contains the names of programs to buy.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {const float_period = object_netscript.args[0],array_programs = object_netscript.args[1];let boolean_has_all_programs = !1;for (;!boolean_has_all_programs;) {let boolean_program_missing = !1;array_programs.forEach((string_program) => {object_netscript.fileExists(string_program, "home") ||(boolean_program_missing = !0);try {object_netscript.purchaseProgram(string_program);} catch (object_exception) {object_netscript.print(`WARNING: ${JSON.stringify(object_exception)}`);}}),boolean_program_missing || (boolean_has_all_programs = !0),await object_netscript.sleep(float_period);}};
/*** @description nicoty.sbin.nop.js - 1.6GB - Perpetually waits. Useable as a no-operation script to reserve RAM for another script* @param {Object} object_netscript - The Netscript environment.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {for (;;) await object_netscript.sleep(9e9);};
/*** @description nicoty.sbin.hacker.js - 13.35GB - Responsible for running scripts to weaken, grow and hack servers.* @license BlueOak-1.0.0* @todo only need to keep track of the last job being done on a target server (and its effect on target after finishes) for each server?also need to track when to make and run new schediles for each target.create and run a full cycling schedule for first target if possible (duration of paddings is padding + duration of weaken (slowest job)), then do the same for second target, etc. unless running the schedule for the second means the amount of ram that'd be available is less that the amount used for the schedule of the first target (this assumes the ram required by the second schedule of the first target is equal to that required by its first), in which case make and run the next schedule for the first target instead, and only then do the same for the second target. so before starting a schedule for the third target, need to ensure that doing so will still leave enough ram for another schedule for first and second targets.keep adding jobs to a schedule as long as amount of jobs is under maximum and the duration of paddings is less than required (see above) and there is enough ram to keep adding more jobs.* @todo Use dependency injection or `Fluture` to move side-effects to `void-main`.* @todo Send array of servers used to cyclic weaken manager periodically so it can use it do decide how many threads of cyclic weaken would be possible to generate.* @todo Add a way to control this using Kozd's GUIFramework.* @todo Refactor unecessary cloning/copying.* @todo Add a way to notify nicoty.sbin.weaken.manager if this script needs more RAM so nicoty.sbin.weaken.manager can kill some cyclic weaken scripts and adjust float_ram_fraction_for_weaken_cyclic.* @todo Add a way to be able to target more than one server at a time?* @todo Add a way to determine the optimal weights for the factors used in the server scoring function* @todo Add a job cap thing that prevents running more jobs if the first worker in a cycle finishes. Add a thing to worker script that writes to a file (or to `window`) its identifier, when it started, and when it finishes. Add a padding optimiser that detects when tail collision occurs and increases padding each cycle if it does occur, and decreases it by half of how much it increases everytime no tail collision occurs.*/import { array_get_servers } from "./nicoty.lib.servers.js";import {float_get_server_ram_free,array_get_servers_useable,object_get_server_ram_free_biggest,} from "./nicoty.lib.ram.server.js";import {object_get_server_used,array_get_servers_used_updated,boolean_copy_script_to,integer_exec,boolean_can_run_job,} from "./nicoty.lib.ram.script.js";import {array_make_servers,clamp,any_while,object_get_updated,clone,array_sort,} from "./nicoty.lib.no.netscript.js";import { array_get_servers_hackable } from "./nicoty.lib.score.js";import {float_get_time_hack,float_get_time_grow,float_get_time_weaken,} from "./nicoty.lib.time.js";import { float_get_server_score } from "./nicoty.lib.score.js";/*** @description Constants.* @readonly* @property {number} object_constants.ServerBaseGrowthRate - Unadjusted Growth rate. Base percentage increase of cash from one thread of `grow`.* @property {number} object_constants.ServerMaxGrowthRate - Maximum possible growth rate (max rate accounting for server security).* @property {number} object_constants.ServerFortifyAmount - Amount by which server's security increases when its hacked/grown.* @property {number} object_constants.ServerWeakenAmount - Amount by which server's security decreases when weakened.* @property {Object} object_constants.object_workers - Contains the names of worker scripts.* @property {string} object_constants.object_workers.weaken_ - The name of the worker script responsible for running `weaken`.* @property {string} object_constants.object_workers.grow_ - The name of the worker script responsible for running `grow`.* @property {string} object_constants.object_workers.hack_ - The name of the worker script responsible for running `hack`.* @see `CONSTANTS` in {@link https://github.com/danielyxie/bitburner/blob/49fa63971b404af04cfaf331cad33ec4e59b4024/src/Constants.ts|Bitburner's source code}.*/const object_constants = {ServerBaseGrowthRate: 1.03,ServerMaxGrowthRate: 1.0035,ServerFortifyAmount: 0.002,ServerWeakenAmount: 0.05,object_workers: {weaken_: "nicoty.sbin.weaken.js",grow_: "nicoty.sbin.grow.js",hack_: "nicoty.sbin.hack.js",},};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Returns an object containing the current bitnode multiplier values.* @returns {Object} Contains the current bitnode multiplier values.* @see `BitNodeMultipliers` in {@link https://github.com/danielyxie/bitburner/blob/34d749809a3ca810d6fb22c39225e76a67897ba9/src/BitNode/BitNodeMultipliers.ts|"BitNodeMultipliers.ts" from Bitburner's source code}.*/const object_get_bitnode_multipliers = () => {try {// Comment out the following line to save on ~4GB of RAM.return object_netscript.getBitNodeMultipliers();throw new Error("WARNING: Uncommented the call to `getBitNodeMultipliers`.");} catch (object_exception) {return (object_netscript.print(`${JSON.stringify(object_exception)}\nUsing default values instead.`),{HackingLevelMultiplier: 1,StrengthLevelMultiplier: 1,DefenseLevelMultiplier: 1,DexterityLevelMultiplier: 1,AgilityLevelMultiplier: 1,CharismaLevelMultiplier: 1,ServerGrowthRate: 1,ServerMaxMoney: 1,ServerStartingMoney: 1,ServerStartingSecurity: 1,ServerWeakenRate: 1,HomeComputerRamCost: 1,PurchasedServerCost: 1,PurchasedServerLimit: 1,PurchasedServerMaxRam: 1,CompanyWorkMoney: 1,CrimeMoney: 1,HacknetNodeMoney: 1,ManualHackMoney: 1,ScriptHackMoney: 1,CodingContractMoney: 1,ClassGymExpGain: 1,CompanyWorkExpGain: 1,CrimeExpGain: 1,FactionWorkExpGain: 1,HackExpGain: 1,FactionPassiveRepGain: 1,FactionWorkRepGain: 1,RepToDonateToFaction: 1,AugmentationMoneyCost: 1,AugmentationRepCost: 1,InfiltrationMoney: 1,InfiltrationRep: 1,FourSigmaMarketDataCost: 1,FourSigmaMarketDataApiCost: 1,CorporationValuation: 1,BladeburnerRank: 1,BladeburnerSkillCost: 1,DaedalusAugsRequirement: 1,});}};/*** @description Returns `true` if any of the scripts in the specified array are running on any server, otherwise returns `false`.* @param {string[]} array_scripts - Contains the names of scripts to test.* @returns {boolean} `true` if any of the scripts in the specified array are running on any server, otherwise `false`.*/const boolean_array_scripts_any_running = (array_scripts) =>0 !== array_scripts.length &&array_get_servers({ object_netscript: object_netscript }).some((string_server) => {const array_running = object_netscript.ps(string_server);return (0 !== array_running.length &&array_running.some((object_running) =>array_scripts.some((string_script) => string_script === object_running.filename)));});// Weakening, growing and hacking.// Weaken-related functions./*** @description Returns the amount of threads of `weaken` required to cause a server's security by the specified amount.* @param {number} float_weaken_by - The amount to weaken server security by.* @returns {number} The amount of threads of `weaken` required to cause a server's security by the specified amount.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const integer_get_threads_required_for_weaken = (float_weaken_by) =>// Denominator is prevented from going lower than Number.MIN_VALUE to prevent divide by 0 errors.Math.ceil(float_weaken_by / Math.max(Number.MIN_VALUE,object_constants.ServerWeakenAmount *object_get_bitnode_multipliers().ServerWeakenRate));/*** @description Returns the amount of threads of `weaken` required to cause a server's security to reach minimum.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @returns {number} The amount of threads of `weaken` required to cause the server's security to reach minimum.*/const integer_get_threads_required_for_weaken_minimum_security = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),}) =>integer_get_threads_required_for_weaken(s - object_netscript.getServerMinSecurityLevel(n));/*** @description Returns the amount that server security will decrease from the amount of threads of `weaken` specified.* @param {number} integer_threads_weaken - The amount of threads of `weaken` to be used.* @returns {number} The amount that server security will decrease from the amount of threads of `weaken` specified.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_decrease_from_weaken = (integer_threads_weaken) =>integer_threads_weaken * object_constants.ServerWeakenAmount;// Grow-related functions./*** @description Returns the number of threads of `grow` needed to grow the specified server's cash by the specified percentage when it has the specified security.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_growth - The percentage to grow the server's cash by + 1. E.g., 1.5 will grow it by 50%.* @returns {number} The amount that server security will decrease from the amount of threads of `weaken` specified.* @see `numCycleForGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.*/const integer_get_threads_for_growth = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_growth: g,}) => {const CONSTANTS = object_constants,BitNodeMultipliers = object_get_bitnode_multipliers();function numCycleForGrowth(server, growth, p) {let ajdGrowthRate =1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;}const serverGrowthPercentage = server.serverGrowth / 100;const cycles =Math.log(growth) /(Math.log(ajdGrowthRate) *p.hacking_grow_mult *serverGrowthPercentage *BitNodeMultipliers.ServerGrowthRate);return cycles;}return Math.ceil(numCycleForGrowth({hackDifficulty: s,serverGrowth: object_netscript.getServerGrowth(n),},g,{hacking_grow_mult: object_netscript.getHackingMultipliers().growth,}));};/*** @description Inverse function of integer_get_threads_for_growth. Returns the percentage growth of the server's cash in decimal form (e.g., 2 = 100% growth).* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.integer_threads - The number of threads of `grow` to use.* @returns {number} The percentage of growth that will occur to the server's cash.* @see `numCycleForGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.*/const float_get_growth_from_threads = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),integer_threads: t,}) =>Math.pow(Math.min(object_constants.ServerMaxGrowthRate,1 + (object_constants.ServerBaseGrowthRate - 1) / s),t *object_netscript.getHackingMultipliers().growth *(object_netscript.getServerGrowth(n) / 100) *object_get_bitnode_multipliers().ServerGrowthRate);/*** @description Returns the threads of `grow` required to grow the specified server's cash to its maximum when its security and cash are at the specified values.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_cash - The server's cash.* @returns {number} The threads of `grow` required to grow the specified server's cash to its maximum when its security and cash are at the specified values.*/const integer_get_threads_required_for_grow_cash_maximum = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c,}) =>integer_get_threads_for_growth({string_server: n,float_security: s,float_growth: object_netscript.getServerMaxMoney(n) / c,});/*** @description Returns the amount that a server's security will increase from the threads of `grow` used.* @param {number} integer_threads_grow - The number of threads of `grow` to use.* @returns {number} The amount that a server's security will increase from the threads of `grow` used.* @see `processSingleServerGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_increase_from_grow = (integer_threads_grow) =>2 * object_constants.ServerFortifyAmount * integer_threads_grow;// Hack-related functions./*** @description Returns the percentage of the available cash in the specified server that is stolen when it is hacked when it has the specified amount of security.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @returns {number} The percentage of the available cash in the specified server that is stolen when it is hacked when it has the specified amount of security.* @see `calculatePercentMoneyHacked` in {@link https://github.com/danielyxie/bitburner/blob/473f0f14475c40b829fc278dcd07bdd27a5da76f/src/Hacking.js|"Hacking.js" from Bitburner's source code}.* @see `hackDifficulty` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_percentage_cash_taken_per_hack = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),}) => {const Player = {hacking_skill: object_netscript.getHackingLevel(),hacking_money_mult: object_netscript.getHackingMultipliers().money,},BitNodeMultipliers = object_get_bitnode_multipliers();function calculatePercentMoneyHacked(server) {// Adjust if needed for balancing. This is the divisor for the final calculationconst balanceFactor = 240;const difficultyMult = (100 - server.hackDifficulty) / 100;const skillMult =(Player.hacking_skill - (server.requiredHackingSkill - 1)) /Player.hacking_skill;const percentMoneyHacked =(difficultyMult * skillMult * Player.hacking_money_mult) /balanceFactor;if (percentMoneyHacked < 0) {return 0;}if (percentMoneyHacked > 1) {return 1;}return percentMoneyHacked * BitNodeMultipliers.ScriptHackMoney;}return calculatePercentMoneyHacked({hackDifficulty: s,requiredHackingSkill: object_netscript.getServerRequiredHackingLevel(n),});};/*** @description Returns the threads of `hack` required to steal the specified percentage of the specified server's available cash when its security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of cash to steal.* @returns {number} The threads of `hack` required to steal the specified percentage of the specified server's available cash when its security is at the specified value.*/const integer_get_threads_required_to_hack_percentage = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_percentage_to_steal: p,}) =>Math.ceil(p / float_get_percentage_cash_taken_per_hack({string_server: n,float_security: s,}));/*** @description Returns the amount that a server's security will increase from the specified threads of `hack`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} [object_arguments.float_cash] - The server's available cash.* @param {number} object_arguments.integer_threads_hack - The amount of threads of `hack` to use.* @returns {number} The amount that a server's security will increase from the specified threads of `hack`.* @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_increase_from_hack = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c = object_netscript.getServerMoneyAvailable(string_server),integer_threads_hack: t,}) => {const percentHacked = float_get_percentage_cash_taken_per_hack({string_server: n,float_security: s,}),server = {moneyAvailable: c,moneyMax: object_netscript.getServerMaxMoney(n),},CONSTANTS = object_constants;function float_hack(threads) {let maxThreadNeeded = Math.ceil((1 / percentHacked) * (server.moneyAvailable / server.moneyMax));if (isNaN(maxThreadNeeded)) {// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large valuemaxThreadNeeded = 1e6;}return CONSTANTS.ServerFortifyAmount * Math.min(threads, maxThreadNeeded);}return float_hack(t);};/*** @description Depending on the job:* If "weaken", returns the threads required for `weaken` to cause the target server's security to reach minimum if possible, otherwise, returns the max threads that the server used can provide.* If "grow", returns the threads required for `grow` to grow the target server's cash to its maximum if possible, otherwise, returns the max threads that the server used can provide.* If "hack", returns the threads required for `hack` to steal the specified percentage of the available money of the target if possible, otherwise, returns the max threads that the server used can provide.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free - The amount of free RAM of the server used.* @param {string} object_arguments.string_script - The worker script required for the job.* @param {string} object_arguments.string_server - The target server's hostname.* @param {number} [object_arguments.float_security] - The target server's security.* @param {number} [object_arguments.float_cash] - The target server's available cash.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the target server's available cash to steal.* @returns {number} The amount of threads required/available for the job.* @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/const integer_get_threads = ({float_ram_free: f,string_script: r,string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c = object_netscript.getServerMoneyAvailable(string_server),float_percentage_to_steal: p,}) =>clamp({value: (({string_script: r,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}) => {switch (r) {case object_constants.object_workers.weaken_:return integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: s,});case object_constants.object_workers.grow_:return integer_get_threads_required_for_grow_cash_maximum({string_server: n,float_security: s,/*** @description If current cash is <= 0, 1 is used so "It can be grown even if it has no money".* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: c <= 0 ? 1 : c,});case object_constants.object_workers.hack_:return integer_get_threads_required_to_hack_percentage({string_server: n,float_security: s,float_percentage_to_steal: p,});}})({string_script: r,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}),lower: 0,upper: Math.trunc(f / object_netscript.getScriptRam(r)),});// Functions related to calculating percentage to steal./*** @description Returns the threads required by `grow` to grow the target server's cash back to its original value after stealing the specified percentage of it, and assuming its security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the server's available cash to steal.* @returns {number} The threads required by `grow` to grow the target server's cash back to its original value after stealing the specified percentage of it, and assuming its security is at the specified value.*/const integer_get_threads_required_for_cash_grow_after_percentage_stolen = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_percentage_to_steal: p,}) =>integer_get_threads_for_growth({string_server: n,float_security: s,// Denominator is prevented from going lower than Number.MIN_VALUE to prevent divide by 0 errors.float_growth: 1 / Math.max(Number.MIN_VALUE, 1 - p),});/*** @description Should return `true` if there is enough RAM to provide the threads required of `weaken` to weaken to minimum security, then of `grow` to grow the cash back to maximum after stealing the specified percentahe of the cash, then again of `weaken` to weaken to minimum security again if possible, otherwise, returns `false`, assuming security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free_server_used - The free RAM available in the server used.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {number} object_arguments.float_cash_server_target - The target server's cash.* @param {number} [object_arguments.float_security_server_target] - The target server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the target server's available cash to steal.* @returns {boolean} `true` if RAM is sufficient, otherwise `false`.*/const boolean_is_ram_enough_after_hack_percentage = ({float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c = object_netscript.getServerMoneyAvailable(string_server_target),float_security_server_target: s = object_netscript.getServerSecurityLevel(string_server_target),float_percentage_to_steal: p,}) => {const float_server_target_security_after_hack =s +float_get_security_increase_from_hack({string_server: n,float_security: s,float_cash: c,integer_threads_hack: integer_get_threads({float_ram_free: r,string_script: object_constants.object_workers.hack_,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}),}),integer_threads_required_for_weaken_minimum_security_after_hack = integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: float_server_target_security_after_hack,}),float_server_target_security_after_weaken =float_server_target_security_after_hack -float_get_security_decrease_from_weaken(integer_threads_required_for_weaken_minimum_security_after_hack),integer_threads_required_for_cash_grow_after_percentage_stolen = integer_get_threads_required_for_cash_grow_after_percentage_stolen({string_server: n,float_security: float_server_target_security_after_weaken,float_percentage_to_steal: p,}),float_server_target_security_after_grow =float_server_target_security_after_weaken +float_get_security_increase_from_grow(integer_threads_required_for_cash_grow_after_percentage_stolen),integer_threads_required_for_weaken_minimum_security_after_grow = integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: float_server_target_security_after_grow,}),ram_weaken = object_netscript.getScriptRam(object_constants.object_workers.weaken_),float_ram_required =integer_threads_required_for_weaken_minimum_security_after_hack *ram_weaken +integer_threads_required_for_cash_grow_after_percentage_stolen *object_netscript.getScriptRam(object_constants.object_workers.grow_) +integer_threads_required_for_weaken_minimum_security_after_grow *ram_weaken;return float_ram_required < r;};/*** @description Returns the number of cycles of bisection to be done to reach a certain precision, rounded up to the nearest integer.* @param {number} float_precision - The desired precision.* @returns {number} The number of cycles of bisection to be done to the reach the required precision.*/const integer_get_cycles_for_bisection_precision = (float_precision) =>Math.ceil(Math.log(1 / Math.max(float_precision, Number.MIN_VALUE)) *(1 / Math.log(2)));/*** @description Should return the optimum percentage to steal such that cash stolen at most is as high as the steal cap and the target server's security is able to be weakened to minimum with one `weaken` after the `hack`, its cash grown to 100% after one `grow` after the `weaken`, then its security weakened again to minimum with one `weaken`, all with the available remaining RAM on the server used after the `hack` by using a binary search algorithm.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free_server_used - The free RAM available in the server used.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {number} object_arguments.float_cash_server_target - The target server's cash.* @param {number} [object_arguments.float_security_server_target] - The target server's security.* @param {number} object_arguments.float_precision - The desired precision of the binary search algorithm.* @param {number} object_arguments.float_steal_cap - The maximum percentage of available cash that may be stolen at a time.* @returns {number} The optimum percentage of cash to steal.*/const float_get_percentage_to_steal = ({float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c = object_netscript.getServerMoneyAvailable(string_server_target),float_security_server_target: s = object_netscript.getServerSecurityLevel(string_server_target),float_precision: p,float_steal_cap: m,}) =>// Result is capped so not all cash is stolen, which can be bad because it's harder to grow from 0 in most cases.Math.min(m,any_while({any_state: {float_ceiling: 1,float_floor: 0,float_percentage_to_steal: (1 + 0) / 2,integer_counter: 0,integer_cycles_for_bisection_precision: integer_get_cycles_for_bisection_precision(p),float_steal_cap: m,float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c,float_security_server_target: s,},boolean_condition: (object_state) =>object_state.integer_cycles_for_bisection_precision >object_state.integer_counter &&object_state.float_steal_cap >=object_state.float_percentage_to_steal,any_function: (object_state) =>boolean_is_ram_enough_after_hack_percentage({float_ram_free_server_used: object_state.float_ram_free_server_used,string_server_target: object_state.string_server_target,float_cash_server_target: object_state.float_cash_server_target,float_security_server_target:object_state.float_security_server_target,float_percentage_to_steal: object_state.float_percentage_to_steal,})? object_get_updated({object_original: object_state,object_properties_new: {float_floor: object_state.float_percentage_to_steal,float_percentage_to_steal:(object_state.float_ceiling +object_state.float_percentage_to_steal) / 2,},integer_counter: 1 + object_state.integer_counter,}): object_get_updated({object_original: object_state,object_properties_new: {float_ceiling: object_state.float_percentage_to_steal,float_percentage_to_steal:(object_state.float_percentage_to_steal +object_state.float_floor) / 2,},integer_counter: 1 + object_state.integer_counter,}),}).float_percentage_to_steal);// Server-related functions./*** @description Returns an array of hackable servers sorted by their score in descending order.* @param {Object} object_arguments - Contains the arguments for the function.* @param {boolean} object_arguments.boolean_method_score_correction - Whether or not to use mean-normalised or standardised score correction.* @param {number} object_arguments.float_multiplier_factor_skill - Multiplier used for the skill factor.* @param {number} object_arguments.float_multiplier_factor_max_cash - Multiplier used for the maximum cash factor.* @param {number} object_arguments.float_multiplier_factor_growth - Multiplier used for the growth factor.* @returns {string[]|null} Contains the names of hackable servers sorted by score in descending order or `null` if there are none.*/const array_get_servers_hackable_sorted_by_score = ({boolean_method_score_correction,float_multiplier_factor_skill,float_multiplier_factor_max_cash,float_multiplier_factor_growth,}) => {const array_servers_hackable = array_get_servers_hackable(object_netscript);return array_servers_hackable.length === 0 ?null :array_sort({array: array_servers_hackable,boolean_ascending: !1,function_prepare: (string_server) => float_get_server_score({object_netscript: object_netscript,string_server: string_server,boolean_method_score_correction: boolean_method_score_correction,float_multiplier_factor_skill: float_multiplier_factor_skill,float_multiplier_factor_max_cash: float_multiplier_factor_max_cash,float_multiplier_factor_growth: float_multiplier_factor_growth,}),});};/*** @description A target server object.* @typedef {Object} ServerTarget* @property {string} string_server - The name of the target server.* @property {number} float_security_minimum - The minimum security of the target server.* @property {number} float_security_maximum - The maximum security of the target server.* @property {number} float_security - The security of the target server.* @property {number} float_cash - The cash of the target server.*//*** @description Returns a target server object. Assumes a server's minimum security and maximum cash values are constant.* @param {string} string_server - The target server's hostname.* @returns {ServerTarget} The target server object.*/const object_get_server_target = (string_server) => ({string_server: string_server,float_security_minimum: object_netscript.getServerMinSecurityLevel(string_server),float_cash_maximum: object_netscript.getServerMaxMoney(string_server),float_security: object_netscript.getServerSecurityLevel(string_server),float_cash: object_netscript.getServerMoneyAvailable(string_server),});// Scheduling-related functions./*** @description Returns the name of the appropriate worker script for given target server object.* @param {ServerTarget} object_server_target - The target server object.* @returns {string} The name of the appropriate worker script.* @todo Use an enumerated type for this.*/const string_get_job = (object_server_target) =>object_server_target.float_security >object_server_target.float_security_minimum? object_constants.object_workers.weaken_: object_server_target.float_cash <object_server_target.float_cash_maximum? object_constants.object_workers.grow_: object_constants.object_workers.hack_;/*** @description A job object.* @typedef {Object} JobHacking* @property {string} string_script - The name of the script to run.* @property {string} string_server_used - The name of the server to run the script on.* @property {string} string_server_target - The name of the target server.* @property {number} integer_threads - The number of threads to run of the script.* @property {number} float_delay_seconds - The number of seconds sleep the script should run before running the actual job.* @property {number} float_security_before_server_target - The target server's security before this job's effects are applied.* @property {number} float_security_after_server_target - The target server's security after this job's effects are applied.*//*** @description Returns a new target server object based on an original after the effects of a job object have been applied to it.* @param {Object} object_arguments - Contains the arguments for the function.* @param {ServerTarget} object_arguments.object_server_target - The original target server object.* @param {JobHacking} object_arguments.object_job - The job object.* @returns {ServerTarget} The new target server object.*/const object_get_server_target_job_applied = ({object_server_target: t,object_job: j,}) => {switch (j.string_script) {case object_constants.object_workers.weaken_:return object_get_updated({object_original: t,object_properties_new: {float_security: Math.max(t.float_security_minimum,t.float_security -float_get_security_decrease_from_weaken(j.integer_threads)),},});case object_constants.object_workers.grow_:return object_get_updated({object_original: t,object_properties_new: {/*** @description If current cash is <= 0, 1 is used so "It can be grown even if it has no money".* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: Math.min(t.float_cash_maximum,(t.float_cash <= 0 ? 1 : t.float_cash) *float_get_growth_from_threads({string_server: t.string_server,float_security: t.float_security,integer_threads: j.integer_threads,})),/*** @see `processSingleServerGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_security:t.float_security +float_get_security_increase_from_grow(j.integer_threads),},});case object_constants.object_workers.hack_:return object_get_updated({object_original: t,object_properties_new: {/*** @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: Math.max(0,t.float_cash -Math.floor(t.float_cash *float_get_percentage_cash_taken_per_hack({string_server: t.string_server,float_security: t.float_security,})) *j.integer_threads),/*** @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/float_security:t.float_security +float_get_security_increase_from_hack({string_server: t.string_server,float_security: t.float_security,float_cash: t.float_cash,integer_threads_hack: j.integer_threads,}),},});default:throw new Error(`ERROR: Unrecognised job \`${j.string_script}\`.`);}};/*** @description An object containing job durations in seconds.* @typedef {Object} DurationsJob* @property {number} [object_constants.object_workers.weaken_] - The time it takes for `weaken` to resolve.* @property {number} [object_constants.object_workers.grow_] - The time it takes for `grow` to resolve.* @property {number} [object_constants.object_workers.hack_] - The time it takes for `hack` to resolve.*//*** @description Return an object containing job durations in seconds. Takes security as the current security instead of projected security because job times resolve according to current anyway, so no need to use projected value.* @param {string} string_server_target - The target server's hostname.* @returns {DurationsJob} The job durations object.*/const object_get_time_jobs = (string_server_target) => ({[object_constants.object_workers.weaken_]: float_get_time_weaken({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),[object_constants.object_workers.grow_]: float_get_time_grow({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),[object_constants.object_workers.hack_]: float_get_time_hack({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),});/*** @description A hacking schedule array.* @typedef {JobHacking[]} ArrayScheduleHacking*//*** @description Returns the time that a job in a hacking schedule will finish.* @param {Object} object_arguments - Contains the arguments for the function.* @param {ArrayScheduleHacking} object_arguments.array_schedule - The hacking schedule.* @param {DurationsJob} object_arguments.object_time_jobs - The job durations object.* @returns {number} The time the job will finish.*/const float_get_time_job_finishes_seconds = ({array_schedule: s,object_time_jobs: t,}) => {if (0 === s.length)return Math.max(t[object_constants.object_workers.weaken_],t[object_constants.object_workers.grow_],t[object_constants.object_workers.hack_]);{const object_job_last = s[s.length - 1];return (object_job_last.float_delay_seconds + t[object_job_last.string_script]);}};/*** @description A useable server object.* @typedef {Object} ObjectServerUsed* @property {string} string_server - The server's name.* @property {number} float_ram_used - The amount of the server's RAM in use.* @see "nicoty.lib.ram.script.js"*//*** @description An array of useable server objects.* @typedef {ObjectServerUsed[]} ArrayServersUsed*//*** @description Returns a job object, aka a hacking schedule item.* @param {Object} object_arguments - Contains the arguments for the function.* @param {ServerTarget} object_arguments.object_server_target - The target server object.* @param {DurationsJob} [object_arguments.object_time_jobs] - The job durations object.* @param {ArrayServersUsed} object_arguments.array_servers_used - Contains useable server objects.* @param {ArrayScheduleHacking} object_arguments.array_schedule - The hacking schedule.* @param {number} object_arguments.float_padding_seconds - The duration of padding between each job in seconds.* @param {number} object_arguments.float_precision - The precision used for the percentage to steal calculation.* @param {number} object_arguments.float_steal_cap - The maximum percentage to steal of the target server's available cash per hack.* @returns {JobHacking} The job object.*/const object_get_job = ({object_server_target: n,object_time_jobs: t = object_get_time_jobs(object_server_target.string_server),array_servers_used: u,array_schedule: s,float_padding_seconds: d,float_precision: p,float_steal_cap: m,}) => {const object_server_used = object_get_server_ram_free_biggest({object_netscript: object_netscript,array_servers_used: u,}),string_script = string_get_job(n),string_server_target = n.string_server,float_ram_free_server_used = float_get_server_ram_free({object_netscript: object_netscript,string_server: object_server_used.string_server,float_server_ram_used: object_server_used.float_ram_used,}),float_security_before_server_target = n.float_security,float_cash_current_server_target = n.float_cash,object_job = {string_script: string_script,string_server_used: object_server_used.string_server,string_server_target: string_server_target,integer_threads: integer_get_threads({float_ram_free: float_ram_free_server_used,string_script: string_script,string_server: string_server_target,float_security: float_security_before_server_target,float_cash: float_cash_current_server_target,float_percentage_to_steal: float_get_percentage_to_steal({float_ram_free_server_used: float_ram_free_server_used,string_server_target: string_server_target,float_cash_server_target: float_cash_current_server_target,float_security_server_target: float_security_before_server_target,float_precision: p,float_steal_cap: m,}),}),float_delay_seconds:float_get_time_job_finishes_seconds({array_schedule: s,object_time_jobs: t,}) -t[string_script] +d,// This is the target server's security before this job's effects are applied.float_security_before_server_target: float_security_before_server_target,};// Simulate the effects of the job on the server to get the security after, which is needed to determine if we need to remove any jobs in the schedule later on.return object_get_updated({object_original: object_job,object_properties_new: {float_security_after_server_target: object_get_server_target_job_applied({object_server_target: n,object_job: object_job,}).float_security,},});};/*** @description Takes an older and newer useable server arrays and merges the newer objects onto a clone of the old array.* @param {Object} object_arguments - Contains the arguments for the function.* @param {ArrayServersUsed} object_arguments.array_servers_used_old - The older array.* @param {ArrayServersUsed} object_arguments.array_servers_used_new - The newer array.* @returns {ArrayServersUsed} The result of merging the arrays.*/const array_get_servers_used_merged = ({array_servers_used_old: o,array_servers_used_new: n,}) =>n.reduce((array_servers_merged, object_server_current) =>array_servers_merged.some((object_server) =>object_server.string_server === object_server_current.string_server)? array_servers_merged: array_servers_merged.concat(object_server_current),clone(o));/*** @description A hacking schedule object.* @typedef {Object} ObjectScheduleHacking* @property {ServerTarget} object_server_target - The target server object.* @property {ArrayScheduleHacking} array_schedule - The hacking schedule array.* @property {ArrayServersUsed} array_servers_used - The array of useable servers.*//*** @description Returns a hacking schedule object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.integer_job_cap - The maximum number of jobs per schedule.* @param {number} object_arguments.float_precision - The precision used for the percentage to steal calculation.* @param {number} object_arguments.float_steal_cap - The maximum percentage to steal of the target server's available cash per hack.* @param {number} object_arguments.float_padding_seconds - The duration of padding between each job in seconds.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {ObjectScheduleHacking} object_arguments.object_schedule_hacking_previous - The previous hacking schedule object.* @returns {ObjectScheduleHacking} The hacking schedule object.*/const object_get_schedule_hacking = ({integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,string_server_target: n,object_schedule_hacking_previous: o = {array_schedule: [],},}) => {const object_server_target_new = object_get_server_target(n),array_servers_used_new = array_make_servers({object_netscript: object_netscript,array_method_get_servers: array_get_servers_useable,object_method_make_server: object_get_server_used,}),array_servers_used_merged =o.array_schedule.length > 0? array_get_servers_used_merged({array_servers_used_old: o.array_servers_used,array_servers_used_new: array_servers_used_new,}): array_servers_used_new,object_state = any_while({any_state:o.array_schedule.length > 0? {object_time_jobs: object_get_time_jobs(n),object_server_target:o.object_server_target.string_server == n? o.object_server_target: object_server_target_new,object_server_target_last_security_minimum:o.object_server_target.string_server == n? o.object_server_target: object_server_target_new,float_security_minimum_server_target: object_netscript.getServerMinSecurityLevel(n),array_schedule: [],array_servers_used:array_servers_used_new.length > o.array_servers_used.length? array_servers_used_merged: o.array_servers_used,array_servers_used_last_security_minimum:array_servers_used_new.length > o.array_servers_used.length? array_servers_used_merged: o.array_servers_used,integer_last_seen_job_index_with_security_minimum: -1,integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,}: {object_time_jobs: object_get_time_jobs(n),object_server_target: object_server_target_new,object_server_target_last_security_minimum: object_server_target_new,float_security_minimum_server_target: object_netscript.getServerMinSecurityLevel(n),array_schedule: [],array_servers_used: array_servers_used_new,array_servers_used_last_security_minimum: array_servers_used_new,integer_last_seen_job_index_with_security_minimum: -1,integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,},boolean_condition: (object_state) => {const object_server_ram_free_biggest = object_get_server_ram_free_biggest({object_netscript: object_netscript,array_servers_used: object_state.array_servers_used,});return (object_state.array_schedule.length < object_state.integer_job_cap &&boolean_can_run_job({object_netscript: object_netscript,float_ram_free: float_get_server_ram_free({object_netscript: object_netscript,string_server: object_server_ram_free_biggest.string_server,float_server_ram_used:object_server_ram_free_biggest.float_ram_used,}),string_script: string_get_job(object_state.object_server_target),integer_threads: 1,}));},any_function: (object_state) => {const object_job = object_get_job({object_server_target: object_state.object_server_target,object_time_jobs: object_state.object_time_jobs,array_servers_used: object_state.array_servers_used,array_schedule: object_state.array_schedule,float_padding_seconds: object_state.float_padding_seconds,float_precision: object_state.float_precision,float_steal_cap: object_state.float_steal_cap,}),object_server_target = object_get_server_target_job_applied({object_server_target: object_state.object_server_target,object_job: object_job,}),array_servers_used = array_get_servers_used_updated({object_netscript: object_netscript,array_servers_used: object_state.array_servers_used,object_job: object_job,});return object_job.float_security_after_server_target ===object_state.float_security_minimum_server_target? object_get_updated({object_original: object_state,object_properties_new: {integer_last_seen_job_index_with_security_minimum:object_state.array_schedule.length,array_schedule: object_state.array_schedule.concat(object_job),object_server_target: object_server_target,object_server_target_last_security_minimum: object_server_target,array_servers_used: array_servers_used,array_servers_used_last_security_minimum: array_servers_used,},}): object_get_updated({object_original: object_state,object_properties_new: {integer_last_seen_job_index_with_security_minimum:object_state.integer_last_seen_job_index_with_security_minimum,array_schedule: object_state.array_schedule.concat(object_job),object_server_target: object_server_target,array_servers_used: array_servers_used,},});},});// Return a schedule with jobs near the end that prevent it from achieving minimum security removed so the target server has minimum security when the schedule finishes. If no jobs achieve minimum security, return the original schedule.return object_state.integer_last_seen_job_index_with_security_minimum > 0? {object_server_target:object_state.object_server_target_last_security_minimum,array_schedule: object_state.array_schedule.slice(0,object_state.integer_last_seen_job_index_with_security_minimum + 1),array_servers_used:object_state.array_servers_used_last_security_minimum,}: {object_server_target: object_state.object_server_target,array_schedule: object_state.array_schedule,array_servers_used: object_state.array_servers_used,};};const void_main = async () => {// Wait for scripts to die.for (;boolean_array_scripts_any_running([object_constants.object_workers.weaken_,object_constants.object_workers.grow_,object_constants.object_workers.hack_,]);) {await object_netscript.sleep(1e4);}// Start schedule generation and execution.const object_document = parent["document"];let integer_time_start = Date.now(),object_schedule = {array_schedule: [],};for (;;) {// Select a target server if there isn't one.const string_server_target ="" === object_document.nicoty_hacker_string_server_target_manual? string_or_null_get_server_hackable_score_best({boolean_method_score_correction:object_document.nicoty_hacker_boolean_method_score_correction,float_multiplier_factor_skill:object_document.nicoty_hacker_float_multiplier_factor_skill,float_multiplier_factor_max_cash:object_document.nicoty_hacker_float_multiplier_factor_max_cash,float_multiplier_factor_growth:object_document.nicoty_hacker_float_multiplier_factor_growth,}): object_document.nicoty_hacker_string_server_target_manual;// Tell the cyclic weaken script what the target server is.object_document.nicoty_hacker_string_server_target_actual = string_server_target;// If this isn't the first iteration of the loop, sleep for the duration of paddings of the previous schedule.if (0 < object_schedule.array_schedule.length) {await object_netscript.sleep(object_schedule.array_schedule.length *object_document.nicoty_hacker_float_padding -integer_time_start +Date.now());}integer_time_start = Date.now();object_schedule = object_get_schedule_hacking({integer_job_cap: object_document.nicoty_hacker_integer_job_cap,float_precision: object_document.nicoty_hacker_float_precision,float_steal_cap: object_document.nicoty_hacker_float_steal_cap,float_padding_seconds:object_document.nicoty_hacker_float_padding / 1e3,string_server_target: string_server_target,object_schedule_hacking_previous: object_schedule,});0 < object_schedule.array_schedule.length? object_schedule.array_schedule.forEach((object_job, integer_index) => {boolean_copy_script_to({object_netscript: object_netscript,scripts: object_job.string_script,string_server_destination: object_job.string_server_used,});integer_exec({object_netscript: object_netscript,string_script: object_job.string_script,string_server: object_job.string_server_used,integer_threads: object_job.integer_threads,array_arguments: [object_job.string_server_target,1e3 * object_job.float_delay_seconds - Date.now(),integer_index,],});}): await object_netscript.sleep(object_document.nicoty_hacker_float_padding);}};await void_main();};
/*** @description nicoty.sbin.hack.js - 1.8GB - Waits for the time specified, then hacks the specified server.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait.* @param {number} object_netscript.args.1 - The server to target.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {await object_netscript.sleep(Date.now() + object_netscript.args[1]),await object_netscript.hack(object_netscript.args[0]);};
/*** @description nicoty.sbin.grow.js - 1.85GB - Waits for the time specified, then grows the specified server.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait.* @param {number} object_netscript.args.1 - The server to target.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {await object_netscript.sleep(Date.now() + object_netscript.args[1]),await object_netscript.grow(object_netscript.args[0]);};
/*** @description nicoty.sbin.botnet.js - 2.2GB - Opens ports and nukes any unrooted servers if the player's hacking level is high enough to do so and the appropriate number of exploits are present.* @license BlueOak-1.0.0*/import {array_get_servers_nonrooted,} from "nicoty.lib.root.js";/*** @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.*/export const main = async (object_netscript) => {constfloat_period = object_netscript.args[0],array_exploits = [object_netscript.brutessh,object_netscript.ftpcrack,object_netscript.relaysmtp,object_netscript.httpworm,object_netscript.sqlinject];for (;;)array_get_servers_nonrooted(object_netscript).forEach((string_server) => {array_exploits.forEach((function_exploit) => {try {function_exploit(string_server);} catch (object_exception) {}});try {object_netscript.nuke(string_server);} catch (object_exception) {}}),await object_netscript.sleep(float_period);};
/*** @description nicoty.sbin.4s.tix.api.js - 4.1GB - Perpetually tries to buy 4S Market data TIX API access until it's already owned.* @param {Object} object_netscript - The Netscript environment.* @param {any[]} object_netscript.args - Contains arguments passed to the script.* @param {number} object_netscript.args.0 - The duration to wait per iteration of the script's main loop in milliseconds.* @license BlueOak-1.0.0*/export const main = async (object_netscript) => {const boolean_has_4s_api = () => {try {return object_netscript.purchase4SMarketDataTixApi();} catch (object_exception) {return false;}};const void_main = async () => {const float_period = object_netscript.args[0];for (;!boolean_has_4s_api();) await object_netscript.sleep(float_period);};await void_main();};
/*** @description nicoty.lib.time.js - 6.25GB* @license BlueOak-1.0.0*//*** @description Returns an object containing the player's current statuses.* @param {Object} object_netscript - The Netscript environment.* @returns {Object} Contains the player's current statuses.*/const object_get_stats = (object_netscript) => {try {// Comment out the following line to save ~0.5 GB RAM.return object_netscript.getStats();throw new Error("WARNING: Uncommented the call to `getStats`.");}catch (object_exception) {object_netscript.print(`${JSON.stringify(object_exception)}\nUsing default values instead.`);/*** @description Default statuses.* @see {@link https://github.com/danielyxie/bitburner/blob/master/src/Constants.js|GitHub}*/return {hacking: object_netscript.getHackingLevel(),strength: 1,defense: 1,dexterity: 1,agility: 1,charisma: 1,intelligence: 1};}};/*** @description Returns time it takes to complete a hack on a server, in seconds. Adapted from the {@link `calculateHackingTime`} function from {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|Bitburner's source code}.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - Hostname of target server.* @param {number} object_arguments.float_server_security - The target server's security.* @param {number} [object_arguments.float_skill_hacking] - Optional hacking level for the calculation. Defaults to player's current hacking level.* @param {number} [object_arguments.float_intelligence] - Optional intelligence level for the calculation. Defaults to player's current intelligence if the player has Source-File 4 or is in BitNode-4, otherwise defaults to `1`.* @see {@link `calculateHackingTime`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|GitHub}.*/export const float_get_time_hack = ({object_netscript: n,string_server: r,float_server_security: c,float_skill_hacking: h,float_intelligence: i,}) => {const object_stats = object_get_stats(n),Player = {hacking_skill: object_stats.hacking,intelligence: object_stats.intelligence,hacking_speed_mult: n.getHackingMultipliers().speed,};function calculateHackingTime(server, float_hack, int) {const difficultyMult = server.requiredHackingSkill * server.hackDifficulty;const baseDiff = 500;const baseSkill = 50;const diffFactor = 2.5;const intFactor = 0.1;if (float_hack == null) {float_hack = Player.hacking_skill;}if (int == null) {int = Player.intelligence;}var skillFactor = (diffFactor * difficultyMult + baseDiff);// tslint:disable-next-lineskillFactor /= (float_hack + baseSkill + (intFactor * int));const hackTimeMultiplier = 5;const hackingTime = hackTimeMultiplier * skillFactor / Player.hacking_speed_mult;return hackingTime;}return calculateHackingTime({requiredHackingSkill: n.getServerRequiredHackingLevel(r),hackDifficulty: c,},h,i);};/*** @description Returns time it takes to complete a grow operation on a server, in seconds. Adapted from the {@link `calculateGrowTime`} function from {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|Bitburner's source code}.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - Hostname of target server.* @param {number} object_arguments.float_server_security - The target server's security.* @param {number} [object_arguments.float_skill_hacking] - Optional hacking level for the calculation. Defaults to player's current hacking level.* @param {number} [object_arguments.float_intelligence] - Optional intelligence level for the calculation. Defaults to player's current intelligence if the player has Source-File 4 or is in BitNode-4, otherwise defaults to `1`.* @see {@link `calculateGrowTime`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|GitHub}.*/export const float_get_time_grow = ({object_netscript: n,string_server: r,float_server_security: c,float_skill_hacking: h,float_intelligence: i,}) => {const calculateHackingTime = (r, h, i) => float_get_time_hack({object_netscript: n,string_server: r,float_server_security: c,float_skill_hacking: h,float_intelligence: i,});function calculateGrowTime(server, float_hack, int) {const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2return growTimeMultiplier * calculateHackingTime(server, float_hack, int);}return calculateGrowTime(r, h, i);};/*** @description Returns time it takes to complete a weaken operation on a server, in seconds. Adapted from the {@link `calculateWeakenTime`} function from {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|Bitburner's source code}.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - Hostname of target server.* @param {number} object_arguments.float_server_security - The target server's security.* @param {number} [object_arguments.float_skill_hacking] - Optional hacking level for the calculation. Defaults to player's current hacking level.* @param {number} [object_arguments.float_intelligence] - Optional intelligence level for the calculation. Defaults to player's current intelligence if the player has Source-File 4 or is in BitNode-4, otherwise defaults to `1`.* @see {@link `calculateWeakenTime`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|GitHub}.*/export const float_get_time_weaken = ({object_netscript: n,string_server: r,float_server_security: c,float_skill_hacking: h,float_intelligence: i,}) => {const calculateHackingTime = (r, h, i) => float_get_time_hack({object_netscript: n,string_server: r,float_server_security: c,float_skill_hacking: h,float_intelligence: i,});function calculateWeakenTime(server, float_hack, int) {const weakenTimeMultiplier = 4; // Relative to hacking timereturn weakenTimeMultiplier * calculateHackingTime(server, float_hack, int);}return calculateWeakenTime(r, h, i);};
/*** @description nicoty.lib.servers.js - 1.85GB* @license BlueOak-1.0.0*/import { array_get_strings_matching_regexes } from "nicoty.lib.no.netscript.js";/*** @description Returns an array of the names of all discoverable servers in the game.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string[]} [object_arguments.array_found] - Optional array containing found servers.* @param {string[]} [object_arguments.array_visited] - Optional array containing visited servers.* @returns {string[]} Contains the names of all discoverable servers in the game.* @todo Return any errors?*/export const array_get_servers = ({object_netscript: n,array_found: f = [n.getHostname()],array_visited: v = [],}) => {const object_document = parent["document"];if (Array.isArray(object_document.nicoty_array_servers) &&object_document.nicoty_array_servers.length > 0) {return object_document.nicoty_array_servers;} else {const array_found_new = f// Find new servers.flatMap((string_found) => n.scan(string_found))// Remove duplicates. The following check assumes that none of the results of the current search are any of the nodes in the parent array..reduce((array_accumulator, string_found_new) =>-1 === v.indexOf(string_found_new) &&-1 === array_accumulator.indexOf(string_found_new)? array_accumulator.concat(string_found_new): array_accumulator,// Use an empty array as initial value for the callback function to coerce `array_accumulator` to be an array.[]);if (0 === array_found_new.length) {// No new servers found, cache and return the array.object_document.nicoty_array_servers = v.concat(f);return object_document.nicoty_array_servers;}// New servers found, keep recursing.return array_get_servers({object_netscript: n,array_found: array_found_new,array_visited: v.concat(f),});}};/*** @description If the provided array is empty, returns an array containing all discoverable servers in the game, otherwise, returns an array containing server names that matches some or all of an array of regular expression objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_regexes - Contains regular expression objects that server names will be checked against.* @param {boolean} object_arguments.boolean_all - Whether or not server names should match all or only some of the regular expressions.* @returns {string[]} If the provided array was empty, contains all discoverable servers in the game, otherwise contains server names that matches some or all of an array of regular expression objects.* @see {@link `updateMoneyGainRate`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacknet/HacknetNode.ts|GitHub}.*/export const array_get_servers_matching_regexes = ({object_netscript: n,array_regexes: r = [],boolean_all: a = !1,}) =>r.length === 0? array_get_servers({ object_netscript: n }): array_get_strings_matching_regexes({array_strings: array_get_servers({ object_netscript: n }),array_regexes: r,boolean_all: a,});
/*** @description nicoty.lib.score.js - 2.25GB* @license BlueOak-1.0.0*/import {array_get_servers_rooted,} from "nicoty.lib.root.js";/*** @description Returns the average of an array of numbers.* @param {number[]} n - The array of numbers to calculate the average of.* @returns {number} The average.*/const float_get_mean = (n) =>n.reduce((float_accumulator, float_current) =>float_accumulator + float_current) / n.length;/*** @description Returns the variance of an array of numbers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number[]} object_arguments.array_numbers - The array of numbers to calculate the variance of.* @param {number} [object_arguments.float_mean] - Optional mean of the numbers.* @returns {number} The variance.*/const float_get_variance = ({array_numbers: n,float_mean: m = float_get_mean(n),}) =>n.reduce((float_accumulator, float_current) =>float_accumulator +Math.pow(float_current - m, 2)) / n.length;/*** @description Returns the standard deviation of an array of numbers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number[]} object_arguments.array_numbers - The array of numbers to calculate the standard deviation of.* @param {number} [object_arguments.float_mean] - Optional mean of the numbers.* @returns {number} The standard deviation.*/const float_get_standard_deviation = ({array_numbers: n,float_mean: m = float_get_mean(n),}) => Math.sqrt(float_get_variance({ array_numbers: n, float_mean: m }));// Score correction methods./*** @description Returns the standardised version of a number.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_original - The number to correct.* @param {number[]} object_arguments.array_numbers - The array of numbers that the number to correct is a part of.* @returns {number} The standardised number.*/const float_get_standard_score = ({ float_original: o, array_numbers: n }) => {const float_mean = float_get_mean(n);return ((o - float_mean) /float_get_standard_deviation({array_numbers: n,float_mean: float_mean,}));};/*** @description Returns the range of an array of numbers.* @param {number[]} array_numbers - The array of numbers to calculate the range of.* @returns {number} The range.*/const float_get_range = (array_numbers) => {let float_minimum,float_maximum;return (array_numbers.forEach((float_number) => {float_number < float_minimum? (float_minimum = float_number): float_number > float_maximum &&(float_maximum = float_number);}),float_maximum - float_minimum);};/*** @description Returns the mean-normalised version of a number.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_original - The number to correct.* @param {number[]} object_arguments.array_numbers - The array of numbers that the number to correct is a part of.* @returns {number} The mean-normalised number.*/const float_get_mean_normalised_score = ({float_original: o,array_numbers: n,}) => (o - float_get_mean(n)) / float_get_range(n);/*** @description Returns an array of scores of a trait of the servers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string[]} object_arguments.array_servers - An array of server names.* @param {function} object_arguments.float_get_trait_score - Function to use to get a score for a trait of the servers.* @returns {number[]} Contains the trait scores of the servers.*/const array_get_servers_trait = ({object_netscript: n,array_servers: s,float_get_trait_score: f,}) =>s.map((string_server) =>f({object_netscript: n,string_server: string_server,}));/*** @description Gives a score for how well you will be able to hack a server (how much cash you can take per hack, how long it takes and your chances of hacking it successfully) given your current hacking level and its required hacking level. Adapted from {@link `calculateHackingChance`}, {@link `calculatePercentMoneyHacked`}, and {@link `calculateHackingTime`} in {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|Bitburner's source code}.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to calculate a "skill against" score for.* @returns {number} The server's "skill against" score.* @see {@link `calculateHackingChance`}, {@link `calculatePercentMoneyHacked`}, and {@link `calculateHackingTime`} in {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js|Bitburner's source code}.*/const float_get_skill_against = ({ object_netscript: n, string_server: s }) => {const float_skill_hack = n.getHackingLevel();return (float_skill_hack - n.getServerRequiredHackingLevel(s)) / float_skill_hack;};/*** @description Returns the maximum amount of money that can be available on a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to determine the maximum possible money of.* @returns {number} The maximum amount of money that can be available on a server.*/const float_get_server_cash_max = ({ object_netscript: n, string_server: s }) => n.getServerMaxMoney(s);/*** @description Returns the server's instrinsic "growth parameter". This growth parameter is a numberbetween 1 and 100 that represents how quickly the server's money grows. This parameter affects thepercentage by which the server's money is increased when using the `grow()` Netscript function. A highergrowth parameter will result in a higher percentage increase from `grow()`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to determine the growth parameter of.* @returns {number} The server's growth parameter.*/const float_get_server_growth = ({ object_netscript: n, string_server: s }) => n.getServerGrowth(s);/*** @description Returns an array of server names of servers that are suitable for hacking; i.e., they are rooted, have required hacking levels <= player's current hacking level, growth parameters > 0 and maximum available money > 0.* @param {Object} object_netscript - The Netscript environment.* @returns {string[]} Contains names of servers that are suitable for hacking.*/export const array_get_servers_hackable = (object_netscript) =>array_get_servers_rooted(object_netscript).filter((string_server) =>object_netscript.getHackingLevel() >= object_netscript.getServerRequiredHackingLevel(string_server) &&object_netscript.getServerMaxMoney(string_server) > 0 &&object_netscript.getServerGrowth(string_server) > 0);/*** @description Returns the corrected score for a server's trait.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to calculate the trait of.* @param {function} object_arguments.float_get_trait_score - Function to use to get a score for a trait of the servers.* @param {function} object_arguments.function_score_correction - Function to use to correct the score.* @returns {number[]} Contains the trait scores of the servers.*/const float_get_score_factor = ({object_netscript: n,string_server: s,float_get_trait_score: t,function_score_correction: c,}) =>c({float_original: t({ object_netscript: n, string_server: s }),array_numbers: array_get_servers_trait({object_netscript: n,array_servers: array_get_servers_hackable(n),float_get_trait_score: t,}),});/*** @description Returns the score of a server which is calculated by taking into account its maximum available cash, its growth rate and your skill against it as factors which are corrected and summed.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to calculate the score of.* @param {string} [object_arguments.boolean_method_score_correction] - Whether to use standardised or mean-normalised score corrections. If `true`, uses mean-normalisation, otherwise uses standardisation. Defaults to `false`.* @param {number} [object_arguments.float_multiplier_factor_skill] - Optional muliplier for the "skill against" score factor of the server. Defaults to 1.* @param {number} [object_arguments.float_multiplier_factor_max_cash] - Optional muliplier for the "max cash" score factor of the server. Defaults to 1.* @param {number} [object_arguments.float_multiplier_factor_growth] - Optional muliplier for the "growth" score factor of the server. Defaults to 1.* @returns {number} The aggregated, corrected score.*/export const float_get_server_score = ({object_netscript: n,string_server: s,boolean_method_score_correction: b = !1,// Can adjust the weights of the factors. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect.function_adjust_factor_skill: a = (x) => x * 1,function_adjust_factor_max_cash: m = (x) => x * 1,function_adjust_factor_growth: g = (x) => x * 1,}) => {const function_score_correction = b ? float_get_mean_normalised_score : float_get_standard_score;return (a(float_get_score_factor({object_netscript: n,string_server: s,float_get_trait_score: float_get_skill_against,function_score_correction: function_score_correction,})) +m(float_get_score_factor({object_netscript: n,string_server: s,float_get_trait_score: float_get_server_cash_max,function_score_correction: function_score_correction,})) +g(float_get_score_factor({object_netscript: n,string_server: s,float_get_trait_score: float_get_server_growth,function_score_correction: function_score_correction,})));};
/*** @description nicoty.lib.root.js - 1.9GB* @license BlueOak-1.0.0*/import {array_get_servers,}from "nicoty.lib.servers.js";/*** @description Returns an array of the names of all discoverable rooted servers in the game.* @param {Object} object_netscript - The Netscript environment.* @returns {string[]} Contains the names of all discoverable rooted servers in the game.* @todo Return any errors?*/export const array_get_servers_rooted = (object_netscript) =>array_get_servers({ object_netscript: object_netscript }).filter((string_server) =>object_netscript.hasRootAccess(string_server));/*** @description Returns an array of the names of all discoverable non-rooted servers in the game.* @param {Object} object_netscript - The Netscript environment.* @returns {string[]} Contains the names of all discoverable non-rooted servers in the game.* @todo Return any errors?*/export const array_get_servers_nonrooted = (object_netscript) =>array_get_servers({ object_netscript: object_netscript }).filter((string_server) =>!object_netscript.hasRootAccess(string_server));
/*** @description nicoty.lib.ram.server.js - 2GB* @license BlueOak-1.0.0*/import {array_get_servers_rooted,}from "nicoty.lib.root.js";/*** @description Returns the total RAM of a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to get the total RAM of.* @returns {number} The server's total RAM.*/export const float_get_server_ram_total = ({object_netscript: n,string_server: s,}) => n.getServerRam(s)[0];/*** @description Returns the used RAM of a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to get the used RAM of.* @returns {number} The server's used RAM.*/export const float_get_server_ram_used = ({object_netscript: n,string_server: s,}) => n.getServerRam(s)[1];/*** @description Returns the available RAM of a server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server to get the available RAM of.* @param {number} [object_arguments.float_server_ram_used] - Optional used RAM of the server. Defaults to the current used RAM.* @returns {number} The server's available RAM.*/export const float_get_server_ram_free = ({object_netscript: n,string_server: s,float_server_ram_used: u = float_get_server_ram_used({ object_netscript: n, string_server: s }),}) =>float_get_server_ram_total({ object_netscript: n, string_server: s }) - u;/*** @description Returns an object containing a server object and its free RAM.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object} object_arguments.object_server - The server object.* @returns {Object} Contains a server object and its free RAM.*/const object_get_server_and_ram_free = ({object_netscript: n,object_server: s,}) => ({object_server: s,float_ram_free: float_get_server_ram_free({object_netscript: n,string_server: s.string_server,float_server_ram_used: s.float_ram_used,})});/*** @description Returns the server object with the most free RAM from an array of server objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_servers_used - Array of useable server objects.* @returns {Object|null} The copy of the useable server object with the most free RAM.*/export const object_get_server_ram_free_biggest = ({object_netscript: n,array_servers_used: a,}) =>a.reduce((object_server_and_ram_free_biggest, object_server) => {const object_server_and_ram_free = object_get_server_and_ram_free({object_netscript: n,object_server: object_server,});return object_server_and_ram_free.float_ram_free > object_server_and_ram_free_biggest.float_ram_free? object_server_and_ram_free: object_server_and_ram_free_biggest},{object_server: null,float_ram_free: -Infinity,}).object_server;/*** @description Returns the total RAM trait from all the servers you have root access to.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {function} object_arguments.float_get_ram_trait - The function to use to get the RAM trait of a server.* @returns {number} The total RAM trait from all the rooted servers.*/export const float_get_network_ram_trait = ({object_netscript: n,float_get_ram_trait: f,}) =>array_get_servers_rooted(n).reduce((float_accumulator, string_current) =>float_accumulator +f({object_netscript: n,string_server: string_current,}),0);/*** @description Returns the RAM utilisation of the botnet as a fraction.* @param {Object} object_netscript - The Netscript environment.* @returns {number} The RAM utilisation of the botnet as a fraction.*/export const float_get_network_ram_utilisation = (object_netscript) =>float_get_network_ram_trait({object_netscript: object_netscript,float_get_ram_trait: float_get_server_ram_used,}) /float_get_network_ram_trait({object_netscript: object_netscript,float_get_ram_trait: float_get_server_ram_total,});/*** @description Returns an array of names of rooted servers that have total RAM > 0.* @param {Object} object_netscript - The Netscript environment.* @returns {string[]} Contains the names of rooted servers that have total RAM > 0.*/export const array_get_servers_useable = (object_netscript) =>array_get_servers_rooted(object_netscript).filter((string_server) =>float_get_server_ram_total({object_netscript: object_netscript,string_server: string_server}) > 0);
/*** @description nicoty.lib.ram.script.js - 4GB* @license BlueOak-1.0.0* @todo: Check if any exports are not actually being used by external scripts.*/import {array_make_servers,clamp,object_get_updated,clone,any_while,} from "nicoty.lib.no.netscript.js";import {float_get_server_ram_free,float_get_server_ram_total,float_get_server_ram_used,float_get_network_ram_trait,array_get_servers_useable,object_get_server_ram_free_biggest,} from "nicoty.lib.ram.server.js";/*** @description A useable server object.* @typedef {Object} ObjectServerUsed* @property {string} string_server - The server's name.* @property {number} float_ram_used - The amount of the server's RAM in use.*//*** @description Returns a new useable server object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The hostname of the server.* @returns {ObjectServerUsed} The new useable server object.*/export const object_get_server_used = ({ object_netscript: n, string_server: s }) => ({string_server: s,float_ram_used: float_get_server_ram_used({ object_netscript: n, string_server: s }),});/*** @description Returns `true` if the available RAM is sufficient to run the specified amount of threads of a script, otherwise returns `false.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {number} object_arguments.float_ram_free - The amount of RAM available.* @param {string} object_arguments.string_script - The script to run.* @param {number} object_arguments.integer_threads - The number of threads to run.* @returns {boolean} `true` if the available RAM is sufficient to run the specified amount of threads of the script, otherwise `false`.*/export const boolean_can_run_job = ({object_netscript: n,float_ram_free: f,string_script: s,integer_threads: t,}) => f >= n.getScriptRam(s) * t;/*** @description Returns the maximum amount of threads of a script that can be ran by a useable server object.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object} object_arguments.object_server_used - The useable server object.* @param {Object} object_arguments.object_server_used.string_server - The hostname of the useable server.* @param {Object} object_arguments.object_server_used.float_ram_used - The used RAM value of the server.* @param {string} object_arguments.string_script - The script to run.* @returns {boolean} The maximum amount of threads of a script that can be ran by the useable server object.*/const integer_get_threads_max = ({object_netscript: n,object_server_used: u,string_script: s,}) => Math.floor(float_get_server_ram_free({object_netscript: n,string_server: u.string_server,float_server_ram_used: u.float_ram_used,}) / n.getScriptRam(s));/*** @description Takes a useable server object and returns a new one based on the original, but with an updated used RAM value after simulating it running a job object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object} object_arguments.object_job The job object to simulate for the useable server object.* @param {number} object_arguments.object_job.string_script - The script value of the job object, representing the name of the script to execute.* @param {number} object_arguments.object_job.integer_threads - The threads value of the job object, representing the number of threads to run of the script.* @param {Object} object_arguments.object_server_used - The original useable server object.* @param {Object} object_arguments.object_server_used.float_ram_used - The amount of RAM of the server that's already used.* @returns {Object} The new stock object with values updated after selling some shares.*/const object_get_server_used_job_applied = ({object_netscript: n,object_job: j,object_server_used: s,}) =>object_get_updated({object_original: s,object_properties_new: {float_ram_used:s.float_ram_used + j.integer_threads * n.getScriptRam(j.string_script),},});/*** @description Returns a new array of useable server state objects after simulating a change based on a schedule item on to an older array of useable server state objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_servers_used - The array of server objects to simulate the changes on.* @param {Object} object_arguments.object_job - The job to apply on the server objects.* @returns {Object[]} The new array based on the original after simulating the changes.*/export const array_get_servers_used_updated = ({object_netscript: n,array_servers_used: a,object_job: j,}) =>a.map((s) =>s.string_server === j.string_server_used? object_get_server_used_job_applied({object_netscript: n,object_job: j,object_server_used: s,}): clone(s));/*** @description Returns `true` if the rooted server with the biggest RAM free as enough free RAM to run at least one thread of the specified script and the number of threads to be ran is greater than 0, otherwise returns `false`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_servers_used - The array of server objects to simulate the changes on.* @param {number} object_arguments.integer_threads - The number of threads to be ran.* @param {string} object_arguments.string_script - The name of the script to run.* @returns {boolean} `true` if the rooted server with the biggest RAM free as enough free RAM to run at least one thread of the specified script and the number of threads to be ran is greater than 0, otherwise `false`.*/const boolean_conditions_array_get_schedule_script = ({object_netscript: n,array_servers_used: u,integer_threads: t,string_script: c,}) => {const object_server_ram_free_biggest = object_get_server_ram_free_biggest({object_netscript: n,array_servers_used: u,});return t > 0 &&boolean_can_run_job({object_netscript: n,float_ram_free: float_get_server_ram_free({object_netscript: n,string_server: object_server_ram_free_biggest.string_server,float_server_ram_used: object_server_ram_free_biggest.float_ram_used,}),string_script: c,integer_threads: 1,});};/*** @description Takes an older script schedule state object used for the recursive while function and returns a new one based on the original, but with updated values.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object} object_arguments.object_script - The script object.* @param {Object} object_arguments.any_output - The object type that will be returned after the final recursion.* @returns {boolean} The updated script schedule state object.*/const object_get_schedule_script_updated = ({object_netscript: n,object_script: s,any_output: o,}) => {constobject_server_ram_free_biggest = object_get_server_ram_free_biggest({object_netscript: n,array_servers_used: o.array_servers_used,}),object_job = {string_script: s.string_script,string_server_used: object_server_ram_free_biggest.string_server,integer_threads: clamp({value: o.integer_threads,lower: 1,upper: integer_get_threads_max({object_netscript: n,object_server_used: object_server_ram_free_biggest,string_script: s.string_script,}),}),array_arguments: s.array_arguments,};return {object_netscript: n,object_script: s,any_output: {integer_threads: o.integer_threads - object_job.integer_threads,array_schedule: o.array_schedule.concat(object_job),array_servers_used: array_get_servers_used_updated({object_netscript: n,array_servers_used: o.array_servers_used,object_job: object_job,}),},};};/*** @description Takes in an array of script objects and returns an array of job objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_scripts - The array of script objects to make a schedule from.* @returns {Object[]} The schedule containing the job objects.*/export const array_get_schedule_script = ({object_netscript: n,array_scripts: s,}) =>s.reduce((object_state, object_script) => {const object_server_used_ram_free_biggest = object_get_server_ram_free_biggest({object_netscript: n,array_servers_used: object_state.array_servers_used,});if (boolean_can_run_job({object_netscript: n,float_ram_free: float_get_server_ram_free({object_netscript: n,string_server: object_server_used_ram_free_biggest.string_server,float_server_ram_used: object_server_used_ram_free_biggest.float_ram_used,}),string_script: object_script.string_script,integer_threads: 1,})) {const object_schedule_script_updated = any_while({any_state: {object_netscript: n,object_script: object_script,any_output: {integer_threads:object_script.float_threads_or_fraction_botnet >= 1// Assume this many threads are required.? object_script.float_threads_or_fraction_botnet// Assume fraction of botnet's RAM is required instead.: Math.floor((float_get_network_ram_trait({object_netscript: n,float_get_ram_trait: float_get_server_ram_total,}) *object_script.float_threads_or_fraction_botnet) /n.getScriptRam(object_script.string_script)),array_schedule: object_state.array_schedule,array_servers_used: object_state.array_servers_used,},},boolean_condition: (object_state) =>boolean_conditions_array_get_schedule_script({object_netscript: object_state.object_netscript,array_servers_used: object_state.any_output.array_servers_used,integer_threads: object_state.any_output.integer_threads,string_script: object_state.object_script.string_script,}),any_function: object_get_schedule_script_updated,}).any_output;return (object_schedule_script_updated.integer_threads > 0 &&n.print(`WARNING: Failed to run the remaining ${object_schedule_script_updated.integer_threads} threads of "${object_script.string_script}". Skipped.`),{array_schedule: object_schedule_script_updated.array_schedule,array_servers_used: object_schedule_script_updated.array_servers_used,});}return (n.print(`WARNING: Unable to find a server to run "${object_script.string_script}". Skipped.`),object_state);},// Use an object as initial value for the callback function to coerce `object_state` to be an object.{array_schedule: [],array_servers_used: array_make_servers({object_netscript: n,array_method_get_servers: array_get_servers_useable,object_method_make_server: object_get_server_used}),}).array_schedule;/*** @description Copies (a) script(s) in the current server to a target server.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string|string[]} object_arguments.scripts - The script or array of scripts to copy to the target server.* @param {string} object_arguments.string_server_destination - The server to copy the script(s) to.* @returns {boolean} `true` if at least one of the scripts were copied, otherwise `false`.*/export const boolean_copy_script_to = ({object_netscript: n,scripts: s,string_server_destination: d,}) => n.scp(s, n.getHostname(), d);/*** @description Wrapper around the `exec` Netscript procedure.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_script - Filename of script to execute.* @param {string} object_arguments.string_server - IP or hostname of the ‘target server’ on which to execute the script.* @param {number} [object_arguments.integer_threads] - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.* @param {any[]} [object_arguments.array_arguments] - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument `integer_threads` must be filled in with a value.* @returns {number} PID of script if it was started successfully, otherwise `0`.*/export const integer_exec = ({object_netscript: n,string_script: c,string_server: e,integer_threads: t = 1,array_arguments: a,}) => (void 0 === a ? n.exec(c, e, t) : n.exec(c, e, t, ...a));/*** @description Runs a script schedule.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {Object[]} object_arguments.array_schedule - The script schedule containing script objects.* @todo Return whether or not scripts in the schedule were executed successfully? Maybe as an array (using `map`)?*/export const void_schedule_script_runner = ({object_netscript: n,array_schedule: s,}) => {s.forEach((object_job, integer_index) => {boolean_copy_script_to({object_netscript: n,scripts: object_job.string_script,string_server_destination: object_job.string_server_used,}),integer_exec({object_netscript: n,string_script: object_job.string_script,string_server: object_job.string_server_used,integer_threads: object_job.integer_threads,array_arguments: object_job.array_arguments.concat(integer_index),});});};/*** @description Returns `true` if a server has enough RAM to run a script with a stated number of threads, otherwise, returns `false`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {number} object_arguments.float_server_used_ram_free - The amount of RAM free that the server has.* @param {number} object_arguments.integer_threads - The amount of threads of the script to run.* @param {number} object_arguments.string_script - The name of the script to run.* @returns {boolean} `true` if a server has enough RAM to run a script with a stated number of threads, otherwise, `false`.*/export const boolean_can_server_run_script_threads = ({object_netscript: n,float_server_used_ram_free: f,integer_threads: t,string_script: c,}) => f >= t * n.getScriptRam(c);/*** @description Returns the amount of threads of the non-operative script required to make up the RAM difference between two scripts.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_script_first - The first script.* @param {string} object_arguments.string_script_second - The second script.* @param {string} object_arguments.string_nop - The non-operative script's name.* @returns {number} The amount of threads of the non-operative script required to make up the RAM difference between two scripts.*/export const integer_get_threads_nop = ({object_netscript: n,string_script_first: a,string_script_second: b,string_nop: _,}) =>Math.ceil((n.getScriptRam(a) - n.getScriptRam(b)) /n.getScriptRam(_));
/*** @description nicoty.lib.ps.js - 2.3GB.* @license BlueOak-1.0.0*/import {array_get_servers_rooted,}from "nicoty.lib.root.js";import {float_get_server_ram_total,float_get_network_ram_trait,}from "nicoty.lib.ram.server.js";/*** @description Returns the fraction of the network of rooted server's RAM used by a script.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_script - The name of the script.* @return {number} The fraction of the network of rooted server's RAM used by a script.*/export const float_get_network_ram_fraction_used_by_script = ({object_netscript: n,string_script: c,}) =>array_get_servers_rooted(n).reduce((float_ram_used_accumulator, string_server) =>float_ram_used_accumulator +n.ps(string_server).reduce((float_ram_used_accumulator, object_script) =>float_ram_used_accumulator + (object_script.filename === c? object_script.threads * n.getScriptRam(c, string_server): 0),0),0) / float_get_network_ram_trait({object_netscript: n,float_get_ram_trait: float_get_server_ram_total,});
import { _ } from "nicoty.lib.lodash.js";import { mri } from "nicoty.lib.mri.js";import { array_sort } from "nicoty.lib.mapsort.js";export { array_sort };/*** clone : a -> a** Returns a clone of a value.* @function* @template a* @param {a} value - Value to be cloned.* @returns {a} Cloned value* @function* @see {@link https://lodash.com/docs/#cloneDeep|Lodash}* @see {@link https://stackoverflow.com/a/54157459|StackOverflow}* @see {@link https://stackoverflow.com/a/53737490|StackOverflow}* @see {@link https://stackoverflow.com/a/24648941|StackOverflow}*/export const clone = value => _.cloneDeep(value);/*** @description Returns an updated object.* @param {Object} object_arguments - Contains the arguments for the function.* @template a* @param {a} object_arguments.object_original - The original object.i* @param {Object} object_arguments.object_properties_new - An object whose properties will be used to replace those of the original in the new object to be returned.* @returns {a} The updated object.* @todo Make this more functional. Maybe use `entries`, `fromEntries`, `map`, `reduce`, `any_while`.*/export const object_get_updated = ({ object_original: o, object_properties_new: n }) => {const object_update = clone(n);for (const string_property in o) {if (!object_update.hasOwnProperty(string_property)) {object_update[string_property] = clone(o[string_property]);}}return object_update;};/*** @description Returns an array of strings that match all or of the regular expression objects specified.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} object_arguments.array_strings - Contains the strings to check.* @param {Object[]} object_arguments.array_regexes - Contains regular expression objects that the strings will be checked against.* @param {boolean} object_arguments.boolean_all - Whether or not the strings should match all or some of the regular expressions.* @returns {string[]} Contains the strings that match all or some of the regular expression.*/export const array_get_strings_matching_regexes = ({array_strings: s,array_regexes: r,boolean_all: a = !1,}) =>void 0 === r? s: s.filter((string) =>a? r.map((object_regex) =>new RegExp(object_regex.string_pattern,object_regex.string_flags)).every((object_regex) =>object_regex.test(string)): r.map((object_regex) =>new RegExp(object_regex.string_pattern,object_regex.string_flags)).some((object_regex) =>object_regex.test(string)));/*** @description A unary function that returns a boolean.* @callback UnaryBoolean* @param {any} state - The state.* @returns {boolean}*//*** @description A unary function whose output is the same type as its input.* @callback UnaryGeneric* @template a* @param {a} input* @returns {a}*//*** @description Recurses while a condition is true. Not stack-safe.* @param {Object} object_arguments - Contains the arguments for the function.* @template a* @param {a} object_arguments.any_state - The state to process.* @param {UnaryBoolean} object_arguments.boolean_condition - Processes state to determine whether or not to recurse.* @param {UnaryGeneric} object_arguments.any_function - Processes state.* @returns {a} The output.* @todo Make this stack-safe by using trampoline?*/export const any_while = ({any_state: s,boolean_condition: c,any_function: f,}) =>c(s)? any_while({any_state: f(s),boolean_condition: c,any_function: f,}): s;/*** @description Runs a function a certain number of times.* @param {Object} object_arguments - Contains the arguments for the function.* @param {function} object_arguments.any_function - The function to apply on the state.* @param {Object} object_arguments.object_state - The initial state.* @param {number} object_arguments.integer_repeats - The amount of repetitions.* @param {string} object_arguments.string_property_counter - The name of the property to store the count of repetitions.* @example* const object_plus_two = (object_integer) => ({* any_output: object_integer.any_output + 2,* });** export const main = async (object_netscript) => {* object_netscript.tprint(`Output was: ${any_repeat({* object_state: { any_output: 0, },* any_function: object_plus_two,* integer_repeats: 10,* }).any_output}.`); // Output was: 20* };*/export const any_repeat = ({object_state: s,integer_repeats: r,any_function: f,string_property_counter: c = "integer_counter",}) =>any_while({any_state: s,boolean_condition: (object_state) => object_state[c] < r,any_function: (object_state) => object_get_updated({object_original: f(object_state),object_properties_new: {[c]: object_state[c] + 1,}}),});/*** @description Returns `true` if a value is a string, otherwise returns `false`.* @param {any} any_value - Value to check.* @returns `true` if input is a string, otherwise `false.* @see {@link https://lodash.com/docs/#isString|Lodash}* @see {@link https://raw.githubusercontent.com/lodash/lodash/4.0.1-npm-packages/lodash.isstring/index.js|Github}* @license MIT*/export const boolean_is_string = (any_value) =>"string" == typeof any_value ||(!Array.isArray(any_value) &&((v) => !!v && "object" == typeof v)(any_value) &&"[object String]" == Object.prototype.toString.call(any_value));/*** @description Returns an array of server objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {function} object_arguments.array_method_get_servers - The function to use to get the array of server names.* @param {function} object_arguments.object_method_make_server - The function to use to generate objects from the server names.* @returns {Object[]} The generated array of server objects.*/export const array_make_servers = ({object_netscript: n,array_method_get_servers: a,object_method_make_server: o,}) => a(n).map((string_server) => o({ object_netscript: n, string_server: string_server}));/*** @description Clamps a value within the inclusive range specified by boundary values. If the value falls within the range, returns it. Otherwise, returns the nearest value in the range.* @function* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.value The value to clamp.* @param {number} object_arguments.lower The inclusive lower bound of the range.* @param {number} object_arguments.upper The inclusive upper bound of the range.* @returns {number} The clamped value.*/export const clamp = ({value: v,lower: l,upper: u,}) => Math.max(Math.min(v, Math.max(l, u)), Math.min(l, u));/*** @description Returns a string with characters converted to their HTML equivalents.* @param {string} string - String to sanitise.* @returns {string} The sanitised string.* @see {@link https://stackoverflow.com/a/30376762|StackOverflow}*/export const string_sanitise = (string) =>string.replace(/[&<>"']/g,(s) =>({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[s]));/*** @description Parses arguments.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} object_arguments.array_arguments - Array of arguments.* @param {Object} [object_arguments.object_options] - Options set for the arguments.* @returns {Object} Object populated with the parsed arguments.* @see {@link https://github.com/lukeed/mri/blob/dda3343b92b2d96facafaa38f1e55bd1bcbaf7fc/src/index.js|GitHub}* @see {@link https://github.com/substack/minimist/|GitHub}* @see {@link https://github.com/ethanent/gar|GitHub}* @see {@link https://github.com/yargs/yargs-parser|GitHub}*/export const object_parse_arguments = ({array_arguments,object_options,}) => mri(array_arguments, object_options);
/*** @description mri - 1.6GB - Edited to remove use of anonymous export which doesn't work with Bitburner.* @license MIT* @see {@link https://github.com/lukeed/mri/blob/dda3343b92b2d96facafaa38f1e55bd1bcbaf7fc/src/index.js|GitHub}*/function toArr(any) {return any == null ? [] : Array.isArray(any) ? any : [any];}function toVal(out, key, val, opts) {var x, old=out[key], nxt=(!!~opts.string.indexOf(key) ? (val == null || val === true ? '' : String(val)): typeof val === 'boolean' ? val: !!~opts.boolean.indexOf(key) ? (val === 'false' ? false : val === 'true' || (out._.push((x = +val,x * 0 === 0) ? x : val),!!val)): (x = +val,x * 0 === 0) ? x : val);out[key] = old == null ? nxt : (Array.isArray(old) ? old.concat(nxt) : [old, nxt]);}export function mri (args, opts) {args = args || [];opts = opts || {};var k, arr, arg, name, val, out={ _:[] };var i=0, j=0, idx=0, len=args.length;const alibi = opts.alias !== void 0;const strict = opts.unknown !== void 0;const defaults = opts.default !== void 0;opts.alias = opts.alias || {};opts.string = toArr(opts.string);opts.boolean = toArr(opts.boolean);if (alibi) {for (k in opts.alias) {arr = opts.alias[k] = toArr(opts.alias[k]);for (i=0; i < arr.length; i++) {(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);}}}for (i=opts.boolean.length; i-- > 0;) {arr = opts.alias[opts.boolean[i]] || [];for (j=arr.length; j-- > 0;) opts.boolean.push(arr[j]);}for (i=opts.string.length; i-- > 0;) {arr = opts.alias[opts.string[i]] || [];for (j=arr.length; j-- > 0;) opts.string.push(arr[j]);}if (defaults) {for (k in opts.default) {name = typeof opts.default[k];arr = opts.alias[k] = opts.alias[k] || [];if (opts[name] !== void 0) {opts[name].push(k);for (i=0; i < arr.length; i++) {opts[name].push(arr[i]);}}}}const keys = strict ? Object.keys(opts.alias) : [];for (i=0; i < len; i++) {arg = args[i];if (arg === '--') {out._ = out._.concat(args.slice(++i));break;}for (j=0; j < arg.length; j++) {if (arg.charCodeAt(j) !== 45) break; // "-"}if (j === 0) {out._.push(arg);} else if (arg.substring(j, j + 3) === 'no-') {name = arg.substring(j + 3);if (strict && !~keys.indexOf(name)) {return opts.unknown(arg);}out[name] = false;} else {for (idx=j+1; idx < arg.length; idx++) {if (arg.charCodeAt(idx) === 61) break; // "="}name = arg.substring(j, idx);val = arg.substring(++idx) || (i+1 === len || (''+args[i+1]).charCodeAt(0) === 45 || args[++i]);arr = (j === 2 ? [name] : name);for (idx=0; idx < arr.length; idx++) {name = arr[idx];if (strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);toVal(out, name, (idx + 1 < arr.length) || val, opts);}}}if (defaults) {for (k in opts.default) {if (out[k] === void 0) {out[k] = opts.default[k];}}}if (alibi) {for (k in out) {arr = opts.alias[k] || [];while (arr.length > 0) {out[arr.shift()] = out[k];}}}return out;};
/*** @description mapsort - 1.6GB - Performant sorting for complex input.* @param {Object} object_arguments - Contains the arguments for the function.* @param {any[]} object_arguments.array - Array to sort.* @param {boolean} [object_arguments.boolean_ascending] - If `true`, sorts elements by ascending order. If `false`, sorts by descending order. Defaults to `true`.* @param {function} [object_arguments.function_prepare] - Optional function to use on the array's elements to get ideal versions for sorting. Defaults to converting the elements to strings.* @returns {any[]} The new sorted list.* @see {@link https://unpkg.com/mapsort@1.0.4/compiled/iife/mapsort.min.js|unpkg}* @see {@link https://github.com/Pimm/mapsort|GitHub}* @license MIT*/export const array_sort = ({array: a,boolean_ascending: b = !0,function_prepare: p = (any_element) => any_element + "",}) => {var mapSort=(function(){'use strict';function defaultCompareFunction(a,b){var c=a+"",d=b+"";return c<d?-1:c==d?0:1}var forEach=[].forEach;function mapSort(a,b,c){if("function"!=typeof b)throw new TypeError(b+" is not a function");var d,e=[],f=[],g=[];forEach.call(a,function(a,h,i){if(d=b(a,h,i),void 0===d)return void g.push(a);if(void 0===c&&"symbol"==typeof d)throw new TypeError("Can't convert symbol to string");e.push(h),f[h]=d;}),void 0===c&&(c=defaultCompareFunction),e.sort(function(a,b){return c(f[a],f[b])});var h=e.map(function(b){return a[b]}).concat(g);return h.length!=a.length&&(h.length=a.length),h}return mapSort;}());return mapSort(a,p,b? (any_first, any_second) => any_first - any_second: (any_first, any_second) => any_second - any_first);};
/*** @description nicoty.lib.ls.js - 1.8GB* @license BlueOak-1.0.0*/import {boolean_is_string,array_get_strings_matching_regexes,} from "nicoty.lib.no.netscript.js";/*** @description Returns an array of files from a named server, and whose names contain the given substring(s).* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - An instance of the `ns` object.* @param {string} object_arguments.string_server - The server on the files are located.* @param {string|string[]} object_arguments.substrings - Part(s) of the name(s) of the file(s).* @returns {string[]} The array of files, and whose names contain the provided substring(s).* @throws Will throw an error if the type of `substring` is not a `string` or an `Array`.*/export const array_get_files_with_string = ({object_netscript: n,string_server: e,substrings: s,}) => {if (boolean_is_string(s)) return n.ls(e, s);if (Array.isArray(s))return s.flatMap((string_substring) =>array_get_files_with_string({object_netscript: n,string_server: e,substrings: string_substring,}));{const t = `Invalid input "${s}" of type ${typeof s}.`;throw (n.print("ERROR: " + t), new Error(t));}};/*** @description If the provided array is empty, returns an array containing the names of all the scripts in the specified server, otherwise, returns an array of the names of files in the specified server that match any of the regular expression patterns specified.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The server on which the files are located.* @param {Object[]} object_arguments.array_regexes - Contains regular expression objects that file names will be checked against.* @param {boolean} object_arguments.boolean_all - Whether or not file names should match all or only some of the regular expressions.* @returns {string[]} If the provided array was empty, contains the names of all scripts in the specified server, otherwise, contains the names of files on the specified server that match any of the regular expression patterns specified.*/export const array_get_files_on_server_matching_regexes = ({object_netscript: n,string_server: s,array_regexes: r = [],boolean_all: a = !1,}) =>r.length === 0? n.ls(s): array_get_strings_matching_regexes({array_strings: n.ls(s),array_regexes: r,boolean_all: a,});
/*** @description lodash 4.17.5 - 1.6GB - Edited so that variables that have the same names as Netscript functions (`clear` and `exec`) don't increase static RAM usage (by using bracket notation instead of dot notation).* @see {@link https://github.com/lodash/lodash|GitHub}* @see {@link https://lodash.com/|Lodash}*//*** @license* Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE* Build: `lodash strict exports="none" iife="var _=(function(){%output%;return _;}).call(this);" include="cloneDeep,runInContext" moduleId="none"`*/;export var _=function(){function t(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function e(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&false!==e(t[r],r,t););return t}function r(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var c=t[r];e(c,r,t)&&(i[o++]=c)}return i}function n(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function o(t){return function(e){return t(e)}}function i(t,e){return function(r){return t(e(r))}}var c=1/0,a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/[\\^$.*+?()[\]{}|]/g,s=/\\(\\)?/g,b=/\w*$/,p=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,h="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=true,v["[object Arguments]"]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v["[object Function]"]=v["[object Map]"]=v["[object Number]"]=v["[object Object]"]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=false;var j={};j["[object Arguments]"]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j["[object Object]"]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=true,j["[object Error]"]=j["[object Function]"]=j["[object WeakMap]"]=false;var _,d=typeof global=="object"&&global&&global.Object===Object&&global,g=typeof self=="object"&&self&&self.Object===Object&&self,A=d||g||Function("return this")(),m=(g=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,w=m&&m.exports===g,d=w&&d.process;t:{try{_=d&&d.binding&&d.binding("util");break t}catch(t){}_=void 0}var S=_&&_.isMap,O=_&&_.isSet,z=_&&_.isTypedArray,x=function _(d){function g(){}function m(t){var e=-1,r=null==t?0:t.length;for(this["clear"]();++e<r;){var n=t[e];this.set(n[0],n[1])}}function F(t){var e=-1,r=null==t?0:t.length;for(this["clear"]();++e<r;){var n=t[e];this.set(n[0],n[1])}}function I(t){var e=-1,r=null==t?0:t.length;for(this["clear"]();++e<r;){var n=t[e];this.set(n[0],n[1])}}function U(t){this.size=(this.__data__=new F(t)).size}function M(t,e){var r=Ue(t),n=!r&&Ie(t),o=!r&&!n&&Me(t),i=!r&&!n&&!o&&De(t);if(r=r||n||o||i){for(var n=t.length,c=Pt,a=-1,u=Array(n);++a<n;)u[a]=c(a);n=u}else n=[];var f,c=n.length;for(f in t)!e&&!Lt.call(t,f)||r&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||ft(f,c))||n.push(f);return n}function k(t,e,r){var n=t[e];Lt.call(t,e)&&vt(n,r)&&(void 0!==r||e in t)||P(t,e,r)}function E(t,e){for(var r=t.length;r--;)if(vt(t[r][0],e))return r;return-1}function D(t,e){return t&&Y(e,Ot(e),t)}function B(t,e){return t&&Y(e,zt(e),t)}function P(t,e,r){"__proto__"==e&&re?re(t,e,{configurable:true,enumerable:true,value:r,writable:true}):t[e]=r}function $(t,r,n,o,i,c){var a,u=1&r,f=2&r,l=4&r;if(n&&(a=i?n(t,o,i,c):n(t)),void 0!==a)return a;if(!gt(t))return t;if(o=Ue(t)){if(a=it(t),!u)return X(t,a)}else{var s=ze(t),b="[object Function]"==s||"[object GeneratorFunction]"==s;if(Me(t))return K(t,u);if("[object Object]"==s||"[object Arguments]"==s||b&&!i){if(a=f||b?{}:ct(t),!u)return f?tt(t,B(a,t)):Z(t,D(a,t))}else{if(!j[s])return i?t:{};a=at(t,s,u)}}if(c||(c=new U),i=c.get(t))return i;if(c.set(t,a),Ee(t))return t.forEach(function(e){a.add($(e,r,n,e,t,c))}),a;if(ke(t))return t.forEach(function(e,o){a.set(o,$(e,r,n,o,t,c))}),a;var f=l?f?rt:et:f?zt:Ot,p=o?void 0:f(t);return e(p||t,function(e,o){p&&(o=e,e=t[o]),k(a,o,$(e,r,n,o,t,c))}),a}function C(t,e,r,o,i){var c=-1,a=t.length;for(r||(r=ut),i||(i=[]);++c<a;){var u=t[c];0<e&&r(u)?1<e?C(u,e-1,r,o,i):n(i,u):o||(i[i.length]=u)}return i}function T(t,e,r){return e=e(t),Ue(t)?e:n(e,r(t))}function V(t){if(null==t)return void 0===t?"[object Undefined]":"[object Null]";if(ee&&ee in Dt(t)){var e=Lt.call(t,ee),r=t[ee];try{t[ee]=void 0;var n=true}catch(t){}var o=Nt.call(t);n&&(e?t[ee]=r:delete t[ee]),t=o}else t=Nt.call(t);return t}function R(t){return At(t)&&"[object Arguments]"==V(t)}function L(t){return At(t)&&"[object Map]"==ze(t)}function W(t){return At(t)&&"[object Set]"==ze(t)}function N(t){return At(t)&&dt(t.length)&&!!v[V(t)]}function G(t,e){return q(t,e,function(e,r){return St(t,r)})}function q(t,e,r){for(var n=-1,o=e.length,i={};++n<o;){var c,a=e[n];c=t;for(var u=a,u=J(u,c),f=0,l=u.length;null!=c&&f<l;)c=c[bt(u[f++])];if(c=f&&f==l?c:void 0,r(c,a)){var s=i,a=J(a,t);if(gt(s))for(a=J(a,s),u=-1,f=a.length,l=f-1;null!=s&&++u<f;){var b=bt(a[u]),p=c;if(u!=l){var y=s[b],p=void 0;void 0===p&&(p=gt(y)?y:ft(a[u+1])?[]:{})}k(s,b,p),s=s[b]}}}return i}function H(t){if(typeof t=="string")return t;if(Ue(t)){for(var e=H,r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o+""}return mt(t)?Ae?Ae.call(t):"":(e=t+"","0"==e&&1/t==-c?"-0":e)}function J(t,e){if(Ue(t))return t;var r;return Ue(t)?r=false:(r=typeof t,r=!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!mt(t))||(u.test(t)||!a.test(t)||null!=e&&t in Dt(e))),r?[t]:Fe(wt(t))}function K(t,e){if(e)return t.slice();var r=t.length,r=Kt?Kt(r):new t.constructor(r);return t.copy(r),r}function Q(t){var e=new t.constructor(t.byteLength);return new Jt(e).set(new Jt(t)),e}function X(t,e){var r=-1,n=t.length;for(e||(e=Mt(n));++r<n;)e[r]=t[r];return e}function Y(t,e,r,n){var o=!r;r||(r={});for(var i=-1,c=e.length;++i<c;){var a=e[i],u=n?n(r[a],t[a],a,r,t):void 0;void 0===u&&(u=t[a]),o?P(r,a,u):k(r,a,u)}return r}function Z(t,e){return Y(t,Se(t),e)}function tt(t,e){return Y(t,Oe(t),e);}function et(t){return T(t,Ot,Se)}function rt(t){return T(t,zt,Oe)}function nt(t,e){var r=t.__data__,n=typeof e;return("string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?r[typeof e=="string"?"string":"hash"]:r.map}function ot(t,e){var r,n=null==t?void 0:t[e];return r=!(!gt(n)||Wt&&Wt in n)&&(_t(n)?Gt:p).test(pt(n)),r?n:void 0}function it(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Lt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function ct(t){return typeof t.constructor!="function"||lt(t)?{}:me(Qt(t))}function at(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return Q(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return e=r?Q(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return e=r?Q(t.buffer):t.buffer,new t.constructor(e,t.byteOffset,t.length);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return e=new t.constructor(t.source,b["exec"](t)),e.lastIndex=t.lastIndex,e;case"[object Set]":return new n;case"[object Symbol]":return ge?Dt(ge.call(t)):{}}}function ut(t){return Ue(t)||Ie(t)||!!(te&&t&&t[te])}function ft(t,e){var r=typeof t;return e=null==e?9007199254740991:e,!!e&&("number"==r||"symbol"!=r&&y.test(t))&&-1<t&&0==t%1&&t<e}function lt(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||Tt)}function st(e,r,n){return r=ce(void 0===r?e.length-1:r,0),function(){for(var o=arguments,i=-1,c=ce(o.length-r,0),a=Mt(c);++i<c;)a[i]=o[r+i];for(i=-1,c=Mt(r+1);++i<r;)c[i]=o[i];return c[r]=n(a),t(e,this,c)}}function bt(t){if(typeof t=="string"||mt(t))return t;var e=t+"";return"0"==e&&1/t==-c?"-0":e}function pt(t){if(null!=t){try{return Rt.call(t)}catch(t){}return t+""}return""}function yt(t){return(null==t?0:t.length)?C(t,1):[]}function ht(t,e){if(typeof t!="function"||null!=e&&typeof e!="function")throw new $t("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;return i.has(o)?i.get(o):(n=t.apply(this,n),r.cache=i.set(o,n)||i,n)};return r.cache=new(ht.Cache||I),r}function vt(t,e){return t===e||t!==t&&e!==e}function jt(t){return null!=t&&dt(t.length)&&!_t(t)}function _t(t){return!!gt(t)&&(t=V(t),"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t);}function dt(t){return typeof t=="number"&&-1<t&&0==t%1&&9007199254740991>=t}function gt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function At(t){return null!=t&&typeof t=="object"}function mt(t){return typeof t=="symbol"||At(t)&&"[object Symbol]"==V(t)}function wt(t){return null==t?"":H(t)}function St(t,e){var r;if(r=null!=t){r=t;var n;n=J(e,r);for(var o=-1,i=n.length,c=false;++o<i;){var a=bt(n[o]);if(!(c=null!=r&&null!=r&&a in Dt(r)))break;r=r[a]}c||++o!=i?r=c:(i=null==r?0:r.length,r=!!i&&dt(i)&&ft(a,i)&&(Ue(r)||Ie(r)))}return r}function Ot(t){if(jt(t))t=M(t);else if(lt(t)){var e,r=[];for(e in Dt(t))Lt.call(t,e)&&"constructor"!=e&&r.push(e);t=r}else t=ie(t);return t}function zt(t){if(jt(t))t=M(t,true);else if(gt(t)){var e,r=lt(t),n=[];for(e in t)("constructor"!=e||!r&&Lt.call(t,e))&&n.push(e);t=n}else{if(e=[],null!=t)for(r in Dt(t))e.push(r);t=e}return t}function xt(t){return function(){return t}}function Ft(t){return t}function It(){return[]}function Ut(){return false}d=null==d?A:x.defaults(A.Object(),d,x.pick(A,h));var Mt=d.Array,kt=d.Date,Et=d.Math,Dt=d.Object,Bt=d.RegExp,Pt=d.String,$t=d.TypeError,Ct=Mt.prototype,Tt=Dt.prototype,Vt=d["__core-js_shared__"],Rt=d.Function.prototype.toString,Lt=Tt.hasOwnProperty,Wt=function(){var t=/[^.]+$/["exec"](Vt&&Vt.keys&&Vt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Nt=Tt.toString;Rt.call(Dt);var Gt=Bt("^"+Rt.call(Lt).replace(l,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=w?d.Buffer:void 0,Ht=d.Symbol,Jt=d.Uint8Array,Kt=qt?qt.allocUnsafe:void 0,Qt=i(Dt.getPrototypeOf,Dt),Xt=Dt.create,Yt=Tt.propertyIsEnumerable,Zt=Ct.splice,te=Ht?Ht.isConcatSpreadable:void 0,ee=Ht?Ht.toStringTag:void 0,re=function(){try{var t=ot(Dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ne=Dt.getOwnPropertySymbols,oe=qt?qt.isBuffer:void 0,ie=i(Dt.keys,Dt),ce=Et.max,ae=kt.now,ue=ot(d,"DataView"),fe=ot(d,"Map"),le=ot(d,"Promise"),se=ot(d,"Set"),be=ot(d,"WeakMap"),pe=ot(Dt,"create"),ye=pt(ue),he=pt(fe),ve=pt(le),je=pt(se),_e=pt(be),de=Ht?Ht.prototype:void 0,ge=de?de.valueOf:void 0,Ae=de?de.toString:void 0,me=function(){function t(){}return function(e){return gt(e)?Xt?Xt(e):(t.prototype=e,e=new t,t.prototype=void 0,e):{}}}();m.prototype["clear"]=function(){this.__data__=pe?pe(null):{},this.size=0},m.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t],this.size-=t?1:0,t},m.prototype.get=function(t){var e=this.__data__;return pe?(t=e[t],"__lodash_hash_undefined__"===t?void 0:t):Lt.call(e,t)?e[t]:void 0},m.prototype.has=function(t){var e=this.__data__;return pe?void 0!==e[t]:Lt.call(e,t)},m.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pe&&void 0===e?"__lodash_hash_undefined__":e,this},F.prototype["clear"]=function(){this.__data__=[],this.size=0},F.prototype.delete=function(t){var e=this.__data__;return t=E(e,t),!(0>t)&&(t==e.length-1?e.pop():Zt.call(e,t,1),--this.size,true)},F.prototype.get=function(t){var e=this.__data__;return t=E(e,t),0>t?void 0:e[t][1]},F.prototype.has=function(t){return-1<E(this.__data__,t)},F.prototype.set=function(t,e){var r=this.__data__,n=E(r,t);return 0>n?(++this.size,r.push([t,e])):r[n][1]=e,this},I.prototype["clear"]=function(){this.size=0,this.__data__={hash:new m,map:new(fe||F),string:new m}},I.prototype.delete=function(t){return t=nt(this,t).delete(t),this.size-=t?1:0,t},I.prototype.get=function(t){return nt(this,t).get(t)},I.prototype.has=function(t){return nt(this,t).has(t)},I.prototype.set=function(t,e){var r=nt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},U.prototype["clear"]=function(){this.__data__=new F,this.size=0},U.prototype.delete=function(t){var e=this.__data__;return t=e.delete(t),this.size=e.size,t},U.prototype.get=function(t){return this.__data__.get(t)},U.prototype.has=function(t){return this.__data__.has(t)},U.prototype.set=function(t,e){var r=this.__data__;if(r instanceof F){var n=r.__data__;if(!fe||199>n.length)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new I(n)}return r.set(t,e),this.size=r.size,this};var we=re?function(t,e){return re(t,"toString",{configurable:true,enumerable:false,value:xt(e),writable:true})}:Ft,Se=ne?function(t){return null==t?[]:(t=Dt(t),r(ne(t),function(e){return Yt.call(t,e)}))}:It,Oe=ne?function(t){for(var e=[];t;)n(e,Se(t)),t=Qt(t);return e}:It,ze=V;(ue&&"[object DataView]"!=ze(new ue(new ArrayBuffer(1)))||fe&&"[object Map]"!=ze(new fe)||le&&"[object Promise]"!=ze(le.resolve())||se&&"[object Set]"!=ze(new se)||be&&"[object WeakMap]"!=ze(new be))&&(ze=function(t){var e=V(t);if(t=(t="[object Object]"==e?t.constructor:void 0)?pt(t):"")switch(t){case ye:return"[object DataView]";case he:return"[object Map]";case ve:return"[object Promise]";case je:return"[object Set]";case _e:return"[object WeakMap]";}return e});var xe=function(t){var e=0,r=0;return function(){var n=ae(),o=16-(n-r);if(r=n,0<o){if(800<=++e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(we),Fe=function(t){t=ht(t,function(t){return 500===e.size&&e["clear"](),t});var e=t.cache;return t}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(f,function(t,r,n,o){e.push(n?o.replace(s,"$1"):r||t)}),e});ht.Cache=I;var Ie=R(function(){return arguments}())?R:function(t){return At(t)&&Lt.call(t,"callee")&&!Yt.call(t,"callee");},Ue=Mt.isArray,Me=oe||Ut,ke=S?o(S):L,Ee=O?o(O):W,De=z?o(z):N,Be=function(t,e){return xe(st(t,e,Ft),t+"")}(function(t,e){t=Dt(t);var r,n=-1,o=e.length,i=2<o?e[2]:void 0;if(r=i){r=e[0];var c=e[1];if(gt(i)){var a=typeof c;r=!!("number"==a?jt(i)&&ft(c,i.length):"string"==a&&c in i)&&vt(i[c],r)}else r=false}for(r&&(o=1);++n<o;)for(i=e[n],r=zt(i),c=-1,a=r.length;++c<a;){var u=r[c],f=t[u];(void 0===f||vt(f,Tt[u])&&!Lt.call(t,u))&&(t[u]=i[u])}return t}),Pe=function(t){return xe(st(t,void 0,yt),t+"")}(function(t,e){return null==t?{}:G(t,e)});return g.constant=xt,g.defaults=Be,g.flatten=yt,g.keys=Ot,g.keysIn=zt,g.memoize=ht,g.pick=Pe,g.cloneDeep=function(t){return $(t,5)},g.eq=vt,g.hasIn=St,g.identity=Ft,g.isArguments=Ie,g.isArray=Ue,g.isArrayLike=jt,g.isBuffer=Me,g.isFunction=_t,g.isLength=dt,g.isMap=ke,g.isObject=gt,g.isObjectLike=At,g.isSet=Ee,g.isSymbol=mt,g.isTypedArray=De,g.stubArray=It,g.stubFalse=Ut,g.runInContext=_,g.toString=wt,g.VERSION="4.17.5",g}();return x}.call(this);
/*** @description nicoty.lib.kill.js - 2.3GB.* @license BlueOak-1.0.0*//*** @description Kills running instances of the named script on a named server.* @param {Object} object_arguments - Contains the arguments for the procedure.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {string} object_arguments.string_server - The name of the server which contains the script to be killed.* @param {string} object_arguments.string_script - The name of the script to be killed.* @todo Return whether or not `kill` succeeded. Maybe as an array (using `map`)?*/export const void_kill_script_named_server_named = ({object_netscript: n,string_server: s,string_script: c,}) =>n.ps(s).forEach((object_script) =>object_script.filename === c && n.kill(object_script.filename, s, ...object_script.args));
let docum = {};let wind = {};let docheight = 0;let guiheight = 0;let pcalcmay = 0;let xpos = 0;let ypos = 0;export let maxRows = 8;export let gui = {};export let genericStyle = { position: "absolute", zIndex: 11, backgroundColor: "#f1f1f1", border: "2px solid var(--my-highlight-color)",textAlign: "center", width: "350px" };export let headerStyle = { cursor: "move", zIndex: 12, backgroundColor: "#222", color: "#e6e6e6",display: "flex", flexDirection: "row", height: "30px" };export let optionsStyle = { boxSizing: "border-box", backgroundColor: "#555", color: "#faffdf", height: "26px",lineHeight: "24px", boxShadow: "inset 0 0em 0 0.1em rgba(0,0,0,0.20)", cursor: "pointer" };export async function initialize(ns, htmldoc, htmlwin) {docum = htmldoc;wind = htmlwin;const game = docum.getElementById("entire-game-container");game.appendChild(newElement("div", "extraGUI", genericStyle));gui = docum.getElementById("extraGUI");const headerContainer = newElement("div", "extraGUIcontainer1", headerStyle);headerContainer.appendChild(newElement("div", "extraGUIheader", { flex: 0.9, marginTop: "5px", borderBottom: "2px solid var(--my-highlight-color)",lineHeight: "normal" }, "Movable Command Center"));headerContainer.appendChild(newElement("div", "extraGUIclose", { lineHeight: "30px", flex: 0.1, borderLeft: "2px solid var(--my-highlight-color)",borderBottom: "2px solid var(--my-highlight-color)", cursor: "pointer" }, "X"));gui.appendChild(headerContainer);const headerClose = docum.getElementById("extraGUIclose");headerClose.onclick = (e) => closeGUI(e, ns);dragElement();calcHeight();}function calcHeight() {docheight = docum.documentElement.scrollHeight;guiheight = parseInt(gui.clientHeight, 10);pcalcmay = docheight - guiheight - 4;}export function verifyHeight() {if (parseInt(gui.clientHeight, 10) > guiheight&& pcalcmay < parseInt(gui.style.top, 10) + parseInt(gui.clientHeight, 10) + 4) {gui.style.top = (docheight - parseInt(gui.clientHeight, 10) - 4) + "px";}calcHeight();}export function stopBubble(e) {e.stopImmediatePropagation();}export function clearMenu() {while (gui.childElementCount > 1) {gui.removeChild(gui.lastChild);}}export function newElement(elem, id, genstyle, text = "") {const element = docum.createElement(elem);element.setAttribute("id", id);setStyle(element, genstyle);if (text.length !== 0) {addTextElement(element, text);}return element;}export function modElementText(elem, text) {const element = docum.getElementById(elem);if (element !== null) {element.textContent = text;}}export function appendElement(elem1, elem2) {const element = docum.getElementById(elem1);if (element !== null) {element.appendChild(elem2);verifyHeight();}}export function addTextElement(elem, text) {const elementText = docum.createTextNode(text);elem.appendChild(elementText);}export function addNewLine(elem) {const br = docum.createElement("br");elem.appendChild(br);}export function closeGUI(e, ns) {docum.getElementById("entire-game-container").removeChild(docum.getElementById("extraGUI"));ns.exit();}export function setPos(x, y) {setStyle(gui, { top: x + "px", left: y + "px" });}function dragElement() {let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0, pmax = parseInt(gui.parentNode.offsetWidth, 10) - parseInt(gui.style.width, 10);if (docum.getElementById(gui.id + "header")) {docum.getElementById(gui.id + "header").onmousedown = dragMouseDown;}else {gui.onmousedown = dragMouseDown;}function dragMouseDown(e) {e = e || wind.event;e.preventDefault();pos3 = e.clientX;pos4 = e.clientY;docum.onmouseup = closeDragElement;docum.onmousemove = elementDrag;}function elementDrag(e) {e = e || wind.event;e.preventDefault();pos1 = pos3 - e.clientX;pos2 = pos4 - e.clientY;pos3 = e.clientX;pos4 = e.clientY;if (pmax < gui.offsetLeft - pos1) {pos1 = gui.offsetLeft - pmax;}else if (0 > gui.offsetLeft - pos1) {pos1 = gui.offsetLeft;}if (pcalcmay < gui.offsetTop - pos2) {pos2 = gui.offsetTop - pcalcmay;}else if (0 > gui.offsetTop - pos2) {pos2 = gui.offsetTop;}gui.style.top = (gui.offsetTop - pos2) + "px";gui.style.left = (gui.offsetLeft - pos1) + "px";}function closeDragElement() {docum.onmouseup = null;docum.onmousemove = null;}}export function setStyle(elem, style) {for (const name in style) {if (style.hasOwnProperty(name)) {elem.style[name] = style[name];}}}export function mergeStyles(style1, style2, style3) {const styles1 = [];const styles2 = [];const styles3 = [];for (const name in style1) {if (style1.hasOwnProperty(name)) {styles1.push(name);}}for (const name in style2) {if (style2.hasOwnProperty(name)) {styles2.push(name);}}if (style3 != null) {for (const name in style3) {if (style3.hasOwnProperty(name)) {styles3.push(name);}}}for (let i = 0; i < styles1.length; i++) {if (styles2.includes(styles1[i])) {styles1.splice(i, 1);i--;}if (style3 != null) {if (styles3.includes(styles1[i])) {styles1.splice(i, 1);i--;}}}const mergedstyle = {};for (const name of styles1) {mergedstyle[name] = style1[name];}for (const name of styles2) {mergedstyle[name] = style2[name];}if (style3 != null) {for (const name of styles3) {mergedstyle[name] = style3[name];}}return mergedstyle;}export function SetMaxRows(num) {maxRows = num;}export function SetGenericStyle(style) {genericStyle = style;}export function SetHeaderStyle(style) {headerStyle = style;}export function SetOptionsStyle(style) {optionsStyle = style;}export function CreateContainer(str, num, doc) {const obj = { str, num, doc, CurrentElementId, CurrentElement, PrevElement, NextElement };return obj;}function CurrentElementId() {return this.str + this.num;}function CurrentElement() {return this.doc.getElementById(this.str + this.num);}function NextElement() {this.num++;}function PrevElement() {this.num--;}//# sourceMappingURL=GUIFramework.js.map
/*** @description nicoty.lib.cp.js - 2.65GB* @license BlueOak-1.0.0*/import {array_get_servers,} from "nicoty.lib.servers.js";import {array_get_files_on_server_matching_regexes,array_get_files_with_string,} from "nicoty.lib.ls.js";/*** @description Copies files to all servers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_netscript - The Netscript environment.* @param {number} object_arguments.string_substrings - (Parts of) the names of the files to copy.*/export const void_copy_files = ({object_netscript: n,string_substrings: s,}) => {const string_server_source = n.getHostname(),array_files = array_get_files_with_string({object_netscript: n,string_server: string_server_source,substrings: s,});array_get_servers({object_netscript: n,}).forEach((string_server_destination) =>n.scp(array_files,string_server_source,string_server_destination));};/*** @description Copies (a) file(s) from the specidied server to the current server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string|string[]} object_arguments.files_to_copy - The file or array of files to copy.* @param {string} object_arguments.string_server_source - The name of the server from which to copy the file(s).* @param {boolean} object_arguments.boolean_silent - Whether or not to print any messages to the terminal.*/const void_copy_to_current = ({object_netscript: n,files_to_copy: c,string_server_source: s,boolean_silent: b,}) => {if (b)try {n.scp(c, s, n.getHostname()),n.tprint(`Copied "${JSON.stringify(c)}" located in the server "${s}".`);} catch (object_exception) {n.tprint(`${object_exception}\nAttempted to copy "${JSON.stringify(c)}" located in the server "${s}".`);}elsetry {n.scp(c, s, n.getHostname());} catch (object_exception) {}};/*** @description Copies any files that match any of the specified regular expressions from all servers to the current server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} object_arguments.array_patterns - Contains the regular expression patterns to match.* @param {boolean} object_arguments.boolean_silent - Whether or not to print any messages to the terminal.*/export const void_copy_matched_to_current = ({object_netscript: n,array_patterns: p,boolean_silent: b,}) => {array_get_servers({ object_netscript: n }).forEach((string_server) => {const array_files = array_get_files_on_server_matching_regexes({object_netscript: n,string_server: string_server,array_regexes: p.map((string_pattern) =>({string_pattern: string_pattern,string_flags: "i",})),boolean_all: !1,});array_files.length > 0 &&void_copy_to_current({files_to_copy: array_files,string_server_source: string_server,boolean_silent: b,});});};
/*** @description nicoty.bin.start.stock.scripts.js - 8.9GB - Runs scripts related to hacking servers.* @license BlueOak-1.0.0* @todo Determine if the GUI is already running (main/hacker may have already started it?)* @todo Determine if there's enough RAM in the network to run both the trader and GUI (if the latter isn't already running). Do we make the GUI runnable manually as well?*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import { float_get_server_ram_free } from "nicoty.lib.ram.server.js";import {array_get_schedule_script,void_schedule_script_runner,integer_exec,boolean_can_server_run_script_threads,integer_get_threads_nop,} from "nicoty.lib.ram.script.js";import { void_kill_script_named_server_named } from "nicoty.lib.kill.js";import { void_copy_files } from "nicoty.lib.cp.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {number} object_defaults.float_period_seconds - Time period used for checking the time in seconds.* @property {boolean} object_defaults.boolean_print_help - Whether or not to display help and exit.* @property {number} object_defaults.float_investment_capital - The default fraction of total assets to potentially be used for investing in the market.* @property {number} object_defaults.integer_prices_average_length - The default maximum length of the stock objects' average price array used for calculating the short range average.* @property {Object} object_helpers - Contains the names of helper scripts.* @property {Object} object_argument_names - Contains argument names.* @property {string[]} array_identifier_files_required - Contains identifiers for files that are required to be in all servers.* @property {string} string_property_trade - The property name used for the global property that indicates whether or not trading should occur.*/const object_constants = {object_defaults: {float_period_seconds: 10,boolean_print_help: !1,float_investment_capital: 1,integer_prices_average_length: 10,boolean_trade: !0,},object_helpers: {string_nop: "nicoty.sbin.nop.js",string_4s_tix_api: "nicoty.sbin.4s.tix.api.js",string_stock_trader: "nicoty.sbin.stock.trader.js",},object_argument_names: {investment_capital: { short: "c", long: "investment-capital" },help: { short: "h", long: "help" },trade: { short: "n", long: "trade" },delay: {short: "d",long: "delay",},prices_average_length: { short: "r", long: "range" },},array_identifier_files_required: ["nicoty.lib."],object_document: parent["document"],object_storage: parent["window"].localStorage,string_prefix: "nicoty_stocks_",get string_property_investment_capital() {return this.string_prefix + "float_investment_capital";},get string_property_prices_average_length() {return this.string_prefix + "integer_prices_average_length";},get string_property_trade() {return this.string_prefix + "boolean_trade";},get string_property_sell_profitable() {return this.string_prefix + "boolean_sell_profitable";},get string_property_sell_asap() {return this.string_prefix + "boolean_sell_asap";},};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names,object_helpers = object_constants.object_helpers;object_netscript.tprint(string_sanitise(`DESCRIPTIONStarts stock-trading related scripts. Requires TIX API access.USAGErun ${object_netscript.getScriptName()} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.trade.short}, --no-${object_argument_names.trade.long}Prevents the "${object_helpers.string_stock_trader}" script from trading right after it's spawned.OPTIONS-${object_argument_names.investment_capital.short}, --${object_argument_names.investment_capital.long} <FRACTION>FRACTION = The fraction of your total cash (invested + not invested in the stock market) that can be used to invest in the stock market. Should be a floating point number > 0 <= 1. Defaults to ${object_defaults.float_investment_capital}.-${object_argument_names.delay.short}, --${object_argument_names.delay.long} <SECONDS>SECONDS = The duration of delay between each repeat of the helper scripts' main loops, in seconds. Should be a floating-point number > 0. Defaults to ${object_defaults.float_period_seconds}.-${object_argument_names.prices_average_length.short}, --${object_argument_names.prices_average_length.long} <RANGE>RANGE = The length of the stock objects' average price array used to calculate the short range simple moving average of the stock's average price growth. Should be an integer >= 1. Defaults to ${object_defaults.integer_prices_average_length}.`));};const void_main = async () => {// variablesconst object_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names,object_helpers = object_constants.object_helpers,// Threads of the non-operative script required to reserve enough RAM to run the stock trading script.integer_threads_nop = integer_get_threads_nop({object_netscript: object_netscript,string_script_first: object_helpers.string_stock_trader,string_script_second: object_netscript.getScriptName(),string_nop: object_constants.object_helpers.string_nop,});// If this server doesn't have enough RAM to run the stock trading script, eject.if (!boolean_can_server_run_script_threads({object_netscript: object_netscript,float_server_used_ram_free: float_get_server_ram_free({object_netscript: object_netscript,string_server: object_netscript.getHostname(),}),integer_threads: integer_threads_nop,string_script: object_helpers.string_nop,})) {const string_message_error = `This server has insufficient RAM to run "${object_helpers.string_nop}" with "${integer_threads_nop}" thread(s).`;throw ((object_netscript.tprint(`ERROR: ${string_message_error}`),new Error(string_message_error)));}let float_investment_capital = object_defaults.float_investment_capital,integer_prices_average_length =object_defaults.integer_prices_average_length,float_period_seconds = object_defaults.float_period_seconds,boolean_print_help = object_defaults.boolean_print_help,boolean_trade = object_defaults.boolean_trade;// Parse argumentsconst object_arguments = object_parse_arguments({array_arguments: object_netscript.args,});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.investment_capital.short:// fall-throughcase object_argument_names.investment_capital.long:float_investment_capital = argument_value;break;case object_argument_names.prices_average_length.short:// fall-throughcase object_argument_names.prices_average_length.long:integer_prices_average_length = argument_value;break;case object_argument_names.trade.short:boolean_trade = !argument_value;break;case object_argument_names.trade.long:boolean_trade = argument_value;break;case object_argument_names.delay.short:// fall-throughcase object_argument_names.delay.long:float_period_seconds = argument_value;break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw ((object_netscript.tprint(`ERROR: ${string_message_error}`),new Error(string_message_error)));}}const array_helpers = [{string_script: object_helpers.string_4s_tix_api,float_threads_or_fraction_botnet: 1,array_arguments: [1e3 * float_period_seconds],},];// Mainif (boolean_print_help) return void_print_help();try {object_netscript.getStockSymbols();} catch (object_exception) {return object_netscript.tprint("ERROR: Unable to access TIX API! Did you forget to buy access?");}object_constants.object_document[object_constants.string_property_trade] = boolean_trade;object_constants.object_document[object_constants.string_property_sell_profitable] = !1;object_constants.object_document[object_constants.string_property_sell_asap] = !1;object_constants.object_document[object_constants.string_property_investment_capital] = float_investment_capital;object_constants.object_document[object_constants.string_property_prices_average_length] = integer_prices_average_length;// Copy library files to all servers.void_copy_files({object_netscript: object_netscript,string_substrings: object_constants.array_identifier_files_required,});// Reserve enough RAM for the stock-trading script.integer_exec({object_netscript: object_netscript,string_script: object_helpers.string_nop,string_server: object_netscript.getHostname(),integer_threads: integer_threads_nop,});void_schedule_script_runner({object_netscript: object_netscript,array_schedule: array_get_schedule_script({object_netscript: object_netscript,array_scripts: array_helpers,}),});// Kill the non-operative scripts to free RAM.void_kill_script_named_server_named({object_netscript: object_netscript,string_server: object_netscript.getHostname(),string_script: object_helpers.string_nop,});object_netscript.spawn(object_helpers.string_stock_trader, 1);};await void_main();};
/*** @description nicoty.bin.rm.js - 3.05GB - Removes files.* @license BlueOak-1.0.0*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import {array_get_servers_matching_regexes,} from "nicoty.lib.servers.js";import {array_get_files_on_server_matching_regexes,} from "nicoty.lib.ls.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {boolean} object_defaults.boolean_some - Whether or not all regular expressions should be matched.* @property {Object} object_argument_names - Contains argument names.*/const object_constants = {object_defaults: {boolean_all: !1},object_argument_names: {file_regex: {short: "f",long: "file"},server_regex: {short: "e",long: "server"},help: {short: "h",long: "help"},all: {short: "a",long: "all"},},};/*** @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_argument_names = object_constants.object_argument_names,string_script = object_netscript.getScriptName();object_netscript.tprint(string_sanitise(`DESCRIPTIONRemoves all removable files (which excludes currently running scripts, including this one).Optionally, removes only files whose names match a given regular expression.Optionally, removes only files on servers whose names match a given regular expression.Optionally, removes only files whose names match a given regular expression on servers whose names match a given regular expression.USAGErun ${string_script} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.all.short}, --${object_argument_names.all.long}Whether or not only all or only some regular expressions should be matched. By default, only some regular expressions will be matched, unless this flag is set.OPTIONS-${object_argument_names.server_regex.short}, --${object_argument_names.server_regex.long} <REGEX>REGEX = Regular expression used for server names.-${object_argument_names.file_regex.short}, --${object_argument_names.file_regex.long} <REGEX>REGEX = Regular expression used for filenames.EXAMPLESrun ${string_script} -${object_argument_names.all.short} -${object_argument_names.server_regex.short} ^((?!home).)*$ -${object_argument_names.file_regex.short} ^((?!cct).)*$ -${object_argument_names.file_regex.short} ^((?!exe).)*$ -${object_argument_names.file_regex.short} ^((?!lit).)*$ -${object_argument_names.file_regex.short} ^((?!msg).)*$ -${object_argument_names.file_regex.short} ^((?!txt).)*$Removes all files from all servers, except for those in servers that have "home" in their name, and are files that have "cct", "exe", "lit", "msg" or "txt" in their name.`));};/*** @description Tries to remove any files that match any of the specified regular expressions from any servers that match any of the specified regular expressions.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} object_arguments.array_regexes_server - Contains the regular expression patterns that the servers should match.* @param {string[]} object_arguments.array_regexes_files - Contains the regular expression patterns that the files should match.* @param {boolean} [object_arguments.boolean_some] - Whether or not only some or all of the regular expressions should be matched.*/const void_remove = ({array_regexes_server: s,array_regexes_file: f,boolean_some: a = object_constants.object_defaults.boolean_all,}) =>array_get_servers_matching_regexes({object_netscript: object_netscript,array_regexes: s.map((string_regex) =>({string_pattern: string_regex,string_flags: "i",})),boolean_all: a,}).forEach((string_server) =>array_get_files_on_server_matching_regexes({object_netscript: object_netscript,string_server: string_server,array_regexes: f.map((string_regex) =>({string_pattern: string_regex,string_flags: "i",})),boolean_all: a,}).forEach((string_file) =>object_netscript.rm(string_file, string_server) ||object_netscript.tprint(`WARNING: Unable to remove file "${string_file}" from server "${string_server}".`)));const void_main = async () => {// variableslet boolean_some = object_constants.object_defaults.boolean_all,boolean_print_help = !1;const array_regexes_server = [],array_regexes_file = [],object_arguments = object_parse_arguments({ array_arguments: object_netscript.args }),object_argument_names = object_constants.object_argument_names;// argument parsingfor (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.all.short:// fall-throughcase object_argument_names.all.long:boolean_some = argument_value;break;case object_argument_names.server_regex.short:// fall-throughcase object_argument_names.server_regex.long:"object" == typeof argument_value? array_regexes_server.push(...argument_value): array_regexes_server.push(argument_value);break;case object_argument_names.file_regex.short:// fall-throughcase object_argument_names.file_regex.long:"object" == typeof argument_value? array_regexes_file.push(...argument_value): array_regexes_file.push(argument_value);break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: \"${string_argument}\".`;object_netscript.tprint(`ERROR: ${string_message_error}`);throw new Error(string_message_error);}}if (boolean_print_help)return void_print_help(object_netscript);void_remove({array_regexes_server: array_regexes_server,array_regexes_file: array_regexes_file,boolean_some: boolean_some,});};await void_main();};
/*** @description nicoty.bin.main.js - 6.9GB - Runs scripts related to hacking servers.* @license BlueOak-1.0.0* @todo Add a way to choose which programs to buy.* @todo Separate logic that requires source files so that they are only ran when you have the required source file - need a cheap way to check if you have source file?* @todo Add a way to determine and notify if an unrecognised argument was passed.* @todo Figure out a better way for this to run "nicoty.bin.hacker.js".* @todo Maybe make a cache script that saves runtime constants like max money of servers to a cache file to potentially reduce RAM usage further.*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import { float_get_server_ram_free } from "nicoty.lib.ram.server.js";import {array_get_schedule_script,void_schedule_script_runner,integer_exec,boolean_can_server_run_script_threads,integer_get_threads_nop,} from "nicoty.lib.ram.script.js";import { void_kill_script_named_server_named } from "nicoty.lib.kill.js";import { void_copy_files } from "nicoty.lib.cp.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {number} object_defaults.float_period_seconds - Time period used for checking the time in seconds.* @property {number} object_defaults.float_padding_seconds - Duration between each job used to prevent collisions between them to keep them in sequence.* @property {number} object_defaults.integer_job_cap - Maximum amount of jobs to execute per schedule, used to prevent using up too much IRL RAM.* @property {string} object_defaults.string_servers_bought_name - String to prefix to the names of purchased servers.* @property {string} object_defaults.string_server_target - Server to target.* @property {number} object_defaults.float_precision - Precision of the percentage to steal calculator.* @property {number} object_defaults.float_ram_utilisation_threshold - Ram utilisiation threshold. upgrade ram or buy or replace servers when reached.* @property {number} object_defaults.float_steal_cap - The maximum percentage of cash that should be stolen from a server.* @property {number} object_defaults.float_multiplier_factor_skill - Multiplier for skill factor used in server scoring system.* @property {number} object_defaults.float_multiplier_factor_max_cash - Multiplier for max cash factor used in server scoring system.* @property {number} object_defaults.float_multiplier_factor_growth - Multiplier for growth factor used in server scoring system.* @property {boolean} object_defaults.boolean_method_score_correction - Correction method for factors used in server scoring system. `true` = mean-normalisation, `false` = standardisation.* @property {boolean} object_defaults.float_ram_fraction_for_weaken_cyclic - Fraction of botnet's ram to use for cyclic weaken.* @property {boolean} object_defaults.boolean_print_help - Whether or not to display help and exit.* @property {Object} object_helpers - Contains the names of helper scripts.* @property {Object} object_argument_names - Contains argument names.* @property {string[]} array_programs - Contains buyable program names.* @property {string[]} array_identifier_files_required - Contains identifiers for files that are required to be in all servers.*/const object_constants = {object_defaults: {float_period_seconds: 10,float_padding_seconds: 2,integer_job_cap: 100,string_servers_bought_name: "server",string_server_target: "",float_precision: 0.01,float_ram_utilisation_threshold: 0.9,float_steal_cap: 0.9,float_multiplier_factor_skill: 1,float_multiplier_factor_max_cash: 1,float_multiplier_factor_growth: 1,boolean_method_score_correction: false,float_ram_fraction_for_weaken_cyclic: 0.5,boolean_print_help: !1,},object_helpers: {string_nop: "nicoty.sbin.nop.js",string_hacker: "nicoty.sbin.hacker.js",string_ram: "nicoty.sbin.ram.js",string_servers: "nicoty.sbin.servers.js",string_tor: "nicoty.sbin.tor.js",string_programs: "nicoty.sbin.programs.js",string_botnet: "nicoty.sbin.botnet.js",string_weaken_manager: "nicoty.sbin.weaken.manager.js",string_cyclic_weaken: "nicoty.sbin.weaken.cyclic.js",},object_argument_names: {check_delay: {short: "c",long: "check-delay",},job_delay: {short: "d",long: "job-delay",},help: {short: "h",long: "help",},target: {short: "i",long: "target",},job_cap: {short: "j",long: "job-cap",},multiplier_skill: {short: "k",long: "multiplier-skill",},multiplier_cash: {short: "l",long: "multiplier-cash",},multiplier_growth: {short: "m",long: "multiplier-growth",},server_name: {short: "n",long: "server-name",},precision: {short: "p",long: "precision",},normal: {short: "q",long: "normal",},ram_utilisation: {short: "r",long: "ram-utilisation",},steal_cap: {short: "s",long: "steal-cap",},weaken_manager: {short: "u",long: "weaken-manager",},ram_cyclic_weaken: {short: "v",long: "ram-cyclic-weaken",},ram: {short: "a",long: "ram",},servers: {short: "e",long: "servers",},tor: {short: "o",long: "tor",},programs: {short: "g",long: "programs",},botnet: {short: "b",long: "botnet",},},array_programs: ["BruteSSH.exe","FTPCrack.exe","relaySMTP.exe","HTTPWorm.exe","SQLInject.exe",// "DeepscanV1.exe",// "DeepscanV2.exe",// "Autolink.exe",],array_identifier_files_required: ["nicoty.lib.","nicoty.sbin.weaken.cyclic.js",],};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names,object_helpers = object_constants.object_helpers;object_netscript.tprint(string_sanitise(`USAGErun ${object_netscript.getScriptName()} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.ram.short}, --no-${object_argument_names.ram.long}Prevents the "${object_helpers.string_ram}" script from being started which is responsible for upgrading the RAM of the "home" server.-${object_argument_names.botnet.short}, --no-${object_argument_names.botnet.long}Prevents the "${object_helpers.string_botnet}" script from being started which is responsible for rooting servers in the network.-${object_argument_names.servers.short}, --no-${object_argument_names.servers.long}Prevents the "${object_helpers.string_servers}" script from being started which is responsible for buying and replacing bought servers.-${object_argument_names.programs.short}, --no-${object_argument_names.programs.long}Prevents the "${object_helpers.string_programs}" script from being started which is responsible for buying programs from the "darkweb" server.-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.tor.short}, --no-${object_argument_names.tor.long}Prevents the "${object_helpers.string_tor}" script from being started which is responsible for buying a TOR Router.-${object_argument_names.normal.short}, --${object_argument_names.normal.long}Use mean-normalised correction for the server scoring system instead of standard correction.-${object_argument_names.weaken_manager.short}, --no-${object_argument_names.weaken_manager.long}Prevents the "${object_helpers.string_weaken_manager}" script from being started which is responsible for running threads of "${object_helpers.string_cyclic_weaken}" to gain hacking experience.OPTIONS-${object_argument_names.check_delay.short}, --${object_argument_names.check_delay.long} <SECONDS>SECONDS = The duration of delay between each repeat of the helper scripts' main loops, in seconds. Should be a floating-point number > 0. Defaults to ${object_defaults.float_period_seconds}.-${object_argument_names.job_delay.short}, --${object_argument_names.job_delay.long} <SECONDS>SECONDS = The duration of delay between each job, in seconds. Should be a floating-point number > 0. Defaults to ${object_defaults.float_padding_seconds}.-${object_argument_names.target.short}, --${object_argument_names.target.long} <SERVER>SERVER = The server that should be targetted by the \`weaken\`, \`grow\` and \`hack\` functions. Should be a string. Defaults to choosing an optimal target using a scoring system based on the server's maximum cash, growth, required hacking level, and the player's current hacking level.-${object_argument_names.job_cap.short}, --${object_argument_names.job_cap.long} <CAP>CAP = The maximum amount of jobs to execute per schedule. This is ignored when running in continuous mode. Should be an integer > 0. Defaults to ${object_defaults.integer_job_cap}.-${object_argument_names.server_name.short}, --${object_argument_names.server_name.long} <NAME>NAME = The name to be used for purchased servers. Should be a string. Defaults to "${object_defaults.string_servers_bought_name}".-${object_argument_names.precision.short}, --${object_argument_names.precision.long} <PRECISION>PRECISION = A value used in determining how many cycles of bisection the binary search algorithm used for the percentage to steal calculator should use. Should be a floating point number > 0 <= 1. Values closer to 0 will result in greater precision in the calculation, but potentially longer run-times and compared to values closer to 1. Defaults to ${object_defaults.float_precision}.-${object_argument_names.ram_utilisation.short}, --${object_argument_names.ram_utilisation.long} <THRESHOLD>THRESHOLD = The botnet's ram utilisation threshold after which upgrades/replacements should be bought for servers and the RAM of "home". Should be a floating point number >= 0 <= 1. Values closer to 0 will result in attempting more frequent upgrades/replacements at the cost of less efficient RAM utilisation to cash spenditure ratios. Defaults to ${object_defaults.float_ram_utilisation_threshold}.-${object_argument_names.steal_cap.short}, --${object_argument_names.steal_cap.long} <CAP>CAP = The maximum fraction of cash to steal from the target server per \`hack\` job. Should be a floating point number >= 0 <=1. Defaults to ${object_defaults.float_steal_cap}.-${object_argument_names.multiplier_skill.short}, --${object_argument_names.multiplier_skill.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing your skill against the target server used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_skill}.-${object_argument_names.multiplier_cash.short}, --${object_argument_names.multiplier_cash.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's maximum cash used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_max_cash}.-${object_argument_names.multiplier_growth.short}, --${object_argument_names.multiplier_growth.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's growth used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_growth}.-${object_argument_names.ram_cyclic_weaken.short}, --${object_argument_names.ram_cyclic_weaken.long} <FLOAT>FLOAT = The fraction of the botnet's current available RAM to be used by "${object_helpers.string_weaken_manager}" to run threads of "${object_helpers.string_cyclic_weaken}". Should be a floating point number > 0. Defaults to ${object_defaults.float_ram_fraction_for_weaken_cyclic}.`));};const void_main = async () => {// variablesconst object_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names,object_helpers = object_constants.object_helpers,// Threads of the non-operative script required to reserve enough RAM to run the hacking script.integer_threads_nop = integer_get_threads_nop({object_netscript: object_netscript,string_script_first: object_helpers.string_hacker,string_script_second: object_netscript.getScriptName(),string_nop: object_constants.object_helpers.string_nop,});// If this server doesn't have enough RAM to run the hacking script, eject.if (!boolean_can_server_run_script_threads({object_netscript: object_netscript,float_server_used_ram_free: float_get_server_ram_free({object_netscript: object_netscript,string_server: object_netscript.getHostname(),}),integer_threads: integer_threads_nop,string_script: object_helpers.string_nop,})) {const string_message_error = `This server has insufficient RAM to run "${object_helpers.string_nop}" with "${integer_threads_nop}" thread(s).`;throw ((object_netscript.tprint(`ERROR: ${string_message_error}`),new Error(string_message_error)));}let string_servers_bought_name = object_defaults.string_servers_bought_name,integer_job_cap = object_defaults.integer_job_cap,float_padding_seconds = object_defaults.float_padding_seconds,float_precision = object_defaults.float_precision,float_steal_cap = object_defaults.float_steal_cap,float_period_seconds = object_defaults.float_period_seconds,string_server_target = object_defaults.string_server_target,float_ram_utilisation_threshold =object_defaults.float_ram_utilisation_threshold,float_multiplier_factor_skill =object_defaults.float_multiplier_factor_skill,float_multiplier_factor_max_cash =object_defaults.float_multiplier_factor_max_cash,float_multiplier_factor_growth =object_defaults.float_multiplier_factor_growth,boolean_method_score_correction =object_defaults.boolean_method_score_correction,float_ram_fraction_for_weaken_cyclic =object_defaults.float_ram_fraction_for_weaken_cyclic,boolean_print_help = object_defaults.boolean_print_help;// Parse argumentsconst object_arguments = object_parse_arguments({array_arguments: object_netscript.args,});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.check_delay.short:// fall-throughcase object_argument_names.check_delay.long:float_period_seconds = argument_value;break;case object_argument_names.job_delay.short:// fall-throughcase object_argument_names.job_delay.long:float_padding_seconds = argument_value;break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case object_argument_names.target.short:// fall-throughcase object_argument_names.target.long:string_server_target = argument_value;break;case object_argument_names.job_cap.short:// fall-throughcase object_argument_names.job_cap.long:integer_job_cap = argument_value;break;case object_argument_names.multiplier_skill.short:// fall-throughcase object_argument_names.multiplier_skill.long:float_multiplier_factor_skill = argument_value;break;case object_argument_names.multiplier_cash.short:// fall-throughcase object_argument_names.multiplier_cash.long:float_multiplier_factor_max_cash = argument_value;break;case object_argument_names.multiplier_growth.short:// fall-throughcase object_argument_names.multiplier_growth.long:float_multiplier_factor_growth = argument_value;break;case object_argument_names.server_name.short:// fall-throughcase object_argument_names.server_name.long:string_servers_bought_name = argument_value;break;case object_argument_names.precision.short:// fall-throughcase object_argument_names.precision.long:float_precision = argument_value;break;case object_argument_names.normal.short:// fall-throughcase object_argument_names.normal.long:boolean_method_score_correction = argument_value;break;case object_argument_names.ram_utilisation.short:// fall-throughcase object_argument_names.ram_utilisation.long:float_ram_utilisation_threshold = argument_value;break;case object_argument_names.steal_cap.short:// fall-throughcase object_argument_names.steal_cap.long:float_steal_cap = argument_value;break;case object_argument_names.ram_cyclic_weaken.short:// fall-throughcase object_argument_names.ram_cyclic_weaken.long:float_ram_fraction_for_weaken_cyclic = argument_value;break;}}const float_period = 1e3 * float_period_seconds,float_padding = 1e3 * float_padding_seconds,array_helpers = [{string_script: object_helpers.string_ram,float_threads_or_fraction_botnet: 1,array_arguments: [float_period, float_ram_utilisation_threshold],},{string_script: object_helpers.string_servers,float_threads_or_fraction_botnet: 1,array_arguments: [float_period,string_servers_bought_name,float_ram_utilisation_threshold,],},{string_script: object_helpers.string_tor,float_threads_or_fraction_botnet: 1,array_arguments: [float_period],},{string_script: object_helpers.string_programs,float_threads_or_fraction_botnet: 1,array_arguments: [float_period, object_constants.array_programs],},{string_script: object_helpers.string_botnet,float_threads_or_fraction_botnet: 1,array_arguments: [float_period],},{string_script: object_helpers.string_weaken_manager,float_threads_or_fraction_botnet: 1,array_arguments: [float_period,object_constants.object_helpers.string_cyclic_weaken,float_ram_fraction_for_weaken_cyclic,object_netscript.getHostname(),object_helpers.string_hacker,[float_padding],],},];const array_helpers_parsed = array_helpers.filter((object_helper) => {switch (object_helper.string_script) {case object_helpers.string_ram:return object_arguments.hasOwnProperty(object_argument_names.ram.short)? !object_arguments[object_argument_names.ram.short]: !object_arguments.hasOwnProperty(object_argument_names.ram.long) || !!object_arguments[object_argument_names.ram.long];case object_helpers.string_servers:return object_arguments.hasOwnProperty(object_argument_names.servers.short)? !object_arguments[object_argument_names.servers.short]: !object_arguments.hasOwnProperty(object_argument_names.servers.long) || !!object_arguments[object_argument_names.servers.long];case object_helpers.string_tor:return object_arguments.hasOwnProperty(object_argument_names.tor.short)? !object_arguments[object_argument_names.tor.short]: !object_arguments.hasOwnProperty(object_argument_names.tor.long) || !!object_arguments[object_argument_names.tor.long];case object_helpers.string_programs:return object_arguments.hasOwnProperty(object_argument_names.programs.short)? !object_arguments[object_argument_names.programs.short]: !object_arguments.hasOwnProperty(object_argument_names.programs.long) || !!object_arguments[object_argument_names.programs.long];case object_helpers.string_botnet:return object_arguments.hasOwnProperty(object_argument_names.botnet.short)? !object_arguments[object_argument_names.botnet.short]: !object_arguments.hasOwnProperty(object_argument_names.botnet.long) || !!object_arguments[object_argument_names.botnet.long];case object_helpers.string_weaken_manager:return object_arguments.hasOwnProperty(object_argument_names.weaken_manager.short)? !object_arguments[object_argument_names.weaken_manager.short]: !object_arguments.hasOwnProperty(object_argument_names.weaken_manager.long) ||!!object_arguments[object_argument_names.weaken_manager.long];default:const string_message_error = `"${object_helper.string_script}" is an unrecognised script.`;throw ((object_netscript.tprint(`ERROR: ${string_message_error}`),new Error(string_message_error)));}});// Mainif (boolean_print_help) return void_print_help();// Copy required files to all servers.void_copy_files({object_netscript: object_netscript,string_substrings: object_constants.array_identifier_files_required,});// Reserve enough RAM for the hacking script.integer_exec({object_netscript: object_netscript,string_script: object_helpers.string_nop,string_server: object_netscript.getHostname(),integer_threads: integer_threads_nop,});// Run helper scripts.void_schedule_script_runner({object_netscript: object_netscript,array_schedule: array_get_schedule_script({object_netscript: object_netscript,array_scripts: array_helpers_parsed,}),});// Kill the non-operative scripts to free RAM.void_kill_script_named_server_named({object_netscript: object_netscript,string_server: object_netscript.getHostname(),string_script: object_helpers.string_nop,});// Set options for the hacking script.const object_document = parent["document"];object_document.nicoty_hacker_string_server_target_manual = string_server_target;object_document.nicoty_hacker_boolean_method_score_correction = boolean_method_score_correction;object_document.nicoty_hacker_float_multiplier_factor_skill = float_multiplier_factor_skill;object_document.nicoty_hacker_float_multiplier_factor_max_cash = float_multiplier_factor_max_cash;object_document.nicoty_hacker_float_multiplier_factor_growth = float_multiplier_factor_growth;object_document.nicoty_hacker_integer_job_cap = integer_job_cap;object_document.nicoty_hacker_float_precision = float_precision;object_document.nicoty_hacker_float_steal_cap = float_steal_cap;object_document.nicoty_hacker_float_padding = float_padding;// Spawn the hacking script.object_netscript.spawn(object_helpers.string_hacker, 1);};await void_main();};
/*** @description nicoty.bin.lshw.js - 7.35GB - Displays information about one or more servers.* @license BlueOak-1.0.0* @todo Add flags that prevent certain information from being displayed.*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import {float_get_time_hack,float_get_time_grow,float_get_time_weaken,} from "nicoty.lib.time.js";import {float_get_server_score,} from "nicoty.lib.score.js";/*** @description Constants.* @readonly* @property {number} float_commission - The cost of a transaction.* @property {number} float_period_update_stock - The delay between each market update in milliseconds. @see {@link msPerStockUpdate in src/StockMartket/StockMarket.tsx}* @property {Object} object_defaults - Contains default values for script's arguments.* @property {number} object_defaults.integer_precision - Decimal places to use for displaying numerical information.* @property {number} object_defaults.float_multiplier_factor_skill - Multiplier for skill factor used in server scoring system.* @property {number} object_defaults.float_multiplier_factor_max_cash - Multiplier for max cash factor used in server scoring system.* @property {number} object_defaults.float_multiplier_factor_growth - Multiplier for growth factor used in server scoring system.* @property {number} object_defaults.boolean_method_score_correction - Correction method for factors used in server scoring system. True = mean-normalisation, false = standardisation.* @property {number} object_defaults.float_period_seconds - The duration to wait per iteration of the script's main loop in seconds.* @property {Object} object_argument_names - Contains argument names.*/const object_constants = {object_defaults: {integer_precision: 2,float_multiplier_factor_skill: 1,float_multiplier_factor_max_cash: 1,float_multiplier_factor_growth: 1,boolean_method_score_correction: false,float_period_seconds: 0,},object_argument_names: {delay: {short: "d",long: "delay",},help: {short: "h",long: "help",},multiplier_skill: {short: "k",long: "multiplier-skill",},multiplier_cash: {short: "l",long: "multiplier-cash",},multiplier_growth: {short: "m",long: "multiplier-growth",},precision: {short: "p",long: "precision",},normal: {short: "q",long: "normal",},},};/*** @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {constobject_argument_names = object_constants.object_argument_names,object_defaults = object_constants.object_defaults;object_netscript.tprint(string_sanitise(`DESCRIPTIONDisplay information about one or more servers.Optionally, display the information at regular intervals.USAGErun ${object_netscript.getScriptName()} [OPTIONS ...] <ARGUMENT [ARGUMENT ...]>ARGUMENT = Server to display the information about.FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.normal.short}, --${object_argument_names.normal.long}Use mean-normalised correction for the server scoring system instead of standard correction.OPTIONS-${object_argument_names.delay.short}, --${object_argument_names.delay.long} <SECONDS>SECONDS = The duration of delay between updates, in seconds. Should be a floating-point number >= 0.001. By default, the script will only display server information once, unless this option is manually set.-${object_argument_names.multiplier_skill.short}, --${object_argument_names.multiplier_skill.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing your skill against the target server used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_skill}.-${object_argument_names.multiplier_cash.short}, --${object_argument_names.multiplier_cash.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's maximum cash used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_max_cash}.-${object_argument_names.multiplier_growth.short}, --${object_argument_names.multiplier_growth.long} <FLOAT>FLOAT = The multiplier used to change the weight of the factor representing the target server's growth used in the server scoring system. Should a floating point number. 1 = factor has normal importance, > 1 = factor has more importance, < 1 = factor has less importance, 0 = factor is not used, < 0 = factor has negative effect. Defaults to ${object_defaults.float_multiplier_factor_growth}.-${object_argument_names.precision.short}, --${object_argument_names.precision.long} <INTEGER>INTEGER = The decimal places to display floating point values with. Should be an integer >= 0. Defaults to ${object_defaults.integer_precision}.`));};/*** @description Returns a new stock object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server to print information of.* @param {number} object_arguments.integer_precision - Decimal places to use for displaying numerical information.* @param {boolean} object_arguments.boolean_method_score_correction - Correction method for factors used in server scoring system. True = mean-normalisation, false = standardisation.* @param {number} object_arguments.float_multiplier_factor_skill - Multiplier for skill factor used in server scoring system.* @param {number} object_arguments.float_multiplier_factor_max_cash - Multiplier for max cash factor used in server scoring system.* @param {number} object_arguments.float_multiplier_factor_growth - Multiplier for growth factor used in server scoring system.*/const void_print_information = ({string_server: s,integer_precision: p,boolean_method_score_correction: c,float_multiplier_factor_skill: k,float_multiplier_factor_max_cash: m,float_multiplier_factor_growth: g,}) => {constfloat_cash_max = object_netscript.getServerMaxMoney(s),float_cash_current = object_netscript.getServerMoneyAvailable(s),float_security_minimum = object_netscript.getServerMinSecurityLevel(s),float_security_current = object_netscript.getServerSecurityLevel(s),array_ram = object_netscript.getServerRam(s),float_ram_total = array_ram[0],float_ram_used = array_ram[1],float_ram_free = array_ram[0] - array_ram[1],// Comment unneeded info.string_server_information =`Time: ${new Date().toISOString()}Name: ${s}Root access: ${object_netscript.hasRootAccess(s)}Maximum cash ($): ${float_cash_max.toFixed(p)}Current cash ($): ${float_cash_current.toFixed(p)}Current cash (%): ${((float_cash_current * 100) / float_cash_max).toFixed(p)}Minimum security: ${float_security_minimum.toFixed(p)}Current security: ${float_security_current.toFixed(p)}Current security (x): ${(float_security_current / float_security_minimum).toFixed(p)}Growth rate: ${object_netscript.getServerGrowth(s)}hack() time (s): ${float_get_time_hack({object_netscript: object_netscript, string_server: s, float_server_security: float_security_current}).toFixed(p)}grow() time (s): ${float_get_time_grow({object_netscript: object_netscript, string_server: s, float_server_security: float_security_current}).toFixed(p)}weaken() time (s): ${float_get_time_weaken({object_netscript: object_netscript, string_server: s, float_server_security: float_security_current}).toFixed(p)}Hacking level needed: ${object_netscript.getServerRequiredHackingLevel(s)}Score: ${float_get_server_score({object_netscript: object_netscript,string_server: s,boolean_method_score_correction: c,float_multiplier_factor_skill: k,float_multiplier_factor_max_cash: m,float_multiplier_factor_growth: g,}).toFixed(p)}Ports needed for root: ${object_netscript.getServerNumPortsRequired(s)}RAM total (GB): ${float_ram_total.toFixed(p)}RAM used (GB): ${float_ram_used.toFixed(p)}RAM used (%): ${((float_ram_used * 100) / float_ram_total).toFixed(p)}RAM free (GB): ${float_ram_free.toFixed(p)}RAM free (%): ${((float_ram_free * 100) / float_ram_total).toFixed(p)}`;object_netscript.tprint(string_server_information);};const void_main = async () => {// variablesconst// defaultsobject_defaults = object_constants.object_defaults,// argument namesobject_argument_names = object_constants.object_argument_names;letfloat_multiplier_factor_skill = object_defaults.float_multiplier_factor_skill,float_multiplier_factor_max_cash = object_defaults.float_multiplier_factor_max_cash,float_multiplier_factor_growth = object_defaults.float_multiplier_factor_growth,boolean_method_score_correction = object_defaults.boolean_method_score_correction,float_period_seconds = object_defaults.float_period_seconds,integer_precision = object_defaults.integer_precision,array_servers = [],// Whether to display help and exit.boolean_print_help = !1;// Parse arguments.const object_arguments = object_parse_arguments({array_arguments: object_netscript.args});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.delay.short:// fall-throughcase object_argument_names.delay.long:float_period_seconds = argument_value;break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case object_argument_names.multiplier_skill.short:// fall-throughcase object_argument_names.multiplier_skill.long:float_multiplier_factor_skill = argument_value;break;case object_argument_names.multiplier_cash.short:// fall-throughcase object_argument_names.multiplier_cash.long:float_multiplier_factor_max_cash = argument_value;break;case object_argument_names.multiplier_growth.short:// fall-throughcase object_argument_names.multiplier_growth.long:float_multiplier_factor_growth = argument_value;break;case object_argument_names.precision.short:// fall-throughcase object_argument_names.precision.long:integer_precision = argument_value;break;case object_argument_names.normal.short:// fall-throughcase object_argument_names.normal.long:boolean_method_score_correction = argument_value;break;case "_":array_servers = argument_value;break;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (object_netscript.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}if (boolean_print_help)return void_print_help(object_netscript);const float_period = 1e3 * float_period_seconds;0 === array_servers.length && array_servers.push(object_netscript.getHostname());array_servers.forEach((string_server) => {void_print_information({string_server: string_server,integer_precision: integer_precision,boolean_method_score_correction: boolean_method_score_correction,float_multiplier_factor_skill: float_multiplier_factor_skill,float_multiplier_factor_max_cash: float_multiplier_factor_max_cash,float_multiplier_factor_growth: float_multiplier_factor_growth,});});if (float_period === 0) return;for (;;) {array_servers.forEach((string_server) => {void_print_information({string_server: string_server,integer_precision: integer_precision,boolean_method_score_correction: boolean_method_score_correction,float_multiplier_factor_skill: float_multiplier_factor_skill,float_multiplier_factor_max_cash: float_multiplier_factor_max_cash,float_multiplier_factor_growth: float_multiplier_factor_growth,});}),await object_netscript.sleep(float_period);}};await void_main();};
/*** @description nicoty.bin.kill.js - 2.55GB - Kills scripts.* @license BlueOak-1.0.0*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import {array_get_servers,} from "nicoty.lib.servers.js";import {void_kill_script_named_server_named,} from "nicoty.lib.kill.js";/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Constants.* @readonly* @property {string} string_script_this - The name of this script.* @property {Object} object_argument_names - Contains argument names.*/const object_constants = {string_script_this: object_netscript.getScriptName(),object_argument_names: {script: {short: "c",long: "script",},server: {short: "e",long: "server",},help: {short: "h",long: "help",},},};/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_argument_names = object_constants.object_argument_names;object_netscript.tprint(string_sanitise(`DESCRIPTIONKill all running scripts.Optionally, kill only named scripts instead.Optionally, kill only scripts on named servers instead.Optionally, kill only named scripts on named servers instead.USAGErun ${object_constants.string_script_this} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.OPTIONS-${object_argument_names.script.short}, --${object_argument_names.script.long} <SCRIPT>SCRIPT = The name of a script to kill.-${object_argument_names.server.short}, --${object_argument_names.server.long} <SERVER>SERVER = The name of a server on which scripts will be killed.`));};/*** @description Kills running instances of named scripts on a named server.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server running the scripts to be killed.* @param {string[]} object_arguments.array_scripts - Contains the scripts to be killed.*/const void_kill_scripts_named_server_named = ({string_server: e,array_scripts: c,}) =>c.forEach((string_script) =>void_kill_script_named_server_named({object_netscript: object_netscript,string_server: e,string_script: string_script,}));/*** @description Kills running instances of named scripts on named servers.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string[]} object_arguments.array_servers - Contains the servers running the scripts to be killed.* @param {string[]} object_arguments.array_scripts - Contains the scripts to be killed.*/const void_kill_scripts_named_servers_named = ({array_servers: e,array_scripts: c,}) =>e.forEach((string_server) =>void_kill_scripts_named_server_named({string_server: string_server,array_scripts: c,}));/*** @description Kills running instances of named scripts on all servers.* @param {string[]} array_scripts - Contains the scripts to be killed.*/const void_kill_scripts_named = (array_scripts) =>void_kill_scripts_named_servers_named({array_servers: array_get_servers({ object_netscript: object_netscript }),array_scripts: array_scripts,});/*** @description Kills all but this script on a named server.* @param {string} string_server - The server running the scripts to be killed.*/const void_kill_scripts_server_named = (string_server) =>object_netscript.ps(string_server).forEach((object_script) =>object_script.filename !== object_constants.string_script_this &&object_netscript.kill(object_script.filename,string_server,...object_script.args));/*** @description Kills all but this script on named servers.* @param {string} array_servers - Contains the servers running the scripts to be killed.*/const void_kill_scripts_servers_named = (array_servers) =>array_servers.forEach((string_server) =>void_kill_scripts_server_named(string_server));/*** @description Kills running scripts on all servers.*/const void_kill_scripts = () =>void_kill_scripts_servers_named(array_get_servers({ object_netscript: object_netscript }));const void_main = async () => {// Variables.constarray_servers = [],array_scripts = [];let boolean_print_help = !1;// Parse arguments.constobject_argument_names = object_constants.object_argument_names,object_arguments = object_parse_arguments({array_arguments: object_netscript.args});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.script.short:// fall-throughcase object_argument_names.script.long:"object" == typeof argument_value? array_scripts.push(...argument_value): array_scripts.push(argument_value);break;case object_argument_names.server.short:// fall-throughcase object_argument_names.server.long:"object" == typeof argument_value? array_servers.push(...argument_value): array_servers.push(argument_value);break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: \"${string_argument}\".`;object_netscript.tprint(`ERROR: ${string_message_error}`);throw new Error(string_message_error);}}if (boolean_print_help)return void_print_help(object_netscript);array_scripts.length > 0? array_servers.length > 0? void_kill_scripts_named_servers_named({array_servers: array_servers,array_scripts: array_scripts,}): void_kill_scripts_named(array_scripts): array_servers.length > 0? void_kill_scripts_servers_named(array_servers): void_kill_scripts();};await void_main();};
/*** @description nicoty.bin.installer.js - 2.6 GB - Installs the scripts from the local server.* @license BlueOak-1.0.0*/const object_constants = {string_url: "http://127.0.0.1:8080/",string_prefix: "nicoty.",get string_prefix_url() {return this.string_url + this.string_prefix;},string_suffix: ".js",array_lib: ["kill","no.netscript","time","ls","servers","cp","root","score","ram.server","ps","ram.script","mri","lodash","guiframework",],array_sbin: ["4s.tix.api","botnet","grow","hack","hacker","nop","programs","ram","servers","stock.trader","tor","weaken.cyclic","weaken","weaken.manager",],array_bin: ["contracts","cp","hacknet","installer","kill","lshw","main","rm","stocks","gui",],};export const main = async (object_netscript) => {// const string_fetch = async ({ string_source: s, string_destination: d }) => {// await fetch(s).then(async (object_response) => {// await object_response// .text()// .then((string_text) => object_netscript.write(d, string_text, "w"));// });// return d;// };// const array_fetch_external = async (array_files) =>// await Promise.all(// array_files.map(// async ({ string_source, string_destination }) =>// await string_fetch({// string_source: string_source,// string_destination: string_destination,// })// )// );const array_fetch = async ({ string_prefix: p, array_files: a }) => {const string_prefix_concatenated_url =object_constants.string_prefix_url + p,string_prefix_concatenated_file = object_constants.string_prefix + p;return await Promise.all(a.map(async (string_file) =>await fetch(string_prefix_concatenated_url +string_file +object_constants.string_suffix).then(async (object_response) => {const string_file_name =string_prefix_concatenated_file +string_file +object_constants.string_suffix;await object_response.text().then((string_text) =>object_netscript.write(string_file_name, string_text, "w"));return string_file_name;})));};const string_from_array = ({ array_input: a, string_delimiter: d }) =>a.reduce((string_accumulator, string_element, integer_index, array_input) =>integer_index < array_input.length? string_accumulator + string_element + d: string_accumulator + string_element,"");const void_main = async () => {// const array_external = [// // {// // string_source:// // object_constants.string_url + "node_modules/" + "mri/lib/index.mjs",// // string_destination:// // object_constants.string_prefix +// // "lib.mri" +// // object_constants.string_suffix,// // },// {// string_source:// object_constants.string_url +// "node_modules/" +// "rambda/dist/rambda.esm.js",// string_destination:// object_constants.string_prefix +// "lib.rambda" +// object_constants.string_suffix,// },// ];object_netscript.tprint("\nInstalled:\n" +[// await array_fetch_external(array_external),await array_fetch({string_prefix: "lib.",array_files: object_constants.array_lib,}),await array_fetch({string_prefix: "sbin.",array_files: object_constants.array_sbin,}),await array_fetch({string_prefix: "bin.",array_files: object_constants.array_bin,}),].reduce((string_accumulator, array_current) =>string_accumulator +string_from_array({array_input: array_current,string_delimiter: "\n",}),""));};await void_main();};
/*** @description nicoty.bin.hacknet.js - 5.6 GB - Purchases nodes and upgrades them until the highest gain rate increase per cost ratio of the possible upgrades are below a given threshold.* @license BlueOak-1.0.0* @todo Link ratio to time to break-even.*/import {string_sanitise,object_parse_arguments,any_repeat,} from "nicoty.lib.no.netscript.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {number} object_defaults.float_period_check_seconds - Time period used for checking the time in seconds.* @property {number} object_defaults.float_minimum_ratio - Minimum gain rate increase per cost ratio threshold before the script is killed.* @property {Object} object_argument_names - Contains argument names.*/const object_constants = {object_defaults: {float_period_seconds: 1,float_minimum_ratio: 0.0005,},object_argument_names: {delay: {short: "d",long: "delay",},help: {short: "h",long: "help",},ratio: {short: "r",long: "ratio",},},};/*** @description Returns a gain rate value. Adapted from the {@link `updateMoneyGainRate`} function from {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacknet/HacknetNode.ts|Bitburner's source code}.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.integer_level] - The node's level.* @param {number} [object_arguments.integer_ram] - The node's RAM.* @param {number} [object_arguments.integer_cores] - The node's number of cores.* @returns {number} The gain rate value.* @see {@link `updateMoneyGainRate`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacknet/HacknetNode.ts|GitHub}.*/const float_get_gain_rate = ({integer_level: l = 0,integer_ram: r = 0,integer_cores: c = 0,}) =>l * Math.pow(1.035, r - 1) * (c + 5);/*** @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {constobject_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names;object_netscript.tprint(string_sanitise(`DESCRIPTIONBuys Hacknet nodes and upgrades them until the highest gain rate increase per cost ratio of the possible upgrades are below a given threshold.USAGErun ${object_netscript.getScriptName()} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.OPTIONS-${object_argument_names.delay.short}, --${object_argument_names.delay.long} <SECONDS>SECONDS = The duration of delay between each loop iteration, in seconds. Should be a floating-point number >= 0.001. Defaults to ${object_defaults.float_period_seconds}.-${object_argument_names.ratio.short}, --${object_argument_names.ratio.long} <FLOAT>FLOAT = A value used in determining if the script should continue buying new Hacknet nodes/upgrades for these. Should be a floating point number >= 0. Higher values indicates a greater threshold so less upgrades/new nodes will be bought. Defaults to ${object_defaults.float_minimum_ratio}.`));};/*** @description Returns a gain rate increase per cost value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.integer_node - The node's ID.* @param {number} [object_arguments.integer_level] - The level to increase by.* @param {number} [object_arguments.integer_ram] - The RAM to increase by.* @param {number} [object_arguments.integer_cores] - The number of cores to increase by.* @returns {number} The gain rate increase per cost value.* @see {@link `updateMoneyGainRate`} {@link https://github.com/danielyxie/bitburner/blob/master/src/Hacknet/HacknetNode.ts|GitHub}.*/const float_get_gain_rate_increase_cost_ratio = ({integer_node: n,integer_level: l = 0,integer_ram: r = 0,integer_cores: c = 0,}) => {const object_node_stats = object_netscript.hacknet.getNodeStats(n);return ((float_get_gain_rate({integer_level: object_node_stats.level + l,integer_ram: object_node_stats.ram + r,integer_cores: object_node_stats.cores + c,}) -float_get_gain_rate({integer_level: object_node_stats.level,integer_ram: object_node_stats.ram,integer_cores: object_node_stats.cores,})) /(object_netscript.hacknet.getLevelUpgradeCost(n, l) +object_netscript.hacknet.getRamUpgradeCost(n, r) +object_netscript.hacknet.getCoreUpgradeCost(n, c)));};/*** @description Returns a new node upgrade object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} [object_arguments.float_gain_rate_increase_cost_ratio] - The gain rate increase to cost ratio of the upgrade.* @param {any[]} [object_arguments.array_arguments] - The arguments to pass to the upgrade function.* @param {function} [object_arguments.function_upgrade] - The upgrade function.* @returns {Object} Stock object.*/const object_get_node_upgrade = ({float_gain_rate_increase_cost_ratio: r = float_get_gain_rate({integer_level: 1,integer_ram: 1,integer_cores: 1,}) / object_netscript.hacknet.getPurchaseNodeCost(),array_arguments: a = [],function_upgrade: u = object_netscript.hacknet.purchaseNode,}) => ({float_gain_rate_increase_cost_ratio: r,array_arguments: a,function_upgrade: u,});/*** @description Takes a node upgrade object and returns a newer node upgrade object if it has a better gain rate increase to cost ratio, otherwise returns the old node upgrade object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_node_upgrade - The node upgrade object.* @param {number} object_arguments.integer_node - The node.* @param {integer} object_arguments.integer_amount - The amount of upgrades to buy.* @returns {Object} The newer node upgrade object if it has a better gain rate increase to cost ratio, otherwise the old one.*/const object_get_node_upgrade_updated_main = ({object_node_upgrade: u = object_get_node_upgrade({}),integer_node: n,integer_amount: a = 1,}) => {const float_ratio_level = float_get_gain_rate_increase_cost_ratio({integer_node: n,integer_level: a,}),float_ratio_ram = float_get_gain_rate_increase_cost_ratio({integer_node: n,integer_ram: a,}),float_ratio_cores = float_get_gain_rate_increase_cost_ratio({integer_node: n,integer_cores: a,});switch (Math.max(u.float_gain_rate_increase_cost_ratio,float_ratio_level,float_ratio_ram,float_ratio_cores)) {case u.float_gain_rate_increase_cost_ratio:return u;case float_ratio_level:return object_get_node_upgrade({float_gain_rate_increase_cost_ratio: float_ratio_level,array_arguments: [n, a],function_upgrade: object_netscript.hacknet.upgradeLevel,});case float_ratio_ram:return object_get_node_upgrade({float_gain_rate_increase_cost_ratio: float_ratio_ram,array_arguments: [n, a],function_upgrade: object_netscript.hacknet.upgradeRam,});case float_ratio_cores:return object_get_node_upgrade({float_gain_rate_increase_cost_ratio: float_ratio_cores,array_arguments: [n, a],function_upgrade: object_netscript.hacknet.upgradeCore,});}};/*** @description Returns an object that can be used as input by the repeater function to get updated node upgrade objects.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.any_output - The current node upgrade object.* @param {number} object_arguments.integer_node - The current node.* @param {integer} object_arguments.integer_amount - The amount of upgrades to buy.* @returns {Object} The input object for the repeater function.*/const object_get_node_upgrade_updated = ({object_node_upgrade: u = object_get_node_upgrade({}),integer_node: n = 0,integer_amount: a = 1,}) => ({object_node_upgrade: object_get_node_upgrade_updated_main({object_node_upgrade: u,integer_node: n,integer_amount: a,}),integer_node: n + 1,integer_amount: a,});const void_main = async () => {constobject_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names;letfloat_period_seconds = object_defaults.float_period_seconds,float_minimum_ratio = object_defaults.float_minimum_ratio,// Whether to display help and exit.boolean_print_help = !1;// Parse arguments.const object_arguments = object_parse_arguments({array_arguments: object_netscript.args});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.delay.short:// fall-throughcase object_argument_names.delay.long:float_period_seconds = argument_value;break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case object_argument_names.ratio.short:// fall-throughcase object_argument_names.ratio.long:float_minimum_ratio = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (object_netscript.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}if (boolean_print_help)return void_print_help(object_netscript);const float_period = 1e3 * float_period_seconds;// Make sure there's at least one node owned.for (;object_netscript.hacknet.numNodes() <= 0;) {// Wait a bit if funds are insufficient.-1 === object_netscript.hacknet.purchaseNode() && (await object_netscript.sleep(float_period));}for (;;) {const string_property_counter = "integer_counter",object_node_upgrade = any_repeat({object_state: {[string_property_counter]: 0,object_node_upgrade: object_get_node_upgrade({}),integer_node: 0,integer_amount: 1,},integer_repeats: object_netscript.hacknet.numNodes(),any_function: object_get_node_upgrade_updated,string_property_counter: string_property_counter,}).object_node_upgrade;if (object_node_upgrade.float_gain_rate_increase_cost_ratio < float_minimum_ratio) break;object_node_upgrade.function_upgrade(...object_node_upgrade.array_arguments),await object_netscript.sleep(float_period);}};await void_main();};
/*** @description nicoty.bin.gui.js - 1.6GB - Exposes a GUI that can be used to control other scripts.* @license BlueOak-1.0.0* @todo Use `most` to implement GUI instead.* @todo Improve `--help` flag output and documentation.* @toto Probably needs to save state to localStorage when changing them.*/import * as object_framework from "nicoty.lib.guiframework.js";import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {boolean} object_defaults.boolean_print_help - Whether or not to display help and exit.* @property {Object} object_argument_names - Contains argument names.*/const object_constants = {object_defaults: {boolean_print_help: !1,},object_argument_names: {help: { short: "h", long: "help" },},string_prefix: "nicoty_stocks_",get string_property_investment_capital() {return this.string_prefix + "float_investment_capital";},get string_property_prices_average_length() {return this.string_prefix + "integer_prices_average_length";},get string_property_trade() {return this.string_prefix + "boolean_trade";},get string_property_sell_profitable() {return this.string_prefix + "boolean_sell_profitable";},get string_property_sell_asap() {return this.string_prefix + "boolean_sell_asap";},},object_document = parent["document"],object_window = parent["window"],integer_rows_max = object_framework.maxRows;export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_argument_names = object_constants.object_argument_names;object_netscript.tprint(string_sanitise(`DESCRIPTIONExposes a GUI that can be used to control other scripts.USAGErun ${object_netscript.getScriptName()} [FLAGS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.`));};/*** @description Adds an HTML element to the GUI and returns it.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} [object_arguments.string_tag] - The HTML element tag to use.* @param {string} object_arguments.string_id - The element id to use.* @param {CSSStyleDeclaration} [object_arguments.object_style] - The CSS styles to apply.* @param {Object} [object_arguments.object_gui] - The GUI object.* @param {Object} object_arguments.string_text - Text to add to the element.* @param {function} object_arguments.void_on_mouse_over - The function to use during mouse over events.* @param {function} object_arguments.void_on_mouse_out - The function to use during mouse out events.* @param {function} [object_arguments.void_on_click] - The function to use during on-click events.* @returns {Object} The new element.*/const object_get_element_new = ({string_tag: e = "div",string_id: i,object_style: s = object_framework.optionsStyle,object_gui: g = object_framework.gui,string_text: t,void_on_mouse_over: y,void_on_mouse_out: n,void_on_click: c,}) => {const object_element = object_document.createElement(e);object_element.setAttribute("id", i);object_element.appendChild(object_document.createTextNode(t));for (const string_property in s) {if (s.hasOwnProperty(string_property)) {object_element.style[string_property] = s[string_property];}}if (y !== undefined) {object_element.onmouseover = y;}if (n !== undefined) {object_element.onmouseout = n;}if (c !== undefined) {object_element.onclick = c;}g.appendChild(object_element);return object_element;};/*** @description Returns to the previous menu.* @param {Object} object_arguments - Contains the arguments for the function.* @param {MouseEvent} object_arguments.object_mouse_event - The mouse event passed from the calling function.* @param {Number} [object_arguments.integer_rows_max_old] - The maximum number of rows of the previous menu.* @param {function} [object_arguments.void_menu_previous] - The function used to generate the previous menu.*/const void_menu_back = ({object_mouse_event: e,integer_rows_max_old: m = integer_rows_max,void_menu_previous: p = void_menu_main,}) => {const string_text = e.target.textContent;object_framework.clearMenu();object_framework.appendElement(object_framework.gui.id,object_get_element_new({string_id: "extraGUIcontainer2",object_style: object_framework.mergeStyles(object_framework.optionsStyle,{ backgroundColor: "#777" }),string_text: string_text,void_on_mouse_over: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#999"),void_on_mouse_out: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#777"),void_on_click: () => {object_framework.clearMenu();if (m !== undefined) {object_framework.SetMaxRows(m);}p();},}));};const object_get_button_toggle = ({string_id: i,boolean_condition: b,void_function: _,string_text_true: t,string_text_false: f,string_colour_inactive_out: a = "#555",string_colour_inactive_over: c = "#777",string_colour_active_out: d = "#777",string_colour_active_over: e = "#999",}) =>object_get_element_new({string_id: i,string_text: b()? t: f,void_on_click: (object_mouse_event) => {if (b()) {_(false);object_mouse_event.target.style.backgroundColor = c;object_mouse_event.target.textContent = f;} else {_(true);object_mouse_event.target.style.backgroundColor = e;object_mouse_event.target.textContent = t;}},void_on_mouse_over: (object_mouse_event) => {if (b()) {object_mouse_event.target.style.backgroundColor = e;} else {object_mouse_event.target.style.backgroundColor = c;}},void_on_mouse_out: (object_mouse_event) => {if (b()) {object_mouse_event.target.style.backgroundColor = d;} else {object_mouse_event.target.style.backgroundColor = a;}},});/*** @description Generates the hacking menu.* @param {Object} object_arguments - Contains the arguments for the function.* @param {MouseEvent} object_arguments.object_mouse_event - The mouse event passed from the calling function.* @param {function} [object_arguments.void_menu_previous] - The function used to generate the previous menu.*/const void_menu_hacker = ({object_mouse_event: e,void_menu_previous: p = void_menu_main,}) => {const integer_rows_max = object_framework.maxRows;void_menu_back({object_mouse_event: e,integer_rows_max_old: integer_rows_max,void_menu_previous: p,});object_framework.verifyHeight();};/*** @description Generates the stocks menu.* @param {Object} object_arguments - Contains the arguments for the function.* @param {MouseEvent} object_arguments.object_mouse_event - The mouse event passed from the calling function.* @param {function} [object_arguments.void_menu_previous] - The function used to generate the previous menu.*/const void_menu_stocks = ({object_mouse_event: e,void_menu_previous: p,}) => {const integer_rows_max = object_framework.maxRows;void_menu_back({object_mouse_event: e,integer_rows_max_old: integer_rows_max,void_menu_previous: p,});object_get_button_toggle({string_id: "trade",boolean_condition: () => object_document.nicoty_stocks_boolean_trade,void_function: (boolean_condition) => {object_document.nicoty_stocks_boolean_trade = boolean_condition;},string_text_true: "Trading",string_text_false: "Not Trading",});object_get_button_toggle({string_id: "sell_profitable",boolean_condition: () => object_document.nicoty_stocks_boolean_sell_profitable,void_function: (boolean_condition) => {object_document.nicoty_stocks_boolean_sell_profitable = boolean_condition;},string_text_true: "Selling When Profitable",string_text_false: "Not Selling When Profitable",});object_get_button_toggle({string_id: "sell_profitable",boolean_condition: () => object_document.nicoty_stocks_boolean_sell_asap,void_function: (boolean_condition) => {object_document.nicoty_stocks_boolean_sell_asap = boolean_condition;},string_text_true: "Selling ASAP",string_text_false: "Not Selling ASAP",});object_framework.verifyHeight();};/*** @description Generates the main menu.*/const void_menu_main = () => {object_get_element_new({string_id: "hacker",string_text: "Hacker",void_on_mouse_over: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#777"),void_on_mouse_out: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#555"),void_on_click: (object_mouse_event) =>void_menu_hacker({object_mouse_event: object_mouse_event,void_menu_previous: void_menu_main,}),});object_get_element_new({string_id: "stocks",string_text: "Stocks",void_on_mouse_over: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#777"),void_on_mouse_out: (object_mouse_event) =>(object_mouse_event.target.style.backgroundColor = "#555"),void_on_click: (object_mouse_event) =>void_menu_stocks({object_mouse_event: object_mouse_event,void_menu_previous: void_menu_main,}),});object_framework.verifyHeight();};const void_main = async () => {// variablesconst object_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names;let boolean_print_help = object_defaults.boolean_print_help;// Parse argumentsconst object_arguments = object_parse_arguments({array_arguments: object_netscript.args,});for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw ((object_netscript.tprint(`ERROR: ${string_message_error}`),new Error(string_message_error)));}}// Mainif (boolean_print_help) return void_print_help();object_framework.initialize(object_netscript,object_document,object_window);object_framework.setPos(0, 0);void_menu_main();for (;;) {await object_netscript.sleep(9e9);}};await void_main();};
/*** @description nicoty.bin.cp.js - 2.65GB - Copies files from other servers to the current server.* @license BlueOak-1.0.0*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import { void_copy_matched_to_current } from "nicoty.lib.cp.js";/*** @description Constants.* @readonly* @property {Object} object_argument_names - Contains argument names.* @property {Object} object_defaults - Contains default values for script's arguments.* @property {boolean} object_defaults.boolean_silent - Whether to display notification messages or not.*/const object_constants = {object_argument_names: {help: {short: "h",long: "help",},silent: {short: "s",long: "silent",},},object_defaults: {boolean_silent: !1,},};/*** @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = function () {const object_argument_names = object_constants.object_argument_names;object_netscript.tprint(string_sanitise(`DESCRIPTIONCopy all files whose names match (a) regular expression(s) from all servers to the current server.USAGErun ${object_netscript.getScriptName()} [FLAGS ...] <ARGUMENT [ARGUMENT ...]>ARGUMENT = Regular expression that files in the network need to match to be copied to the current server.FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.silent.short}, --${object_argument_names.silent.long}Whether or not messages will be displayed or not. If set, no messages will be displayed, otherwise, messages will be displayed by default.`));};const void_main = async () => {constobject_argument_names = object_constants.object_argument_names,object_arguments = object_parse_arguments({array_arguments: object_netscript.args});let boolean_print_help = !1,boolean_silent = object_constants.object_defaults.boolean_silent,array_patterns = [];for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case object_argument_names.silent.short:// fall-throughcase object_argument_names.silent.long:boolean_silent = argument_value;break;case "_":"object" == typeof argument_value? array_patterns.push(...argument_value): array_patterns.push(argument_value);break;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (object_netscript.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}if (boolean_print_help)return void_print_help(object_netscript);void_copy_matched_to_current({object_netscript: object_netscript,array_patterns: array_patterns,boolean_silent: boolean_silent,});};await void_main();};
/*** @description nicoty.bin.contracts.js - 22.05 GB - Attempts to solve existing coding contracts.* @license BlueOak-1.0.0*/import {string_sanitise,object_parse_arguments,} from "nicoty.lib.no.netscript.js";import {array_get_files_with_string,} from "nicoty.lib.ls.js";import {array_get_servers,} from "nicoty.lib.servers.js";/*** @description Constants.* @readonly* @property {Object} object_defaults - Contains default values for script's arguments.* @property {number} object_defaults.float_period_check_seconds - Time period used for checking the time in seconds.* @property {boolean} object_defaults.boolean_verbose - Whether to display notification messages or not.* @property {boolean} object_defaults.boolean_print_help - Whether to display help and exit.* @property {Object} object_argument_names - Contains argument names.* @property {Object} object_solvers - Contract solving functions. Adapted from functions in {@link https://github.com/danielyxie/bitburner/blob/master/src/data/codingcontracttypes.ts|Bitburner's source code}.*/const object_constants = {object_argument_names: {delay: {short: "d",long: "delay",},help: {short: "h",long: "help",},verbose: {short: "v",long: "verbose",},},object_defaults: {float_period_seconds: 0,boolean_verbose: !1,boolean_print_help: !1,},object_solvers: {"Find Largest Prime Factor": (data) => {let fac = 2;let n = data;while (n > ((fac - 1) * (fac - 1))) {while (n % fac === 0) {n = Math.round(n / fac);}++fac;}return (n === 1 ? (fac - 1) : n);},"Subarray with Maximum Sum": (data) => {const nums = data.slice();for (let i = 1; i < nums.length; i++) {nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);}return Math.max(...nums);},"Total Ways to Sum": (data) => {const ways = [1];ways.length = data + 1;ways.fill(0, 1);for (let i = 1; i < data; ++i) {for (let j = i; j <= data; ++j) {ways[j] += ways[j - i];}}return ways[data];},"Spiralize Matrix": (data) => {const spiral = [];const m = data.length;const n = data[0].length;let u = 0;let d = m - 1;let l = 0;let r = n - 1;let k = 0;while (true) {// Upfor (let col = l; col <= r; col++) {spiral[k] = data[u][col];++k;}if (++u > d) {break;}// Rightfor (let row = u; row <= d; row++) {spiral[k] = data[row][r];++k;}if (--r < l) {break;}// Downfor (let col = r; col >= l; col--) {spiral[k] = data[d][col];++k;}if (--d < u) {break;}// Leftfor (let row = d; row >= u; row--) {spiral[k] = data[row][l];++k;}if (++l > r) {break;}}return spiral;},"Array Jumping Game": (data) => {const n = data.length;let i = 0;for (let reach = 0; i < n && i <= reach; ++i) {reach = Math.max(i + data[i], reach);}return i === n ? 1 : 0;},"Merge Overlapping Intervals": (data) => {const intervals = data.slice();intervals.sort((a, b) => {return a[0] - b[0];});const result = [];let start = intervals[0][0];let end = intervals[0][1];for (const interval of intervals) {if (interval[0] <= end) {end = Math.max(end, interval[1]);}else {result.push([start, end]);start = interval[0];end = interval[1];}}result.push([start, end]);return result;},"Generate IP Addresses": (data) => {const ret = [];for (let a = 1; a <= 3; ++a) {for (let b = 1; b <= 3; ++b) {for (let c = 1; c <= 3; ++c) {for (let d = 1; d <= 3; ++d) {if (a + b + c + d === data.length) {const A = parseInt(data.substring(0, a), 10);const B = parseInt(data.substring(a, a + b), 10);const C = parseInt(data.substring(a + b, a + b + c), 10);const D = parseInt(data.substring(a + b + c, a + b + c + d), 10);if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {const ip = [A.toString(), ".",B.toString(), ".",C.toString(), ".",D.toString()].join("");if (ip.length === data.length + 3) {ret.push(ip);}}}}}}}return ret;},"Algorithmic Stock Trader I": (data) => {let maxCur = 0;let maxSoFar = 0;for (let i = 1; i < data.length; ++i) {maxCur = Math.max(0, maxCur += data[i] - data[i - 1]);maxSoFar = Math.max(maxCur, maxSoFar);}return maxSoFar.toString();},"Algorithmic Stock Trader II": (data) => {let profit = 0;for (let p = 1; p < data.length; ++p) {profit += Math.max(data[p] - data[p - 1], 0);}return profit.toString();},"Algorithmic Stock Trader III": (data) => {let hold1 = Number.MIN_SAFE_INTEGER;let hold2 = Number.MIN_SAFE_INTEGER;let release1 = 0;let release2 = 0;for (const price of data) {release2 = Math.max(release2, hold2 + price);hold2 = Math.max(hold2, release1 - price);release1 = Math.max(release1, hold1 + price);hold1 = Math.max(hold1, price * -1);}return release2.toString();},"Algorithmic Stock Trader IV": (data) => {const k = data[0];const prices = data[1];const len = prices.length;if (len < 2) {return 0;}if (k > len / 2) {let res = 0;for (let i = 1; i < len; ++i) {res += Math.max(prices[i] - prices[i - 1], 0);}return res;}const hold = [];const rele = [];hold.length = k + 1;rele.length = k + 1;for (let i = 0; i <= k; ++i) {hold[i] = Number.MIN_SAFE_INTEGER;rele[i] = 0;}let cur;for (let i = 0; i < len; ++i) {cur = prices[i];for (let j = k; j > 0; --j) {rele[j] = Math.max(rele[j], hold[j] + cur);hold[j] = Math.max(hold[j], rele[j - 1] - cur);}}return rele[k];},"Minimum Path Sum in a Triangle": (data) => {let n = data.length;let dp = data[n - 1].slice();for (let i = n - 2; i > -1; --i) {for (let j = 0; j < data[i].length; ++j) {dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];}}return dp[0];},"Unique Paths in a Grid I": (data) => {let n = data[0]; // Number of rowslet m = data[1]; // Number of columnslet currentRow = [];currentRow.length = n;for (let i = 0; i < n; i++) {currentRow[i] = 1;}for (let row = 1; row < m; row++) {for (let i = 1; i < n; i++) {currentRow[i] += currentRow[i - 1];}}return currentRow[n - 1];},"Unique Paths in a Grid II": (data) => {let obstacleGrid = [];obstacleGrid.length = data.length;for (let i = 0; i < obstacleGrid.length; ++i) {obstacleGrid[i] = data[i].slice();}for (let i = 0; i < obstacleGrid.length; i++) {for (let j = 0; j < obstacleGrid[0].length; j++) {if (obstacleGrid[i][j] == 1) {obstacleGrid[i][j] = 0;}else if (i == 0 && j == 0) {obstacleGrid[0][0] = 1;}else {obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);}}}return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1];},"Sanitize Parentheses in Expression": (data) => {let left = 0;let right = 0;let res = [];for (let i = 0; i < data.length; ++i) {if (data[i] === '(') {++left;}else if (data[i] === ')') {(left > 0) ? --left : ++right;}}function dfs(pair, index, left, right, s, solution, res) {if (s.length === index) {if (left === 0 && right === 0 && pair === 0) {for (var i = 0; i < res.length; i++) {if (res[i] === solution) {return;}}res.push(solution);}return;}if (s[index] === '(') {if (left > 0) {dfs(pair, index + 1, left - 1, right, s, solution, res);}dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);}else if (s[index] === ')') {if (right > 0)dfs(pair, index + 1, left, right - 1, s, solution, res);if (pair > 0)dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);}else {dfs(pair, index + 1, left, right, s, solution + s[index], res);}}dfs(0, 0, left, right, data, "", res);return res;},"Find All Valid Math Expressions": (data) => {const num = data[0];const target = data[1];function helper(res, path, num, target, pos, evaluated, multed) {if (pos === num.length) {if (target === evaluated) {res.push(path);}return;}for (let i = pos; i < num.length; ++i) {if (i != pos && num[pos] == '0') {break;}let cur = parseInt(num.substring(pos, i + 1));if (pos === 0) {helper(res, path + cur, num, target, i + 1, cur, cur);}else {helper(res, path + "+" + cur, num, target, i + 1, evaluated + cur, cur);helper(res, path + "-" + cur, num, target, i + 1, evaluated - cur, -cur);helper(res, path + "*" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);}}}let result = [];helper(result, "", num, target, 0, 0, 0);return result;},},};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Prints a help message to the terminal.*/const void_print_help = () => {const object_argument_names = object_constants.object_argument_names;object_netscript.tprint(string_sanitise(`DESCRIPTIONAttempts to solve existing coding contracts in the network.USAGErun ${object_netscript.getScriptName()} [FLAGS ...] [OPTIONS]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.-${object_argument_names.verbose.short}, --${object_argument_names.verbose.long}If set, displays messages regarding successful attempts (in addition to standard failed attempt messages).OPTIONS-${object_argument_names.delay.short}, --${object_argument_names.delay.long} <SECONDS>SECONDS = The duration of delay between each network-wide contract search and solve attempts, in seconds. Should be a floating-point number >= 0.001. By default, the script will only search for and attempt to solve contracts once, unless this option is manually set.`));};/*** @description Returns an array of existing coding contract objects.* @returns {Object[]} Contains existing coding contract objects.*/const array_get_contracts = () =>array_get_servers({ object_netscript: object_netscript }).flatMap((string_server) =>array_get_files_with_string({object_netscript: object_netscript,string_server: string_server,substrings: ".cct"})// Check if this really is a contract or just a file with ".cct" in its name..filter((string_file) =>"string" ===typeof object_netscript.codingcontract.getContractType(string_file,string_server)).map((string_contract) =>({string_name: string_contract,string_location: string_server,string_type: object_netscript.codingcontract.getContractType(string_contract,string_server),any_data: object_netscript.codingcontract.getData(string_contract, string_server),boolean_or_string_attempt: ({any_answer,boolean_verbose}) =>object_netscript.codingcontract.attempt(any_answer,string_contract,string_server,{returnReward: boolean_verbose,}),})));/*** @description Attempts to solve existing coding contracts in the network.* @param {boolean} boolean_verbose - Whether or not to display extra messages.* @todo Return things?*/const void_contracts_solver = (boolean_verbose) =>array_get_contracts().forEach((object_contract) => {constany_answer = object_constants.object_solvers[object_contract.string_type](object_contract.any_data),boolean_or_string_output = object_contract.boolean_or_string_attempt({any_answer: any_answer,boolean_verbose: boolean_verbose});switch (boolean_or_string_output) {case "":// fall-throughcase !1:object_netscript.tprint(`Failed to solve:${JSON.stringify(object_contract)}Using input:${any_answer}`);break;case !0:break;default:object_netscript.tprint(`${boolean_or_string_output}`);break;}});const void_main = async () => {// Parse arguments.constobject_defaults = object_constants.object_defaults,object_argument_names = object_constants.object_argument_names;letfloat_period_seconds = object_defaults.float_period_seconds,boolean_verbose = object_defaults.boolean_verbose,boolean_print_help = object_defaults.boolean_print_help;const object_arguments = object_parse_arguments({ array_arguments: object_netscript.args });for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.delay.short:// fall-throughcase object_argument_names.delay.long:float_period_seconds = argument_value;break;case object_argument_names.verbose.short:// fall-throughcase object_argument_names.verbose.long:boolean_verbose = argument_value;break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (object_netscript.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}if (boolean_print_help)return void_print_help(object_netscript);const float_period = 1e3 * float_period_seconds;if (float_period > 0)for (;;)void_contracts_solver(boolean_verbose),await object_netscript.sleep(float_period);else void_contracts_solver(boolean_verbose);};await void_main();};
// lib_time.js - 6.25GBconst object_get_constants = function(ns) {const object_get_stats = function(ns) {try {return ns.getStats();}catch (error) {ns.tprint(JSON.stringify(error));return {hacking: ns.getHackingLevel(),strength: 1,defense: 1,dexterity: 1,agility: 1,charisma: 1,intelligence: 1};}};// object_constants are from https://github.com/danielyxie/bitburner/blob/master/src/Constants.jsreturn {// hacking multipliersobject_hacking_multipliers: ns.getHackingMultipliers(),// player statsobject_stats: object_get_stats(ns)};};// Returns time it takes to complete a hack on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsexport const float_get_time_hack = function(ns, string_server_target, float_server_target_security) {const object_constants = object_get_constants(ns);const difficultyMult = ns.getServerRequiredHackingLevel(string_server_target) * float_server_target_security;const baseDiff = 500;const baseSkill = 50;const diffFactor = 2.5;const intFactor = 0.1;const hack_stat = object_constants.object_stats.hacking;const int = object_constants.object_stats.intelligence;var skillFactor = (diffFactor * difficultyMult + baseDiff);// tslint:disable-next-lineskillFactor /= (hack_stat + baseSkill + (intFactor * int));const hackTimeMultiplier = 5;const hackingTime = hackTimeMultiplier * skillFactor / object_constants.object_hacking_multipliers.speed;return hackingTime;};// Returns time it takes to complete a grow operation on a server, in seconds. Adapted from `calculateGrowTime` in Hacking.jsexport const float_get_time_grow = function(ns, string_server_target, float_server_target_security) {const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2return growTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security);};// Returns time it takes to complete a weaken operation on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsexport const float_get_time_weaken = function(ns, string_server_target, float_server_target_security) {const weakenTimeMultiplier = 4; // Relative to hacking timereturn weakenTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security);};
// lib_servers.js - 1.85GB// returns an array of all servers in the gameexport const array_get_servers = function(ns) {const string_host = ns.getHostname();const array_servers = [string_host];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const array_scan_results = ns.scan(array_servers[integer_indices_0]);for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {array_servers.push(array_scan_results[integer_indices_1]);}}}return array_servers;};
// lib_server_used.js - 2.1GBimport {float_get_server_ram_total,float_get_server_ram_used} from "lib_ram_server.js";// makes a server used objectexport const object_make_server_used = function (ns,string_server) {return {name: string_server,get_ram_max: function () {return float_get_server_ram_total(ns, string_server);},ram_used: float_get_server_ram_used(ns, string_server),get_ram_free: function () {return this.get_ram_max() - this.ram_used;},can_run_job: function (string_script, integer_threads) {return (ns.getScriptRam(string_script) * integer_threads <=this.get_ram_free());},get_threads_max: function (string_script) {return Math.floor(this.get_ram_free() / ns.getScriptRam(string_script));},apply_job: function (object_job) {this.ram_used +=object_job.integer_threads *ns.getScriptRam(object_job.string_script);},};};
// lib_score.js - 2.25GBimport { array_get_servers_rooted } from "lib_root.js";// return array of rooted servers that have required hacking levels <= current hacking level, growth rates > 0 and max cash > 0export const array_get_servers_hackable = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let array_servers_hackable = [];for (let integer_indices_0 = 0;integer_indices_0 < array_servers_rooted.length;++integer_indices_0) {const string_server = array_servers_rooted[integer_indices_0];ns.getHackingLevel() > ns.getServerRequiredHackingLevel(string_server) &&ns.getServerMaxMoney(string_server) > 0 &&ns.getServerGrowth(string_server) > 0 &&array_servers_hackable.push(string_server);}return array_servers_hackable;};const float_get_mean = function (array_numbers) {let float_total = 0;for (let integer_indices_0 = 0;integer_indices_0 < array_numbers.length;++integer_indices_0)float_total += array_numbers[integer_indices_0];return float_total / array_numbers.length;};const array_get_servers_trait = function (ns, array_servers, void_get_trait) {let array_servers_trait = [];for (let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0)array_servers_trait.push(void_get_trait(ns, array_servers[integer_indices_0]));return array_servers_trait;};const float_get_servers_hackable_mean_trait = function (ns, void_get_trait) {return float_get_mean(array_get_servers_trait(ns, array_get_servers_hackable(ns), void_get_trait));};// gives a score for how well you will be able to hack a server (how much cash you can take per hack and how long it takes) given your current hacking level and its required hacking level. adapted from various functions in Hacking.jsconst float_get_skill_against = function (ns, string_server) {const float_player_hacking_level = ns.getHackingLevel();return (float_player_hacking_level - ns.getServerRequiredHackingLevel(string_server)) / float_player_hacking_level;};const float_get_server_cash_max = function (ns, string_server) {return ns.getServerMaxMoney(string_server);};const float_get_server_growth = function (ns, string_server) {return ns.getServerGrowth(string_server);};// returns the score of a server which is calculated by taking into account the deviation from mean of its max cash, its growth rate and your skill against it.export const float_get_server_score = function (ns, string_server) {constfloat_factor_skill =float_get_skill_against(ns, string_server) -float_get_servers_hackable_mean_trait(ns, float_get_skill_against),float_factor_max_cash =ns.getServerMaxMoney(string_server) -float_get_servers_hackable_mean_trait(ns, float_get_server_cash_max),float_factor_growth =ns.getServerGrowth(string_server) -float_get_servers_hackable_mean_trait(ns, float_get_server_growth);// Can adjust the weights of the variables. the following values were chose to "normalise" the contribution of the factors to about +/- values in the tens placereturn (100 * float_factor_skill +0.00000001 * float_factor_max_cash +1 * float_factor_growth);};
// lib_root.js - 1.9GBimport {array_get_servers}from "lib_servers.js";// returns an array of all rooted serversexport const array_get_servers_rooted = function(ns) {const array_servers = array_get_servers(ns);const array_servers_rooted = [];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {if (ns.hasRootAccess(array_servers[integer_indices_0])) {array_servers_rooted.push(array_servers[integer_indices_0]);}}return array_servers_rooted;};// returns an array of all servers that are yet to be rootedexport const array_get_servers_unrooted = function(ns) {const array_servers = array_get_servers(ns);const array_servers_unrooted = [];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {if (!ns.hasRootAccess(array_servers[integer_indices_0])) {array_servers_unrooted.push(array_servers[integer_indices_0]);}}return array_servers_unrooted;};
// lib_ram_server.js - 2GBimport {array_get_servers_rooted}from "lib_root.js";// returns the total ram of a serverexport const float_get_server_ram_total = function(ns, string_server) {return (ns.getServerRam(string_server))[0];};// returns the used ram of a serverconst float_get_server_ram_used = function(ns, string_server) {return (ns.getServerRam(string_server))[1];};// returns the amount of free ram of a serverexport const float_get_server_ram_free = function(ns, string_server) {return float_get_server_ram_total(ns, string_server) - float_get_server_ram_used(ns, string_server);};// returns the total RAM from all the servers you have root access toconst float_get_network_ram_total = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let float_network_ram_total = 0;for (let integer_indices_0 = 0;integer_indices_0 < array_servers_rooted.length;++integer_indices_0)float_network_ram_total += float_get_server_ram_total(ns,array_servers_rooted[integer_indices_0]);return float_network_ram_total;};// returns the total RAM used from all the servers you have root access toconst float_get_network_ram_used = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let float_network_ram_used = 0;for (let integer_indices_0 = 0;integer_indices_0 < array_servers_rooted.length;++integer_indices_0)float_network_ram_used += float_get_server_ram_used(ns,array_servers_rooted[integer_indices_0]);return float_network_ram_used;};// returns the RAM utilisation of the botnet as a decimalexport const float_get_network_ram_utilisation = function (ns) {return float_get_network_ram_used(ns) / float_get_network_ram_total(ns);};// sort an array of servers by their amounts of RAM, from lowest to highestconst void_sort_by_server_ram = function (ns, array_servers) {return array_servers.sort((string_element_0, string_element_1) =>float_get_server_ram_total(ns, string_element_0) -float_get_server_ram_total(ns, string_element_1));};export const array_get_servers_rooted_sorted_by_ram = function (ns) {let array_servers_rooted = array_get_servers_rooted(ns);return (void_sort_by_server_ram(ns, array_servers_rooted), array_servers_rooted);};
// lib_ram_script.js - 1.7GB// return true if a server has enough RAM to run a script with a stated number of threadsexport const boolean_can_server_run_script_threads = function (ns,float_server_used_ram_free,string_script,integer_threads) {return !(ns.getScriptRam(string_script) * integer_threads >float_server_used_ram_free);};
// lib_ram.js - 2GBimport {array_get_servers_rooted}from "lib_root.js";// returns the total ram of a serverexport const float_get_server_ram_total = function(ns, string_server) {return (ns.getServerRam(string_server))[0];};// returns the used ram of a serverconst float_get_server_ram_used = function(ns, string_server) {return (ns.getServerRam(string_server))[1];};// returns the amount of free ram of a serverexport const float_get_server_ram_free = function(ns, string_server) {return float_get_server_ram_total(ns, string_server) - float_get_server_ram_used(ns, string_server);};// returns the total RAM from all the servers you have root access toconst float_get_network_ram_total = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let float_network_ram_total = 0;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_rooted.length; ++integer_indices_0) {float_network_ram_total += float_get_server_ram_total(ns, array_servers_rooted[integer_indices_0]);}return float_network_ram_total;};// returns the total free RAM from all the servers you have root access toconst float_get_network_ram_free = function (ns) {const array_servers_rooted = array_get_servers_rooted(ns);let float_network_ram_free = 0;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_rooted.length; ++integer_indices_0) {float_network_ram_free += float_get_server_ram_free(ns, array_servers_rooted[integer_indices_0]);}return float_network_ram_free;};// returns the RAM utilisation of the botnet as a decimalexport const float_get_network_ram_utilisation = function (ns) {return float_get_network_ram_free(ns) / float_get_network_ram_total(ns);};
// lib_ps.js - 2.05 GB// returns true if a script is running on any serverimport { array_get_servers } from "lib_servers.js";export const boolean_script_running = function (ns, string_script) {const array_servers = array_get_servers(ns);for (let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0) {const string_server = array_servers[integer_indices_0],array_scripts_running = ns.ps(string_server);if (array_scripts_running.length > 0)for (let integer_indices_1 = 0;integer_indices_1 < array_scripts_running.length;++integer_indices_1) {const object_script = array_scripts_running[integer_indices_1],string_script_to_check = object_script.filename;if (string_script_to_check == string_script) return !0;}}return !1;};// returns true if any of the scripts in an array is running on any serverexport const boolean_array_scripts_any_running = function (ns, array_scripts) {for (let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0)return boolean_script_running(ns, array_scripts[integer_indices_0]);};
// lib_minimist.js - 1.6GB - adapted from https://github.com/substack/minimist/blob/38a4d1caead72ef99e824bb420a2528eec03d9ab/index.js// This software is released under the MIT license:// Permission is hereby granted, free of charge, to any person obtaining a copy of// this software and associated documentation files (the "Software"), to deal in// the Software without restriction, including without limitation the rights to// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of// the Software, and to permit persons to whom the Software is furnished to do so,// subject to the following conditions:// The above copyright notice and this permission notice shall be included in all// copies or substantial portions of the Software.// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.export const object_parse = function (args, opts) {if (!opts) opts = {};var flags = { bools : {}, strings : {}, unknownFn: null };if (typeof opts['unknown'] === 'function') {flags.unknownFn = opts['unknown'];}if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {flags.allBools = true;} else {[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {flags.bools[key] = true;});}var aliases = {};Object.keys(opts.alias || {}).forEach(function (key) {aliases[key] = [].concat(opts.alias[key]);aliases[key].forEach(function (x) {aliases[x] = [key].concat(aliases[key].filter(function (y) {return x !== y;}));});});[].concat(opts.string).filter(Boolean).forEach(function (key) {flags.strings[key] = true;if (aliases[key]) {flags.strings[aliases[key]] = true;}});var defaults = opts['default'] || {};var argv = { _ : [] };Object.keys(flags.bools).forEach(function (key) {setArg(key, defaults[key] === undefined ? false : defaults[key]);});var notFlags = [];if (args.indexOf('--') !== -1) {notFlags = args.slice(args.indexOf('--')+1);args = args.slice(0, args.indexOf('--'));}function argDefined(key, arg) {return (flags.allBools && /^--[^=]+$/.test(arg)) ||flags.strings[key] || flags.bools[key] || aliases[key];}function setArg (key, val, arg) {if (arg && flags.unknownFn && !argDefined(key, arg)) {if (flags.unknownFn(arg) === false) return;}var value = !flags.strings[key] && isNumber(val)? Number(val) : val;setKey(argv, key.split('.'), value);(aliases[key] || []).forEach(function (x) {setKey(argv, x.split('.'), value);});}function setKey (obj, keys, value) {var o = obj;for (var i = 0; i < keys.length-1; i++) {var key = keys[i];if (key === '__proto__') return;if (o[key] === undefined) o[key] = {};if (o[key] === Object.prototype || o[key] === Number.prototype|| o[key] === String.prototype) o[key] = {};if (o[key] === Array.prototype) o[key] = [];o = o[key];}var key = keys[keys.length - 1];if (key === '__proto__') return;if (o === Object.prototype || o === Number.prototype|| o === String.prototype) o = {};if (o === Array.prototype) o = [];if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {o[key] = value;}else if (Array.isArray(o[key])) {o[key].push(value);}else {o[key] = [ o[key], value ];}}function aliasIsBoolean(key) {return aliases[key].some(function (x) {return flags.bools[x];});}for (var i = 0; i < args.length; i++) {var arg = args[i];if (/^--.+=/.test(arg)) {// Using [\s\S] instead of . because js doesn't support the// 'dotall' regex modifier. See:// http://stackoverflow.com/a/1068308/13216var m = arg.match(/^--([^=]+)=([\s\S]*)$/);var key = m[1];var value = m[2];if (flags.bools[key]) {value = value !== 'false';}setArg(key, value, arg);}else if (/^--no-.+/.test(arg)) {var key = arg.match(/^--no-(.+)/)[1];setArg(key, false, arg);}else if (/^--.+/.test(arg)) {var key = arg.match(/^--(.+)/)[1];var next = args[i + 1];if (next !== undefined && !/^-/.test(next)&& !flags.bools[key]&& !flags.allBools&& (aliases[key] ? !aliasIsBoolean(key) : true)) {setArg(key, next, arg);i++;}else if (/^(true|false)$/.test(next)) {setArg(key, next === 'true', arg);i++;}else {setArg(key, flags.strings[key] ? '' : true, arg);}}else if (/^-[^-]+/.test(arg)) {var letters = arg.slice(1,-1).split('');var broken = false;for (var j = 0; j < letters.length; j++) {var next = arg.slice(j+2);if (next === '-') {setArg(letters[j], next, arg)continue;}if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {setArg(letters[j], next.split('=')[1], arg);broken = true;break;}if (/[A-Za-z]/.test(letters[j])&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {setArg(letters[j], next, arg);broken = true;break;}if (letters[j+1] && letters[j+1].match(/\W/)) {setArg(letters[j], arg.slice(j+2), arg);broken = true;break;}else {setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);}}var key = arg.slice(-1)[0];if (!broken && key !== '-') {if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])&& !flags.bools[key]&& (aliases[key] ? !aliasIsBoolean(key) : true)) {setArg(key, args[i+1], arg);i++;}else if (args[i+1] && /^(true|false)$/.test(args[i+1])) {setArg(key, args[i+1] === 'true', arg);i++;}else {setArg(key, flags.strings[key] ? '' : true, arg);}}}else {if (!flags.unknownFn || flags.unknownFn(arg) !== false) {argv._.push(flags.strings['_'] || !isNumber(arg) ? arg : Number(arg));}if (opts.stopEarly) {argv._.push.apply(argv._, args.slice(i + 1));break;}}}Object.keys(defaults).forEach(function (key) {if (!hasKey(argv, key.split('.'))) {setKey(argv, key.split('.'), defaults[key]);(aliases[key] || []).forEach(function (x) {setKey(argv, x.split('.'), defaults[key]);});}});if (opts['--']) {argv['--'] = new Array();notFlags.forEach(function(key) {argv['--'].push(key);});}else {notFlags.forEach(function(key) {argv._.push(key);});}return argv;};function hasKey (obj, keys) {var o = obj;keys.slice(0,-1).forEach(function (key) {o = (o[key] || {});});var key = keys[keys.length - 1];return key in o;}function isNumber (x) {if (typeof x === 'number') return true;if (/^0x[0-9a-f]+$/i.test(x)) return true;return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);}
// lib_ls.js - 1.8GB// build array of files to copy from string_server_sourceexport const array_get_files_to_copy = function(ns, string_server_source, string_substring) {const array_files_in_server = ns.ls(string_server_source);let array_files_to_copy = [];for (let integer_indices_0 = 0; integer_indices_0 < array_files_in_server.length; ++integer_indices_0) {const string_file = array_files_in_server[integer_indices_0];if (string_file.includes(string_substring)) {array_files_to_copy.push(string_file);}}return array_files_to_copy;};
// lib_kill.js - 2.3GB// kills running instances of the named script on a named serverexport const void_kill_script_named_server_named = function (ns,string_server,string_script) {const array_scripts_running = ns.ps(string_server);for (let integer_indices_0 = 0;integer_indices_0 < array_scripts_running.length;++integer_indices_0) {const object_script = array_scripts_running[integer_indices_0],string_script_running = object_script.filename;string_script_running === string_script &&ns.kill(string_script_running, string_server, ...object_script.args);}};
// // debugging function that produces an output by running the function it is debugging. as such, should not be used on impure functions. NOT WORKING PROPERLY, CAUSES INFINITE LOOPS DUE TO RECURSION.// const void_debug_pure = function() {// const boolean_on = true;// const array_arguments = Array.from(arguments);// if (boolean_on) {// const ns = array_arguments[1][0];// for (let integer_indices_0 = 0; integer_indices_0 < array_arguments[1].length; ++integer_indices_0) {// const string_argument_type = typeof(array_arguments[1][integer_indices_0]);// if (integer_indices_0 === 0) {// ns.tprint(`${new Date(Date.now()).toISOString()}: ${array_arguments[integer_indices_0].name}(`);// }// else {// if (integer_indices_0 < array_arguments[1].length - 1) {// ns.tprint(`${string_argument_type}: ${JSON.stringify(array_arguments[1][integer_indices_0])}, `);// }// if (integer_indices_0 === array_arguments[1].length - 1) {// ns.tprint(`${string_argument_type}: ${JSON.stringify(array_arguments[1][integer_indices_0])})`);// }// }// }// ns.tprint(`output: ${JSON.stringify(eval(array_arguments[0].name)(...array_arguments[1]))}`);// }// };// outputs function names and arguments passed to them.const void_debug = function() {const boolean_on = false;const array_arguments = Array.from(arguments);if (boolean_on) {const ns = array_arguments[1][0];for (let integer_indices_0 = 0; integer_indices_0 < array_arguments[1].length; ++integer_indices_0) {const string_argument_type = typeof(array_arguments[1][integer_indices_0]);if (integer_indices_0 === 0) {ns.tprint(`${new Date(Date.now()).toISOString()}: ${array_arguments[integer_indices_0].name}(`);}else {if (integer_indices_0 < array_arguments[1].length - 1) {ns.tprint(`${string_argument_type}: ${JSON.stringify(array_arguments[1][integer_indices_0])}, `);}if (integer_indices_0 === array_arguments[1].length - 1) {ns.tprint(`${string_argument_type}: ${JSON.stringify(array_arguments[1][integer_indices_0])})`);}}}}};const object_get_constants = function(ns) {void_debug(object_get_constants, Array.from(arguments));const object_get_bitnode_multipliers = function(ns) {// try {// return ns.getBitNodeMultipliers();// }// catch (error) {// return {// HackingLevelMultiplier: 1,// StrengthLevelMultiplier: 1,// DefenseLevelMultiplier: 1,// DexterityLevelMultiplier: 1,// AgilityLevelMultiplier: 1,// CharismaLevelMultiplier: 1,// ServerGrowthRate: 1,// ServerMaxMoney: 1,// ServerStartingMoney: 1,// ServerStartingSecurity: 1,// ServerWeakenRate: 1,// HomeComputerRamCost: 1,// PurchasedServerCost: 1,// PurchasedServerLimit: 1,// PurchasedServerMaxRam: 1,// CompanyWorkMoney: 1,// CrimeMoney: 1,// HacknetNodeMoney: 1,// ManualHackMoney: 1,// ScriptHackMoney: 1,// CodingContractMoney: 1,// ClassGymExpGain: 1,// CompanyWorkExpGain: 1,// CrimeExpGain: 1,// FactionWorkExpGain: 1,// HackExpGain: 1,// FactionPassiveRepGain: 1,// FactionWorkRepGain: 1,// RepToDonateToFaction: 1,// AugmentationMoneyCost: 1,// AugmentationRepCost: 1,// InfiltrationMoney: 1,// InfiltrationRep: 1,// FourSigmaMarketDataCost: 1,// FourSigmaMarketDataApiCost: 1,// CorporationValuation: 1,// BladeburnerRank: 1,// BladeburnerSkillCost: 1,// DaedalusAugsRequirement: 1,// };// }return {HackingLevelMultiplier: 1,StrengthLevelMultiplier: 1,DefenseLevelMultiplier: 1,DexterityLevelMultiplier: 1,AgilityLevelMultiplier: 1,CharismaLevelMultiplier: 1,ServerGrowthRate: 1,ServerMaxMoney: 1,ServerStartingMoney: 1,ServerStartingSecurity: 1,ServerWeakenRate: 1,HomeComputerRamCost: 1,PurchasedServerCost: 1,PurchasedServerLimit: 1,PurchasedServerMaxRam: 1,CompanyWorkMoney: 1,CrimeMoney: 1,HacknetNodeMoney: 1,ManualHackMoney: 1,ScriptHackMoney: 1,CodingContractMoney: 1,ClassGymExpGain: 1,CompanyWorkExpGain: 1,CrimeExpGain: 1,FactionWorkExpGain: 1,HackExpGain: 1,FactionPassiveRepGain: 1,FactionWorkRepGain: 1,RepToDonateToFaction: 1,AugmentationMoneyCost: 1,AugmentationRepCost: 1,InfiltrationMoney: 1,InfiltrationRep: 1,FourSigmaMarketDataCost: 1,FourSigmaMarketDataApiCost: 1,CorporationValuation: 1,BladeburnerRank: 1,BladeburnerSkillCost: 1,DaedalusAugsRequirement: 1,};};const object_get_stats = function(ns) {// try {// return ns.getStats();// }// catch (error) {// return {// hacking: ns.getHackingLevel(),// strength: 1,// defense: 1,// dexterity: 1,// agility: 1,// charisma: 1,// intelligence: 1// };// }return {hacking: ns.getHackingLevel(),strength: 1,defense: 1,dexterity: 1,agility: 1,charisma: 1,intelligence: 1};};// object_constants are from https://github.com/danielyxie/bitburner/blob/master/src/Constants.jsconst object_constants = {// cost of server per 1 GB of RAMBaseCostFor1GBOfRamServer: 55000,// maximum amount of purchased servers allowedPurchasedServerLimit: 25,// minimum ram of purchased servers possibleinteger_server_ram_min: 2,// maximum ram of purchased servers possible. 2^20PurchasedServerMaxRam: 1048576,// filenames and related functions of exploitsobject_exploits: {brutessh: {file: "BruteSSH.exe",function: "brutessh"},ftpcrack: {file: "FTPCrack.exe",function: "ftpcrack"},relaysmtp: {file: "relaySMTP.exe",function: "relaysmtp"},httpworm: {file: "HTTPWorm.exe",function: "httpworm"},sqlinject: {file: "SQLInject.exe",function: "sqlinject"}},// factor used in determining the amount security increases by from a grow or hackServerFortifyAmount: 0.002,// amount security decreases by from a weakenServerWeakenAmount: 0.05,// base percentage cash increases by from a growServerBaseGrowthRate: 1.03,// max percentage cash increases by from a grow (accounts for server security)ServerMaxGrowthRate: 1.0035,// hacking multipliersobject_hacking_multipliers: ns.getHackingMultipliers(),// bitnode multipliersobject_bitnode_multipliers: object_get_bitnode_multipliers(ns),// player statsobject_stats: object_get_stats(ns),// filenames and ram cost of helper object_scriptsobject_scripts: {weaken: {file: "weaken.js",ram: 1.75 // or ns.getScriptRam(object_get_constants(ns).object_scripts.weaken.file);},grow: {file: "grow.js",ram: 1.75 // or ns.getScriptRam(object_get_constants(ns).object_scripts.grow.file);},hack: {file: "hack.js",ram: 1.7 // or ns.getScriptRam(object_get_constants(ns).object_scripts.hack.file);}},// name of current host (usually "home")string_host: "home" // or ns.getHostname()};return object_constants;};// returns an array of all servers in the gameconst array_get_servers = function(ns) {void_debug(array_get_servers, Array.from(arguments));const string_host = object_get_constants(ns).string_host;const array_servers = [string_host];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const array_scan_results = ns.scan(array_servers[integer_indices_0]);for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {array_servers.push(array_scan_results[integer_indices_1]);}}}return array_servers;};// returns the total ram of a serverconst integer_get_server_ram_total = function(ns, string_server) {void_debug(integer_get_server_ram_total, Array.from(arguments));return (ns.getServerRam(string_server))[0];};// returns the used ram of a serverconst float_get_server_ram_used = function(ns, string_server) {void_debug(float_get_server_ram_used, Array.from(arguments));return (ns.getServerRam(string_server))[1];};// returns the amount of free ram of a serverconst float_get_server_ram_free = function(ns, string_server) {void_debug(float_get_server_ram_free, Array.from(arguments));return integer_get_server_ram_total(ns, string_server) - float_get_server_ram_used(ns, string_server);};// buy/upgrade servers// true if all bought servers have ram == PurchasedServerMaxRamconst boolean_servers_bought_all_max = function(ns) {void_debug(boolean_servers_bought_all_max, Array.from(arguments));const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let boolean_tripwire = true;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {if (integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]) < object_get_constants(ns).PurchasedServerMaxRam) {boolean_tripwire = false;}}return boolean_tripwire;}};// returns bought server with smallest RAMconst string_get_server_bought_smallest = function(ns) {void_debug(string_get_server_bought_smallest, Array.from(arguments));const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let string_server_smallest;let integer_size_smallest = object_get_constants(ns).PurchasedServerMaxRam;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {let integer_server_ram_total = integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]);if (integer_server_ram_total < integer_size_smallest) {string_server_smallest = array_servers_bought[integer_indices_0];integer_size_smallest = integer_server_ram_total;}}return string_server_smallest;}};// returns bought server with biggest RAMconst string_get_server_bought_biggest = function(ns) {void_debug(string_get_server_bought_biggest, Array.from(arguments));const array_servers_bought = ns.getPurchasedServers();if (array_servers_bought.length > 0) {let string_server_biggest;let integer_size_biggest = object_get_constants(ns).integer_server_ram_min;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_bought.length; ++integer_indices_0) {let integer_server_ram_total = integer_get_server_ram_total(ns, array_servers_bought[integer_indices_0]);if (integer_server_ram_total > integer_size_biggest) {string_server_biggest = array_servers_bought[integer_indices_0];integer_size_biggest = integer_server_ram_total;}}return string_server_biggest;}};// return the RAM of the server with the biggest RAM that you can affordconst integer_get_server_ram_biggest_afforded = function(ns) {void_debug(integer_get_server_ram_biggest_afforded, Array.from(arguments));const object_constants = object_get_constants(ns);let integer_server_ram_biggest_afforded = Math.pow(2, Math.trunc(Math.log2(ns.getServerMoneyAvailable(object_constants.string_host) / object_constants.BaseCostFor1GBOfRamServer) / Math.log2(2)));if (integer_server_ram_biggest_afforded > object_constants.PurchasedServerMaxRam) {integer_server_ram_biggest_afforded = object_constants.PurchasedServerMaxRam;}return integer_server_ram_biggest_afforded;};// buys the best server with cash available, unless there are 25 servers already, in which case deletes the worst server, unless all 25 have ram == PurchasedServerMaxRamconst void_server_buy_or_upgrade = function(ns, string_name) {void_debug(void_server_buy_or_upgrade, Array.from(arguments));const object_constants = object_get_constants(ns);const array_servers_bought = ns.getPurchasedServers();// if array_servers_bought.length <= 2 and your cash is >= the cheapest serverconst integer_server_ram_biggest_afforded = integer_get_server_ram_biggest_afforded(ns);// you currently have no bought servers yet, get a server with ram at least equal to "home"if (// ram is at least equal to the minimum ram possible for purchased servers(integer_server_ram_biggest_afforded >= object_constants.integer_server_ram_min) &&// ram is at least equal to the ram of "home", probably a bad idea to hardcode this since the string_name of "home" might change in the future. tags: warning, potential, problem(integer_server_ram_biggest_afforded >= integer_get_server_ram_total(ns, object_constants.string_host)) &&// you have no bought servers yet(array_servers_bought.length === 0)) {ns.purchaseServer(string_name, integer_server_ram_biggest_afforded);}// you have one or more servers alreadyif ((array_servers_bought.length > 0)) {// get smallest bought serverconst string_server_bought_smallest = string_get_server_bought_smallest(ns);// get biggest bought serverconst string_server_bought_biggest = string_get_server_bought_biggest(ns);// get the ram of the biggest bought serverconst integer_server_bought_biggest_ram_total = integer_get_server_ram_total(ns, string_server_bought_biggest);// you currently own less than the maximum amount of purchased servers allowedif (array_servers_bought.length < object_constants.PurchasedServerLimit) {// you dont own a server with max ram yet, buy a server with ram greater than the ram of your biggest bought serverif ((integer_server_bought_biggest_ram_total != object_constants.PurchasedServerLimit) &&(integer_server_ram_biggest_afforded > integer_server_bought_biggest_ram_total)) {ns.purchaseServer(string_name, integer_server_ram_biggest_afforded);}// you already bought a server with max ram, buy another server the max possible ramif ((integer_server_bought_biggest_ram_total == object_constants.PurchasedServerMaxRam) &&(integer_server_ram_biggest_afforded == object_constants.PurchasedServerMaxRam)) {ns.purchaseServer(string_name, integer_server_ram_biggest_afforded);}}if (// you currently own the maximum amount of purchased servers allowed(array_servers_bought.length == object_constants.PurchasedServerLimit) &&// your servers do not all have the maximum ram possible for purchased servers!(boolean_servers_bought_all_max(ns, object_constants.PurchasedServerMaxRam))) {const integer_price_server_bought_biggest = object_constants.BaseCostFor1GBOfRamServer * integer_server_bought_biggest_ram_total;// is cash at least equal to the price of the cheapest server bought + the next highest server after that, which is twice the price of the former, thus 3. this check is so that a server with the same ram as before isn't bought.if (ns.getServerMoneyAvailable(object_constants.string_host) >= 3 * integer_price_server_bought_biggest) {ns.deleteServer(string_server_bought_smallest);ns.purchaseServer(string_name, integer_server_ram_biggest_afforded);}}}};// root servers// returns an array of all servers that are yet to be rootedconst array_get_servers_unrooted = function(ns) {void_debug(array_get_servers_unrooted, Array.from(arguments));const array_servers = array_get_servers(ns);const array_servers_unrooted = [];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {if (!ns.hasRootAccess(array_servers[integer_indices_0])) {array_servers_unrooted.push(array_servers[integer_indices_0]);}}return array_servers_unrooted;};// // opens ports of a server using available object_exploits// const void_open_ports = function(ns, string_server_target) {// void_debug_impure(void_open_ports, Array.from(arguments));// const object_constants = object_get_constants(ns);// const object_exploits = object_constants.object_exploits;// for (const exploit in object_exploits) {// if (ns.fileExists(object_exploits[exploit].file, object_constants.string_host)) {// eval("ns." + object_exploits[exploit].function + "(\"" + string_server_target + "\")");// }// }// };// tries to open ports of serverconst void_open_ports_try = function(ns, string_server_target) {void_debug(void_open_ports_try, Array.from(arguments));const object_exploits = object_get_constants(ns).object_exploits;for (const exploit in object_exploits) {try {eval("ns." + object_exploits[exploit].function + "(\"" + string_server_target + "\")");}catch (error) {}}};// // returns the amount of exploits present in the string_host// const integer_get_exploits_amount = function(ns) {// void_debug_pure(integer_get_exploits_amount, Array.from(arguments));// const object_constants = object_get_constants(ns);// const object_exploits = object_constants.object_exploits;// let integer_exploits_amount = 0;// for (const exploit in object_exploits) {// if (ns.fileExists(object_exploits[exploit].file, object_constants.string_host)) {// ++integer_exploits_amount;// }// }// return integer_exploits_amount;// };// // opens ports and nukes any unrooted servers if the player's hacking level is high enough to do so and the appropriate number of object_exploits are present// const void_open_ports_nuke = function(ns) {// void_debug_impure(void_open_ports_nuke, Array.from(arguments));// const array_servers_unrooted = array_get_servers_unrooted(ns);// for (let integer_indices_0 = 0; integer_indices_0 < array_servers_unrooted.length; ++integer_indices_0) {// const string_server_unrooted = array_servers_unrooted[integer_indices_0];// if (// (ns.getServerRequiredHackingLevel(string_server_unrooted) <= object_get_constants(ns).object_stats.hacking) &&// (ns.getServerNumPortsRequired(string_server_unrooted) <= integer_get_exploits_amount(ns))// ) {// void_open_ports(ns, string_server_unrooted);// ns.nuke(string_server_unrooted);// }// }// };// opens ports and nukes any unrooted servers if the player's hacking level is high enough to do so and the appropriate number of object_exploits are presentconst void_open_ports_nuke_try = function(ns) {void_debug(void_open_ports_nuke_try, Array.from(arguments));const array_servers_unrooted = array_get_servers_unrooted(ns);for (let integer_indices_0 = 0; integer_indices_0 < array_servers_unrooted.length; ++integer_indices_0) {const string_server_unrooted = array_servers_unrooted[integer_indices_0];void_open_ports_try(ns, string_server_unrooted);try {ns.nuke(string_server_unrooted);} catch (error) {}}};// targetting// sort an array of servers by their amounts of RAM, from lowest to highestconst void_sort_by_server_ram = function(ns, array_servers) {void_debug(void_sort_by_server_ram, Array.from(arguments));return array_servers.sort((string_element_0, string_element_1) => (integer_get_server_ram_total(ns, string_element_0) - integer_get_server_ram_total(ns, string_element_1)));};// returns the score of a server which is calculated by taking into account its max cash, growth, minimum security level and server difficultyconst integer_server_score = function(ns, string_server_target) {void_debug(integer_server_score, Array.from(arguments));return ns.getServerMaxMoney(string_server_target) * ns.getServerGrowth(string_server_target) * Math.pow(ns.getServerMinSecurityLevel(string_server_target), -1) * Math.pow(ns.getServerRequiredHackingLevel(string_server_target), -1);};// sort an array of servers by their integer_server_score, from lowest to highestconst void_sort_by_server_scores = function(ns, array_servers) {void_debug(void_sort_by_server_scores, Array.from(arguments));return array_servers.sort((string_element_0, string_element_1) => integer_server_score(ns, string_element_0) - integer_server_score(ns, string_element_1));};// weaken, grow, hack// returns an array of all rooted serversconst array_get_servers_rooted = function(ns) {void_debug(array_get_servers_rooted, Array.from(arguments));const array_servers = array_get_servers(ns);const array_servers_rooted = [];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {if (ns.hasRootAccess(array_servers[integer_indices_0])) {array_servers_rooted.push(array_servers[integer_indices_0]);}}return array_servers_rooted;};// // returns the sum of all free ram from all the servers you have root access to// const float_get_ram_free_total = function(ns) {// void_debug_pure(float_get_ram_free_total, Array.from(arguments));// const array_servers_rooted = array_get_servers_rooted(ns);// let float_free_ram_from_servers_rooted = 0.0;// for (let integer_indices_0 = 0; integer_indices_0 < array_servers_rooted.length; ++integer_indices_0) {// float_free_ram_from_servers_rooted += float_get_server_ram_free(ns, array_servers_rooted[integer_indices_0]);// }// return float_free_ram_from_servers_rooted;// };// // returns what percentage of ram_free_total the ram of a server is// const float_get_percentage_of_server_ram_free_from_ram_free_total = function(ns, string_server) {// void_debug_pure(float_get_percentage_of_server_ram_free_from_ram_free_total, Array.from(arguments));// return float_get_server_ram_free(ns, string_server) / float_get_ram_free_total(ns);// };// returns integer_threads_required if it's less than or equal to integer_threads_available, otherwise returns integer_threads_availableconst integer_get_corrected_threads = function(ns, integer_threads_required, integer_threads_available) {void_debug(integer_get_corrected_threads, Array.from(arguments));if (integer_threads_required > integer_threads_available) {return integer_threads_available;}else {return integer_threads_required;}};// weaken stuff// the threads required for weaken to cause string_server_target's security to decrease by float_weaken_amount. adapted from `weaken` in NetscriptFunctions.js and `weaken` in Server.tsconst integer_get_threads_required_for_weaken = function(ns, float_weaken_amount) {void_debug(integer_get_threads_required_for_weaken, Array.from(arguments));const object_constants = object_get_constants(ns);return float_weaken_amount * Math.pow(object_constants.ServerWeakenAmount, -1) * Math.pow(object_constants.object_bitnode_multipliers.ServerWeakenRate, -1);};// returns the threads required for weaken to cause string_server_target's security to reach minimumconst integer_get_threads_required_for_min_security_weaken = function(ns, string_server_target, float_server_target_security) {void_debug(integer_get_threads_required_for_min_security_weaken, Array.from(arguments));return Math.ceil(integer_get_threads_required_for_weaken(ns, float_server_target_security - ns.getServerMinSecurityLevel(string_server_target)));};// returns the threads required for weaken to cause string_server_target's security to reach minimum if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_weaken = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security) {void_debug(integer_get_threads_weaken, Array.from(arguments));const integer_threads_available = Math.trunc(float_server_used_ram_free / object_get_constants(ns).object_scripts.weaken.ram);const integer_threads_required = integer_get_threads_required_for_min_security_weaken(ns, string_server_target, float_server_target_security);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// grow stuff// returns the number of threads of `grow` needed to grow `string_server_target` by the percentage `float_growth` when it has security of `float_server_security`. float_growth = How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50). adapted from `numCycleForGrowth` in https://github.com/danielyxie/bitburner/blob/master/src/Server/ServerHelpers.tsconst integer_get_threads_for_growth = function(ns, string_server_target, float_server_target_security, float_growth) {void_debug(integer_get_threads_for_growth, Array.from(arguments));const object_constants = object_get_constants(ns);let ajdGrowthRate = 1 + (object_constants.ServerBaseGrowthRate - 1) / float_server_target_security;if (ajdGrowthRate > object_constants.ServerMaxGrowthRate) {ajdGrowthRate = object_constants.ServerMaxGrowthRate;}const serverGrowthPercentage = ns.getServerGrowth(string_server_target) / 100;const cycles = Math.log(float_growth)/(Math.log(ajdGrowthRate) * object_constants.object_hacking_multipliers.growth * serverGrowthPercentage * object_constants.object_bitnode_multipliers.ServerGrowthRate);return Math.ceil(cycles);};// Inverse function of integer_get_threads_for_growth. Returns the percentage growth in decimal form (e.g., 2 = 100% growth).const float_get_growth_from_threads = function(ns, string_server_target, float_server_target_security, integer_threads) {void_debug(integer_get_threads_for_growth, Array.from(arguments));const object_constants = object_get_constants(ns);let ajdGrowthRate = 1 + (object_constants.ServerBaseGrowthRate - 1) / float_server_target_security;if (ajdGrowthRate > object_constants.ServerMaxGrowthRate) {ajdGrowthRate = object_constants.ServerMaxGrowthRate;}const serverGrowthPercentage = ns.getServerGrowth(string_server_target) / 100;const float_growth = Math.pow(ajdGrowthRate, integer_threads * object_constants.object_hacking_multipliers.growth * serverGrowthPercentage * object_constants.object_bitnode_multipliers.ServerGrowthRate);return float_growth;};// returns the threads required by grow to grow string_server_target's cash to its maximum when security is at float_server_target_security and current cash is at float_server_target_cashconst integer_get_threads_required_for_max_cash_grow = function(ns, string_server_target, float_server_target_security, float_server_target_cash) {void_debug(integer_get_threads_required_for_max_cash_grow, Array.from(arguments));return integer_get_threads_for_growth(ns, string_server_target, float_server_target_security, ns.getServerMaxMoney(string_server_target) / float_server_target_cash);};// returns the threads required by grow to grow string_server_target's cash to its maximum if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_grow = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_server_target_cash) {void_debug(integer_get_threads_grow, Array.from(arguments));const integer_threads_available = Math.trunc(float_server_used_ram_free / object_get_constants(ns).object_scripts.grow.ram);const integer_threads_required = integer_get_threads_required_for_max_cash_grow(ns, string_server_target, float_server_target_security, float_server_target_cash);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// hack stuff// returns the percentage of the available cash in string_server_target that is stolen when it is hacked when it has float_server_target_security. adapted from calculatePercentMoneyHacked() in https://github.com/danielyxie/bitburner/blob/master/src/Hacking.js . See also `hackDifficulty` in https://github.com/danielyxie/bitburner/blob/master/src/Server.jsconst float_get_percentage_of_cash_from_available_per_hack = function(ns, string_server_target, float_server_target_security) {void_debug(float_get_percentage_of_cash_from_available_per_hack, Array.from(arguments));const object_constants = object_get_constants(ns);const balanceFactor = 240;const difficultyMult = (100 - float_server_target_security) / 100;const skillMult = (object_constants.object_stats.hacking - (ns.getServerRequiredHackingLevel(string_server_target) - 1)) / object_constants.object_stats.hacking;let percentMoneyHacked = difficultyMult * skillMult * object_constants.object_hacking_multipliers.money / balanceFactor;if (percentMoneyHacked < 0) {return 0;}if (percentMoneyHacked > 1) {return 1;}return percentMoneyHacked * object_constants.object_bitnode_multipliers.ScriptHackMoney;};// returns the threads required to steal "float_percentage_to_steal" of available money in string_server_targetconst float_get_threads_required_to_hack_percentage = function(ns, string_server_target, float_server_target_security, float_percentage_to_steal) {void_debug(float_get_threads_required_to_hack_percentage, Array.from(arguments));return float_percentage_to_steal / float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security);};// returns the threads required to steal "float_percentage_to_steal" of available money in string_server_target if possible, otherwise, return max threads that string_server_used can provideconst integer_get_threads_hack = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_percentage_to_steal) {void_debug(integer_get_threads_hack, Array.from(arguments));const integer_threads_available = Math.trunc(float_server_used_ram_free / object_get_constants(ns).object_scripts.hack.ram);const integer_threads_required = float_get_threads_required_to_hack_percentage(ns, string_server_target, float_server_target_security, float_percentage_to_steal);return integer_get_corrected_threads(ns, integer_threads_required, integer_threads_available);};// percentage to steal stuff// returns the threads required by grow to grow a string_server_target's money back to its original value after stealing float_percentage_to_steal of it, and assuming security is at float_server_target_securityconst integer_get_threads_required_for_cash_grow_after_percentage_stolen = function(ns, string_server_target, float_server_target_security, float_percentage_to_steal) {void_debug(integer_get_threads_required_for_cash_grow_after_percentage_stolen, Array.from(arguments));return integer_get_threads_for_growth(ns, string_server_target, float_server_target_security, Math.pow(1 - float_percentage_to_steal, -1));};// returns true if there is enough ram to provide the threads required by grow to grow string_server_target's cash by float_percentage_to_steal if possible, otherwise, returns false. assumes security is at float_server_target_securityconst bool_is_ram_enough_for_growth_percentage = function(ns, float_server_used_ram_free, string_server_target, float_percentage_to_steal, float_server_target_security) {void_debug(bool_is_ram_enough_for_growth_percentage, Array.from(arguments));const integer_threads_available = Math.trunc(float_server_used_ram_free * Math.pow (object_get_constants(ns).object_scripts.grow.ram, -1));const integer_threads_required = integer_get_threads_required_for_cash_grow_after_percentage_stolen(ns, string_server_target, float_server_target_security, float_percentage_to_steal);if (integer_threads_required < integer_threads_available) {return false;}else {return true;}};// returns the number of cycles of bisection to be done to reach a certain precision, rounded up to the nearest integerconst integer_get_cycles_for_bisection_float_precision = function(ns, float_precision) {void_debug(integer_get_cycles_for_bisection_float_precision, Array.from(arguments));return Math.ceil(Math.log(Math.pow(float_precision, -1)) * Math.pow(Math.log(2), -1));};// returns optimum percentage to steal such that cash stolen is as high as float_cap and string_server_target's cash still able to be grown to 100% after one grow with the ram it has available by using a binary search algorithmconst float_get_percentage_to_steal = function(ns, float_server_used_ram_free, string_server_target, float_server_target_security, float_precision, float_cap) {void_debug(float_get_percentage_to_steal, Array.from(arguments));let float_ceiling = 1;let float_floor = 0;let float_percentage_to_steal = (float_ceiling + float_floor) * 0.5;for (let integer_indices_0 = 0; integer_indices_0 < integer_get_cycles_for_bisection_float_precision(ns, float_precision); ++integer_indices_0) {if (bool_is_ram_enough_for_growth_percentage(ns, float_server_used_ram_free, string_server_target, float_percentage_to_steal, float_server_target_security)) {float_floor = float_percentage_to_steal;}else {float_ceiling = float_percentage_to_steal;}float_percentage_to_steal = (float_ceiling + float_floor) * 0.5;}// cap which can be used so not all money is stolen, which can be bad because it's harder to grow from 0 in most casesif (float_percentage_to_steal > float_cap) {return float_cap;}else {return float_percentage_to_steal;}};// copy stuff// copies files to all rooted serversconst void_copy_files_to_string_servers_rooted = function(ns, array_files, string_source) {void_debug(void_copy_files_to_string_servers_rooted, Array.from(arguments));const array_servers_rooted = array_get_servers_rooted(ns);for (let integer_indices_0 = 0; integer_indices_0 < array_servers_rooted.length; ++integer_indices_0) {for (let integer_indices_1 = 0; integer_indices_1 < array_files.length; ++integer_indices_1) {// if (!ns.fileExists(array_files[integer_indices_1], array_servers_rooted[integer_indices_0])) {ns.scp(array_files[integer_indices_1], string_source, array_servers_rooted[integer_indices_0]);// }}}};// schedulingconst array_get_servers_rooted_sorted_by_ram = function(ns) {void_debug(array_get_servers_rooted_sorted_by_ram, Array.from(arguments));let array_servers_rooted = array_get_servers_rooted(ns);void_sort_by_server_ram(ns, array_servers_rooted);return array_servers_rooted;};const array_get_servers_rooted_sorted_by_score = function(ns) {void_debug(array_get_servers_rooted_sorted_by_score, Array.from(arguments));let array_servers_rooted = array_get_servers_rooted(ns);void_sort_by_server_scores(ns, array_servers_rooted);return array_servers_rooted;};const string_get_server_rooted_with_ram_biggest = function(ns) {void_debug(string_get_server_rooted_with_ram_biggest, Array.from(arguments));const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram(ns);return array_servers_rooted_sorted_by_ram[array_servers_rooted_sorted_by_ram.length - 1];};const string_get_server_rooted_with_score_biggest = function(ns) {void_debug(string_get_server_rooted_with_score_biggest, Array.from(arguments));const array_servers_rooted_sorted_by_score = array_get_servers_rooted_sorted_by_score(ns);return array_servers_rooted_sorted_by_score[array_servers_rooted_sorted_by_score.length - 1];};const string_action_decide = function(ns, string_server_target, float_server_target_security, float_server_target_cash) {void_debug(string_action_decide, Array.from(arguments));if (float_server_target_security > ns.getServerMinSecurityLevel(string_server_target)) {return "weaken";}else {if (float_server_target_cash < ns.getServerMaxMoney(string_server_target)) {return "grow";}else {return "hack";}}};const bool_can_server_run_script_threads = function(ns, float_server_used_ram_free, float_script_ram, integer_threads) {void_debug(bool_can_server_run_script_threads, Array.from(arguments));if (float_script_ram * integer_threads > float_server_used_ram_free) {return false;}else {return true;}};// Returns time it takes to complete a hack on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsconst float_get_time_hack = function(ns, string_server_target, float_server_target_security, hack, int) {void_debug(float_get_time_hack, Array.from(arguments));const object_constants = object_get_constants(ns);const difficultyMult = ns.getServerRequiredHackingLevel(string_server_target) * float_server_target_security;const baseDiff = 500;const baseSkill = 50;const diffFactor = 2.5;const intFactor = 0.1;if (hack == null) {hack = object_constants.object_stats.hacking;}if (int == null) {int = object_constants.object_stats.intelligence;}var skillFactor = (diffFactor * difficultyMult + baseDiff);// tslint:disable-next-lineskillFactor /= (hack + baseSkill + (intFactor * int));const hackTimeMultiplier = 5;const hackingTime = hackTimeMultiplier * skillFactor / object_constants.object_hacking_multipliers.speed;return hackingTime;};// Returns time it takes to complete a grow operation on a server, in seconds. Adapted from `calculateGrowTime` in Hacking.jsconst float_get_time_grow = function(ns, string_server_target, float_server_target_security, hack, int) {void_debug(float_get_time_grow, Array.from(arguments));const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2return growTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security, hack, int);};// Returns time it takes to complete a weaken operation on a server, in seconds. Adapted from `calculateHackingTime` in Hacking.jsconst float_get_time_weaken = function(ns, string_server_target, float_server_target_security, hack, int) {void_debug(float_get_time_weaken, Array.from(arguments));const weakenTimeMultiplier = 4; // Relative to hacking timereturn weakenTimeMultiplier * float_get_time_hack(ns, string_server_target, float_server_target_security, hack, int);};export const array_make_schedule = function(ns, float_precision, float_cap, float_padding_seconds) {void_debug(array_make_schedule, Array.from(arguments));const object_constants = object_get_constants(ns);const object_scripts = object_constants.object_scripts;const array_servers_rooted_sorted_by_ram = array_get_servers_rooted_sorted_by_ram (ns);const string_server_target = string_get_server_rooted_with_score_biggest(ns);const float_server_target_security_minimum = ns.getServerMinSecurityLevel(string_server_target);const float_server_target_cash_maximum = ns.getServerMaxMoney(string_server_target);const float_time_weaken = float_get_time_weaken(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));const float_time_grow = float_get_time_grow(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));const float_time_hack = float_get_time_hack(ns, string_server_target, ns.getServerSecurityLevel(string_server_target));let float_server_target_security_current = ns.getServerSecurityLevel(string_server_target);let float_server_target_cash_current = ns.getServerMoneyAvailable(string_server_target);let array_schedule = [];// assumes weaken takes longestlet integer_time_action_finishes_seconds = float_time_weaken;for (let integer_indices_0 = 0; integer_indices_0 < array_servers_rooted_sorted_by_ram.length; ++integer_indices_0) {const string_server_used = array_servers_rooted_sorted_by_ram[integer_indices_0];let float_server_used_ram_free_current = float_get_server_ram_free(ns, string_server_used);while (float_server_used_ram_free_current > 0) {const string_action = string_action_decide(ns, string_server_target, float_server_target_security_current, float_server_target_cash_current);let schedule_item = {string_action: string_action,string_server_used: string_server_used,string_server_target: string_server_target,float_server_used_ram_free_before: float_server_used_ram_free_current,float_server_target_security_before: float_server_target_security_current,float_server_target_cash_before: float_server_target_cash_current};switch (string_action) {case "weaken": {if (!bool_can_server_run_script_threads(ns, float_server_used_ram_free_current, object_scripts.weaken.ram, 1)) {// ram of the currently used server isn't actually 0, we're just doing this to skip it and start using a server with more ramfloat_server_used_ram_free_current = 0;break;}const integer_threads_weaken = integer_get_threads_weaken(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current);float_server_used_ram_free_current -= integer_threads_weaken * object_scripts.weaken.ram;let float_server_target_security_uncorrected = float_server_target_security_current - (integer_threads_weaken * object_constants.ServerWeakenAmount);if (float_server_target_security_uncorrected < float_server_target_security_minimum) {float_server_target_security_current = float_server_target_security_minimum;}else {float_server_target_security_current = float_server_target_security_uncorrected;}schedule_item.float_delay_seconds = integer_time_action_finishes_seconds - float_time_weaken + float_padding_seconds;integer_time_action_finishes_seconds += float_padding_seconds;schedule_item.integer_time_action_finishes_seconds = integer_time_action_finishes_seconds;schedule_item.integer_threads = integer_threads_weaken;schedule_item.float_ram_cost = integer_threads_weaken * object_scripts.weaken.ram;schedule_item.float_server_used_ram_free_after = float_server_used_ram_free_current;schedule_item.float_server_target_security_after = float_server_target_security_current;schedule_item.float_server_target_security_delta = float_server_target_security_current - schedule_item.float_server_target_security_before;array_schedule.push(schedule_item);// ns.tprint(`weaken item: ${JSON.stringify(schedule_item)}`);break;}case "grow": {if (!bool_can_server_run_script_threads(ns, float_server_used_ram_free_current, object_scripts.grow.ram, 1)) {// ram of the currently used server isn't actually 0, we're just doing this to skip it and start using a server with more ramfloat_server_used_ram_free_current = 0;break;}const integer_threads_grow = integer_get_threads_grow(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_server_target_cash_current);float_server_used_ram_free_current -= integer_threads_grow * object_scripts.grow.ram;let float_server_target_cash_current_uncorrected = float_server_target_cash_current * float_get_growth_from_threads(ns, string_server_target, float_server_target_security_current, integer_threads_grow);if (float_server_target_cash_current_uncorrected > float_server_target_cash_maximum) {float_server_target_cash_current = float_server_target_cash_maximum;}else {float_server_target_cash_current = float_server_target_cash_current_uncorrected;}// the following is adapted from `processSingleServerGrowth` in ServerHelpers.ts and `fortify` in Server.tsfloat_server_target_security_current += 2 * object_constants.ServerFortifyAmount * integer_threads_grow;schedule_item.float_delay_seconds = integer_time_action_finishes_seconds - float_time_grow + float_padding_seconds;integer_time_action_finishes_seconds += float_padding_seconds;schedule_item.integer_time_action_finishes_seconds = integer_time_action_finishes_seconds;schedule_item.integer_threads = integer_threads_grow;schedule_item.float_ram_cost = integer_threads_grow * object_scripts.grow.ram;schedule_item.float_server_used_ram_free_after = float_server_used_ram_free_current;schedule_item.float_server_target_security_after = float_server_target_security_current;schedule_item.float_server_target_security_delta = float_server_target_security_current - schedule_item.float_server_target_security_before;schedule_item.float_server_target_cash_after = float_server_target_cash_current;schedule_item.float_server_target_cash_delta = float_server_target_cash_current - schedule_item.float_server_target_cash_before;array_schedule.push(schedule_item);// ns.tprint(`grow item: ${JSON.stringify(schedule_item)}`);break;}case "hack": {if (!bool_can_server_run_script_threads(ns, float_server_used_ram_free_current, object_scripts.hack.ram, 1)) {// ram of the currently used server isn't actually 0, we're just doing this to skip it and start using a server with more ramfloat_server_used_ram_free_current = 0;break;}const integer_threads_hack = integer_get_threads_hack(ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_get_percentage_to_steal (ns, float_server_used_ram_free_current, string_server_target, float_server_target_security_current, float_precision, float_cap));float_server_used_ram_free_current -= integer_threads_hack * object_scripts.hack.ram;float_server_target_cash_current -= float_server_target_cash_current * float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security_current);// the following is adapted from `hack` in NetscriptFunctions.js and `fortify` in Server.tslet maxThreadNeeded = Math.ceil(1/float_get_percentage_of_cash_from_available_per_hack(ns, string_server_target, float_server_target_security_current)*(float_server_target_cash_current/float_server_target_cash_maximum));if (isNaN(maxThreadNeeded)) {// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large valuemaxThreadNeeded = 1e6;}float_server_target_security_current += object_constants.ServerFortifyAmount * Math.min(integer_threads_hack, maxThreadNeeded);schedule_item.float_delay_seconds = integer_time_action_finishes_seconds - float_time_hack + float_padding_seconds;integer_time_action_finishes_seconds += float_padding_seconds;schedule_item.integer_time_action_finishes_seconds = integer_time_action_finishes_seconds;schedule_item.integer_threads = integer_threads_hack;schedule_item.float_ram_cost = integer_threads_hack * object_scripts.hack.ram;schedule_item.float_server_used_ram_free_after = float_server_used_ram_free_current;schedule_item.float_server_target_security_after = float_server_target_security_current;schedule_item.float_server_target_security_delta = float_server_target_security_current - schedule_item.float_server_target_security_before;schedule_item.float_server_target_cash_after = float_server_target_cash_current;schedule_item.float_server_target_cash_delta = float_server_target_cash_current - schedule_item.float_server_target_cash_before;array_schedule.push(schedule_item);// ns.tprint(`hack item: ${JSON.stringify(schedule_item)}`);break;}}}}// ns.tprint(`array_schedule: ${JSON.stringify(array_schedule)}`);return array_schedule;};// script executors// execute the "weaken.js" scriptconst void_exec_script_weaken = async function(ns, string_server_used, string_server_target, threads, delay, identifier) {void_debug(void_exec_script_weaken, Array.from(arguments));await ns.exec(object_get_constants(ns).object_scripts.weaken.file, string_server_used, threads, string_server_used, string_server_target, delay, identifier);};// execute the "grow.js" scriptconst void_exec_script_grow = async function(ns, string_server_used, string_server_target, threads, delay, identifier) {void_debug(void_exec_script_grow, Array.from(arguments));await ns.exec(object_get_constants(ns).object_scripts.grow.file, string_server_used, threads, string_server_used, string_server_target, delay, identifier);};// execute the "hack.js" scriptconst void_exec_script_hack = async function(ns, string_server_used, string_server_target, threads, delay, identifier) {void_debug(void_exec_script_hack, Array.from(arguments));await ns.exec(object_get_constants(ns).object_scripts.hack.file, string_server_used, threads, string_server_used, string_server_target, delay, identifier);};// schedule runner. returns the the time it'll take to finish in milliseconds.export const void_schedule_runner = async function(ns, string_servers_bought_name, float_precision, float_cap, float_padding_seconds) {void_debug(void_schedule_runner, Array.from(arguments));const object_constants = object_get_constants(ns);const object_scripts = object_constants.object_scripts;void_server_buy_or_upgrade(ns, string_servers_bought_name);// opens ports and nukes any unrooted servers if the player's hacking level is high enough to do so and the appropriate number of object_exploits are presentvoid_open_ports_nuke_try(ns);// array of current servers in the game (including bought servers) to be used for the loop, sorted by ram, from lowest to highestconst array_servers_rooted_used = void_sort_by_server_ram(ns, array_get_servers_rooted(ns));// copy object_scripts to rooted serversvoid_copy_files_to_string_servers_rooted(ns, [object_scripts.weaken.file,object_scripts.grow.file,object_scripts.hack.file], object_constants.string_host, array_servers_rooted_used);const array_schedule = array_make_schedule(ns, float_precision, float_cap, float_padding_seconds);for (let integer_indices_0 = 0; integer_indices_0 < array_schedule.length; ++integer_indices_0) {switch (array_schedule[integer_indices_0].string_action) {case "weaken": {await void_exec_script_weaken(ns, array_schedule[integer_indices_0].string_server_used, array_schedule[integer_indices_0].string_server_target, array_schedule[integer_indices_0].integer_threads, array_schedule[integer_indices_0].float_delay_seconds * 1000, integer_indices_0);break;}case "grow": {await void_exec_script_grow(ns, array_schedule[integer_indices_0].string_server_used, array_schedule[integer_indices_0].string_server_target, array_schedule[integer_indices_0].integer_threads, array_schedule[integer_indices_0].float_delay_seconds * 1000, integer_indices_0);break;}case "hack": {await void_exec_script_hack(ns, array_schedule[integer_indices_0].string_server_used, array_schedule[integer_indices_0].string_server_target, array_schedule[integer_indices_0].integer_threads, array_schedule[integer_indices_0].float_delay_seconds * 1000, integer_indices_0);break;}}}return array_schedule[array_schedule.length - 1].integer_time_action_finishes_seconds * 1000;};
/* rm.js - 3.05GB - removes files */import {string_sanitise,object_parse_arguments} from "lib_no_ns.js";// functionsconst object_get_constants = function () {return {object_argument_names: {file_regex: {short: "f",long: "file",},server_regex: {short: "e",long: "server",},help: {short: "h",long: "help",},}};};const void_print_help = function (ns) {const object_argument_names = object_get_constants().object_argument_names;ns.tprint(string_sanitise(`DESCRIPTIONRemoves all removable files (which excludes currently running scripts, including this one).Optionally, removes only files whose names match a given regular expression.Optionally, removes only files on servers whose names match a given regular expression.Optionally, removes only files whose names match a given regular expression on servers whose names match a given regular expression.USAGErun ${ns.getScriptName()} [FLAGS ...] [OPTIONS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.OPTIONS-${object_argument_names.server_regex.short}, --${object_argument_names.server_regex.long} <REGEX>REGEX = Regular expression used for server names.-${object_argument_names.file_regex.short}, --${object_argument_names.file_regex.long} <REGEX>REGEX = Regular expression used for filenames.`));};const array_get_servers_matching_regexes = (ns,array_string_server_regexes) => {const array_servers = [ns.getHostname()];if (array_string_server_regexes.length > 0) {const array_server_regexes = [];array_string_server_regexes.forEach(string_server_regex => {array_server_regexes.push(new RegExp(string_server_regex));});array_servers.forEach(string_server => {const array_scan_results = ns.scan(string_server);array_scan_results.forEach(string_scan_result => {array_server_regexes.forEach(object_server_regex => {if (object_server_regex.test(string_scan_result) &&array_servers.indexOf(string_scan_result) === -1)array_servers.push(string_scan_result);});});});} else {array_servers.forEach(string_server => {const array_scan_results = ns.scan(string_server);array_scan_results.forEach(string_scan_result => {if (array_servers.indexOf(string_scan_result) === -1)array_servers.push(string_scan_result);});});}return array_servers;};const array_get_files_on_server_matching_regexes = (ns,string_server,array_string_file_regexes) => {if (array_string_file_regexes.length > 0) {constarray_file_regexes = [],array_files = [];array_string_file_regexes.forEach(string_file_regex => {array_file_regexes.push(new RegExp(string_file_regex));});ns.ls(string_server).forEach(string_file => {array_file_regexes.forEach(object_file_regex => {if (object_file_regex.test(string_file))array_files.push(string_file);});});return array_files;} else {return ns.ls(string_server);}};const void_remove = (ns,array_string_server_regexes,array_string_file_regexes) => {const array_servers = array_get_servers_matching_regexes(ns,array_string_server_regexes);array_servers.forEach(string_server => {const array_files = array_get_files_on_server_matching_regexes(ns,string_server,array_string_file_regexes);array_files.forEach(string_file => {if (!ns.rm(string_file,string_server)) {ns.tprint(`WARNING: Unable to remove file "${string_file}" from server "${string_server}".`);}});});};// mainexport const main = async function (ns) {// variableslet boolean_print_help = !1;constarray_server_regexes = [],array_file_regexes = [],object_arguments = object_parse_arguments(ns.args),object_argument_names = object_get_constants().object_argument_names;// argument parsingfor (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.server_regex.short:// fall-throughcase object_argument_names.server_regex.long:"object" == typeof argument_value? array_server_regexes.push(...argument_value): array_server_regexes.push(argument_value);break;case object_argument_names.file_regex.short:// fall-throughcase object_argument_names.file_regex.long:"object" == typeof argument_value? array_file_regexes.push(...argument_value): array_file_regexes.push(argument_value);break;case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: \"${string_argument}\".`;ns.tprint(`ERROR: ${string_message_error}`);throw new Error(string_message_error);}}// mainif (boolean_print_help)return void_print_help(ns);void_remove(ns, array_server_regexes, array_file_regexes);};
// importsimport {void_schedule_runner} from "lib.js";export const main = async function(ns) {// variables// name of purchased serversconst string_servers_bought_name = "#";// duration between each actionconst float_padding_seconds = 0.1;// precision of the percentage to steal calculatorconst float_precision = 0.0001;// the maximum percentage of cash that should be stolen from a serverconst float_cap = 0.99;// time period used for checking the time in secondsconst float_period_check_seconds = 10;// main loop// // debug stuff// array_make_schedule(ns, float_precision, float_cap, float_padding_seconds);// await ns.sleep(1);let integer_time_current = Date.now();let integer_time_finishes = integer_time_current;while (true) {integer_time_current = Date.now();if (integer_time_current >= integer_time_finishes) {// ns.tprint(`current value before: ${integer_time_current}`);// ns.tprint(`finishes value before: ${integer_time_finishes}`);integer_time_finishes = await void_schedule_runner(ns, string_servers_bought_name, float_precision, float_cap, float_padding_seconds) + Date.now();// ns.tprint(`finishes value after: ${integer_time_finishes}`);}// arbitrarily check every float_period_check_seconds to see if the current time is greater than the time that the runner is supposed to finish.await ns.sleep(float_period_check_seconds * 1000);}};
export const main = async function (ns) {for (let indices_0 = 0; indices_0 < ns.args.length; ++indices_0) {const float_cash_max = ns.getServerMaxMoney(ns.args[indices_0]);const float_cash_current = ns.getServerMoneyAvailable(ns.args[indices_0]);const float_security_minimum = ns.getServerMinSecurityLevel(ns.args[indices_0]);const float_security_current = Math.round(ns.getServerSecurityLevel(ns.args[indices_0]));const array_ram = ns.getServerRam(ns.args[indices_0]);const float_ram_total = array_ram[0];const float_ram_used = array_ram[1];const float_ram_free = array_ram[0] - array_ram[1];const data = [// comment out unneeded info"Name:\t\t\t" + ns.args[indices_0],"Root access:\t\t" + ns.hasRootAccess(ns.args[indices_0]),"Maximum cash ($):\t" + float_cash_max,"Current cash ($):\t" + float_cash_current.toFixed(2),"Current cash (%):\t" + (float_cash_current * 100 / float_cash_max).toFixed(2),"Growth:\t\t" + ns.getServerGrowth(ns.args[indices_0]),"Minimum security:\t" + float_security_minimum,"Current security:\t" + float_security_current,"Current security (x):\t" + (float_security_current / float_security_minimum).toFixed(2),"Hacking level needed:\t" + ns.getServerRequiredHackingLevel(ns.args[indices_0]),"Ports needed for root:\t" + ns.getServerNumPortsRequired(ns.args[indices_0]),"RAM total (Gb):\t" + float_ram_total,"RAM used (Gb):\t\t" + float_ram_used.toFixed(2),"RAM used (%):\t\t" + (float_ram_used * 100 / float_ram_total).toFixed(2),"RAM free (Gb):\t\t" + float_ram_free.toFixed(2),"RAM free (%):\t\t" + (float_ram_free * 100 / float_ram_total).toFixed(2),"\n"];for (let indices_0 = 0; indices_0 < data.length; ++indices_0) {ns.tprint(data[indices_0]);}}};
// returns an array of all servers in the gameconst array_get_servers = function(ns) {const array_servers = [ns.getHostname()];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const array_scan_results = ns.scan(array_servers[integer_indices_0]);for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {array_servers.push(array_scan_results[integer_indices_1]);}}}return array_servers;};// kills all running scripts in the networkconst void_kill_all_scripts = function (ns) {const const_string_host = ns.getHostname();const array_of_servers = array_get_servers(ns);// exclude host for now so that this script wont be killedarray_of_servers.splice(0, 1);for (var indices_0 = 0; indices_0 < array_of_servers.length; indices_0++) {const server = array_of_servers[indices_0];const scripts = ns.ps(server);// kill each script in the serverfor (var indices_1 = 0; indices_1 < scripts.length; indices_1++) {ns.scriptKill(scripts[indices_1].filename, server);}}// kill scripts in hostlet scripts_host = ns.ps(const_string_host);for (var indices_2 = 0; indices_2 < scripts_host.length; indices_2++) {// ensure current this script is killed lastif (scripts_host[indices_2].filename != ns.getScriptName()) {ns.scriptKill(scripts_host[indices_2].filename, const_string_host);}}};export const main = async function(ns) {void_kill_all_scripts(ns);};
// kill.js - 2.55GB - TODO:// * maybe implement a loop that repeats logic until all appropriate scripts have actually been killed.import {array_get_servers}from "lib_servers.js";import {void_kill_script_named_server_named}from "lib_kill.js";import {object_parse_arguments}from "lib_minimist.js";export const main = async function(ns) {// variableslet array_servers = [];let array_scripts = [];// argument parsingconst object_arguments = object_parse_arguments(ns.args);for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case "c":// fall-throughcase "script":array_scripts = argument_value;break;case "e":// fall-throughcase "server":array_servers = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: \"${string_argument}\".`;ns.tprint(`ERROR: ${string_message_error}`);throw new Error(string_message_error);}}// mainarray_scripts.length > 0? array_servers.length > 0? void_kill_scripts_named_servers_named(ns, array_servers, array_scripts): void_kill_scripts_named(ns, array_scripts): array_servers.length > 0? void_kill_scripts_servers_named(ns, array_servers): void_kill_scripts(ns);};// functions// kills running instances of named scripts on a named serverconst void_kill_scripts_named_server_named = function (ns,string_server,array_scripts) {for (let integer_indices_0 = 0;integer_indices_0 < array_scripts.length;++integer_indices_0) {const string_script = array_scripts[integer_indices_0];void_kill_script_named_server_named(ns, string_server, string_script);}};// kills running instances of named scripts on named serversconst void_kill_scripts_named_servers_named = function (ns,array_servers,array_scripts) {for (let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0) {const string_server = array_servers[integer_indices_0];void_kill_scripts_named_server_named(ns, string_server, array_scripts);}};// kills running instances of named scripts on all serversconst void_kill_scripts_named = function (ns, array_scripts) {void_kill_scripts_named_servers_named(ns, array_get_servers(ns), array_scripts);};// kills all but this script on a named serverconst void_kill_scripts_server_named = function (ns, string_server) {const array_scripts_running = ns.ps(string_server);for (let integer_indices_0 = 0;integer_indices_0 < array_scripts_running.length;++integer_indices_0) {const object_script = array_scripts_running[integer_indices_0],string_script = object_script.filename;string_script !== ns.getScriptName() &&void_kill_script_named_server_named(ns, string_server, string_script);}};// kills all but this script on named serversconst void_kill_scripts_servers_named = function (ns, array_servers) {for (let integer_indices_0 = 0;integer_indices_0 < array_servers.length;++integer_indices_0) {const string_server = array_servers[integer_indices_0];void_kill_scripts_server_named(ns, string_server);}};// kills running scripts on all serversconst void_kill_scripts = function (ns) {void_kill_scripts_servers_named(ns, array_get_servers(ns));};
// returns an array of all servers in the gameconst array_get_servers = function(ns) {const array_servers = [ns.getHostname()];for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const array_scan_results = ns.scan(array_servers[integer_indices_0]);for (let integer_indices_1 = 0; integer_indices_1 < array_scan_results.length; ++integer_indices_1) {if (array_servers.indexOf(array_scan_results[integer_indices_1]) === -1) {array_servers.push(array_scan_results[integer_indices_1]);}}}return array_servers;};// copies string_file_to_copy from string_server_source to the current serverconst void_copy_to_current = function(ns, string_server_source, string_file_to_copy) {try {ns.scp(string_file_to_copy, string_server_source, ns.getHostname());} catch (error) {ns.tprint(`Attempted to copy the file "${string_file_to_copy}" located in the server "${string_server_source}".`);ns.tprint(`${error}`);}};// build array of files to copy from string_server_sourceconst array_get_files_to_copy = function(ns, string_server_source, string_substring) {const array_files_in_server = ns.ls(string_server_source);let array_files_to_copy = [];for (let integer_indices_0 = 0; integer_indices_0 < array_files_in_server.length; ++integer_indices_0) {const string_file = array_files_in_server[integer_indices_0];if (string_file.includes(string_substring)) {array_files_to_copy.push(string_file);}}return array_files_to_copy;};// copies files that contain a substring from all servers to the current serverconst void_copy_files_with_to_current = function(ns, string_substring) {const array_servers = array_get_servers(ns);for (let integer_indices_0 = 0; integer_indices_0 < array_servers.length; ++integer_indices_0) {const string_server_source = array_servers[integer_indices_0];const array_files_to_copy = array_get_files_to_copy(ns, string_server_source, string_substring);for (let integer_indices_1 = 0; integer_indices_1 < array_files_to_copy.length; ++integer_indices_1) {const string_file_to_copy = array_files_to_copy[integer_indices_1];void_copy_to_current(ns, string_server_source, string_file_to_copy);}}};export const main = async function (ns) {const array_arguments = ns.args;for (let integer_indices_0 = 0; integer_indices_0 < array_arguments.length; ++integer_indices_0) {const string_substring = array_arguments[integer_indices_0];void_copy_files_with_to_current(ns, string_substring);}};
/* contracts.js - 22.05 GB - attempts to solve existing coding contracts - TODO:* make messages optional* add an option to loop forever?* should this be ran by main.js?*/import {string_sanitise,object_parse_arguments} from "lib_no_ns.js";import { array_get_files_with_string } from "lib_ls.js";import { array_get_servers } from "lib_servers.js";// mainexport const main = async function (ns) {// variableslet boolean_print_help = !1;// argument parsingconstobject_argument_names = object_get_constants().object_argument_names,object_arguments = object_parse_arguments(ns.args);for (const string_argument in object_arguments)if (object_arguments.hasOwnProperty(string_argument)) {const argument_value = object_arguments[string_argument];switch (string_argument) {case object_argument_names.help.short:// fall-throughcase object_argument_names.help.long:boolean_print_help = argument_value;break;case "_":continue;default:const string_message_error = `Unknown argument passed: "${string_argument}".`;throw (ns.tprint(`ERROR: ${string_message_error}`), new Error(string_message_error));}}// mainif (boolean_print_help)return void_print_help(ns);void_contracts_solver(ns);};const object_get_constants = function () {const object_solvers = {};object_solvers["Find Largest Prime Factor"] = function (data) {let fac = 2;let n = data;while (n > ((fac - 1) * (fac - 1))) {while (n % fac === 0) {n = Math.round(n / fac);}++fac;}return (n === 1 ? (fac - 1) : n);};object_solvers["Subarray with Maximum Sum"] = function (data) {const nums = data.slice();for (let i = 1; i < nums.length; i++) {nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);}return Math.max(...nums);};object_solvers["Total Ways to Sum"] = function (data) {const ways = [1];ways.length = data + 1;ways.fill(0, 1);for (let i = 1; i < data; ++i) {for (let j = i; j <= data; ++j) {ways[j] += ways[j - i];}}return ways[data];};object_solvers["Spiralize Matrix"] = function (data) {const spiral = [];const m = data.length;const n = data[0].length;let u = 0;let d = m - 1;let l = 0;let r = n - 1;let k = 0;while (true) {// Upfor (let col = l; col <= r; col++) {spiral[k] = data[u][col];++k;}if (++u > d) {break;}// Rightfor (let row = u; row <= d; row++) {spiral[k] = data[row][r];++k;}if (--r < l) {break;}// Downfor (let col = r; col >= l; col--) {spiral[k] = data[d][col];++k;}if (--d < u) {break;}// Leftfor (let row = d; row >= u; row--) {spiral[k] = data[row][l];++k;}if (++l > r) {break;}}return spiral;};object_solvers["Array Jumping Game"] = function (data) {const n = data.length;let i = 0;for (let reach = 0; i < n && i <= reach; ++i) {reach = Math.max(i + data[i], reach);}return i === n ? 1 : 0;};object_solvers["Merge Overlapping Intervals"] = function (data) {const intervals = data.slice();intervals.sort((a, b) => {return a[0] - b[0];});const result = [];let start = intervals[0][0];let end = intervals[0][1];for (const interval of intervals) {if (interval[0] <= end) {end = Math.max(end, interval[1]);}else {result.push([start, end]);start = interval[0];end = interval[1];}}result.push([start, end]);return result;};object_solvers["Generate IP Addresses"] = function (data) {const ret = [];for (let a = 1; a <= 3; ++a) {for (let b = 1; b <= 3; ++b) {for (let c = 1; c <= 3; ++c) {for (let d = 1; d <= 3; ++d) {if (a + b + c + d === data.length) {const A = parseInt(data.substring(0, a), 10);const B = parseInt(data.substring(a, a + b), 10);const C = parseInt(data.substring(a + b, a + b + c), 10);const D = parseInt(data.substring(a + b + c, a + b + c + d), 10);if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {const ip = [A.toString(), ".",B.toString(), ".",C.toString(), ".",D.toString()].join("");if (ip.length === data.length + 3) {ret.push(ip);}}}}}}}return ret;};object_solvers["Algorithmic Stock Trader I"] = function (data) {let maxCur = 0;let maxSoFar = 0;for (let i = 1; i < data.length; ++i) {maxCur = Math.max(0, maxCur += data[i] - data[i - 1]);maxSoFar = Math.max(maxCur, maxSoFar);}return maxSoFar.toString();};object_solvers["Algorithmic Stock Trader II"] = function (data) {let profit = 0;for (let p = 1; p < data.length; ++p) {profit += Math.max(data[p] - data[p - 1], 0);}return profit.toString();};object_solvers["Algorithmic Stock Trader III"] = function (data) {let hold1 = Number.MIN_SAFE_INTEGER;let hold2 = Number.MIN_SAFE_INTEGER;let release1 = 0;let release2 = 0;for (const price of data) {release2 = Math.max(release2, hold2 + price);hold2 = Math.max(hold2, release1 - price);release1 = Math.max(release1, hold1 + price);hold1 = Math.max(hold1, price * -1);}return release2.toString();};object_solvers["Algorithmic Stock Trader IV"] = function (data) {const k = data[0];const prices = data[1];const len = prices.length;if (len < 2) {return 0;}if (k > len / 2) {let res = 0;for (let i = 1; i < len; ++i) {res += Math.max(prices[i] - prices[i - 1], 0);}return res;}const hold = [];const rele = [];hold.length = k + 1;rele.length = k + 1;for (let i = 0; i <= k; ++i) {hold[i] = Number.MIN_SAFE_INTEGER;rele[i] = 0;}let cur;for (let i = 0; i < len; ++i) {cur = prices[i];for (let j = k; j > 0; --j) {rele[j] = Math.max(rele[j], hold[j] + cur);hold[j] = Math.max(hold[j], rele[j - 1] - cur);}}return rele[k];};object_solvers["Minimum Path Sum in a Triangle"] = function (data) {let n = data.length;let dp = data[n - 1].slice();for (let i = n - 2; i > -1; --i) {for (let j = 0; j < data[i].length; ++j) {dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];}}return dp[0];};object_solvers["Unique Paths in a Grid I"] = function (data) {let n = data[0]; // Number of rowslet m = data[1]; // Number of columnslet currentRow = [];currentRow.length = n;for (let i = 0; i < n; i++) {currentRow[i] = 1;}for (let row = 1; row < m; row++) {for (let i = 1; i < n; i++) {currentRow[i] += currentRow[i - 1];}}return currentRow[n - 1];};object_solvers["Unique Paths in a Grid II"] = function (data) {let obstacleGrid = [];obstacleGrid.length = data.length;for (let i = 0; i < obstacleGrid.length; ++i) {obstacleGrid[i] = data[i].slice();}for (let i = 0; i < obstacleGrid.length; i++) {for (let j = 0; j < obstacleGrid[0].length; j++) {if (obstacleGrid[i][j] == 1) {obstacleGrid[i][j] = 0;}else if (i == 0 && j == 0) {obstacleGrid[0][0] = 1;}else {obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);}}}return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1];};object_solvers["Sanitize Parentheses in Expression"] = function (data) {let left = 0;let right = 0;let res = [];for (let i = 0; i < data.length; ++i) {if (data[i] === '(') {++left;}else if (data[i] === ')') {(left > 0) ? --left : ++right;}}function dfs(pair, index, left, right, s, solution, res) {if (s.length === index) {if (left === 0 && right === 0 && pair === 0) {for (var i = 0; i < res.length; i++) {if (res[i] === solution) {return;}}res.push(solution);}return;}if (s[index] === '(') {if (left > 0) {dfs(pair, index + 1, left - 1, right, s, solution, res);}dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);}else if (s[index] === ')') {if (right > 0)dfs(pair, index + 1, left, right - 1, s, solution, res);if (pair > 0)dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);}else {dfs(pair, index + 1, left, right, s, solution + s[index], res);}}dfs(0, 0, left, right, data, "", res);return res;};object_solvers["Find All Valid Math Expressions"] = function (data) {const num = data[0];const target = data[1];function helper(res, path, num, target, pos, evaluated, multed) {if (pos === num.length) {if (target === evaluated) {res.push(path);}return;}for (let i = pos; i < num.length; ++i) {if (i != pos && num[pos] == '0') {break;}let cur = parseInt(num.substring(pos, i + 1));if (pos === 0) {helper(res, path + cur, num, target, i + 1, cur, cur);}else {helper(res, path + "+" + cur, num, target, i + 1, evaluated + cur, cur);helper(res, path + "-" + cur, num, target, i + 1, evaluated - cur, -cur);helper(res, path + "*" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);}}}let result = [];helper(result, "", num, target, 0, 0, 0);return result;};return {object_solvers,object_argument_names: {help: {short: "h",long: "help",},}};};const void_print_help = function (ns) {const object_argument_names = object_get_constants().object_argument_names;ns.tprint(string_sanitise(`DESCRIPTIONAttempts to solve existing coding contracts in the network. Displays whether or not any attempts were successful.USAGErun ${ns.getScriptName()} [FLAGS ...]FLAGS-${object_argument_names.help.short}, --${object_argument_names.help.long}Displays this message then exits.`));};const array_get_contracts = function (ns) {constarray_contracts = [],array_servers = array_get_servers(ns);for (let integer_index_server = 0;integer_index_server < array_servers.length;++integer_index_server) {conststring_server = array_servers[integer_index_server],array_contract_names = array_get_files_with_string(ns,string_server,".cct");for (let integer_index_contracts = 0;integer_index_contracts < array_contract_names.length;++integer_index_contracts) {// check if this really is a contract or just a file with .cct in its nameconst string_contract = array_contract_names[integer_index_contracts];"string" ==typeof ns.codingcontract.getContractType(string_contract,string_server) &&array_contracts.push({name: string_contract,location: string_server,type: ns.codingcontract.getContractType(string_contract,string_server),data: ns.codingcontract.getData(string_contract, string_server),solve: function (answer) {return ns.codingcontract.attempt(answer,string_contract,string_server,{returnReward: !0,});},});}}return array_contracts;};const void_contracts_solver = function (ns) {constobject_solvers = object_get_constants().object_solvers,array_contracts = array_get_contracts(ns);for (let integer_index_contract = 0;integer_index_contract < array_contracts.length;++integer_index_contract) {constobject_contract = array_contracts[integer_index_contract],answer = object_solvers[object_contract.type](object_contract.data),string_output = object_contract.solve(answer);"" === object_contract.solve(answer)? ns.tprint(`Failed to solve:${JSON.stringify(object_contract)}Using input:${answer}`): ns.tprint(`${string_output}`);}};
/*** @description nicoty.sbin.hacker.js - 13.35GB - Responsible for running scripts to weaken, grow and hack servers.* @license BlueOak-1.0.0* @todo Use dependency injection or `Fluture` to move side-effects to `void-main`.* @todo Send array of servers used to cyclic weaken manager periodically so it can use it do decide how many threads of cyclic weaken would be possible to generate.* @todo Add a way to control this using Kozd's GUIFramework.* @todo Refactor unecessary cloning/copying.* @todo Add a way to notify nicoty.sbin.weaken.manager if this script needs more RAM so nicoty.sbin.weaken.manager can kill some cyclic weaken scripts and adjust float_ram_fraction_for_weaken_cyclic.* @todo Add a way to be able to target more than one server at a time?* @todo Add a way to determine the optimal weights for the factors used in the server scoring function* @todo Add a job cap thing that prevents running more jobs if the first worker in a cycle finishes. Add a thing to worker script that writes to a file (or to `window`) its identifier, when it started, and when it finishes. Add a padding optimiser that detects when tail collision occurs and increases padding each cycle if it does occur, and decreases it by half of how much it increases everytime no tail collision occurs.*/import { array_get_servers } from "nicoty.lib.servers.js";import {float_get_server_ram_free,array_get_servers_useable,object_get_server_ram_free_biggest,} from "nicoty.lib.ram.server.js";import {object_get_server_used,array_get_servers_used_updated,boolean_copy_script_to,integer_exec,boolean_can_run_job,} from "nicoty.lib.ram.script.js";import {array_make_servers,clamp,any_while,object_get_updated,clone,} from "nicoty.lib.no.netscript.js";import { array_get_servers_hackable } from "nicoty.lib.score.js";import {float_get_time_hack,float_get_time_grow,float_get_time_weaken,} from "nicoty.lib.time.js";import { float_get_server_score } from "nicoty.lib.score.js";/*** @description Constants.* @readonly* @property {number} ServerBaseGrowthRate - Unadjusted Growth rate. Base percentage increase of cash from one thread of `grow`.* @property {number} ServerMaxGrowthRate - Maximum possible growth rate (max rate accounting for server security).* @property {number} ServerFortifyAmount - Amount by which server's security increases when its hacked/grown.* @property {number} ServerWeakenAmount - Amount by which server's security decreases when weakened.* @property {number} array_workers - Contains the names of worker scripts.* @see `CONSTANTS` in {@link https://github.com/danielyxie/bitburner/blob/49fa63971b404af04cfaf331cad33ec4e59b4024/src/Constants.ts|Bitburner's source code}.*/const object_constants = {ServerBaseGrowthRate: 1.03,ServerMaxGrowthRate: 1.0035,ServerFortifyAmount: 0.002,ServerWeakenAmount: 0.05,object_workers: {weaken_: "nicoty.sbin.weaken.js",grow_: "nicoty.sbin.grow.js",hack_: "nicoty.sbin.hack.js",},};/*** @description Main function* @param {Object} object_netscript - The Netscript environment.*/export const main = async (object_netscript) => {/*** @description Returns an object containing the current bitnode multiplier values.* @returns {Object} Contains the current bitnode multiplier values.* @see `BitNodeMultipliers` in {@link https://github.com/danielyxie/bitburner/blob/34d749809a3ca810d6fb22c39225e76a67897ba9/src/BitNode/BitNodeMultipliers.ts|"BitNodeMultipliers.ts" from Bitburner's source code}.*/const object_get_bitnode_multipliers = () => {try {// Comment out the following line to save on ~4GB of RAM.return object_netscript.getBitNodeMultipliers();throw new Error("WARNING: Uncommented the call to `getBitNodeMultipliers`.");} catch (object_exception) {return (object_netscript.print(`${JSON.stringify(object_exception)}\nUsing default values instead.`),{HackingLevelMultiplier: 1,StrengthLevelMultiplier: 1,DefenseLevelMultiplier: 1,DexterityLevelMultiplier: 1,AgilityLevelMultiplier: 1,CharismaLevelMultiplier: 1,ServerGrowthRate: 1,ServerMaxMoney: 1,ServerStartingMoney: 1,ServerStartingSecurity: 1,ServerWeakenRate: 1,HomeComputerRamCost: 1,PurchasedServerCost: 1,PurchasedServerLimit: 1,PurchasedServerMaxRam: 1,CompanyWorkMoney: 1,CrimeMoney: 1,HacknetNodeMoney: 1,ManualHackMoney: 1,ScriptHackMoney: 1,CodingContractMoney: 1,ClassGymExpGain: 1,CompanyWorkExpGain: 1,CrimeExpGain: 1,FactionWorkExpGain: 1,HackExpGain: 1,FactionPassiveRepGain: 1,FactionWorkRepGain: 1,RepToDonateToFaction: 1,AugmentationMoneyCost: 1,AugmentationRepCost: 1,InfiltrationMoney: 1,InfiltrationRep: 1,FourSigmaMarketDataCost: 1,FourSigmaMarketDataApiCost: 1,CorporationValuation: 1,BladeburnerRank: 1,BladeburnerSkillCost: 1,DaedalusAugsRequirement: 1,});}};/*** @description Returns `true` if any of the scripts in the specified array are running on any server, otherwise returns `false`.* @param {string[]} array_scripts - Contains the names of scripts to test.* @returns {boolean} `true` if any of the scripts in the specified array are running on any server, otherwise `false`.*/const boolean_array_scripts_any_running = (array_scripts) =>0 !== array_scripts.length &&array_get_servers({ object_netscript: object_netscript }).some((string_server) => {const array_running = object_netscript.ps(string_server);return (0 !== array_running.length &&array_running.some((object_running) =>array_scripts.some((string_script) => string_script === object_running.filename)));});// Weakening, growing and hacking.// Weaken-related functions./*** @description Returns the amount of threads of `weaken` required to cause a server's security by the specified amount.* @param {number} float_weaken_by - The amount to weaken server security by.* @returns {number} The amount of threads of `weaken` required to cause a server's security by the specified amount.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const integer_get_threads_required_for_weaken = (float_weaken_by) =>// Denominator is prevented from going lower than Number.MIN_VALUE to prevent divide by 0 errors.float_weaken_by /Math.max(Number.MIN_VALUE,object_constants.ServerWeakenAmount *object_get_bitnode_multipliers().ServerWeakenRate);/*** @description Returns the amount of threads of `weaken` required to cause a server's security to reach minimum.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @returns {number} The amount of threads of `weaken` required to cause the server's security to reach minimum.*/const integer_get_threads_required_for_weaken_minimum_security = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),}) =>Math.ceil(integer_get_threads_required_for_weaken(s - object_netscript.getServerMinSecurityLevel(n)));/*** @description Returns the amount that server security will decrease from the amount of threads of `weaken` specified.* @param {number} integer_threads_weaken - The amount of threads of `weaken` to be used.* @returns {number} The amount that server security will decrease from the amount of threads of `weaken` specified.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `weaken` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_decrease_from_weaken = (integer_threads_weaken) =>integer_threads_weaken * object_constants.ServerWeakenAmount;// Grow-related functions./*** @description Returns the number of threads of `grow` needed to grow the specified server's cash by the specified percentage when it has the specified security.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_growth - The percentage to grow the server's cash by + 1. E.g., 1.5 will grow it by 50%.* @returns {number} The amount that server security will decrease from the amount of threads of `weaken` specified.* @see `numCycleForGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.*/const integer_get_threads_for_growth = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_growth: g,}) => {const CONSTANTS = object_constants,BitNodeMultipliers = object_get_bitnode_multipliers();function numCycleForGrowth(server, growth, p) {let ajdGrowthRate =1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;}const serverGrowthPercentage = server.serverGrowth / 100;const cycles =Math.log(growth) /(Math.log(ajdGrowthRate) *p.hacking_grow_mult *serverGrowthPercentage *BitNodeMultipliers.ServerGrowthRate);return cycles;}return Math.ceil(numCycleForGrowth({hackDifficulty: s,serverGrowth: object_netscript.getServerGrowth(n),},g,{hacking_grow_mult: object_netscript.getHackingMultipliers().growth,}));};/*** @description Inverse function of integer_get_threads_for_growth. Returns the percentage growth of the server's cash in decimal form (e.g., 2 = 100% growth).* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.integer_threads - The number of threads of `grow` to use.* @returns {number} The percentage of growth that will occur to the server's cash.* @see `numCycleForGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.*/const float_get_growth_from_threads = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),integer_threads: t,}) =>Math.pow(Math.min(object_constants.ServerMaxGrowthRate,1 + (object_constants.ServerBaseGrowthRate - 1) / s),t *object_netscript.getHackingMultipliers().growth *(object_netscript.getServerGrowth(n) / 100) *object_get_bitnode_multipliers().ServerGrowthRate);/*** @description Returns the threads of `grow` required to grow the specified server's cash to its maximum when its security and cash are at the specified values.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_cash - The server's cash.* @returns {number} The threads of `grow` required to grow the specified server's cash to its maximum when its security and cash are at the specified values.*/const integer_get_threads_required_for_grow_cash_maximum = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c,}) =>integer_get_threads_for_growth({string_server: n,float_security: s,float_growth: object_netscript.getServerMaxMoney(n) / c,});/*** @description Returns the amount that a server's security will increase from the threads of `grow` used.* @param {number} integer_threads_grow - The number of threads of `grow` to use.* @returns {number} The amount that a server's security will increase from the threads of `grow` used.* @see `processSingleServerGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_increase_from_grow = (integer_threads_grow) =>2 * object_constants.ServerFortifyAmount * integer_threads_grow;// Hack-related functions./*** @description Returns the percentage of the available cash in the specified server that is stolen when it is hacked when it has the specified amount of security.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @returns {number} The percentage of the available cash in the specified server that is stolen when it is hacked when it has the specified amount of security.* @see `calculatePercentMoneyHacked` in {@link https://github.com/danielyxie/bitburner/blob/473f0f14475c40b829fc278dcd07bdd27a5da76f/src/Hacking.js|"Hacking.js" from Bitburner's source code}.* @see `hackDifficulty` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_percentage_cash_taken_per_hack = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),}) => {const Player = {hacking_skill: object_netscript.getHackingLevel(),hacking_money_mult: object_netscript.getHackingMultipliers().money,},BitNodeMultipliers = object_get_bitnode_multipliers();function calculatePercentMoneyHacked(server) {// Adjust if needed for balancing. This is the divisor for the final calculationconst balanceFactor = 240;const difficultyMult = (100 - server.hackDifficulty) / 100;const skillMult =(Player.hacking_skill - (server.requiredHackingSkill - 1)) /Player.hacking_skill;const percentMoneyHacked =(difficultyMult * skillMult * Player.hacking_money_mult) /balanceFactor;if (percentMoneyHacked < 0) {return 0;}if (percentMoneyHacked > 1) {return 1;}return percentMoneyHacked * BitNodeMultipliers.ScriptHackMoney;}return calculatePercentMoneyHacked({hackDifficulty: s,requiredHackingSkill: object_netscript.getServerRequiredHackingLevel(n),});};/*** @description Returns the threads of `hack` required to steal the specified percentage of the specified server's available cash when its security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of cash to steal.* @returns {number} The threads of `hack` required to steal the specified percentage of the specified server's available cash when its security is at the specified value.*/const integer_get_threads_required_to_hack_percentage = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_percentage_to_steal: p,}) =>Math.ceil(p /float_get_percentage_cash_taken_per_hack({string_server: n,float_security: s,}));/*** @description Returns the amount that a server's security will increase from the specified threads of `hack`.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} [object_arguments.float_cash] - The server's available cash.* @param {number} object_arguments.integer_threads_hack - The amount of threads of `hack` to use.* @returns {number} The amount that a server's security will increase from the specified threads of `hack`.* @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/const float_get_security_increase_from_hack = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c = object_netscript.getServerMoneyAvailable(string_server),integer_threads_hack: t,}) => {const percentHacked = float_get_percentage_cash_taken_per_hack({string_server: n,float_security: s,}),server = {moneyAvailable: c,moneyMax: object_netscript.getServerMaxMoney(n),},CONSTANTS = object_constants;function float_hack(threads) {let maxThreadNeeded = Math.ceil((1 / percentHacked) * (server.moneyAvailable / server.moneyMax));if (isNaN(maxThreadNeeded)) {// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large valuemaxThreadNeeded = 1e6;}return CONSTANTS.ServerFortifyAmount * Math.min(threads, maxThreadNeeded);}return float_hack(t);};/*** @description Depending on the job:* If "weaken", returns the threads required for `weaken` to cause the target server's security to reach minimum if possible, otherwise, returns the max threads that the server used can provide.* If "grow", returns the threads required for `grow` to grow the target server's cash to its maximum if possible, otherwise, returns the max threads that the server used can provide.* If "hack", returns the threads required for `hack` to steal the specified percentage of the available money of the target if possible, otherwise, returns the max threads that the server used can provide.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free - The amount of free RAM of the server used.* @param {string} object_arguments.string_script - The worker script required for the job.* @param {string} object_arguments.string_server - The target server's hostname.* @param {number} [object_arguments.float_security] - The target server's security.* @param {number} [object_arguments.float_cash] - The target server's available cash.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the target server's available cash to steal.* @returns {number} The amount of threads required/available for the job.* @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.* @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/const integer_get_threads = ({float_ram_free: f,string_script: r,string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_cash: c = object_netscript.getServerMoneyAvailable(string_server),float_percentage_to_steal: p,}) =>clamp({value: (({string_script: r,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}) => {switch (r) {case object_constants.object_workers.weaken_:return integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: s,});case object_constants.object_workers.grow_:return integer_get_threads_required_for_grow_cash_maximum({string_server: n,float_security: s,/*** @description If current cash is <= 0, 1 is used so "It can be grown even if it has no money".* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: c <= 0 ? 1 : c,});case object_constants.object_workers.hack_:return integer_get_threads_required_to_hack_percentage({string_server: n,float_security: s,float_percentage_to_steal: p,});}})({string_script: r,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}),lower: 0,upper: Math.trunc(f / object_netscript.getScriptRam(r)),});// Functions related to calculating percentage to steal./*** @description Returns the threads required by `grow` to grow the target server's cash back to its original value after stealing the specified percentage of it, and assuming its security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {string} object_arguments.string_server - The server's hostname.* @param {number} [object_arguments.float_security] - The server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the server's available cash to steal.* @returns {number} The threads required by `grow` to grow the target server's cash back to its original value after stealing the specified percentage of it, and assuming its security is at the specified value.*/const integer_get_threads_required_for_cash_grow_after_percentage_stolen = ({string_server: n,float_security: s = object_netscript.getServerSecurityLevel(string_server),float_percentage_to_steal: p,}) =>integer_get_threads_for_growth({string_server: n,float_security: s,// Denominator is prevented from going lower than Number.MIN_VALUE to prevent divide by 0 errors.float_growth: 1 / Math.max(Number.MIN_VALUE, 1 - p),});/*** @description Should return `true` if there is enough RAM to provide the threads required of `weaken` to weaken to minimum security, then of `grow` to grow the cash back to maximum after stealing the specified percentahe of the cash, then again of `weaken` to weaken to minimum security again if possible, otherwise, returns `false`, assuming security is at the specified value.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free_server_used - The free RAM available in the server used.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {number} object_arguments.float_cash_server_target - The target server's cash.* @param {number} [object_arguments.float_security_server_target] - The target server's security.* @param {number} object_arguments.float_percentage_to_steal - The percentage of the target server's available cash to steal.* @returns {boolean} `true` if RAM is sufficient, otherwise `false`.*/const boolean_is_ram_enough_after_hack_percentage = ({float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c = object_netscript.getServerMoneyAvailable(string_server_target),float_security_server_target: s = object_netscript.getServerSecurityLevel(string_server_target),float_percentage_to_steal: p,}) => {const float_server_target_security_after_hack =s +float_get_security_increase_from_hack({string_server: n,float_security: s,float_cash: c,integer_threads_hack: integer_get_threads({float_ram_free: r,string_script: object_constants.object_workers.hack_,string_server: n,float_security: s,float_cash: c,float_percentage_to_steal: p,}),}),integer_threads_required_for_weaken_minimum_security_after_hack = integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: float_server_target_security_after_hack,}),float_server_target_security_after_weaken =float_server_target_security_after_hack -float_get_security_decrease_from_weaken(integer_threads_required_for_weaken_minimum_security_after_hack),integer_threads_required_for_cash_grow_after_percentage_stolen = integer_get_threads_required_for_cash_grow_after_percentage_stolen({string_server: n,float_security: float_server_target_security_after_weaken,float_percentage_to_steal: p,}),float_server_target_security_after_grow =float_server_target_security_after_weaken +float_get_security_increase_from_grow(integer_threads_required_for_cash_grow_after_percentage_stolen),integer_threads_required_for_weaken_minimum_security_after_grow = integer_get_threads_required_for_weaken_minimum_security({string_server: n,float_security: float_server_target_security_after_grow,}),ram_weaken = object_netscript.getScriptRam(object_constants.object_workers.weaken_),float_ram_required =integer_threads_required_for_weaken_minimum_security_after_hack *ram_weaken +integer_threads_required_for_cash_grow_after_percentage_stolen *object_netscript.getScriptRam(object_constants.object_workers.grow_) +integer_threads_required_for_weaken_minimum_security_after_grow *ram_weaken;return float_ram_required < r;};/*** @description Returns the number of cycles of bisection to be done to reach a certain precision, rounded up to the nearest integer.* @param {number} float_precision - The desired precision.* @returns {number} `true` if RAM is sufficient, otherwise `false`.*/const integer_get_cycles_for_bisection_precision = (float_precision) =>Math.ceil(Math.log(1 / Math.max(float_precision, Number.MIN_VALUE)) *(1 / Math.log(2)));/*** @description Should return the optimum percentage to steal such that cash stolen at most is as high as the steal cap and the target server's security is able to be weakened to minimum with one `weaken` after the `hack`, its cash grown to 100% after one `grow` after the `weaken`, then its security weakened again to minimum with one `weaken`, all with the available remaining RAM on the server used after the `hack` by using a binary search algorithm.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.float_ram_free_server_used - The free RAM available in the server used.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {number} object_arguments.float_cash_server_target - The target server's cash.* @param {number} [object_arguments.float_security_server_target] - The target server's security.* @param {number} object_arguments.float_precision - The desired precision of the binary search algorithm.* @param {number} object_arguments.float_steal_cap - The maximum percentage of available cash that may be stolen at a time.* @returns {number} The optimum percentage of cash to steal.*/const float_get_percentage_to_steal = ({float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c = object_netscript.getServerMoneyAvailable(string_server_target),float_security_server_target: s = object_netscript.getServerSecurityLevel(string_server_target),float_precision: p,float_steal_cap: m,}) =>// Result is capped so not all cash is stolen, which can be bad because it's harder to grow from 0 in most cases.Math.min(m,any_while({any_state: {float_ceiling: 1,float_floor: 0,float_percentage_to_steal: (1 + 0) / 2,integer_counter: 0,integer_cycles_for_bisection_precision: integer_get_cycles_for_bisection_precision(p),float_steal_cap: m,float_ram_free_server_used: r,string_server_target: n,float_cash_server_target: c,float_security_server_target: s,},boolean_condition: (object_state) =>object_state.integer_cycles_for_bisection_precision >object_state.integer_counter &&object_state.float_steal_cap >=object_state.float_percentage_to_steal,any_function: (object_state) =>boolean_is_ram_enough_after_hack_percentage({float_ram_free_server_used: object_state.float_ram_free_server_used,string_server_target: object_state.string_server_target,float_cash_server_target: object_state.float_cash_server_target,float_security_server_target:object_state.float_security_server_target,float_percentage_to_steal: object_state.float_percentage_to_steal,})? object_get_updated({object_original: object_state,object_properties_new: {float_floor: object_state.float_percentage_to_steal,float_percentage_to_steal:(object_state.float_ceiling +object_state.float_percentage_to_steal) /2,},integer_counter: 1 + object_state.integer_counter,}): object_get_updated({object_original: object_state,object_properties_new: {float_ceiling: object_state.float_percentage_to_steal,float_percentage_to_steal:(object_state.float_percentage_to_steal +object_state.float_floor) /2,},integer_counter: 1 + object_state.integer_counter,}),}).float_percentage_to_steal);// Server-related functions./*** @description Returns the name of the hackable server with the highest score, or `null` if it doesn't exist.* @param {Object} object_arguments - Contains the arguments for the function.* @param {boolean} object_arguments.boolean_method_score_correction - Whether or not to use mean-normalised or standardised score correction.* @param {number} object_arguments.float_multiplier_factor_skill - Multiplier used for the skill factor.* @param {number} object_arguments.float_multiplier_factor_max_cash - Multiplier used for the maximum cash factor.* @param {number} object_arguments.float_multiplier_factor_growth - Multiplier used for the growth factor.* @returns {string|null} The name of the server with the highest score if it exists, otherwise, `null`.*/const string_or_null_get_server_hackable_score_best = ({boolean_method_score_correction,float_multiplier_factor_skill,float_multiplier_factor_max_cash,float_multiplier_factor_growth,}) => {const array_servers_hackable = array_get_servers_hackable(object_netscript);return array_servers_hackable.length > 0? array_servers_hackable.reduce((object_server_best, string_server) => {const float_score = float_get_server_score({object_netscript: object_netscript,string_server: string_server,boolean_method_score_correction: boolean_method_score_correction,float_multiplier_factor_skill: float_multiplier_factor_skill,float_multiplier_factor_max_cash: float_multiplier_factor_max_cash,float_multiplier_factor_growth: float_multiplier_factor_growth,});return float_score > object_server_best.float_score? {string_server: string_server,float_score: float_score,}: object_server_best;},{string_server: null,float_score: -Infinity,}).string_server: null;};/*** @description Returns a target server object. Assumes a server's minimum security and maximum cash values are constant.* @param {string} string_server - The target server's hostname.* @returns {Object} The target server object.*/const object_get_server_target = (string_server) => ({string_server: string_server,float_security_minimum: object_netscript.getServerMinSecurityLevel(string_server),float_cash_maximum: object_netscript.getServerMaxMoney(string_server),float_security: object_netscript.getServerSecurityLevel(string_server),float_cash: object_netscript.getServerMoneyAvailable(string_server),});// Scheduling-related functions./*** @description Returns the name of the appropriate worker script for given target server object.* @param {Object} object_server_target - The target server object.* @returns {string} The name of the appropriate worker script.*/const string_get_job = (object_server_target) =>object_server_target.float_security >object_server_target.float_security_minimum? object_constants.object_workers.weaken_: object_server_target.float_cash <object_server_target.float_cash_maximum? object_constants.object_workers.grow_: object_constants.object_workers.hack_;/*** @description Returns a new target server object based on an original after the effects of a job object have been applied to it.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_server_target - The original target server object.* @param {Object} object_arguments.object_job - The job object.* @returns {Object} The new target server object.*/const object_get_server_target_job_applied = ({object_server_target: t,object_job: j,}) => {switch (j.string_script) {case object_constants.object_workers.weaken_:return object_get_updated({object_original: t,object_properties_new: {float_security: Math.max(t.float_security_minimum,t.float_security -float_get_security_decrease_from_weaken(j.integer_threads)),},});case object_constants.object_workers.grow_:return object_get_updated({object_original: t,object_properties_new: {/*** @description If current cash is <= 0, 1 is used so "It can be grown even if it has no money".* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: Math.min(t.float_cash_maximum,(t.float_cash <= 0 ? 1 : t.float_cash) *float_get_growth_from_threads({string_server: t.string_server,float_security: t.float_security,integer_threads: j.integer_threads,})),/*** @see `processSingleServerGrowth` in {@link https://github.com/danielyxie/bitburner/blob/042f92670062558d4a2835c37fff07a14d84b47c/src/Server/ServerHelpers.ts|"ServerHelpers.ts" from Bitburner's source code}.* @see `grow` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_security:t.float_security +float_get_security_increase_from_grow(j.integer_threads),},});case object_constants.object_workers.hack_:return object_get_updated({object_original: t,object_properties_new: {/*** @see `hack` in {@link https://github.com/danielyxie/bitburner/blob/916ef069130bedad76820ab6b5e6605ef2309b02/src/NetscriptFunctions.js|"NetscriptFunctions.js" from Bitburner's source code}.*/float_cash: Math.max(0,t.float_cash -Math.floor(t.float_cash *float_get_percentage_cash_taken_per_hack({string_server: t.string_server,float_security: t.float_security,})) *j.integer_threads),/*** @see `fortify` in {@link https://github.com/danielyxie/bitburner/blob/8a5b6f6cbc76ffadc7bb1ed1fffcc67004e42355/src/Server/Server.ts|"Server.ts" from Bitburner's source code}.*/float_security:t.float_security +float_get_security_increase_from_hack({string_server: t.string_server,float_security: t.float_security,float_cash: t.float_cash,integer_threads_hack: j.integer_threads,}),},});default:throw new Error(`ERROR: Unrecognised job \`${j.string_script}\`.`);}};/*** @description Return an object containing job durations in seconds. Takes security as the current security instead of projected security because job times resolve according to current anyway, so no need to use projected value.* @param {string} string_server_target - The target server's hostname.* @returns {Object} The job durations object.*/const object_get_time_jobs = (string_server_target) => ({[object_constants.object_workers.weaken_]: float_get_time_weaken({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),[object_constants.object_workers.grow_]: float_get_time_grow({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),[object_constants.object_workers.hack_]: float_get_time_hack({object_netscript: object_netscript,string_server: string_server_target,float_server_security: object_netscript.getServerSecurityLevel(string_server_target),}),});/*** @description Returns the time that a job in a hacking schedule will finish.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object[]} object_arguments.array_schedule - The hacking schedule.* @param {Object} object_arguments.object_time_jobs - The job durations object.* @returns {number} The time the job will finish.*/const float_get_time_job_finishes_seconds = ({array_schedule: s,object_time_jobs: t,}) => {if (0 === s.length)return Math.max(t[object_constants.object_workers.weaken_],t[object_constants.object_workers.grow_],t[object_constants.object_workers.hack_]);{const object_job_last = s[s.length - 1];return (object_job_last.float_delay_seconds + t[object_job_last.string_script]);}};/*** @description Returns a job object, aka a hacking schedule item.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object} object_arguments.object_server_target - The target server object.* @param {Object} [object_arguments.object_time_jobs] - The job durations object.* @param {Object[]} object_arguments.array_servers_used - Contains useable server objects.* @param {Object[]} object_arguments.array_schedule - The hacking schedule.* @param {number} object_arguments.float_padding_seconds - The duration of padding between each job in seconds.* @param {number} object_arguments.float_precision - The precision used for the percetage to steal calculation.* @param {number} object_arguments.float_steal_cap - The maximum percentage to steal of the target server's available cash per hack.* @returns {Object} The job object.*/const object_get_job = ({object_server_target: n,object_time_jobs: t = object_get_time_jobs(object_server_target.string_server),array_servers_used: u,array_schedule: s,float_padding_seconds: d,float_precision: p,float_steal_cap: m,}) => {const object_server_used = object_get_server_ram_free_biggest({object_netscript: object_netscript,array_servers_used: u,}),string_script = string_get_job(n),string_server_target = n.string_server,float_ram_free_server_used = float_get_server_ram_free({object_netscript: object_netscript,string_server: object_server_used.string_server,float_server_ram_used: object_server_used.float_ram_used,}),float_security_before_server_target = n.float_security,float_cash_current_server_target = n.float_cash,object_job = {string_script: string_script,string_server_used: object_server_used.string_server,string_server_target: string_server_target,integer_threads: integer_get_threads({float_ram_free: float_ram_free_server_used,string_script: string_script,string_server: string_server_target,float_security: float_security_before_server_target,float_cash: float_cash_current_server_target,float_percentage_to_steal: float_get_percentage_to_steal({float_ram_free_server_used: float_ram_free_server_used,string_server_target: string_server_target,float_cash_server_target: float_cash_current_server_target,float_security_server_target: float_security_before_server_target,float_precision: p,float_steal_cap: m,}),}),float_delay_seconds:float_get_time_job_finishes_seconds({array_schedule: s,object_time_jobs: t,}) -t[string_script] +d,// This is the target server's security before this job's effects are applied.float_security_before_server_target: float_security_before_server_target,};// Simulate the effects of the job on the server to get the security after, which is needed to determine if we need to remove any jobs in the schedule later on.return object_get_updated({object_original: object_job,object_properties_new: {float_security_after_server_target: object_get_server_target_job_applied({object_server_target: n,object_job: object_job,}).float_security,},});};/*** @description Takes an older and newer useable server arrays and merges the newer objects onto a clone of the old array.* @param {Object} object_arguments - Contains the arguments for the function.* @param {Object[]} object_arguments.array_servers_used_old - The older array.* @param {Object[]} object_arguments.array_servers_used_new - The newer array.* @returns {Object[]} The result of merging the arrays.*/const array_get_servers_used_merged = ({array_servers_used_old: o,array_servers_used_new: n,}) =>n.reduce((array_servers_merged, object_server_current) =>array_servers_merged.some((object_server) =>object_server.string_server === object_server_current.string_server)? array_servers_merged: array_servers_merged.concat(object_server_current),clone(o));/*** @description Returns a hacking schedule object.* @param {Object} object_arguments - Contains the arguments for the function.* @param {number} object_arguments.integer_job_cap - The maximum number of jobs per schedule.* @param {number} object_arguments.float_precision - The precision used for the percetage to steal calculation.* @param {number} object_arguments.float_steal_cap - The maximum percentage to steal of the target server's available cash per hack.* @param {number} object_arguments.float_padding_seconds - The duration of padding between each job in seconds.* @param {string} object_arguments.string_server_target - The target server's hostname.* @param {Object} [object_arguments.object_schedule_hacking_previous] - The previous hacking schedule object.* @returns {Object} The hacking schedule object.*/const object_get_schedule_hacking = ({integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,string_server_target: n,object_schedule_hacking_previous: o = {array_schedule: [],},}) => {const object_server_target_new = object_get_server_target(n),array_servers_used_new = array_make_servers({object_netscript: object_netscript,array_method_get_servers: array_get_servers_useable,object_method_make_server: object_get_server_used,}),array_servers_used_merged =o.array_schedule.length > 0? array_get_servers_used_merged({array_servers_used_old: o.array_servers_used,array_servers_used_new: array_servers_used_new,}): array_servers_used_new,object_state = any_while({any_state:o.array_schedule.length > 0? {object_time_jobs: object_get_time_jobs(n),object_server_target:o.object_server_target.string_server == n? o.object_server_target: object_server_target_new,object_server_target_last_security_minimum:o.object_server_target.string_server == n? o.object_server_target: object_server_target_new,float_security_minimum_server_target: object_netscript.getServerMinSecurityLevel(n),array_schedule: [],array_servers_used:array_servers_used_new.length > o.array_servers_used? array_servers_used_merged: o.array_servers_used,array_servers_used_last_security_minimum:array_servers_used_new.length > o.array_servers_used? array_servers_used_merged: o.array_servers_used,integer_last_seen_job_index_with_security_minimum: -1,integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,}: {object_time_jobs: object_get_time_jobs(n),object_server_target: object_server_target_new,object_server_target_last_security_minimum: object_server_target_new,float_security_minimum_server_target: object_netscript.getServerMinSecurityLevel(n),array_schedule: [],array_servers_used: array_servers_used_new,array_servers_used_last_security_minimum: array_servers_used_new,integer_last_seen_job_index_with_security_minimum: -1,integer_job_cap: j,float_precision: p,float_steal_cap: m,float_padding_seconds: d,},boolean_condition: (object_state) => {const object_server_ram_free_biggest = object_get_server_ram_free_biggest({object_netscript: object_netscript,array_servers_used: object_state.array_servers_used,});return (object_state.array_schedule.length < object_state.integer_job_cap &&boolean_can_run_job({object_netscript: object_netscript,float_ram_free: float_get_server_ram_free({object_netscript: object_netscript,string_server: object_server_ram_free_biggest.string_server,float_server_ram_used:object_server_ram_free_biggest.float_ram_used,}),string_script: string_get_job(object_state.object_server_target),integer_threads: 1,}));},any_function: (object_state) => {const object_job = object_get_job({object_server_target: object_state.object_server_target,object_time_jobs: object_state.object_time_jobs,array_servers_used: object_state.array_servers_used,array_schedule: object_state.array_schedule,float_padding_seconds: object_state.float_padding_seconds,float_precision: object_state.float_precision,float_steal_cap: object_state.float_steal_cap,}),object_server_target = object_get_server_target_job_applied({object_server_target: object_state.object_server_target,object_job: object_job,}),array_servers_used = array_get_servers_used_updated({object_netscript: object_netscript,array_servers_used: object_state.array_servers_used,object_job: object_job,});return object_job.float_security_after_server_target ===object_state.float_security_minimum_server_target? object_get_updated({object_original: object_state,object_properties_new: {integer_last_seen_job_index_with_security_minimum:object_state.array_schedule.length,array_schedule: object_state.array_schedule.concat(object_job),object_server_target: object_server_target,object_server_target_last_security_minimum: object_server_target,array_servers_used: array_servers_used,array_servers_used_last_security_minimum: array_servers_used,},}): object_get_updated({object_original: object_state,object_properties_new: {integer_last_seen_job_index_with_security_minimum:object_state.integer_last_seen_job_index_with_security_minimum,array_schedule: object_state.array_schedule.concat(object_job),object_server_target: object_server_target,array_servers_used: array_servers_used,},});},});// Return a schedule with jobs near the end that prevent it from achieving minimum security removed so the target server has minimum security when the schedule finishes. If no jobs achieve minimum security, return the original schedule.return object_state.integer_last_seen_job_index_with_security_minimum > 0? {object_server_target:object_state.object_server_target_last_security_minimum,array_schedule: object_state.array_schedule.slice(0,object_state.integer_last_seen_job_index_with_security_minimum + 1),array_servers_used:object_state.array_servers_used_last_security_minimum,}: {object_server_target: object_state.object_server_target,array_schedule: object_state.array_schedule,array_servers_used: object_state.array_servers_used,};};const void_main = async () => {// Wait for scripts to die.for (;boolean_array_scripts_any_running([object_constants.object_workers.weaken_,object_constants.object_workers.grow_,object_constants.object_workers.hack_,]);) {await object_netscript.sleep(1e4);}// Start schedule generation and execution.const object_document = parent["document"];let integer_time_start = Date.now(),object_schedule = {array_schedule: [],};for (;;) {// Select a target server if there isn't one.const string_server_target ="" === object_document.nicoty_hacker_string_server_target_manual? string_or_null_get_server_hackable_score_best({boolean_method_score_correction:object_document.nicoty_hacker_boolean_method_score_correction,float_multiplier_factor_skill:object_document.nicoty_hacker_float_multiplier_factor_skill,float_multiplier_factor_max_cash:object_document.nicoty_hacker_float_multiplier_factor_max_cash,float_multiplier_factor_growth:object_document.nicoty_hacker_float_multiplier_factor_growth,}): object_document.nicoty_hacker_string_server_target_manual;// Tell the cyclic weaken script what the target server is.object_document.nicoty_hacker_string_server_target_actual = string_server_target;// If this isn't the first iteration of the loop, sleep for the duration of paddings of the previous schedule.if (0 < object_schedule.array_schedule.length) {await object_netscript.sleep(object_schedule.array_schedule.length *object_document.nicoty_hacker_float_padding -integer_time_start +Date.now());}integer_time_start = Date.now();object_schedule = object_get_schedule_hacking({integer_job_cap: object_document.nicoty_hacker_integer_job_cap,float_precision: object_document.nicoty_hacker_float_precision,float_steal_cap: object_document.nicoty_hacker_float_steal_cap,float_padding_seconds:object_document.nicoty_hacker_float_padding / 1e3,string_server_target: string_server_target,object_schedule_hacking_previous: object_schedule,});0 < object_schedule.array_schedule.length? object_schedule.array_schedule.forEach((object_job, integer_index) => {boolean_copy_script_to({object_netscript: object_netscript,scripts: object_job.string_script,string_server_destination: object_job.string_server_used,});integer_exec({object_netscript: object_netscript,string_script: object_job.string_script,string_server: object_job.string_server_used,integer_threads: object_job.integer_threads,array_arguments: [object_job.string_server_target,1e3 * object_job.float_delay_seconds - Date.now(),integer_index,],});}): await object_netscript.sleep(object_document.nicoty_hacker_float_padding);}};await void_main();};
# DescriptionScripts for the game [Bitburner](https://github.com/danielyxie/bitburner).To try them out, simply save all the .js files to the "home" server (which needs to have at least 15.7 GB of free RAM), then enter `run main.js` in the terminal. If you don't have enough RAM on "home", you can also edit the `object_get_constants` function in `lib.js` such that the `string_host` property points to another server that you have rooted and which has >= 15.7 GB.## LicenseThis Work is distributed and dual-licensed under the terms of both the [MIT License](LICENSE-MIT) and the [Apache License 2.0](LICENSE-APACHE).### ContributionUnless You explicitly state otherwise, any Contribution submitted for inclusion in the Work by You, as defined in the Apache License 2.0, shall be dual-licensed as above, without any additional terms or conditions.
The following license applies to (software - author):* https://github.com/lukeed/mri - Copyright (c) Luke Edwards luke.edwards05@gmail.com (lukeed.com)* https://github.com/lodash/lodash - Copyright JS Foundation and other contributors <https://js.foundation/>* https://github.com/http-party/http-server - Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.* [GUIFramework](https://cdn.discordapp.com/attachments/415247422638522395/766498143894241280/GUIFramework.ns) - Kozd AKA lurker_02* https://github.com/Pimm/mapsort - Copyright (c) 2019-2021 Pimm "de Chinchilla" Hogeling, Edo RivaiMIT licensePermission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ORCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHERIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.---The following license applies to (software - author):* https://github.com/danielyxie/bitburner - Daniel Y XieLIMITED USE SOFTWARE LICENSE AGREEMENTThis Limited Use Software License Agreement (the "Agreement") is a legal agreement between you, the end-user, and Daniel Y Xie,the creator of the software, hereafter referred to as the Creator.By downloading or purchasing the software material, which includes source code (the "Source Code"), artwork data, music and softwaretools (collectively, the "Software"), you are agreeing to be bound by the terms of this Agreement. If you do not agree to the termsof this Agreement, promptly destroy the Software you may have downloaded or copied.SOFTWARE LICENSE1. Grant of License. The Creator grants to you the right to use the Software. You have no ownership or proprietary rights in or tothe Software, or the Trademark. For purposes of this section, "use" means loading the Software into RAM, as well as installationon a hard disk or other storage device. The Software, together with any archive copy thereof, shall be destroyed when no longerused in accordance with this Agreement, or when the right to use the Software is terminated. You agree that the Software will notbe shipped, transferred or exported into any country in violation of the U.S. Export Administration Act (or any other law governingsuch matters) and that you will not utilize, in any other manner, the Software in violation of any applicable law.2. Permitted Uses.You may copy and distribute literal (i.e., verbatim) or modified copies of the Software's source code.You must meet all of the following conditions with respect to any work that you distribute or publish that in whole or in partcontains or is derived from the Software or any part thereof:(a) The distributed Software may not be used in any way for commercial gain and must not violate any of the restrictionsset forth in Section 3.(b) If you have modified the Software, you must cause the modified Software to carry prominent notices stating thatyou have modified the Software's files. Modifications must not alter or remove any copyright notices in the Software.(c) The distributed Software must include either a written copy of this License, or a prominent written indication thatthe Software is covered by this License and written instructions for printing and/or displaying the copy of the Licenseon the distribution medium(d) When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted tothe initial developer of the Software to distribute your modification in future versions of the Software providedsuch versions remain available under these terms in addition to any other license(s) of the initial developer.(d) You may not impose any further restrictions on the recipient's exercise of the rights granted herein.For educational purposes only, you, the end-user, may use portions of the Source Code, such as particularroutines, to develop your own software, but may not duplicate the Source Code. The limitedright referenced in the preceding sentence is hereinafter referred to as "Educational Use." By so exercising the EducationalUse right you shall not obtain any ownership, copyright, proprietary or other interest in or to the Source Code, or any portionof the Source Code. You may dispose of your own software in your sole discretion. When exercising the Educational Use right,you may not use or exploit the Software, or any portion of the Software, which includes the Source Code, for commercial gain.3. Prohibited Uses: Under no circumstances shall you, the end-user, be permitted, allowed or authorized to commerciallyexploit the Software or any work that in whole or in part contains or is derived from the Software or any part thereof.Neither you nor anyone at your direction shall do any of the following acts with regard to the Software,or any portion thereof:Rent;Sell;Lease;Offer on a pay-per-play basis;Distribute for money or any other consideration; orIn any other manner and through any medium whatsoever commercially exploit or use for any commercial purpose.4. Copyright. The Software and all copyrights related thereto (including all characters and other images generated by theSoftware or depicted in the Software) are owned by the Creator and is protected by United States copyright laws and international treatyprovisions. The Creator shall retain exclusive ownership and copyright in and to the Software and all portions of the Software and youshall have no ownership or other proprietary interest in such materials. You must treat the Software like any other copyrightedmaterial. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License.You may not otherwise reproduce, copy or disclose to others, in whole or in any part, the Software. You may not copy thewritten materials accompanying the Software. You agree to use your best efforts to see that any user of the Software licensedhereunder complies with this Agreement.5. NO WARRANTIES. The Creator DISCLAIMS ALL WARRANTIES, BOTH EXPRESS IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE SOFTWARE. THIS LIMITED WARRANTY GIVES YOU SPECIFICLEGAL RIGHTS. YOU MAY HAVE OTHER RIGHTS WHICH VARY FROM JURISDICTION TO JURISDICTION. the Creator DOES NOT WARRANT THAT THE OPERATIONOF THE SOFTWARE WILL BE UNINTERRUPTED, ERROR FREE OR MEET YOUR SPECIFIC REQUIREMENTS. THE WARRANTY SET FORTH ABOVE IS IN LIEUOF ALL OTHER EXPRESS WARRANTIES WHETHER ORAL OR WRITTEN. THE AGENTS, EMPLOYEES, DISTRIBUTORS, AND DEALERS OF THE CREATOR ARE NOT AUTHORIZEDTO MAKE MODIFICATIONS TO THIS WARRANTY, OR ADDITIONAL WARRANTIES ON BEHALF OF THE CREATOR.Exclusive Remedies. The Software is being offered to you free of any charge. You agree that you have no remedy against the creator,its affiliates, contractors, suppliers, and agents for loss or damage caused by any defect or failure in the Software regardlessof the form of action, whether in contract, tort, includinegligence, strict liability or otherwise, with regard to the Software.This Agreement shall be construed in accordance with and governed by the laws of the State of Texas. Copyright and otherproprietary matters will be governed by United States laws and international treaties. IN ANY CASE, THE CREATOR SHALL NOT BE LIABLEFOR LOSS OF DATA, LOSS OF PROFITS, LOST SAVINGS, SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT OR OTHER SIMILAR DAMAGES ARISINGFROM BREACH OF WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, OR OTHER LEGAL THEORY EVEN IF THE CREATOR OR ITS AGENT HAS BEEN ADVISED OF THEPOSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. Some jurisdictions do not allow the exclusion or limitation ofincidental or consequential damages, so the above limitation or exclusion may not apply to you.---
MIT LicenseCopyright © 2020 Jesse Ira Abadilla and ContributorsPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
Apache LicenseVersion 2.0, January 2004http://www.apache.org/licenses/TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION1. Definitions."License" shall mean the terms and conditions for use, reproduction,and distribution as defined by Sections 1 through 9 of this document."Licensor" shall mean the copyright owner or entity authorized bythe copyright owner that is granting the License."Legal Entity" shall mean the union of the acting entity and allother entities that control, are controlled by, or are under commoncontrol with that entity. For the purposes of this definition,"control" means (i) the power, direct or indirect, to cause thedirection or management of such entity, whether by contract orotherwise, or (ii) ownership of fifty percent (50%) or more of theoutstanding shares, or (iii) beneficial ownership of such entity."You" (or "Your") shall mean an individual or Legal Entityexercising permissions granted by this License."Source" form shall mean the preferred form for making modifications,including but not limited to software source code, documentationsource, and configuration files."Object" form shall mean any form resulting from mechanicaltransformation or translation of a Source form, including butnot limited to compiled object code, generated documentation,and conversions to other media types."Work" shall mean the work of authorship, whether in Source orObject form, made available under the License, as indicated by acopyright notice that is included in or attached to the work(an example is provided in the Appendix below)."Derivative Works" shall mean any work, whether in Source or Objectform, that is based on (or derived from) the Work and for which theeditorial revisions, annotations, elaborations, or other modificationsrepresent, as a whole, an original work of authorship. For the purposesof this License, Derivative Works shall not include works that remainseparable from, or merely link (or bind by name) to the interfaces of,the Work and Derivative Works thereof."Contribution" shall mean any work of authorship, includingthe original version of the Work and any modifications or additionsto that Work or Derivative Works thereof, that is intentionallysubmitted to Licensor for inclusion in the Work by the copyright owneror by an individual or Legal Entity authorized to submit on behalf ofthe copyright owner. For the purposes of this definition, "submitted"means any form of electronic, verbal, or written communication sentto the Licensor or its representatives, including but not limited tocommunication on electronic mailing lists, source code control systems,and issue tracking systems that are managed by, or on behalf of, theLicensor for the purpose of discussing and improving the Work, butexcluding communication that is conspicuously marked or otherwisedesignated in writing by the copyright owner as "Not a Contribution.""Contributor" shall mean Licensor and any individual or Legal Entityon behalf of whom a Contribution has been received by Licensor andsubsequently incorporated within the Work.2. Grant of Copyright License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,worldwide, non-exclusive, no-charge, royalty-free, irrevocablecopyright license to reproduce, prepare Derivative Works of,publicly display, publicly perform, sublicense, and distribute theWork and such Derivative Works in Source or Object form.3. Grant of Patent License. Subject to the terms and conditions ofthis License, each Contributor hereby grants to You a perpetual,worldwide, non-exclusive, no-charge, royalty-free, irrevocable(except as stated in this section) patent license to make, have made,use, offer to sell, sell, import, and otherwise transfer the Work,where such license applies only to those patent claims licensableby such Contributor that are necessarily infringed by theirContribution(s) alone or by combination of their Contribution(s)with the Work to which such Contribution(s) was submitted. If Youinstitute patent litigation against any entity (including across-claim or counterclaim in a lawsuit) alleging that the Workor a Contribution incorporated within the Work constitutes director contributory patent infringement, then any patent licensesgranted to You under this License for that Work shall terminateas of the date such litigation is filed.4. Redistribution. You may reproduce and distribute copies of theWork or Derivative Works thereof in any medium, with or withoutmodifications, and in Source or Object form, provided that Youmeet the following conditions:(a) You must give any other recipients of the Work orDerivative Works a copy of this License; and(b) You must cause any modified files to carry prominent noticesstating that You changed the files; and(c) You must retain, in the Source form of any Derivative Worksthat You distribute, all copyright, patent, trademark, andattribution notices from the Source form of the Work,excluding those notices that do not pertain to any part ofthe Derivative Works; and(d) If the Work includes a "NOTICE" text file as part of itsdistribution, then any Derivative Works that You distribute mustinclude a readable copy of the attribution notices containedwithin such NOTICE file, excluding those notices that do notpertain to any part of the Derivative Works, in at least oneof the following places: within a NOTICE text file distributedas part of the Derivative Works; within the Source form ordocumentation, if provided along with the Derivative Works; or,within a display generated by the Derivative Works, if andwherever such third-party notices normally appear. The contentsof the NOTICE file are for informational purposes only anddo not modify the License. You may add Your own attributionnotices within Derivative Works that You distribute, alongsideor as an addendum to the NOTICE text from the Work, providedthat such additional attribution notices cannot be construedas modifying the License.You may add Your own copyright statement to Your modifications andmay provide additional or different license terms and conditionsfor use, reproduction, or distribution of Your modifications, orfor any such Derivative Works as a whole, provided Your use,reproduction, and distribution of the Work otherwise complies withthe conditions stated in this License.5. Submission of Contributions. Unless You explicitly state otherwise,any Contribution intentionally submitted for inclusion in the Workby You to the Licensor shall be under the terms and conditions ofthis License, without any additional terms or conditions.Notwithstanding the above, nothing herein shall supersede or modifythe terms of any separate license agreement you may have executedwith Licensor regarding such Contributions.6. Trademarks. This License does not grant permission to use the tradenames, trademarks, service marks, or product names of the Licensor,except as required for reasonable and customary use in describing theorigin of the Work and reproducing the content of the NOTICE file.7. Disclaimer of Warranty. Unless required by applicable law oragreed to in writing, Licensor provides the Work (and eachContributor provides its Contributions) on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied, including, without limitation, any warranties or conditionsof TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR APARTICULAR PURPOSE. You are solely responsible for determining theappropriateness of using or redistributing the Work and assume anyrisks associated with Your exercise of permissions under this License.8. Limitation of Liability. In no event and under no legal theory,whether in tort (including negligence), contract, or otherwise,unless required by applicable law (such as deliberate and grosslynegligent acts) or agreed to in writing, shall any Contributor beliable to You for damages, including any direct, indirect, special,incidental, or consequential damages of any character arising as aresult of this License or out of the use or inability to use theWork (including but not limited to damages for loss of goodwill,work stoppage, computer failure or malfunction, or any and allother commercial damages or losses), even if such Contributorhas been advised of the possibility of such damages.9. Accepting Warranty or Additional Liability. While redistributingthe Work or Derivative Works thereof, You may choose to offer,and charge a fee for, acceptance of support, warranty, indemnity,or other liability obligations and/or rights consistent with thisLicense. However, in accepting such obligations, You may act onlyon Your own behalf and on Your sole responsibility, not on behalfof any other Contributor, and only if You agree to indemnify,defend, and hold each Contributor harmless for any liabilityincurred by, or claims asserted against, such Contributor by reasonof your accepting any such warranty or additional liability.END OF TERMS AND CONDITIONSAPPENDIX: How to apply the Apache License to your work.To apply the Apache License to your work, attach the followingboilerplate notice, with the fields enclosed by brackets "{}"replaced with your own identifying information. (Don't includethe brackets!) The text should be enclosed in the appropriatecomment syntax for the file format. We also recommend that afile or class name and description of purpose be included on thesame "printed page" as the copyright notice for easieridentification within third-party archives.Copyright 2020 Jesse Ira Abadilla and ContributorsLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
Copyright (c) 2020 Jesse Ira AbadillaRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.Subject to the terms and conditions of this license, each copyright holder and contributor hereby grants to those receiving rights under this license a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except for failure to satisfy the conditions of this license) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer this software, where such license applies only to those patent claims, already acquired or hereafter acquired, licensable by such copyright holder or contributor that are necessarily infringed by:(a) their Contribution(s) (the licensed copyrights of copyright holders and non-copyrightable additions of contributors, in source or binary form) alone; or(b) combination of their Contribution(s) with the work of authorship to which such Contribution(s) was added by such copyright holder or contributor, if, at the time the Contribution is added, such addition causes such combination to be necessarily infringed. The patent license shall not apply to any other combinations which include the Contribution.Except as expressly stated above, no rights or licenses from any copyright holder or contributor is granted under this license, whether expressly, by implication, estoppel or otherwise.DISCLAIMERTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Contributor Covenant Code of Conduct## Our PledgeWe as members, contributors, and leaders pledge to make participation in ourcommunity a harassment-free experience for everyone, regardless of age, bodysize, visible or invisible disability, ethnicity, sex characteristics, genderidentity and expression, level of experience, education, socio-economic status,nationality, personal appearance, race, religion, or sexual identityand orientation.We pledge to act and interact in ways that contribute to an open, welcoming,diverse, inclusive, and healthy community.## Our StandardsExamples of behavior that contributes to a positive environment for ourcommunity include:* Demonstrating empathy and kindness toward other people* Being respectful of differing opinions, viewpoints, and experiences* Giving and gracefully accepting constructive feedback* Accepting responsibility and apologizing to those affected by our mistakes,and learning from the experience* Focusing on what is best not just for us as individuals, but for theoverall communityExamples of unacceptable behavior include:* The use of sexualized language or imagery, and sexual attention oradvances of any kind* Trolling, insulting or derogatory comments, and personal or political attacks* Public or private harassment* Publishing others' private information, such as a physical or emailaddress, without their explicit permission* Other conduct which could reasonably be considered inappropriate in aprofessional setting## Enforcement ResponsibilitiesCommunity leaders are responsible for clarifying and enforcing our standards ofacceptable behavior and will take appropriate and fair corrective action inresponse to any behavior that they deem inappropriate, threatening, offensive,or harmful.Community leaders have the right and responsibility to remove, edit, or rejectcomments, commits, code, wiki edits, issues, and other contributions that arenot aligned to this Code of Conduct, and will communicate reasons for moderationdecisions when appropriate.## ScopeThis Code of Conduct applies within all community spaces, and also applies whenan individual is officially representing the community in public spaces.Examples of representing our community include using an official e-mail address,posting via an official social media account, or acting as an appointedrepresentative at an online or offline event.## EnforcementInstances of abusive, harassing, or otherwise unacceptable behavior may bereported to the community leaders responsible for enforcement atnicoty@tuta.io.All complaints will be reviewed and investigated promptly and fairly.All community leaders are obligated to respect the privacy and security of thereporter of any incident.## Enforcement GuidelinesCommunity leaders will follow these Community Impact Guidelines in determiningthe consequences for any action they deem in violation of this Code of Conduct:### 1. Correction**Community Impact**: Use of inappropriate language or other behavior deemedunprofessional or unwelcome in the community.**Consequence**: A private, written warning from community leaders, providingclarity around the nature of the violation and an explanation of why thebehavior was inappropriate. A public apology may be requested.### 2. Warning**Community Impact**: A violation through a single incident or seriesof actions.**Consequence**: A warning with consequences for continued behavior. Nointeraction with the people involved, including unsolicited interaction withthose enforcing the Code of Conduct, for a specified period of time. Thisincludes avoiding interactions in community spaces as well as external channelslike social media. Violating these terms may lead to a temporary orpermanent ban.### 3. Temporary Ban**Community Impact**: A serious violation of community standards, includingsustained inappropriate behavior.**Consequence**: A temporary ban from any sort of interaction or publiccommunication with the community for a specified period of time. No public orprivate interaction with the people involved, including unsolicited interactionwith those enforcing the Code of Conduct, is allowed during this period.Violating these terms may lead to a permanent ban.### 4. Permanent Ban**Community Impact**: Demonstrating a pattern of violation of communitystandards, including sustained inappropriate behavior, harassment of anindividual, or aggression toward or disparagement of classes of individuals.**Consequence**: A permanent ban from any sort of public interaction withinthe community.## AttributionThis Code of Conduct is adapted from the [Contributor Covenant][homepage],version 2.0, available at[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].Community Impact Guidelines were inspired by[Mozilla's code of conduct enforcement ladder][Mozilla CoC].For answers to common questions about this code of conduct, see the FAQ at[https://www.contributor-covenant.org/faq][FAQ]. Translations are availableat [https://www.contributor-covenant.org/translations][translations].[homepage]: https://www.contributor-covenant.org[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html[Mozilla CoC]: https://github.com/mozilla/diversity[FAQ]: https://www.contributor-covenant.org/faq[translations]: https://www.contributor-covenant.org/translations
0.12.2
authors = ["nicoty"][remote]
fFxdrfj5FS0TOQhmXyFx6WpzIUuA5GVd7VvDX8Cwzw5Uh42DKDCLmxTmXUZiC2GK7pZRbREt2KgZSX0MbXtvS5OkhaqvKU3sLyHF
master
8WFLW07WCPw9X3otvloJVjZ9Q1COZPdIQJOLeUdTwDOxiQasVpbL3xhtZ2BvtuvTG9zymz6RFmU0krf2R3E6I8VLMKo9BSR9eYwy7fXPihT2MnQxS1TARWbPWacJPqL95gCMEspCmMY96G8CidTdGdXJLjoEpS93DZRDNptYKMrhiCd9YcdWzjfCfBph:07ddk5uy85XVidx6ju1GBJ1AmkzdALCdEjDxWNmU4xofRkRJYZSLNU4PrR2fuKmZgi1Zr2xKdPsMx15tMC1HYBKYA:16HfK3Dt1ajH1roCbNLA7t1RCrVBsCp8gHKzZqBwi75RwRUrUUAfapirczdXwSJP4Ts96nqKR4SJxvnwds5RCZPqG:27bDiqSemVToexvC2hfT9jDRPG7vx3DPNo2KXDxzAAvvBGPxxnM7GoyaqvVMmD9LGWcx43iYzF6oTMacmK3jNDFkw:37pXzpXoFiHd7FEgEmQHjxmiBaMzk1NHPxsNDrLE6RwJsTiovrbqhMdjq5W9Qk3h741T7NPeBEpr7gL7ETkKE7cAn:4AkEYum9rTDQmVYT3GTX8wWacQDq4qCh6AAYAx6vWnhUUvLtC7VRBBhPnRPDV7iJquZsAMFs5UCmLBeU6dPFGcr9Y:58tR5oyFMX83gHAUqEwki8hfKKeeYhySq6pPfsbx2Pt16LDpDKpcSqrEmQPifx74A2cToxj4qZf3YVJ3qHAnoy2oG:66fesyuFQKoq7gcETHKotAjWjWyHji6YUfczKncFBQoRwVxibjNW2a4CYUAyhYHZpxjE353AumhGcKGPvAr6rjBqL:79sMn5RmUhTx1oQB55RnjamxhqjWTBq4nMwodNXJAPicWMTc149xpFpzLnRgsvW2MTiY6pjSWRMscRkqVvGzh8WQw:892jpgWHFMeep1VxTpfyGRzhVCtD7HTahKCvXgMHrga4kwCUPkzX7Zwd2nC5nNyKA216fsx7t89UMbVyagMFVxk39:9683eDtBHgz7bdFNTV52BWipEGFjhyripjWHieSzoyRWNqtPk8drEJB4AwHhHMULBLmqvF7kJdsqCZyRu7Tqg7sLQ:109hGuUKUMKwhTiAtybTe1n7MoHgHbkAEhU1c656qCfYURqhuknJPJ6kHFiFkG8Bz1WzA7Fuf5hKpEfcwUwE1mmXZ3:11A8gAMfQpNkmb8GJD8aSFcthEbMK4NxcUA121Jg8Ac11A7LZWJhaGz5ktg3GiumzkoJ2U1YZef5c2gfiuJjTbd2EY:12A6h2Udpv4WyuivfYSFBk41aCNhvmX87c33Cz8qJz8vG3KETPfmJ3fRJR8heLvXL5TqS2b2TxoHkJmUmjmV6t83p3:136evjgWz2rPi5xqS13GWbFreDDvegM81B2nzy1uLZBT4tMfpk9ripnjubU2CDiP6bxqCdRDRWJq9EjQPgUxRT6EmR:149RTCycGi8raqPYddUuJRgCcaWsXWKmUDtTdRNKiuRkwH6gq8r9dwQNyDhykNoEbyXT3A9Jphtv8kUqdtGRv2ckf7:157bCEHcYb28YtV9LY3utTGaqhorfjQZcHtix7nKxDDwH58pL7vBno99DrCKdBsjHJ6gfvKSRNaiYkrSx8Y37rZMyZ:168x34oooWdHqSXPzEHGpDsjBu8jWhWzjCAXh8LqFPS6iZmLwopJq7Lohn9FqVg6PhRhFgqA28ExmEuuWnb87AmFeq:178YG1D9GkPen8drJHGvvYyJU28QyXqwhH3dD4RmFYaNeRYM77219HXgwvPTV7xE6rRu9y7sb6BVaTLSkG4mqYQ6uW:187X3BUT2cZJeJvkN22Ykd9y61bhRaMJ5x1SH4Httvau8uY9t3Yn7GrGTtM6PHKFuf5qEAivfCkHQcfKJKjKzUZKbD:198bbRVPmWza2mCMKbWY8L93Tf2X9mVmCa1tmmcgQuethLULVFYvyi9P83T6kKDVv2GXd42NzB7PFaqA8X6VR8bq92:2068BJeDpcZY117H8m8S2aW64y9i5PAbwG7pRA4HaCaBvoG7q2hjeFrKMxWrf5puQnwUEXbx21J2LiBCe1zvdwStuy:219hGPRqFpsTpMarwkWrvyp1VWcwiKbKaUNX82tgTDHxQApN5MTQkJyWbqTxo5CvQTxh4BRtUN81fZ9BJJU191B2Ao:227h19pJEYhWJGCnysPFz5ThpsEoDt7QKB4HpBN6KVycWK1uLj44L3GLd3DjAC739ziEzotu8ttGR8iti4y18RJMja:239idPQnNr8S1wAek8J2gGuSAJoGatUgYwoGzGq7F7wTK6QWz5oYXHBYGbCscafg159Etbc2tpMeDMfC2ivA7boA3d:24AQbFP3WSMhhfr3HupbA3Zn2vM7p7z4WqeYB7swm9TLx6F5nNg1ntSzNgF65XDrh3wUv3oHpTjk4E8MUfi2Z2ULKV:258VF4UqocEA5VkcVuf4JVPT9yodge32wief39xXEjAKkbMw12JeeALzRU6smgfvuWfPWrxUiLQ9rKz4N4W8tvgmRo:26987MVUqwrLnLVWv4Hg5whF81i4yZfpxq7hcRemLr3MWVYL3FYiKpF5wwJb72c8d2nAerCbK3i1SB1rBXvvssLy4v:27AiDuJAo4w7XYNc2RiomkxorqCatXCHhVhJGaiPiLWVRgVu2c776jQv6Nqj6MkpWnErdQifoWCSNp1MeYKsPF8XVm:287vSG4PrENcFDAqo1ZC4b6EcD7awovRXyXmK5sbGroW1MzcZaaQSjFRpRGTkjjnjcqkvPNXJ5h3CtrUq4ZdVPNrjS:298xe6FdccqgACB7en9LpA1o1r43um5frX3PgpocdNZfDizVv6nAm6FVy63JyRj7s3dYBeA6QoUteZGU1MGGqyQBfj:308yBDabbdCWUms66GVsSUkcU2Wy2fZZrXKWNZ3oeNyyiGV5jS7ZrogndAWmfatFSRrZBkcewHYKVo9NwUEBsUPRgD:31ArGfxQibHz4jPVmfrNxAFUPMgZgaAWbFDBibwtwj5FaewM2BLCa5ahmNHRCvYcidsHx5k1GUXoPUCYCDnhfEuRrF:32Aasae1XfafmSgQdeytALVcifH9ke1owAhPabeM3Jqy8YMLthtHBwmG3tU61VhPE1r9DpuSDk3thxRaDSgDGviF1y:33812912dPKncc5A8r2i6ZCrdxrKR414ESrDQf3W6YakEi2w9utwjUXnwh9f2j421HqiJRrwXDkH5p1io2BA6mDzDw:34AQ7PnSf83vue7QMzuCXcecsFRWCXCHRTNm5tK9oLVVXBAX61aQDxYhYdx5ounYnKPb6XuwKwJ4FZcEooupQkfn7i:358jsxKu79YdAzPAstCaKnKoR94CYdhU1WyJqTUndtZtz7gaz1Gqr6hCAY62kZW9AsjYSuMA3Ft911enLU98RkbSjx:367wCjg3hpmNaGo3ZQ42UetMQHCf7hh1qYe6excDdSwXAQ2BKDNjtPigRAaPujFSFz16UtD1mMvh5vzmD6cgxD4sZB:37AFzRq61ZEq98SY6ixQUnJtc4SkcJXZkp3p7kj7roDmJ1X62EUarrwLViyzZF1vqT5UYe6D99thsz9hYrSKcCtSzC:387goRJVUQ8AkMFp13cNo6AzfVKwhNWYCKMHEq8ahZkKgXk9ncvXEvytybPYUDUWW1rJVXFxv7gWHgtmfr68SGfKeV:3992xeRKAoywTA6PFiHEX33ui4zMUoc8Bt5jviGGcsX7A6Nb5Cp6EkNMvXEZcPaiVfvBdhnjph4JPhPcqjvpiJt9ik:406jD8CeyK43d16NarecP52ejyggQL6jjBMScWZDLfM4qWnDJNyqFmyJuikR7kcvUH3Lv7WemisLrNkcR2C2MFMsCs:416LBDmupUxJHGyVywd6xVnzypX8MhRNFQYgb3MCr3sqvPcLiJpcLp63SnG58pivCMACTXRBSojrruNocdBRw9Ko3H:427H8xjgwMVuQgj6iJpdnsiNjgGCZyCLjc6HPDeQYCE4nVXEregv8GLGKQdNCmRaU7bbJWaER8VcdY6FKrupDD6vjX:437zuHfWyPrPaPCr5Bi1VLEJkSxk67DjmgCtyrQAjPb5SME5tiQDz6BwF4Xev4kA9dxBueFsVqt1cNimGY1ch6uhvS:448TEhWcKa1cjvo4sJ5gLcLWwyAKaGLuDtuQtU4KxKrEervKftMZVjES2MtzHEbzfzf65GpM92dMgxtx3zLGaNoGef:458dMRXJZzLyYuovNzrafhBbd9U75xFFqz6eeoRWC57Ur2Wgyty57PqeBvmSxULcZ8Gq1b8mLdbxndRbXACXEjVKat:4676rVGQDtTLc8iFVKGAaXxMN1JLgcMdUQj8gPy7xTrqNTm5zYyHT1LMA5EYyzeVEqyMuMQvAR2dYivLv54k1Rxm9B:477J1WLMukJvGrAomCkD6iAp1mBXYjK9LADrffgsGRZ49B66TuQ8jSfkp3YX7UcNpHNQTqGFaDL54CaJujQEuV7fVk:4888iEQuRi6DTb89CwCh7jzwzhqzfY9ZCzAnYYJtUHphRGWh3CjRK731ju4bNUBCAcUG6PQs24SV8LpPfzFd619wLB:49B49snRBf1ALALmJDyfB81WjXarbVms7Jyh7F7rGRWUJqjiftygwqqk6QuXaaePiHJKnHdqHqRoKFkVjTHmuCTSNN:50ABzk2HuBk71hSUs2SbT5BsrimXRUCEpVdGXDbtfqRBUtnBi85RFNnABZVjkCykFtLLgvEW4JTzNd7hE4R1CNtPBL:5182KnQ5crjcDMQHqbWSksi1gDPUZGhY27R9rk99Law6v8jH2qKVcEPAZAJfE5ZvtAz2gv1pZYiAPjNGVZkdfmmyRv:527TAnMktL2LWSSMiJerqub8skYL84xU9HNdktKyqq7g8DcjvVovboYFMoKFcRgKFupqibNkGutM2RYEEkxzTK9Rvy:536TNex2jzKz5pD2cUtA3ni2SMLQ73Luqkigc6zRq3BWfSCH6XD2Pz3E1MkDJkvvZj6szW9BwSf2MkxAq99sn1kHxU:547hSBGXnMwt8TFpi7qxrF59fMHUXUrHqJur1Ms8yrgnv5YFzThQLvmHSQAx4XycrD9zRyxcRkncEjsyMDvK4R44uS:557TYp82GSArJUMgaVY7cQ2AAP3nrCZd2PKXKqorEAHaKsH5D4WXvvbmgmZJQVh4dngkQ6ANEMVk2z8khkoUbq6RmK:567UH5WfouG3Zn546aB9e68cTJdn69NL3NEULaaAZbeRM8FM3L7jZc7aB92ujV6ezr1PRpuRke9DnPbWiNHSagQEPg:57ALyJZqLfNab1Q8XYzqDoKhBA8AtA2512nCWBKySn29Sx2Fv7f6QqPxpGb1kuQqiEZtCkMtznk2zXugfJPgpzKD4t:587mxM7YEYGFAqqKJtA8VUbuGCmVG3mAEjLGBQYri7JvNneqzyBF7HJaxPhNmkSyoKSf9wSBtzgzyHcpUPti98m36D:5997WPTJWB4jJPtVGHmHFJhSPBZfje3KSuW7aNL6WwbZ467CMrggZqRBZR8cGf96TRz82198YYDakrfMdJrbiqT4kY:60AdnQkGnkAB641TfBtJKQjqqVCymaxMVZNUrBAvTyFFerqW3FqeRd25QRUnEGqwBMGNizVamqdWAmSQR5JrWg2Gar:619QmXMC94tRpNbzuckApFHyaSzeuV3kUJfRYxEiXTWQqsaQbbtnyDkRgfyBKzp9jQr3EH7Mr1mNzykpwFLMMGHXmK:629dEM5GM8bDCZdFM44ye2nQT7Zs9JRZa137rdJbVp4XH3u8zntGGhcLjA5knuZfSLjEB3EX6yrs8aUiu7zxFDLKt4:639RWTGjmHeUbSRdRSKMEUHsvtC2aR1zpmy9HXTq97rUdmuj9BvRw6GsyfREmyEpLdtaHvSqwLJwYkaAsT3GurBSry:646txdqYvpdcJTVMbjU8ttitwXE2BNAPKKP785aYXsvBDCapspPbBMncFyRiA5ZgVo5mJjqWBiZLZwMsGHieiBefAZ:657QqLXWXmvcxQiL9UxBcN9XQdpjYo2RVtW6firn5jFWfxpNLe1A3XVXWC4xzjUyzwUPZJzt4zTRbSy8RLq8V9Hgzg:67B4fSwk2X4C6877ANiwaVuSBAChc976fSPFc5G7zpy8W9GsWVGtWB6WsGnZQTQGsmmrTtzcwyQRrw3sAF6vkNe9AW:686cEMNZT4HTFAEC1ZzbqKb5bpfrAzGkg8tvdU5cfvFd11qT4DXbPPozKxQ54wg5ifoBMatpeK2mMe8JspdkCWost9:6989L7GY93qJxuUFPPNsoLJ2hUMTxgyYAyNPGtwwsftTDybs9XFnpnBbnk3kj6PCdrMSp7BEppy5A1Eqkjabjh1ogC:706HPa7fLahojHGUhFsKSg8Vsv8XCdmFGxfq7Ym8fPxNskW2ujXc8BYFrpcfmBE9q1bREPKUAiq8FesCYM4aRK1K3M:727ruAqCacxRjH5FMiwXFN432fYJz1yb5iN4VUbUhRQ8SyXqCTEfKLb2rauwh9uTNupFiPowwL7FGTm89S1HzdcxLk:736SM43y4PhiqdDow34cdRRvT7H7gLN7U712WdBc7DVyvonyF5zYDZVx2ivnPqAYSnrasbwJVstHCYefcAdVmJiaSM:7473SBYjdmWHRR81HrncvxyooMDysUn9pgWoUsDbqUXTANzALcKX1JbM3QHAZ3f8wFsMjEGQRvHY1hLmcqFfseUyiM:75ADXvA28CtUhJn6MnmkDLW6f8Bwwv5c2qffioJ4THrhjKVaQk52kMA73pKpSVpGSeomzR3UyZjQT7qhYdtX1xGBoM:769s7Ewtw7TmrjvHn2imEiMbouqA7V7HqByoQa7Yj7DkQb2wYXLNgiFHprDtcBAdtX9iQdAPBvB9w1atSwuzxRyFZV:777JYpBbgN7pHkJv8hZtPp6aQJgN16hKC7TpTe2wouK9cu1EtKWwvwjfE4FNdxhwdRoSXMi5frCpQ4D4wLRdLebB3p:789M3AxuTUaX371uMTdUz9aL5rYpAqQ11x1Dh3jd7QYv5BbxJ7k85gzYpB19RwdMqksYbYoGkHkHxGJoD17A7XECrN:799BtjongvbXTr6ro2yvqvc2hNub6W9EAvAE2cxDi2ekNpv7toe7H2WSQb8y9TNn6m32WkaDhqiuLa75msLGfe6Grb:80A4NqVBmrpqqngzFoe4soybDErZcReKK1sogfSFdRmVwEuBv1kcmDJAESXedaZv4iVgZUR4RTRS2mypR2P9Gz7dUm:819ayHvsev91BWe9G6SmJvRb5aGJpTWs8ZbhYQcr9x6RcPjdWGV1HnfwMzdemt3WECsd9jXZfNjUfUkvWkhyETBTBr:8284qrJTrrJmoZ4c6msan6EhLmqACofxMW13Z19FtWcRJ77HEmpbhFyZ99SDoVcoW4qrzZ5Tzqdk3ypTxxVhju7bax:83
# Logslogs*.lognpm-debug.log*yarn-debug.log*yarn-error.log*lerna-debug.log*# Diagnostic reports (https://nodejs.org/api/report.html)report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json# Runtime datapids*.pid*.seed*.pid.lock# Directory for instrumented libs generated by jscoverage/JSCoverlib-cov# Coverage directory used by tools like istanbulcoverage*.lcov# nyc test coverage.nyc_output# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files).grunt# Bower dependency directory (https://bower.io/)bower_components# node-waf configuration.lock-wscript# Compiled binary addons (https://nodejs.org/api/addons.html)build/Release# Dependency directoriesnode_modules/jspm_packages/# Snowpack dependency directory (https://snowpack.dev/)web_modules/# TypeScript cache*.tsbuildinfo# Optional npm cache directory.npm# Optional eslint cache.eslintcache# Microbundle cache.rpt2_cache/.rts2_cache_cjs/.rts2_cache_es/.rts2_cache_umd/# Optional REPL history.node_repl_history# Output of 'npm pack'*.tgz# Yarn Integrity file.yarn-integrity# dotenv environment variables file.env.env.test# parcel-bundler cache (https://parceljs.org/).cache.parcel-cache# Next.js build output.nextout# Nuxt.js build / generate output.nuxtdist# Gatsby files.cache/# Comment in the public line in if your project uses Gatsby and not Next.js# https://nextjs.org/blog/next-9-1#public-directory-support# public# vuepress build output.vuepress/dist# Serverless directories.serverless/# FuseBox cache.fusebox/# DynamoDB Local files.dynamodb/# TernJS port file.tern-port# Stores VSCode versions used for testing VSCode extensions.vscode-test# yarn v2.yarn/cache.yarn/unplugged.yarn/build-state.yml.yarn/install-state.gz.pnp.*